From eaccb5155082fcef9a208de71d7ab402ac40ea36 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:17:11 +0000 Subject: [PATCH 1/2] feat(api): adds support for Auth Rule features --- .stats.yml | 8 +- .../api/models/AuthRuleV2CreateParams.kt | 45 + .../api/models/AuthRuleV2DraftParams.kt | 12 + .../AuthRuleV2RetrieveFeaturesParams.kt | 245 +++ .../com/lithic/api/models/V2ApplyResponse.kt | 77 +- .../com/lithic/api/models/V2CreateResponse.kt | 77 +- .../com/lithic/api/models/V2DraftResponse.kt | 77 +- .../com/lithic/api/models/V2ListResponse.kt | 77 +- .../lithic/api/models/V2PromoteResponse.kt | 77 +- .../api/models/V2RetrieveFeaturesResponse.kt | 1606 +++++++++++++++++ .../lithic/api/models/V2RetrieveResponse.kt | 77 +- .../com/lithic/api/models/V2UpdateResponse.kt | 77 +- .../lithic/api/models/VelocityLimitParams.kt | 397 +++- .../models/VelocityLimitParamsPeriodWindow.kt | 42 +- .../async/authRules/V2ServiceAsync.kt | 94 + .../async/authRules/V2ServiceAsyncImpl.kt | 42 + .../services/blocking/authRules/V2Service.kt | 95 + .../blocking/authRules/V2ServiceImpl.kt | 39 + .../models/AuthRuleV2ListPageResponseTest.kt | 3 + .../AuthRuleV2RetrieveFeaturesParamsTest.kt | 63 + .../lithic/api/models/V2ApplyResponseTest.kt | 3 + .../lithic/api/models/V2CreateResponseTest.kt | 3 + .../lithic/api/models/V2DraftResponseTest.kt | 3 + .../lithic/api/models/V2ListResponseTest.kt | 3 + .../api/models/V2PromoteResponseTest.kt | 3 + .../models/V2RetrieveFeaturesResponseTest.kt | 120 ++ .../api/models/V2RetrieveResponseTest.kt | 3 + .../lithic/api/models/V2UpdateResponseTest.kt | 3 + .../api/models/VelocityLimitParamsTest.kt | 21 +- .../async/authRules/V2ServiceAsyncTest.kt | 23 + .../blocking/authRules/V2ServiceTest.kt | 22 + 31 files changed, 3367 insertions(+), 70 deletions(-) create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParams.kt create mode 100644 lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParamsTest.kt create mode 100644 lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponseTest.kt diff --git a/.stats.yml b/.stats.yml index ad4e59b36..890e2adb5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 169 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fbbce0ea11d3e86e532f705804f3d79e8eecfb8a7796e3a6ad3c50cccee14bb1.yml -openapi_spec_hash: 3f44b97866ca74effe5e70fc9c64effb -config_hash: 768e8f0faa1a21e26b07e6cdc395cebf +configured_endpoints: 170 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1a0e3a42c88b88140af0f9ad05ab0026fc87f0a500d6879c86b93dfa7f923810.yml +openapi_spec_hash: 2b4db6185c6e4ab3626461a448c97d4b +config_hash: 7a6a0c0bab3306093c6c171cd7407a45 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 78b13d8e4..6d268ea1d 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 @@ -1783,6 +1783,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1925,6 +1928,9 @@ private constructor( * currency. This is the amount the issuer should authorize against * unless the issuer is paying the acquirer fee on behalf of the * cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level * associated with a given authorization. Scores are on a range of * 0-999, with 0 representing the lowest risk and 999 representing the @@ -2101,6 +2107,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -2159,6 +2168,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2193,6 +2204,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2224,6 +2236,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2258,6 +2271,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2289,6 +2303,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -4277,6 +4292,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -4419,6 +4437,9 @@ private constructor( * currency. This is the amount the issuer should authorize against * unless the issuer is paying the acquirer fee on behalf of the * cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level * associated with a given authorization. Scores are on a range of * 0-999, with 0 representing the lowest risk and 999 representing the @@ -4595,6 +4616,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -4653,6 +4677,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4687,6 +4713,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4718,6 +4745,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4752,6 +4780,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4783,6 +4812,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -6815,6 +6845,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -6957,6 +6990,9 @@ private constructor( * currency. This is the amount the issuer should authorize against * unless the issuer is paying the acquirer fee on behalf of the * cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level * associated with a given authorization. Scores are on a range of * 0-999, with 0 representing the lowest risk and 999 representing the @@ -7133,6 +7169,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -7191,6 +7230,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -7225,6 +7266,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -7256,6 +7298,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -7290,6 +7333,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -7321,6 +7365,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt index 7da3c2bae..e19fa4aa5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2DraftParams.kt @@ -1188,6 +1188,8 @@ private constructor( * fee field in the settlement/cardholder billing currency. This is the amount the * issuer should authorize against unless the issuer is paying the acquirer fee on * behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + * represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing the * lowest risk and 999 representing the highest risk. For Visa transactions, where @@ -1321,6 +1323,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1485,6 +1489,8 @@ private constructor( * fee field in the settlement/cardholder billing currency. This is the amount the * issuer should authorize against unless the issuer is paying the acquirer fee on * behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + * represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing the * lowest risk and 999 representing the highest risk. For Visa transactions, where @@ -1542,6 +1548,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField val CARD_TRANSACTION_COUNT_15_M = of("CARD_TRANSACTION_COUNT_15M") @@ -1573,6 +1581,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -1603,6 +1612,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -1636,6 +1646,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -1667,6 +1678,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParams.kt new file mode 100644 index 000000000..fa70678eb --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParams.kt @@ -0,0 +1,245 @@ +// 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 + +/** + * Fetches the current calculated Feature values for the given Auth Rule + * + * This only calculates the features for the active version. + * - VelocityLimit Rules calculates the current Velocity Feature data. This requires a `card_token` + * or `account_token` matching what the rule is Scoped to. + * - ConditionalBlock Rules calculates the CARD_TRANSACTION_COUNT_* attributes on the rule. This + * requires a `card_token` + */ +class AuthRuleV2RetrieveFeaturesParams +private constructor( + private val authRuleToken: String?, + private val accountToken: String?, + private val cardToken: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun authRuleToken(): Optional = Optional.ofNullable(authRuleToken) + + fun accountToken(): Optional = Optional.ofNullable(accountToken) + + fun cardToken(): Optional = Optional.ofNullable(cardToken) + + /** 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(): AuthRuleV2RetrieveFeaturesParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [AuthRuleV2RetrieveFeaturesParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AuthRuleV2RetrieveFeaturesParams]. */ + class Builder internal constructor() { + + private var authRuleToken: String? = null + private var accountToken: String? = null + private var cardToken: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(authRuleV2RetrieveFeaturesParams: AuthRuleV2RetrieveFeaturesParams) = + apply { + authRuleToken = authRuleV2RetrieveFeaturesParams.authRuleToken + accountToken = authRuleV2RetrieveFeaturesParams.accountToken + cardToken = authRuleV2RetrieveFeaturesParams.cardToken + additionalHeaders = authRuleV2RetrieveFeaturesParams.additionalHeaders.toBuilder() + additionalQueryParams = + authRuleV2RetrieveFeaturesParams.additionalQueryParams.toBuilder() + } + + fun authRuleToken(authRuleToken: String?) = apply { this.authRuleToken = authRuleToken } + + /** Alias for calling [Builder.authRuleToken] with `authRuleToken.orElse(null)`. */ + fun authRuleToken(authRuleToken: Optional) = + authRuleToken(authRuleToken.getOrNull()) + + fun accountToken(accountToken: String?) = apply { this.accountToken = accountToken } + + /** Alias for calling [Builder.accountToken] with `accountToken.orElse(null)`. */ + fun accountToken(accountToken: Optional) = accountToken(accountToken.getOrNull()) + + fun cardToken(cardToken: String?) = apply { this.cardToken = cardToken } + + /** Alias for calling [Builder.cardToken] with `cardToken.orElse(null)`. */ + fun cardToken(cardToken: Optional) = cardToken(cardToken.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 [AuthRuleV2RetrieveFeaturesParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AuthRuleV2RetrieveFeaturesParams = + AuthRuleV2RetrieveFeaturesParams( + authRuleToken, + accountToken, + cardToken, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> authRuleToken ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + accountToken?.let { put("account_token", it) } + cardToken?.let { put("card_token", it) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AuthRuleV2RetrieveFeaturesParams && + authRuleToken == other.authRuleToken && + accountToken == other.accountToken && + cardToken == other.cardToken && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + authRuleToken, + accountToken, + cardToken, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "AuthRuleV2RetrieveFeaturesParams{authRuleToken=$authRuleToken, accountToken=$accountToken, cardToken=$cardToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt index e203d3815..319a3451b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -358,6 +383,7 @@ private constructor( currentVersion = v2ApplyResponse.currentVersion draftVersion = v2ApplyResponse.draftVersion eventStream = v2ApplyResponse.eventStream + lithicManaged = v2ApplyResponse.lithicManaged name = v2ApplyResponse.name programLevel = v2ApplyResponse.programLevel state = v2ApplyResponse.state @@ -506,6 +532,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -626,6 +669,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -645,6 +689,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -668,6 +713,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -698,6 +744,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1637,6 +1684,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1775,6 +1824,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1946,6 +1998,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2004,6 +2058,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2038,6 +2094,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2069,6 +2126,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2102,6 +2160,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2133,6 +2192,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3621,6 +3681,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3759,6 +3821,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3930,6 +3995,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3988,6 +4055,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4022,6 +4091,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4053,6 +4123,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4086,6 +4157,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4117,6 +4189,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5093,6 +5166,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5110,6 +5184,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5122,5 +5197,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2ApplyResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2ApplyResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt index 36c483073..471517066 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -359,6 +384,7 @@ private constructor( currentVersion = v2CreateResponse.currentVersion draftVersion = v2CreateResponse.draftVersion eventStream = v2CreateResponse.eventStream + lithicManaged = v2CreateResponse.lithicManaged name = v2CreateResponse.name programLevel = v2CreateResponse.programLevel state = v2CreateResponse.state @@ -507,6 +533,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -627,6 +670,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -646,6 +690,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -669,6 +714,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -699,6 +745,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1638,6 +1685,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1776,6 +1825,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1947,6 +1999,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2005,6 +2059,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2039,6 +2095,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2070,6 +2127,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2103,6 +2161,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2134,6 +2193,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3622,6 +3682,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3760,6 +3822,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3931,6 +3996,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3989,6 +4056,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4023,6 +4092,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4054,6 +4124,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4087,6 +4158,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4118,6 +4190,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5094,6 +5167,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5111,6 +5185,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5123,5 +5198,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2CreateResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2CreateResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt index 2ad00367d..c4f079fea 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -358,6 +383,7 @@ private constructor( currentVersion = v2DraftResponse.currentVersion draftVersion = v2DraftResponse.draftVersion eventStream = v2DraftResponse.eventStream + lithicManaged = v2DraftResponse.lithicManaged name = v2DraftResponse.name programLevel = v2DraftResponse.programLevel state = v2DraftResponse.state @@ -506,6 +532,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -626,6 +669,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -645,6 +689,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -668,6 +713,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -698,6 +744,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1637,6 +1684,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1775,6 +1824,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1946,6 +1998,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2004,6 +2058,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2038,6 +2094,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2069,6 +2126,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2102,6 +2160,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2133,6 +2192,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3621,6 +3681,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3759,6 +3821,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3930,6 +3995,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3988,6 +4055,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4022,6 +4091,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4053,6 +4123,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4086,6 +4157,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4117,6 +4189,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5093,6 +5166,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5110,6 +5184,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5122,5 +5197,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2DraftResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2DraftResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt index 153c13f4b..c19983004 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -358,6 +383,7 @@ private constructor( currentVersion = v2ListResponse.currentVersion draftVersion = v2ListResponse.draftVersion eventStream = v2ListResponse.eventStream + lithicManaged = v2ListResponse.lithicManaged name = v2ListResponse.name programLevel = v2ListResponse.programLevel state = v2ListResponse.state @@ -506,6 +532,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -626,6 +669,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -645,6 +689,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -668,6 +713,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -698,6 +744,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1637,6 +1684,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1775,6 +1824,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1946,6 +1998,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2004,6 +2058,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2038,6 +2094,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2069,6 +2126,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2102,6 +2160,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2133,6 +2192,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3621,6 +3681,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3759,6 +3821,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3930,6 +3995,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3988,6 +4055,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4022,6 +4091,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4053,6 +4123,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4086,6 +4157,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4117,6 +4189,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5093,6 +5166,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5110,6 +5184,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5122,5 +5197,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2ListResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2ListResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt index 7a05638e5..53317c571 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -359,6 +384,7 @@ private constructor( currentVersion = v2PromoteResponse.currentVersion draftVersion = v2PromoteResponse.draftVersion eventStream = v2PromoteResponse.eventStream + lithicManaged = v2PromoteResponse.lithicManaged name = v2PromoteResponse.name programLevel = v2PromoteResponse.programLevel state = v2PromoteResponse.state @@ -507,6 +533,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -627,6 +670,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -646,6 +690,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -669,6 +714,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -699,6 +745,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1638,6 +1685,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1776,6 +1825,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1947,6 +1999,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2005,6 +2059,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2039,6 +2095,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2070,6 +2127,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2103,6 +2161,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2134,6 +2193,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3622,6 +3682,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3760,6 +3822,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3931,6 +3996,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3989,6 +4056,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4023,6 +4092,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4054,6 +4124,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4087,6 +4158,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4118,6 +4190,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5094,6 +5167,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5111,6 +5185,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5123,5 +5198,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2PromoteResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2PromoteResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt new file mode 100644 index 000000000..56f5eecd4 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponse.kt @@ -0,0 +1,1606 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.core.checkKnown +import com.lithic.api.core.checkRequired +import com.lithic.api.core.toImmutable +import com.lithic.api.errors.LithicInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class V2RetrieveFeaturesResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val evaluated: JsonField, + private val features: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("evaluated") + @ExcludeMissing + evaluated: JsonField = JsonMissing.of(), + @JsonProperty("features") + @ExcludeMissing + features: JsonField> = JsonMissing.of(), + ) : this(evaluated, features, mutableMapOf()) + + /** + * Timestamp at which the Features were evaluated + * + * @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 evaluated(): OffsetDateTime = evaluated.getRequired("evaluated") + + /** + * Calculated Features used for evaluation of the provided Auth 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). + */ + fun features(): List = features.getRequired("features") + + /** + * Returns the raw JSON value of [evaluated]. + * + * Unlike [evaluated], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("evaluated") + @ExcludeMissing + fun _evaluated(): JsonField = evaluated + + /** + * Returns the raw JSON value of [features]. + * + * Unlike [features], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("features") + @ExcludeMissing + fun _features(): JsonField> = features + + @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 [V2RetrieveFeaturesResponse]. + * + * The following fields are required: + * ```java + * .evaluated() + * .features() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [V2RetrieveFeaturesResponse]. */ + class Builder internal constructor() { + + private var evaluated: JsonField? = null + private var features: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(v2RetrieveFeaturesResponse: V2RetrieveFeaturesResponse) = apply { + evaluated = v2RetrieveFeaturesResponse.evaluated + features = v2RetrieveFeaturesResponse.features.map { it.toMutableList() } + additionalProperties = v2RetrieveFeaturesResponse.additionalProperties.toMutableMap() + } + + /** Timestamp at which the Features were evaluated */ + fun evaluated(evaluated: OffsetDateTime) = evaluated(JsonField.of(evaluated)) + + /** + * Sets [Builder.evaluated] to an arbitrary JSON value. + * + * You should usually call [Builder.evaluated] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun evaluated(evaluated: JsonField) = apply { this.evaluated = evaluated } + + /** Calculated Features used for evaluation of the provided Auth Rule */ + fun features(features: List) = features(JsonField.of(features)) + + /** + * Sets [Builder.features] to an arbitrary JSON value. + * + * You should usually call [Builder.features] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun features(features: JsonField>) = apply { + this.features = features.map { it.toMutableList() } + } + + /** + * Adds a single [SpendFeatureState] to [features]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFeature(feature: SpendFeatureState) = apply { + features = + (features ?: JsonField.of(mutableListOf())).also { + checkKnown("features", it).add(feature) + } + } + + 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 [V2RetrieveFeaturesResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .evaluated() + * .features() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): V2RetrieveFeaturesResponse = + V2RetrieveFeaturesResponse( + checkRequired("evaluated", evaluated), + checkRequired("features", features).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): V2RetrieveFeaturesResponse = apply { + if (validated) { + return@apply + } + + evaluated() + features().forEach { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (evaluated.asKnown().isPresent) 1 else 0) + + (features.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + class SpendFeatureState + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val filters: JsonField, + private val period: JsonField, + private val scope: JsonField, + private val value: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField = JsonMissing.of(), + @JsonProperty("period") + @ExcludeMissing + period: JsonField = JsonMissing.of(), + @JsonProperty("scope") + @ExcludeMissing + scope: JsonField = JsonMissing.of(), + @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(), + ) : this(filters, period, scope, value, mutableMapOf()) + + /** + * @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 filters(): VelocityLimitFilters = filters.getRequired("filters") + + /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * + * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum + * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + * + * @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 period(): VelocityLimitParamsPeriodWindow = period.getRequired("period") + + /** + * The scope the velocity is calculated for + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun scope(): VelocityScope = scope.getRequired("scope") + + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun value(): Value = value.getRequired("value") + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") + @ExcludeMissing + fun _filters(): JsonField = filters + + /** + * Returns the raw JSON value of [period]. + * + * Unlike [period], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("period") + @ExcludeMissing + fun _period(): JsonField = period + + /** + * Returns the raw JSON value of [scope]. + * + * Unlike [scope], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("scope") @ExcludeMissing fun _scope(): JsonField = scope + + /** + * Returns the raw JSON value of [value]. + * + * Unlike [value], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [SpendFeatureState]. + * + * The following fields are required: + * ```java + * .filters() + * .period() + * .scope() + * .value() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SpendFeatureState]. */ + class Builder internal constructor() { + + private var filters: JsonField? = null + private var period: JsonField? = null + private var scope: JsonField? = null + private var value: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(spendFeatureState: SpendFeatureState) = apply { + filters = spendFeatureState.filters + period = spendFeatureState.period + scope = spendFeatureState.scope + value = spendFeatureState.value + additionalProperties = spendFeatureState.additionalProperties.toMutableMap() + } + + fun filters(filters: VelocityLimitFilters) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed [VelocityLimitFilters] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun filters(filters: JsonField) = apply { this.filters = filters } + + /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * + * The size of the trailing window to calculate Spend Velocity over in seconds. The + * minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + */ + fun period(period: VelocityLimitParamsPeriodWindow) = period(JsonField.of(period)) + + /** + * Sets [Builder.period] to an arbitrary JSON value. + * + * You should usually call [Builder.period] with a well-typed + * [VelocityLimitParamsPeriodWindow] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun period(period: JsonField) = apply { + this.period = period + } + + /** + * Alias for calling [period] with + * `VelocityLimitParamsPeriodWindow.ofTrailing(trailing)`. + */ + @Deprecated("deprecated") + fun period(trailing: Long) = + period(VelocityLimitParamsPeriodWindow.ofTrailing(trailing)) + + /** Alias for calling [period] with `VelocityLimitParamsPeriodWindow.ofFixed(fixed)`. */ + @Deprecated("deprecated") + fun period(fixed: VelocityLimitParamsPeriodWindow.FixedWindow) = + period(VelocityLimitParamsPeriodWindow.ofFixed(fixed)) + + /** + * Alias for calling [period] with + * `VelocityLimitParamsPeriodWindow.ofTrailingWindowObject(trailingWindowObject)`. + */ + fun period(trailingWindowObject: VelocityLimitParamsPeriodWindow.TrailingWindowObject) = + period(VelocityLimitParamsPeriodWindow.ofTrailingWindowObject(trailingWindowObject)) + + /** + * Alias for calling [period] with + * `VelocityLimitParamsPeriodWindow.ofFixedWindowDay(fixedWindowDay)`. + */ + fun period(fixedWindowDay: VelocityLimitParamsPeriodWindow.FixedWindowDay) = + period(VelocityLimitParamsPeriodWindow.ofFixedWindowDay(fixedWindowDay)) + + /** + * Alias for calling [period] with + * `VelocityLimitParamsPeriodWindow.ofFixedWindowWeek(fixedWindowWeek)`. + */ + fun period(fixedWindowWeek: VelocityLimitParamsPeriodWindow.FixedWindowWeek) = + period(VelocityLimitParamsPeriodWindow.ofFixedWindowWeek(fixedWindowWeek)) + + /** + * Alias for calling [period] with + * `VelocityLimitParamsPeriodWindow.ofFixedWindowMonth(fixedWindowMonth)`. + */ + fun period(fixedWindowMonth: VelocityLimitParamsPeriodWindow.FixedWindowMonth) = + period(VelocityLimitParamsPeriodWindow.ofFixedWindowMonth(fixedWindowMonth)) + + /** + * Alias for calling [period] with + * `VelocityLimitParamsPeriodWindow.ofFixedWindowYear(fixedWindowYear)`. + */ + fun period(fixedWindowYear: VelocityLimitParamsPeriodWindow.FixedWindowYear) = + period(VelocityLimitParamsPeriodWindow.ofFixedWindowYear(fixedWindowYear)) + + /** The scope the velocity is calculated for */ + fun scope(scope: VelocityScope) = scope(JsonField.of(scope)) + + /** + * Sets [Builder.scope] to an arbitrary JSON value. + * + * You should usually call [Builder.scope] with a well-typed [VelocityScope] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun scope(scope: JsonField) = apply { this.scope = scope } + + fun value(value: Value) = value(JsonField.of(value)) + + /** + * Sets [Builder.value] to an arbitrary JSON value. + * + * You should usually call [Builder.value] with a well-typed [Value] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun value(value: JsonField) = apply { this.value = value } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [SpendFeatureState]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .filters() + * .period() + * .scope() + * .value() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): SpendFeatureState = + SpendFeatureState( + checkRequired("filters", filters), + checkRequired("period", period), + checkRequired("scope", scope), + checkRequired("value", value), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): SpendFeatureState = apply { + if (validated) { + return@apply + } + + filters().validate() + period().validate() + scope().validate() + value().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (filters.asKnown().getOrNull()?.validity() ?: 0) + + (period.asKnown().getOrNull()?.validity() ?: 0) + + (scope.asKnown().getOrNull()?.validity() ?: 0) + + (value.asKnown().getOrNull()?.validity() ?: 0) + + class VelocityLimitFilters + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val excludeCountries: JsonField>, + private val excludeMccs: JsonField>, + private val includeCountries: JsonField>, + private val includeMccs: JsonField>, + private val includePanEntryModes: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("exclude_countries") + @ExcludeMissing + excludeCountries: JsonField> = JsonMissing.of(), + @JsonProperty("exclude_mccs") + @ExcludeMissing + excludeMccs: JsonField> = JsonMissing.of(), + @JsonProperty("include_countries") + @ExcludeMissing + includeCountries: JsonField> = JsonMissing.of(), + @JsonProperty("include_mccs") + @ExcludeMissing + includeMccs: JsonField> = JsonMissing.of(), + @JsonProperty("include_pan_entry_modes") + @ExcludeMissing + includePanEntryModes: JsonField> = JsonMissing.of(), + ) : this( + excludeCountries, + excludeMccs, + includeCountries, + includeMccs, + includePanEntryModes, + mutableMapOf(), + ) + + /** + * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + * Transactions matching any of the provided will be excluded from the calculated + * velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun excludeCountries(): Optional> = + excludeCountries.getOptional("exclude_countries") + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions + * matching this MCC will be excluded from the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun excludeMccs(): Optional> = excludeMccs.getOptional("exclude_mccs") + + /** + * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions + * not matching any of the provided will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun includeCountries(): Optional> = + includeCountries.getOptional("include_countries") + + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not + * matching this MCC will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun includeMccs(): Optional> = includeMccs.getOptional("include_mccs") + + /** + * PAN entry modes to include in the velocity calculation. Transactions not matching any + * of the provided will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun includePanEntryModes(): Optional> = + includePanEntryModes.getOptional("include_pan_entry_modes") + + /** + * Returns the raw JSON value of [excludeCountries]. + * + * Unlike [excludeCountries], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("exclude_countries") + @ExcludeMissing + fun _excludeCountries(): JsonField> = excludeCountries + + /** + * Returns the raw JSON value of [excludeMccs]. + * + * Unlike [excludeMccs], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("exclude_mccs") + @ExcludeMissing + fun _excludeMccs(): JsonField> = excludeMccs + + /** + * Returns the raw JSON value of [includeCountries]. + * + * Unlike [includeCountries], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("include_countries") + @ExcludeMissing + fun _includeCountries(): JsonField> = includeCountries + + /** + * Returns the raw JSON value of [includeMccs]. + * + * Unlike [includeMccs], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("include_mccs") + @ExcludeMissing + fun _includeMccs(): JsonField> = includeMccs + + /** + * Returns the raw JSON value of [includePanEntryModes]. + * + * Unlike [includePanEntryModes], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("include_pan_entry_modes") + @ExcludeMissing + fun _includePanEntryModes(): JsonField> = includePanEntryModes + + @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 [VelocityLimitFilters]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [VelocityLimitFilters]. */ + class Builder internal constructor() { + + private var excludeCountries: JsonField>? = null + private var excludeMccs: JsonField>? = null + private var includeCountries: JsonField>? = null + private var includeMccs: JsonField>? = null + private var includePanEntryModes: JsonField>? = + null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(velocityLimitFilters: VelocityLimitFilters) = apply { + excludeCountries = + velocityLimitFilters.excludeCountries.map { it.toMutableList() } + excludeMccs = velocityLimitFilters.excludeMccs.map { it.toMutableList() } + includeCountries = + velocityLimitFilters.includeCountries.map { it.toMutableList() } + includeMccs = velocityLimitFilters.includeMccs.map { it.toMutableList() } + includePanEntryModes = + velocityLimitFilters.includePanEntryModes.map { it.toMutableList() } + additionalProperties = velocityLimitFilters.additionalProperties.toMutableMap() + } + + /** + * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + * Transactions matching any of the provided will be excluded from the calculated + * velocity. + */ + fun excludeCountries(excludeCountries: List?) = + excludeCountries(JsonField.ofNullable(excludeCountries)) + + /** + * Alias for calling [Builder.excludeCountries] with + * `excludeCountries.orElse(null)`. + */ + fun excludeCountries(excludeCountries: Optional>) = + excludeCountries(excludeCountries.getOrNull()) + + /** + * Sets [Builder.excludeCountries] to an arbitrary JSON value. + * + * You should usually call [Builder.excludeCountries] with a well-typed + * `List` value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun excludeCountries(excludeCountries: JsonField>) = apply { + this.excludeCountries = excludeCountries.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [excludeCountries]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addExcludeCountry(excludeCountry: String) = apply { + excludeCountries = + (excludeCountries ?: JsonField.of(mutableListOf())).also { + checkKnown("excludeCountries", it).add(excludeCountry) + } + } + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions + * matching this MCC will be excluded from the calculated velocity. + */ + fun excludeMccs(excludeMccs: List?) = + excludeMccs(JsonField.ofNullable(excludeMccs)) + + /** Alias for calling [Builder.excludeMccs] with `excludeMccs.orElse(null)`. */ + fun excludeMccs(excludeMccs: Optional>) = + excludeMccs(excludeMccs.getOrNull()) + + /** + * Sets [Builder.excludeMccs] to an arbitrary JSON value. + * + * You should usually call [Builder.excludeMccs] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun excludeMccs(excludeMccs: JsonField>) = apply { + this.excludeMccs = excludeMccs.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [excludeMccs]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addExcludeMcc(excludeMcc: String) = apply { + excludeMccs = + (excludeMccs ?: JsonField.of(mutableListOf())).also { + checkKnown("excludeMccs", it).add(excludeMcc) + } + } + + /** + * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + * Transactions not matching any of the provided will not be included in the + * calculated velocity. + */ + fun includeCountries(includeCountries: List?) = + includeCountries(JsonField.ofNullable(includeCountries)) + + /** + * Alias for calling [Builder.includeCountries] with + * `includeCountries.orElse(null)`. + */ + fun includeCountries(includeCountries: Optional>) = + includeCountries(includeCountries.getOrNull()) + + /** + * Sets [Builder.includeCountries] to an arbitrary JSON value. + * + * You should usually call [Builder.includeCountries] with a well-typed + * `List` value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun includeCountries(includeCountries: JsonField>) = apply { + this.includeCountries = includeCountries.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [includeCountries]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludeCountry(includeCountry: String) = apply { + includeCountries = + (includeCountries ?: JsonField.of(mutableListOf())).also { + checkKnown("includeCountries", it).add(includeCountry) + } + } + + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not + * matching this MCC will not be included in the calculated velocity. + */ + fun includeMccs(includeMccs: List?) = + includeMccs(JsonField.ofNullable(includeMccs)) + + /** Alias for calling [Builder.includeMccs] with `includeMccs.orElse(null)`. */ + fun includeMccs(includeMccs: Optional>) = + includeMccs(includeMccs.getOrNull()) + + /** + * Sets [Builder.includeMccs] to an arbitrary JSON value. + * + * You should usually call [Builder.includeMccs] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun includeMccs(includeMccs: JsonField>) = apply { + this.includeMccs = includeMccs.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [includeMccs]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludeMcc(includeMcc: String) = apply { + includeMccs = + (includeMccs ?: JsonField.of(mutableListOf())).also { + checkKnown("includeMccs", it).add(includeMcc) + } + } + + /** + * PAN entry modes to include in the velocity calculation. Transactions not matching + * any of the provided will not be included in the calculated velocity. + */ + fun includePanEntryModes(includePanEntryModes: List?) = + includePanEntryModes(JsonField.ofNullable(includePanEntryModes)) + + /** + * Alias for calling [Builder.includePanEntryModes] with + * `includePanEntryModes.orElse(null)`. + */ + fun includePanEntryModes( + includePanEntryModes: Optional> + ) = includePanEntryModes(includePanEntryModes.getOrNull()) + + /** + * Sets [Builder.includePanEntryModes] to an arbitrary JSON value. + * + * You should usually call [Builder.includePanEntryModes] with a well-typed + * `List` value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun includePanEntryModes( + includePanEntryModes: JsonField> + ) = apply { + this.includePanEntryModes = includePanEntryModes.map { it.toMutableList() } + } + + /** + * Adds a single [IncludePanEntryMode] to [includePanEntryModes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludePanEntryMode(includePanEntryMode: IncludePanEntryMode) = apply { + includePanEntryModes = + (includePanEntryModes ?: JsonField.of(mutableListOf())).also { + checkKnown("includePanEntryModes", it).add(includePanEntryMode) + } + } + + 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 [VelocityLimitFilters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): VelocityLimitFilters = + VelocityLimitFilters( + (excludeCountries ?: JsonMissing.of()).map { it.toImmutable() }, + (excludeMccs ?: JsonMissing.of()).map { it.toImmutable() }, + (includeCountries ?: JsonMissing.of()).map { it.toImmutable() }, + (includeMccs ?: JsonMissing.of()).map { it.toImmutable() }, + (includePanEntryModes ?: JsonMissing.of()).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): VelocityLimitFilters = apply { + if (validated) { + return@apply + } + + excludeCountries() + excludeMccs() + includeCountries() + includeMccs() + includePanEntryModes().ifPresent { it.forEach { it.validate() } } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (excludeCountries.asKnown().getOrNull()?.size ?: 0) + + (excludeMccs.asKnown().getOrNull()?.size ?: 0) + + (includeCountries.asKnown().getOrNull()?.size ?: 0) + + (includeMccs.asKnown().getOrNull()?.size ?: 0) + + (includePanEntryModes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } + ?: 0) + + class IncludePanEntryMode + @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 AUTO_ENTRY = of("AUTO_ENTRY") + + @JvmField val BAR_CODE = of("BAR_CODE") + + @JvmField val CONTACTLESS = of("CONTACTLESS") + + @JvmField val CREDENTIAL_ON_FILE = of("CREDENTIAL_ON_FILE") + + @JvmField val ECOMMERCE = of("ECOMMERCE") + + @JvmField val ERROR_KEYED = of("ERROR_KEYED") + + @JvmField val ERROR_MAGNETIC_STRIPE = of("ERROR_MAGNETIC_STRIPE") + + @JvmField val ICC = of("ICC") + + @JvmField val KEY_ENTERED = of("KEY_ENTERED") + + @JvmField val MAGNETIC_STRIPE = of("MAGNETIC_STRIPE") + + @JvmField val MANUAL = of("MANUAL") + + @JvmField val OCR = of("OCR") + + @JvmField val SECURE_CARDLESS = of("SECURE_CARDLESS") + + @JvmField val UNSPECIFIED = of("UNSPECIFIED") + + @JvmField val UNKNOWN = of("UNKNOWN") + + @JvmStatic fun of(value: String) = IncludePanEntryMode(JsonField.of(value)) + } + + /** An enum containing [IncludePanEntryMode]'s known values. */ + enum class Known { + AUTO_ENTRY, + BAR_CODE, + CONTACTLESS, + CREDENTIAL_ON_FILE, + ECOMMERCE, + ERROR_KEYED, + ERROR_MAGNETIC_STRIPE, + ICC, + KEY_ENTERED, + MAGNETIC_STRIPE, + MANUAL, + OCR, + SECURE_CARDLESS, + UNSPECIFIED, + UNKNOWN, + } + + /** + * An enum containing [IncludePanEntryMode]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [IncludePanEntryMode] 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 { + AUTO_ENTRY, + BAR_CODE, + CONTACTLESS, + CREDENTIAL_ON_FILE, + ECOMMERCE, + ERROR_KEYED, + ERROR_MAGNETIC_STRIPE, + ICC, + KEY_ENTERED, + MAGNETIC_STRIPE, + MANUAL, + OCR, + SECURE_CARDLESS, + UNSPECIFIED, + UNKNOWN, + /** + * An enum member indicating that [IncludePanEntryMode] 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) { + AUTO_ENTRY -> Value.AUTO_ENTRY + BAR_CODE -> Value.BAR_CODE + CONTACTLESS -> Value.CONTACTLESS + CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE + ECOMMERCE -> Value.ECOMMERCE + ERROR_KEYED -> Value.ERROR_KEYED + ERROR_MAGNETIC_STRIPE -> Value.ERROR_MAGNETIC_STRIPE + ICC -> Value.ICC + KEY_ENTERED -> Value.KEY_ENTERED + MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE + MANUAL -> Value.MANUAL + OCR -> Value.OCR + SECURE_CARDLESS -> Value.SECURE_CARDLESS + UNSPECIFIED -> Value.UNSPECIFIED + UNKNOWN -> Value.UNKNOWN + 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) { + AUTO_ENTRY -> Known.AUTO_ENTRY + BAR_CODE -> Known.BAR_CODE + CONTACTLESS -> Known.CONTACTLESS + CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE + ECOMMERCE -> Known.ECOMMERCE + ERROR_KEYED -> Known.ERROR_KEYED + ERROR_MAGNETIC_STRIPE -> Known.ERROR_MAGNETIC_STRIPE + ICC -> Known.ICC + KEY_ENTERED -> Known.KEY_ENTERED + MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE + MANUAL -> Known.MANUAL + OCR -> Known.OCR + SECURE_CARDLESS -> Known.SECURE_CARDLESS + UNSPECIFIED -> Known.UNSPECIFIED + UNKNOWN -> Known.UNKNOWN + else -> + throw LithicInvalidDataException("Unknown IncludePanEntryMode: $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 + + fun validate(): IncludePanEntryMode = 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 IncludePanEntryMode && 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 VelocityLimitFilters && + excludeCountries == other.excludeCountries && + excludeMccs == other.excludeMccs && + includeCountries == other.includeCountries && + includeMccs == other.includeMccs && + includePanEntryModes == other.includePanEntryModes && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + excludeCountries, + excludeMccs, + includeCountries, + includeMccs, + includePanEntryModes, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "VelocityLimitFilters{excludeCountries=$excludeCountries, excludeMccs=$excludeMccs, includeCountries=$includeCountries, includeMccs=$includeMccs, includePanEntryModes=$includePanEntryModes, additionalProperties=$additionalProperties}" + } + + /** The scope the velocity is calculated for */ + class VelocityScope @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val CARD = of("CARD") + + @JvmField val ACCOUNT = of("ACCOUNT") + + @JvmStatic fun of(value: String) = VelocityScope(JsonField.of(value)) + } + + /** An enum containing [VelocityScope]'s known values. */ + enum class Known { + CARD, + ACCOUNT, + } + + /** + * An enum containing [VelocityScope]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [VelocityScope] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + CARD, + ACCOUNT, + /** + * An enum member indicating that [VelocityScope] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + CARD -> Value.CARD + ACCOUNT -> Value.ACCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CARD -> Known.CARD + ACCOUNT -> Known.ACCOUNT + else -> throw LithicInvalidDataException("Unknown VelocityScope: $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 + + fun validate(): VelocityScope = 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 VelocityScope && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class Value + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val count: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("count") @ExcludeMissing count: JsonField = JsonMissing.of(), + ) : this(amount, count, mutableMapOf()) + + /** + * Amount (in cents) for the given Auth Rule that is used as input for calculating the + * rule. For Velocity Limit rules this would be the calculated Velocity. For Conditional + * Rules using CARD_TRANSACTION_COUNT_* this will be 0 + * + * @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") + + /** + * Number of velocity impacting transactions matching the given scope, period and + * filters + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun count(): Long = count.getRequired("count") + + /** + * 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 [count]. + * + * Unlike [count], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("count") @ExcludeMissing fun _count(): JsonField = count + + @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 [Value]. + * + * The following fields are required: + * ```java + * .amount() + * .count() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Value]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var count: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(value: Value) = apply { + amount = value.amount + count = value.count + additionalProperties = value.additionalProperties.toMutableMap() + } + + /** + * Amount (in cents) for the given Auth Rule that is used as input for calculating + * the rule. For Velocity Limit rules this would be the calculated Velocity. For + * Conditional Rules using CARD_TRANSACTION_COUNT_* this will be 0 + */ + 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 } + + /** + * Number of velocity impacting transactions matching the given scope, period and + * filters + */ + fun count(count: Long) = count(JsonField.of(count)) + + /** + * Sets [Builder.count] to an arbitrary JSON value. + * + * You should usually call [Builder.count] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun count(count: JsonField) = apply { this.count = count } + + 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 [Value]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .count() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Value = + Value( + checkRequired("amount", amount), + checkRequired("count", count), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Value = apply { + if (validated) { + return@apply + } + + amount() + count() + 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 (count.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Value && + amount == other.amount && + count == other.count && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(amount, count, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Value{amount=$amount, count=$count, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SpendFeatureState && + filters == other.filters && + period == other.period && + scope == other.scope && + value == other.value && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(filters, period, scope, value, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "SpendFeatureState{filters=$filters, period=$period, scope=$scope, value=$value, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is V2RetrieveFeaturesResponse && + evaluated == other.evaluated && + features == other.features && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(evaluated, features, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "V2RetrieveFeaturesResponse{evaluated=$evaluated, features=$features, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt index 526d287d5..a5a95d447 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -359,6 +384,7 @@ private constructor( currentVersion = v2RetrieveResponse.currentVersion draftVersion = v2RetrieveResponse.draftVersion eventStream = v2RetrieveResponse.eventStream + lithicManaged = v2RetrieveResponse.lithicManaged name = v2RetrieveResponse.name programLevel = v2RetrieveResponse.programLevel state = v2RetrieveResponse.state @@ -507,6 +533,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -627,6 +670,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -646,6 +690,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -669,6 +714,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -699,6 +745,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1638,6 +1685,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1776,6 +1825,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1947,6 +1999,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2005,6 +2059,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2039,6 +2095,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2070,6 +2127,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2103,6 +2161,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2134,6 +2193,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3622,6 +3682,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3760,6 +3822,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3931,6 +3996,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3989,6 +4056,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4023,6 +4092,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4054,6 +4124,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4087,6 +4158,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4118,6 +4190,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5094,6 +5167,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5111,6 +5185,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5123,5 +5198,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2RetrieveResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2RetrieveResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt index 7e52c2385..689e7ef03 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt @@ -41,6 +41,7 @@ private constructor( private val currentVersion: JsonField, private val draftVersion: JsonField, private val eventStream: JsonField, + private val lithicManaged: JsonField, private val name: JsonField, private val programLevel: JsonField, private val state: JsonField, @@ -70,6 +71,9 @@ private constructor( @JsonProperty("event_stream") @ExcludeMissing eventStream: JsonField = JsonMissing.of(), + @JsonProperty("lithic_managed") + @ExcludeMissing + lithicManaged: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), @JsonProperty("program_level") @ExcludeMissing @@ -87,6 +91,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -148,6 +153,15 @@ private constructor( */ fun eventStream(): EventStream = eventStream.getRequired("event_stream") + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be modified + * or deleted by the user + * + * @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 lithicManaged(): Boolean = lithicManaged.getRequired("lithic_managed") + /** * Auth Rule Name * @@ -257,6 +271,15 @@ private constructor( @ExcludeMissing fun _eventStream(): JsonField = eventStream + /** + * Returns the raw JSON value of [lithicManaged]. + * + * Unlike [lithicManaged], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lithic_managed") + @ExcludeMissing + fun _lithicManaged(): JsonField = lithicManaged + /** * Returns the raw JSON value of [name]. * @@ -323,6 +346,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -342,6 +366,7 @@ private constructor( private var currentVersion: JsonField? = null private var draftVersion: JsonField? = null private var eventStream: JsonField? = null + private var lithicManaged: JsonField? = null private var name: JsonField? = null private var programLevel: JsonField? = null private var state: JsonField? = null @@ -359,6 +384,7 @@ private constructor( currentVersion = v2UpdateResponse.currentVersion draftVersion = v2UpdateResponse.draftVersion eventStream = v2UpdateResponse.eventStream + lithicManaged = v2UpdateResponse.lithicManaged name = v2UpdateResponse.name programLevel = v2UpdateResponse.programLevel state = v2UpdateResponse.state @@ -507,6 +533,23 @@ private constructor( this.eventStream = eventStream } + /** + * Indicates whether this auth rule is managed by Lithic. If true, the rule cannot be + * modified or deleted by the user + */ + fun lithicManaged(lithicManaged: Boolean) = lithicManaged(JsonField.of(lithicManaged)) + + /** + * Sets [Builder.lithicManaged] to an arbitrary JSON value. + * + * You should usually call [Builder.lithicManaged] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lithicManaged(lithicManaged: JsonField) = apply { + this.lithicManaged = lithicManaged + } + /** Auth Rule Name */ fun name(name: String?) = name(JsonField.ofNullable(name)) @@ -627,6 +670,7 @@ private constructor( * .currentVersion() * .draftVersion() * .eventStream() + * .lithicManaged() * .name() * .programLevel() * .state() @@ -646,6 +690,7 @@ private constructor( checkRequired("currentVersion", currentVersion), checkRequired("draftVersion", draftVersion), checkRequired("eventStream", eventStream), + checkRequired("lithicManaged", lithicManaged), checkRequired("name", name), checkRequired("programLevel", programLevel), checkRequired("state", state), @@ -669,6 +714,7 @@ private constructor( currentVersion().ifPresent { it.validate() } draftVersion().ifPresent { it.validate() } eventStream().validate() + lithicManaged() name() programLevel() state().validate() @@ -699,6 +745,7 @@ private constructor( (currentVersion.asKnown().getOrNull()?.validity() ?: 0) + (draftVersion.asKnown().getOrNull()?.validity() ?: 0) + (eventStream.asKnown().getOrNull()?.validity() ?: 0) + + (if (lithicManaged.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (programLevel.asKnown().isPresent) 1 else 0) + (state.asKnown().getOrNull()?.validity() ?: 0) + @@ -1638,6 +1685,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -1776,6 +1825,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -1947,6 +1999,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -2005,6 +2059,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -2039,6 +2095,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2070,6 +2127,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -2103,6 +2161,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -2134,6 +2193,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -3622,6 +3682,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3760,6 +3822,9 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This * is the amount the issuer should authorize against unless the issuer is * paying the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units + * (cents). This represents the amount of cash being withdrawn or + * advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated * with a given authorization. Scores are on a range of 0-999, with 0 * representing the lowest risk and 999 representing the highest risk. For @@ -3931,6 +3996,8 @@ private constructor( * acquirer fee field in the settlement/cardholder billing currency. This is * the amount the issuer should authorize against unless the issuer is paying * the acquirer fee on behalf of the cardholder. + * * `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). + * This represents the amount of cash being withdrawn or advanced. * * `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing * the lowest risk and 999 representing the highest risk. For Visa @@ -3989,6 +4056,8 @@ private constructor( @JvmField val TRANSACTION_AMOUNT = of("TRANSACTION_AMOUNT") + @JvmField val CASH_AMOUNT = of("CASH_AMOUNT") + @JvmField val RISK_SCORE = of("RISK_SCORE") @JvmField @@ -4023,6 +4092,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4054,6 +4124,7 @@ private constructor( LIABILITY_SHIFT, PAN_ENTRY_MODE, TRANSACTION_AMOUNT, + CASH_AMOUNT, RISK_SCORE, CARD_TRANSACTION_COUNT_15_M, CARD_TRANSACTION_COUNT_1_H, @@ -4087,6 +4158,7 @@ private constructor( LIABILITY_SHIFT -> Value.LIABILITY_SHIFT PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT + CASH_AMOUNT -> Value.CASH_AMOUNT RISK_SCORE -> Value.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Value.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H @@ -4118,6 +4190,7 @@ private constructor( LIABILITY_SHIFT -> Known.LIABILITY_SHIFT PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT + CASH_AMOUNT -> Known.CASH_AMOUNT RISK_SCORE -> Known.RISK_SCORE CARD_TRANSACTION_COUNT_15_M -> Known.CARD_TRANSACTION_COUNT_15_M CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H @@ -5094,6 +5167,7 @@ private constructor( currentVersion == other.currentVersion && draftVersion == other.draftVersion && eventStream == other.eventStream && + lithicManaged == other.lithicManaged && name == other.name && programLevel == other.programLevel && state == other.state && @@ -5111,6 +5185,7 @@ private constructor( currentVersion, draftVersion, eventStream, + lithicManaged, name, programLevel, state, @@ -5123,5 +5198,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "V2UpdateResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" + "V2UpdateResponse{token=$token, accountTokens=$accountTokens, businessAccountTokens=$businessAccountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, eventStream=$eventStream, lithicManaged=$lithicManaged, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt index 47c34b227..b3192fc47 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt @@ -23,9 +23,9 @@ import kotlin.jvm.optionals.getOrNull class VelocityLimitParams @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val filters: JsonField, + private val filters: JsonField, private val period: JsonField, - private val scope: JsonField, + private val scope: JsonField, private val limitAmount: JsonField, private val limitCount: JsonField, private val additionalProperties: MutableMap, @@ -33,11 +33,13 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("filters") @ExcludeMissing filters: JsonField = JsonMissing.of(), + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField = JsonMissing.of(), @JsonProperty("period") @ExcludeMissing period: JsonField = JsonMissing.of(), - @JsonProperty("scope") @ExcludeMissing scope: JsonField = JsonMissing.of(), + @JsonProperty("scope") @ExcludeMissing scope: JsonField = JsonMissing.of(), @JsonProperty("limit_amount") @ExcludeMissing limitAmount: JsonField = JsonMissing.of(), @@ -48,9 +50,11 @@ private constructor( * @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 filters(): Filters = filters.getRequired("filters") + fun filters(): VelocityLimitFilters = filters.getRequired("filters") /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). * @@ -60,10 +64,12 @@ private constructor( fun period(): VelocityLimitParamsPeriodWindow = period.getRequired("period") /** + * The scope the velocity is calculated for + * * @throws LithicInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun scope(): Scope = scope.getRequired("scope") + fun scope(): VelocityScope = scope.getRequired("scope") /** * The maximum amount of spend velocity allowed in the period in minor units (the smallest unit @@ -90,7 +96,9 @@ private constructor( * * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField = filters + @JsonProperty("filters") + @ExcludeMissing + fun _filters(): JsonField = filters /** * Returns the raw JSON value of [period]. @@ -106,7 +114,7 @@ private constructor( * * Unlike [scope], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("scope") @ExcludeMissing fun _scope(): JsonField = scope + @JsonProperty("scope") @ExcludeMissing fun _scope(): JsonField = scope /** * Returns the raw JSON value of [limitAmount]. @@ -152,9 +160,9 @@ private constructor( /** A builder for [VelocityLimitParams]. */ class Builder internal constructor() { - private var filters: JsonField? = null + private var filters: JsonField? = null private var period: JsonField? = null - private var scope: JsonField? = null + private var scope: JsonField? = null private var limitAmount: JsonField = JsonMissing.of() private var limitCount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -169,17 +177,20 @@ private constructor( additionalProperties = velocityLimitParams.additionalProperties.toMutableMap() } - fun filters(filters: Filters) = filters(JsonField.of(filters)) + fun filters(filters: VelocityLimitFilters) = filters(JsonField.of(filters)) /** * Sets [Builder.filters] to an arbitrary JSON value. * - * You should usually call [Builder.filters] with a well-typed [Filters] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. + * You should usually call [Builder.filters] with a well-typed [VelocityLimitFilters] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun filters(filters: JsonField) = apply { this.filters = filters } + fun filters(filters: JsonField) = apply { this.filters = filters } /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). */ @@ -199,9 +210,11 @@ private constructor( /** * Alias for calling [period] with `VelocityLimitParamsPeriodWindow.ofTrailing(trailing)`. */ + @Deprecated("deprecated") fun period(trailing: Long) = period(VelocityLimitParamsPeriodWindow.ofTrailing(trailing)) /** Alias for calling [period] with `VelocityLimitParamsPeriodWindow.ofFixed(fixed)`. */ + @Deprecated("deprecated") fun period(fixed: VelocityLimitParamsPeriodWindow.FixedWindow) = period(VelocityLimitParamsPeriodWindow.ofFixed(fixed)) @@ -240,15 +253,17 @@ private constructor( fun period(fixedWindowYear: VelocityLimitParamsPeriodWindow.FixedWindowYear) = period(VelocityLimitParamsPeriodWindow.ofFixedWindowYear(fixedWindowYear)) - fun scope(scope: Scope) = scope(JsonField.of(scope)) + /** The scope the velocity is calculated for */ + fun scope(scope: VelocityScope) = scope(JsonField.of(scope)) /** * Sets [Builder.scope] to an arbitrary JSON value. * - * You should usually call [Builder.scope] with a well-typed [Scope] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. + * You should usually call [Builder.scope] with a well-typed [VelocityScope] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun scope(scope: JsonField) = apply { this.scope = scope } + fun scope(scope: JsonField) = apply { this.scope = scope } /** * The maximum amount of spend velocity allowed in the period in minor units (the smallest @@ -382,13 +397,14 @@ private constructor( (if (limitAmount.asKnown().isPresent) 1 else 0) + (if (limitCount.asKnown().isPresent) 1 else 0) - class Filters + class VelocityLimitFilters @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val excludeCountries: JsonField>, private val excludeMccs: JsonField>, private val includeCountries: JsonField>, private val includeMccs: JsonField>, + private val includePanEntryModes: JsonField>, private val additionalProperties: MutableMap, ) { @@ -406,7 +422,17 @@ private constructor( @JsonProperty("include_mccs") @ExcludeMissing includeMccs: JsonField> = JsonMissing.of(), - ) : this(excludeCountries, excludeMccs, includeCountries, includeMccs, mutableMapOf()) + @JsonProperty("include_pan_entry_modes") + @ExcludeMissing + includePanEntryModes: JsonField> = JsonMissing.of(), + ) : this( + excludeCountries, + excludeMccs, + includeCountries, + includeMccs, + includePanEntryModes, + mutableMapOf(), + ) /** * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Transactions @@ -446,6 +472,16 @@ private constructor( */ fun includeMccs(): Optional> = includeMccs.getOptional("include_mccs") + /** + * PAN entry modes to include in the velocity calculation. Transactions not matching any of + * the provided will not be included in the calculated velocity. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun includePanEntryModes(): Optional> = + includePanEntryModes.getOptional("include_pan_entry_modes") + /** * Returns the raw JSON value of [excludeCountries]. * @@ -484,6 +520,16 @@ private constructor( @ExcludeMissing fun _includeMccs(): JsonField> = includeMccs + /** + * Returns the raw JSON value of [includePanEntryModes]. + * + * Unlike [includePanEntryModes], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("include_pan_entry_modes") + @ExcludeMissing + fun _includePanEntryModes(): JsonField> = includePanEntryModes + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -498,26 +544,29 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [Filters]. */ + /** Returns a mutable builder for constructing an instance of [VelocityLimitFilters]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [Filters]. */ + /** A builder for [VelocityLimitFilters]. */ class Builder internal constructor() { private var excludeCountries: JsonField>? = null private var excludeMccs: JsonField>? = null private var includeCountries: JsonField>? = null private var includeMccs: JsonField>? = null + private var includePanEntryModes: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(filters: Filters) = apply { - excludeCountries = filters.excludeCountries.map { it.toMutableList() } - excludeMccs = filters.excludeMccs.map { it.toMutableList() } - includeCountries = filters.includeCountries.map { it.toMutableList() } - includeMccs = filters.includeMccs.map { it.toMutableList() } - additionalProperties = filters.additionalProperties.toMutableMap() + internal fun from(velocityLimitFilters: VelocityLimitFilters) = apply { + excludeCountries = velocityLimitFilters.excludeCountries.map { it.toMutableList() } + excludeMccs = velocityLimitFilters.excludeMccs.map { it.toMutableList() } + includeCountries = velocityLimitFilters.includeCountries.map { it.toMutableList() } + includeMccs = velocityLimitFilters.includeMccs.map { it.toMutableList() } + includePanEntryModes = + velocityLimitFilters.includePanEntryModes.map { it.toMutableList() } + additionalProperties = velocityLimitFilters.additionalProperties.toMutableMap() } /** @@ -661,6 +710,44 @@ private constructor( } } + /** + * PAN entry modes to include in the velocity calculation. Transactions not matching any + * of the provided will not be included in the calculated velocity. + */ + fun includePanEntryModes(includePanEntryModes: List?) = + includePanEntryModes(JsonField.ofNullable(includePanEntryModes)) + + /** + * Alias for calling [Builder.includePanEntryModes] with + * `includePanEntryModes.orElse(null)`. + */ + fun includePanEntryModes(includePanEntryModes: Optional>) = + includePanEntryModes(includePanEntryModes.getOrNull()) + + /** + * Sets [Builder.includePanEntryModes] to an arbitrary JSON value. + * + * You should usually call [Builder.includePanEntryModes] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun includePanEntryModes(includePanEntryModes: JsonField>) = + apply { + this.includePanEntryModes = includePanEntryModes.map { it.toMutableList() } + } + + /** + * Adds a single [IncludePanEntryMode] to [includePanEntryModes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIncludePanEntryMode(includePanEntryMode: IncludePanEntryMode) = apply { + includePanEntryModes = + (includePanEntryModes ?: JsonField.of(mutableListOf())).also { + checkKnown("includePanEntryModes", it).add(includePanEntryMode) + } + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -681,23 +768,24 @@ private constructor( } /** - * Returns an immutable instance of [Filters]. + * Returns an immutable instance of [VelocityLimitFilters]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): Filters = - Filters( + fun build(): VelocityLimitFilters = + VelocityLimitFilters( (excludeCountries ?: JsonMissing.of()).map { it.toImmutable() }, (excludeMccs ?: JsonMissing.of()).map { it.toImmutable() }, (includeCountries ?: JsonMissing.of()).map { it.toImmutable() }, (includeMccs ?: JsonMissing.of()).map { it.toImmutable() }, + (includePanEntryModes ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): Filters = apply { + fun validate(): VelocityLimitFilters = apply { if (validated) { return@apply } @@ -706,6 +794,7 @@ private constructor( excludeMccs() includeCountries() includeMccs() + includePanEntryModes().ifPresent { it.forEach { it.validate() } } validated = true } @@ -728,18 +817,232 @@ private constructor( (excludeCountries.asKnown().getOrNull()?.size ?: 0) + (excludeMccs.asKnown().getOrNull()?.size ?: 0) + (includeCountries.asKnown().getOrNull()?.size ?: 0) + - (includeMccs.asKnown().getOrNull()?.size ?: 0) + (includeMccs.asKnown().getOrNull()?.size ?: 0) + + (includePanEntryModes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + class IncludePanEntryMode + @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 AUTO_ENTRY = of("AUTO_ENTRY") + + @JvmField val BAR_CODE = of("BAR_CODE") + + @JvmField val CONTACTLESS = of("CONTACTLESS") + + @JvmField val CREDENTIAL_ON_FILE = of("CREDENTIAL_ON_FILE") + + @JvmField val ECOMMERCE = of("ECOMMERCE") + + @JvmField val ERROR_KEYED = of("ERROR_KEYED") + + @JvmField val ERROR_MAGNETIC_STRIPE = of("ERROR_MAGNETIC_STRIPE") + + @JvmField val ICC = of("ICC") + + @JvmField val KEY_ENTERED = of("KEY_ENTERED") + + @JvmField val MAGNETIC_STRIPE = of("MAGNETIC_STRIPE") + + @JvmField val MANUAL = of("MANUAL") + + @JvmField val OCR = of("OCR") + + @JvmField val SECURE_CARDLESS = of("SECURE_CARDLESS") + + @JvmField val UNSPECIFIED = of("UNSPECIFIED") + + @JvmField val UNKNOWN = of("UNKNOWN") + + @JvmStatic fun of(value: String) = IncludePanEntryMode(JsonField.of(value)) + } + + /** An enum containing [IncludePanEntryMode]'s known values. */ + enum class Known { + AUTO_ENTRY, + BAR_CODE, + CONTACTLESS, + CREDENTIAL_ON_FILE, + ECOMMERCE, + ERROR_KEYED, + ERROR_MAGNETIC_STRIPE, + ICC, + KEY_ENTERED, + MAGNETIC_STRIPE, + MANUAL, + OCR, + SECURE_CARDLESS, + UNSPECIFIED, + UNKNOWN, + } + + /** + * An enum containing [IncludePanEntryMode]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [IncludePanEntryMode] 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 { + AUTO_ENTRY, + BAR_CODE, + CONTACTLESS, + CREDENTIAL_ON_FILE, + ECOMMERCE, + ERROR_KEYED, + ERROR_MAGNETIC_STRIPE, + ICC, + KEY_ENTERED, + MAGNETIC_STRIPE, + MANUAL, + OCR, + SECURE_CARDLESS, + UNSPECIFIED, + UNKNOWN, + /** + * An enum member indicating that [IncludePanEntryMode] 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) { + AUTO_ENTRY -> Value.AUTO_ENTRY + BAR_CODE -> Value.BAR_CODE + CONTACTLESS -> Value.CONTACTLESS + CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE + ECOMMERCE -> Value.ECOMMERCE + ERROR_KEYED -> Value.ERROR_KEYED + ERROR_MAGNETIC_STRIPE -> Value.ERROR_MAGNETIC_STRIPE + ICC -> Value.ICC + KEY_ENTERED -> Value.KEY_ENTERED + MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE + MANUAL -> Value.MANUAL + OCR -> Value.OCR + SECURE_CARDLESS -> Value.SECURE_CARDLESS + UNSPECIFIED -> Value.UNSPECIFIED + UNKNOWN -> Value.UNKNOWN + 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) { + AUTO_ENTRY -> Known.AUTO_ENTRY + BAR_CODE -> Known.BAR_CODE + CONTACTLESS -> Known.CONTACTLESS + CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE + ECOMMERCE -> Known.ECOMMERCE + ERROR_KEYED -> Known.ERROR_KEYED + ERROR_MAGNETIC_STRIPE -> Known.ERROR_MAGNETIC_STRIPE + ICC -> Known.ICC + KEY_ENTERED -> Known.KEY_ENTERED + MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE + MANUAL -> Known.MANUAL + OCR -> Known.OCR + SECURE_CARDLESS -> Known.SECURE_CARDLESS + UNSPECIFIED -> Known.UNSPECIFIED + UNKNOWN -> Known.UNKNOWN + else -> throw LithicInvalidDataException("Unknown IncludePanEntryMode: $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 + + fun validate(): IncludePanEntryMode = 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 IncludePanEntryMode && 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 Filters && + return other is VelocityLimitFilters && excludeCountries == other.excludeCountries && excludeMccs == other.excludeMccs && includeCountries == other.includeCountries && includeMccs == other.includeMccs && + includePanEntryModes == other.includePanEntryModes && additionalProperties == other.additionalProperties } @@ -749,6 +1052,7 @@ private constructor( excludeMccs, includeCountries, includeMccs, + includePanEntryModes, additionalProperties, ) } @@ -756,10 +1060,12 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Filters{excludeCountries=$excludeCountries, excludeMccs=$excludeMccs, includeCountries=$includeCountries, includeMccs=$includeMccs, additionalProperties=$additionalProperties}" + "VelocityLimitFilters{excludeCountries=$excludeCountries, excludeMccs=$excludeMccs, includeCountries=$includeCountries, includeMccs=$includeMccs, includePanEntryModes=$includePanEntryModes, additionalProperties=$additionalProperties}" } - class Scope @JsonCreator private constructor(private val value: JsonField) : Enum { + /** The scope the velocity is calculated for */ + class VelocityScope @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -777,19 +1083,19 @@ private constructor( @JvmField val ACCOUNT = of("ACCOUNT") - @JvmStatic fun of(value: String) = Scope(JsonField.of(value)) + @JvmStatic fun of(value: String) = VelocityScope(JsonField.of(value)) } - /** An enum containing [Scope]'s known values. */ + /** An enum containing [VelocityScope]'s known values. */ enum class Known { CARD, ACCOUNT, } /** - * An enum containing [Scope]'s known values, as well as an [_UNKNOWN] member. + * An enum containing [VelocityScope]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [Scope] can contain an unknown value in a couple of cases: + * An instance of [VelocityScope] 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. @@ -798,7 +1104,10 @@ private constructor( enum class Value { CARD, ACCOUNT, - /** An enum member indicating that [Scope] was instantiated with an unknown value. */ + /** + * An enum member indicating that [VelocityScope] was instantiated with an unknown + * value. + */ _UNKNOWN, } @@ -829,7 +1138,7 @@ private constructor( when (this) { CARD -> Known.CARD ACCOUNT -> Known.ACCOUNT - else -> throw LithicInvalidDataException("Unknown Scope: $value") + else -> throw LithicInvalidDataException("Unknown VelocityScope: $value") } /** @@ -846,7 +1155,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Scope = apply { + fun validate(): VelocityScope = apply { if (validated) { return@apply } @@ -876,7 +1185,7 @@ private constructor( return true } - return other is Scope && value == other.value + return other is VelocityScope && value == other.value } override fun hashCode() = value.hashCode() diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParamsPeriodWindow.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParamsPeriodWindow.kt index ef14294e1..3ca469a58 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParamsPeriodWindow.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParamsPeriodWindow.kt @@ -29,6 +29,8 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum value is * 10 seconds, and the maximum value is 2678400 seconds (31 days). */ @@ -47,12 +49,16 @@ private constructor( ) { /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). */ - fun trailing(): Optional = Optional.ofNullable(trailing) + @Deprecated("deprecated") fun trailing(): Optional = Optional.ofNullable(trailing) /** + * DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects + * * The window of time to calculate Spend Velocity over. * * `DAY`: Velocity over the current day since midnight Eastern Time. * * `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time. @@ -60,7 +66,7 @@ private constructor( * Eastern Time. * * `YEAR`: Velocity over the current year since 00:00 / 12 AM on January 1st in Eastern Time. */ - fun fixed(): Optional = Optional.ofNullable(fixed) + @Deprecated("deprecated") fun fixed(): Optional = Optional.ofNullable(fixed) fun trailingWindowObject(): Optional = Optional.ofNullable(trailingWindowObject) @@ -87,9 +93,9 @@ private constructor( */ fun fixedWindowYear(): Optional = Optional.ofNullable(fixedWindowYear) - fun isTrailing(): Boolean = trailing != null + @Deprecated("deprecated") fun isTrailing(): Boolean = trailing != null - fun isFixed(): Boolean = fixed != null + @Deprecated("deprecated") fun isFixed(): Boolean = fixed != null fun isTrailingWindowObject(): Boolean = trailingWindowObject != null @@ -102,12 +108,16 @@ private constructor( fun isFixedWindowYear(): Boolean = fixedWindowYear != null /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). */ - fun asTrailing(): Long = trailing.getOrThrow("trailing") + @Deprecated("deprecated") fun asTrailing(): Long = trailing.getOrThrow("trailing") /** + * DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects + * * The window of time to calculate Spend Velocity over. * * `DAY`: Velocity over the current day since midnight Eastern Time. * * `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time. @@ -115,7 +125,7 @@ private constructor( * Eastern Time. * * `YEAR`: Velocity over the current year since 00:00 / 12 AM on January 1st in Eastern Time. */ - fun asFixed(): FixedWindow = fixed.getOrThrow("fixed") + @Deprecated("deprecated") fun asFixed(): FixedWindow = fixed.getOrThrow("fixed") fun asTrailingWindowObject(): TrailingWindowObject = trailingWindowObject.getOrThrow("trailingWindowObject") @@ -282,13 +292,18 @@ private constructor( companion object { /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). */ + @Deprecated("deprecated") @JvmStatic fun ofTrailing(trailing: Long) = VelocityLimitParamsPeriodWindow(trailing = trailing) /** + * DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects + * * The window of time to calculate Spend Velocity over. * * `DAY`: Velocity over the current day since midnight Eastern Time. * * `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time. @@ -297,7 +312,9 @@ private constructor( * * `YEAR`: Velocity over the current year since 00:00 / 12 AM on January 1st in Eastern * Time. */ - @JvmStatic fun ofFixed(fixed: FixedWindow) = VelocityLimitParamsPeriodWindow(fixed = fixed) + @Deprecated("deprecated") + @JvmStatic + fun ofFixed(fixed: FixedWindow) = VelocityLimitParamsPeriodWindow(fixed = fixed) @JvmStatic fun ofTrailingWindowObject(trailingWindowObject: TrailingWindowObject) = @@ -342,12 +359,16 @@ private constructor( interface Visitor { /** + * DEPRECATED: This has been deprecated in favor of the Trailing Window Objects + * * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum * value is 10 seconds, and the maximum value is 2678400 seconds (31 days). */ - fun visitTrailing(trailing: Long): T + @Deprecated("deprecated") fun visitTrailing(trailing: Long): T /** + * DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects + * * The window of time to calculate Spend Velocity over. * * `DAY`: Velocity over the current day since midnight Eastern Time. * * `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time. @@ -356,7 +377,7 @@ private constructor( * * `YEAR`: Velocity over the current year since 00:00 / 12 AM on January 1st in Eastern * Time. */ - fun visitFixed(fixed: FixedWindow): T + @Deprecated("deprecated") fun visitFixed(fixed: FixedWindow): T fun visitTrailingWindowObject(trailingWindowObject: TrailingWindowObject): T @@ -467,6 +488,8 @@ private constructor( } /** + * DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects + * * The window of time to calculate Spend Velocity over. * * `DAY`: Velocity over the current day since midnight Eastern Time. * * `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time. @@ -474,6 +497,7 @@ private constructor( * Eastern Time. * * `YEAR`: Velocity over the current year since 00:00 / 12 AM on January 1st in Eastern Time. */ + @Deprecated("deprecated") class FixedWindow @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsync.kt index cbd754123..fd4635809 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsync.kt @@ -14,6 +14,7 @@ import com.lithic.api.models.AuthRuleV2ListPageAsync import com.lithic.api.models.AuthRuleV2ListParams import com.lithic.api.models.AuthRuleV2PromoteParams import com.lithic.api.models.AuthRuleV2ReportParams +import com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams import com.lithic.api.models.AuthRuleV2RetrieveParams import com.lithic.api.models.AuthRuleV2RetrieveReportParams import com.lithic.api.models.AuthRuleV2UpdateParams @@ -22,6 +23,7 @@ import com.lithic.api.models.V2CreateResponse import com.lithic.api.models.V2DraftResponse import com.lithic.api.models.V2PromoteResponse import com.lithic.api.models.V2ReportResponse +import com.lithic.api.models.V2RetrieveFeaturesResponse import com.lithic.api.models.V2RetrieveReportResponse import com.lithic.api.models.V2RetrieveResponse import com.lithic.api.models.V2UpdateResponse @@ -366,6 +368,52 @@ interface V2ServiceAsync { ): CompletableFuture = report(authRuleToken, AuthRuleV2ReportParams.none(), requestOptions) + /** + * Fetches the current calculated Feature values for the given Auth Rule + * + * This only calculates the features for the active version. + * - VelocityLimit Rules calculates the current Velocity Feature data. This requires a + * `card_token` or `account_token` matching what the rule is Scoped to. + * - ConditionalBlock Rules calculates the CARD_TRANSACTION_COUNT_* attributes on the rule. This + * requires a `card_token` + */ + fun retrieveFeatures(authRuleToken: String): CompletableFuture = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieveFeatures(params.toBuilder().authRuleToken(authRuleToken).build(), requestOptions) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + ): CompletableFuture = + retrieveFeatures(authRuleToken, params, RequestOptions.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieveFeatures */ + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams + ): CompletableFuture = + retrieveFeatures(params, RequestOptions.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none(), requestOptions) + /** * Retrieves a performance report for an Auth rule containing daily statistics and evaluation * outcomes. @@ -730,6 +778,52 @@ interface V2ServiceAsync { ): CompletableFuture> = report(authRuleToken, AuthRuleV2ReportParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `get /v2/auth_rules/{auth_rule_token}/features`, but is + * otherwise the same as [V2ServiceAsync.retrieveFeatures]. + */ + fun retrieveFeatures( + authRuleToken: String + ): CompletableFuture> = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieveFeatures( + params.toBuilder().authRuleToken(authRuleToken).build(), + requestOptions, + ) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + ): CompletableFuture> = + retrieveFeatures(authRuleToken, params, RequestOptions.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieveFeatures */ + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams + ): CompletableFuture> = + retrieveFeatures(params, RequestOptions.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /v2/auth_rules/{auth_rule_token}/report`, but is * otherwise the same as [V2ServiceAsync.retrieveReport]. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncImpl.kt index 321e4871a..177ec0090 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncImpl.kt @@ -26,6 +26,7 @@ import com.lithic.api.models.AuthRuleV2ListPageResponse import com.lithic.api.models.AuthRuleV2ListParams import com.lithic.api.models.AuthRuleV2PromoteParams import com.lithic.api.models.AuthRuleV2ReportParams +import com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams import com.lithic.api.models.AuthRuleV2RetrieveParams import com.lithic.api.models.AuthRuleV2RetrieveReportParams import com.lithic.api.models.AuthRuleV2UpdateParams @@ -34,6 +35,7 @@ import com.lithic.api.models.V2CreateResponse import com.lithic.api.models.V2DraftResponse import com.lithic.api.models.V2PromoteResponse import com.lithic.api.models.V2ReportResponse +import com.lithic.api.models.V2RetrieveFeaturesResponse import com.lithic.api.models.V2RetrieveReportResponse import com.lithic.api.models.V2RetrieveResponse import com.lithic.api.models.V2UpdateResponse @@ -124,6 +126,13 @@ class V2ServiceAsyncImpl internal constructor(private val clientOptions: ClientO // post /v2/auth_rules/{auth_rule_token}/report withRawResponse().report(params, requestOptions).thenApply { it.parse() } + override fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v2/auth_rules/{auth_rule_token}/features + withRawResponse().retrieveFeatures(params, requestOptions).thenApply { it.parse() } + override fun retrieveReport( params: AuthRuleV2RetrieveReportParams, requestOptions: RequestOptions, @@ -451,6 +460,39 @@ class V2ServiceAsyncImpl internal constructor(private val clientOptions: ClientO } } + private val retrieveFeaturesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("authRuleToken", params.authRuleToken().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v2", "auth_rules", params._pathParam(0), "features") + .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 { retrieveFeaturesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val retrieveReportHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2Service.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2Service.kt index 03f5ccb56..67719951e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2Service.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2Service.kt @@ -15,6 +15,7 @@ import com.lithic.api.models.AuthRuleV2ListPage import com.lithic.api.models.AuthRuleV2ListParams import com.lithic.api.models.AuthRuleV2PromoteParams import com.lithic.api.models.AuthRuleV2ReportParams +import com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams import com.lithic.api.models.AuthRuleV2RetrieveParams import com.lithic.api.models.AuthRuleV2RetrieveReportParams import com.lithic.api.models.AuthRuleV2UpdateParams @@ -23,6 +24,7 @@ import com.lithic.api.models.V2CreateResponse import com.lithic.api.models.V2DraftResponse import com.lithic.api.models.V2PromoteResponse import com.lithic.api.models.V2ReportResponse +import com.lithic.api.models.V2RetrieveFeaturesResponse import com.lithic.api.models.V2RetrieveReportResponse import com.lithic.api.models.V2RetrieveResponse import com.lithic.api.models.V2UpdateResponse @@ -343,6 +345,49 @@ interface V2Service { fun report(authRuleToken: String, requestOptions: RequestOptions): V2ReportResponse = report(authRuleToken, AuthRuleV2ReportParams.none(), requestOptions) + /** + * Fetches the current calculated Feature values for the given Auth Rule + * + * This only calculates the features for the active version. + * - VelocityLimit Rules calculates the current Velocity Feature data. This requires a + * `card_token` or `account_token` matching what the rule is Scoped to. + * - ConditionalBlock Rules calculates the CARD_TRANSACTION_COUNT_* attributes on the rule. This + * requires a `card_token` + */ + fun retrieveFeatures(authRuleToken: String): V2RetrieveFeaturesResponse = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): V2RetrieveFeaturesResponse = + retrieveFeatures(params.toBuilder().authRuleToken(authRuleToken).build(), requestOptions) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + ): V2RetrieveFeaturesResponse = retrieveFeatures(authRuleToken, params, RequestOptions.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): V2RetrieveFeaturesResponse + + /** @see retrieveFeatures */ + fun retrieveFeatures(params: AuthRuleV2RetrieveFeaturesParams): V2RetrieveFeaturesResponse = + retrieveFeatures(params, RequestOptions.none()) + + /** @see retrieveFeatures */ + fun retrieveFeatures( + authRuleToken: String, + requestOptions: RequestOptions, + ): V2RetrieveFeaturesResponse = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none(), requestOptions) + /** * Retrieves a performance report for an Auth rule containing daily statistics and evaluation * outcomes. @@ -722,6 +767,56 @@ interface V2Service { ): HttpResponseFor = report(authRuleToken, AuthRuleV2ReportParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `get /v2/auth_rules/{auth_rule_token}/features`, but is + * otherwise the same as [V2Service.retrieveFeatures]. + */ + @MustBeClosed + fun retrieveFeatures(authRuleToken: String): HttpResponseFor = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none()) + + /** @see retrieveFeatures */ + @MustBeClosed + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieveFeatures( + params.toBuilder().authRuleToken(authRuleToken).build(), + requestOptions, + ) + + /** @see retrieveFeatures */ + @MustBeClosed + fun retrieveFeatures( + authRuleToken: String, + params: AuthRuleV2RetrieveFeaturesParams = AuthRuleV2RetrieveFeaturesParams.none(), + ): HttpResponseFor = + retrieveFeatures(authRuleToken, params, RequestOptions.none()) + + /** @see retrieveFeatures */ + @MustBeClosed + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieveFeatures */ + @MustBeClosed + fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams + ): HttpResponseFor = + retrieveFeatures(params, RequestOptions.none()) + + /** @see retrieveFeatures */ + @MustBeClosed + fun retrieveFeatures( + authRuleToken: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieveFeatures(authRuleToken, AuthRuleV2RetrieveFeaturesParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /v2/auth_rules/{auth_rule_token}/report`, but is * otherwise the same as [V2Service.retrieveReport]. diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceImpl.kt index 40b509bef..2d8faa681 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceImpl.kt @@ -26,6 +26,7 @@ import com.lithic.api.models.AuthRuleV2ListPageResponse import com.lithic.api.models.AuthRuleV2ListParams import com.lithic.api.models.AuthRuleV2PromoteParams import com.lithic.api.models.AuthRuleV2ReportParams +import com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams import com.lithic.api.models.AuthRuleV2RetrieveParams import com.lithic.api.models.AuthRuleV2RetrieveReportParams import com.lithic.api.models.AuthRuleV2UpdateParams @@ -34,6 +35,7 @@ import com.lithic.api.models.V2CreateResponse import com.lithic.api.models.V2DraftResponse import com.lithic.api.models.V2PromoteResponse import com.lithic.api.models.V2ReportResponse +import com.lithic.api.models.V2RetrieveFeaturesResponse import com.lithic.api.models.V2RetrieveReportResponse import com.lithic.api.models.V2RetrieveResponse import com.lithic.api.models.V2UpdateResponse @@ -120,6 +122,13 @@ class V2ServiceImpl internal constructor(private val clientOptions: ClientOption // post /v2/auth_rules/{auth_rule_token}/report withRawResponse().report(params, requestOptions).parse() + override fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions, + ): V2RetrieveFeaturesResponse = + // get /v2/auth_rules/{auth_rule_token}/features + withRawResponse().retrieveFeatures(params, requestOptions).parse() + override fun retrieveReport( params: AuthRuleV2RetrieveReportParams, requestOptions: RequestOptions, @@ -419,6 +428,36 @@ class V2ServiceImpl internal constructor(private val clientOptions: ClientOption } } + private val retrieveFeaturesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieveFeatures( + params: AuthRuleV2RetrieveFeaturesParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("authRuleToken", params.authRuleToken().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v2", "auth_rules", params._pathParam(0), "features") + .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 { retrieveFeaturesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val retrieveReportHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponseTest.kt index e41efc070..fcbf51e69 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2ListPageResponseTest.kt @@ -52,6 +52,7 @@ internal class AuthRuleV2ListPageResponseTest { .build() ) .eventStream(V2ListResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ListResponse.AuthRuleState.ACTIVE) @@ -102,6 +103,7 @@ internal class AuthRuleV2ListPageResponseTest { .build() ) .eventStream(V2ListResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ListResponse.AuthRuleState.ACTIVE) @@ -156,6 +158,7 @@ internal class AuthRuleV2ListPageResponseTest { .build() ) .eventStream(V2ListResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ListResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParamsTest.kt new file mode 100644 index 000000000..0b3f3bdd2 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2RetrieveFeaturesParamsTest.kt @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.lithic.api.core.http.QueryParams +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class AuthRuleV2RetrieveFeaturesParamsTest { + + @Test + fun create() { + AuthRuleV2RetrieveFeaturesParams.builder() + .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + } + + @Test + fun pathParams() { + val params = + AuthRuleV2RetrieveFeaturesParams.builder() + .authRuleToken("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("") + } + + @Test + fun queryParams() { + val params = + AuthRuleV2RetrieveFeaturesParams.builder() + .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("account_token", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put("card_token", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + AuthRuleV2RetrieveFeaturesParams.builder() + .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ApplyResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ApplyResponseTest.kt index 51b9a2087..d99f80614 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ApplyResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ApplyResponseTest.kt @@ -51,6 +51,7 @@ internal class V2ApplyResponseTest { .build() ) .eventStream(V2ApplyResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ApplyResponse.AuthRuleState.ACTIVE) @@ -101,6 +102,7 @@ internal class V2ApplyResponseTest { ) assertThat(v2ApplyResponse.eventStream()) .isEqualTo(V2ApplyResponse.EventStream.AUTHORIZATION) + assertThat(v2ApplyResponse.lithicManaged()).isEqualTo(true) assertThat(v2ApplyResponse.name()).contains("name") assertThat(v2ApplyResponse.programLevel()).isEqualTo(true) assertThat(v2ApplyResponse.state()).isEqualTo(V2ApplyResponse.AuthRuleState.ACTIVE) @@ -151,6 +153,7 @@ internal class V2ApplyResponseTest { .build() ) .eventStream(V2ApplyResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ApplyResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2CreateResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2CreateResponseTest.kt index d808ef96a..09c55bae6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2CreateResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2CreateResponseTest.kt @@ -51,6 +51,7 @@ internal class V2CreateResponseTest { .build() ) .eventStream(V2CreateResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2CreateResponse.AuthRuleState.ACTIVE) @@ -101,6 +102,7 @@ internal class V2CreateResponseTest { ) assertThat(v2CreateResponse.eventStream()) .isEqualTo(V2CreateResponse.EventStream.AUTHORIZATION) + assertThat(v2CreateResponse.lithicManaged()).isEqualTo(true) assertThat(v2CreateResponse.name()).contains("name") assertThat(v2CreateResponse.programLevel()).isEqualTo(true) assertThat(v2CreateResponse.state()).isEqualTo(V2CreateResponse.AuthRuleState.ACTIVE) @@ -152,6 +154,7 @@ internal class V2CreateResponseTest { .build() ) .eventStream(V2CreateResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2CreateResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2DraftResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2DraftResponseTest.kt index d2422e23f..c0110fe5e 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2DraftResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2DraftResponseTest.kt @@ -51,6 +51,7 @@ internal class V2DraftResponseTest { .build() ) .eventStream(V2DraftResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2DraftResponse.AuthRuleState.ACTIVE) @@ -101,6 +102,7 @@ internal class V2DraftResponseTest { ) assertThat(v2DraftResponse.eventStream()) .isEqualTo(V2DraftResponse.EventStream.AUTHORIZATION) + assertThat(v2DraftResponse.lithicManaged()).isEqualTo(true) assertThat(v2DraftResponse.name()).contains("name") assertThat(v2DraftResponse.programLevel()).isEqualTo(true) assertThat(v2DraftResponse.state()).isEqualTo(V2DraftResponse.AuthRuleState.ACTIVE) @@ -151,6 +153,7 @@ internal class V2DraftResponseTest { .build() ) .eventStream(V2DraftResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2DraftResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResponseTest.kt index 9b74151b8..1e493b163 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2ListResponseTest.kt @@ -51,6 +51,7 @@ internal class V2ListResponseTest { .build() ) .eventStream(V2ListResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ListResponse.AuthRuleState.ACTIVE) @@ -100,6 +101,7 @@ internal class V2ListResponseTest { .build() ) assertThat(v2ListResponse.eventStream()).isEqualTo(V2ListResponse.EventStream.AUTHORIZATION) + assertThat(v2ListResponse.lithicManaged()).isEqualTo(true) assertThat(v2ListResponse.name()).contains("name") assertThat(v2ListResponse.programLevel()).isEqualTo(true) assertThat(v2ListResponse.state()).isEqualTo(V2ListResponse.AuthRuleState.ACTIVE) @@ -150,6 +152,7 @@ internal class V2ListResponseTest { .build() ) .eventStream(V2ListResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2ListResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2PromoteResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2PromoteResponseTest.kt index 5493c7e7f..d4d75e6f5 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2PromoteResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2PromoteResponseTest.kt @@ -51,6 +51,7 @@ internal class V2PromoteResponseTest { .build() ) .eventStream(V2PromoteResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2PromoteResponse.AuthRuleState.ACTIVE) @@ -101,6 +102,7 @@ internal class V2PromoteResponseTest { ) assertThat(v2PromoteResponse.eventStream()) .isEqualTo(V2PromoteResponse.EventStream.AUTHORIZATION) + assertThat(v2PromoteResponse.lithicManaged()).isEqualTo(true) assertThat(v2PromoteResponse.name()).contains("name") assertThat(v2PromoteResponse.programLevel()).isEqualTo(true) assertThat(v2PromoteResponse.state()).isEqualTo(V2PromoteResponse.AuthRuleState.ACTIVE) @@ -152,6 +154,7 @@ internal class V2PromoteResponseTest { .build() ) .eventStream(V2PromoteResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2PromoteResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponseTest.kt new file mode 100644 index 000000000..a837c85e4 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveFeaturesResponseTest.kt @@ -0,0 +1,120 @@ +// 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 java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class V2RetrieveFeaturesResponseTest { + + @Test + fun create() { + val v2RetrieveFeaturesResponse = + V2RetrieveFeaturesResponse.builder() + .evaluated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFeature( + V2RetrieveFeaturesResponse.SpendFeatureState.builder() + .filters( + V2RetrieveFeaturesResponse.SpendFeatureState.VelocityLimitFilters + .builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode( + V2RetrieveFeaturesResponse.SpendFeatureState + .VelocityLimitFilters + .IncludePanEntryMode + .AUTO_ENTRY + ) + .build() + ) + .period(10L) + .scope(V2RetrieveFeaturesResponse.SpendFeatureState.VelocityScope.CARD) + .value( + V2RetrieveFeaturesResponse.SpendFeatureState.Value.builder() + .amount(0L) + .count(0L) + .build() + ) + .build() + ) + .build() + + assertThat(v2RetrieveFeaturesResponse.evaluated()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(v2RetrieveFeaturesResponse.features()) + .containsExactly( + V2RetrieveFeaturesResponse.SpendFeatureState.builder() + .filters( + V2RetrieveFeaturesResponse.SpendFeatureState.VelocityLimitFilters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode( + V2RetrieveFeaturesResponse.SpendFeatureState.VelocityLimitFilters + .IncludePanEntryMode + .AUTO_ENTRY + ) + .build() + ) + .period(10L) + .scope(V2RetrieveFeaturesResponse.SpendFeatureState.VelocityScope.CARD) + .value( + V2RetrieveFeaturesResponse.SpendFeatureState.Value.builder() + .amount(0L) + .count(0L) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val v2RetrieveFeaturesResponse = + V2RetrieveFeaturesResponse.builder() + .evaluated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFeature( + V2RetrieveFeaturesResponse.SpendFeatureState.builder() + .filters( + V2RetrieveFeaturesResponse.SpendFeatureState.VelocityLimitFilters + .builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") + .addIncludeCountry("USD") + .addIncludeMcc("5542") + .addIncludePanEntryMode( + V2RetrieveFeaturesResponse.SpendFeatureState + .VelocityLimitFilters + .IncludePanEntryMode + .AUTO_ENTRY + ) + .build() + ) + .period(10L) + .scope(V2RetrieveFeaturesResponse.SpendFeatureState.VelocityScope.CARD) + .value( + V2RetrieveFeaturesResponse.SpendFeatureState.Value.builder() + .amount(0L) + .count(0L) + .build() + ) + .build() + ) + .build() + + val roundtrippedV2RetrieveFeaturesResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(v2RetrieveFeaturesResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedV2RetrieveFeaturesResponse).isEqualTo(v2RetrieveFeaturesResponse) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveResponseTest.kt index 4b34b1f79..c39e741c6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2RetrieveResponseTest.kt @@ -51,6 +51,7 @@ internal class V2RetrieveResponseTest { .build() ) .eventStream(V2RetrieveResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2RetrieveResponse.AuthRuleState.ACTIVE) @@ -101,6 +102,7 @@ internal class V2RetrieveResponseTest { ) assertThat(v2RetrieveResponse.eventStream()) .isEqualTo(V2RetrieveResponse.EventStream.AUTHORIZATION) + assertThat(v2RetrieveResponse.lithicManaged()).isEqualTo(true) assertThat(v2RetrieveResponse.name()).contains("name") assertThat(v2RetrieveResponse.programLevel()).isEqualTo(true) assertThat(v2RetrieveResponse.state()).isEqualTo(V2RetrieveResponse.AuthRuleState.ACTIVE) @@ -152,6 +154,7 @@ internal class V2RetrieveResponseTest { .build() ) .eventStream(V2RetrieveResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2RetrieveResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2UpdateResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2UpdateResponseTest.kt index 2aaa93585..ea8faae31 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2UpdateResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/V2UpdateResponseTest.kt @@ -51,6 +51,7 @@ internal class V2UpdateResponseTest { .build() ) .eventStream(V2UpdateResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2UpdateResponse.AuthRuleState.ACTIVE) @@ -101,6 +102,7 @@ internal class V2UpdateResponseTest { ) assertThat(v2UpdateResponse.eventStream()) .isEqualTo(V2UpdateResponse.EventStream.AUTHORIZATION) + assertThat(v2UpdateResponse.lithicManaged()).isEqualTo(true) assertThat(v2UpdateResponse.name()).contains("name") assertThat(v2UpdateResponse.programLevel()).isEqualTo(true) assertThat(v2UpdateResponse.state()).isEqualTo(V2UpdateResponse.AuthRuleState.ACTIVE) @@ -152,6 +154,7 @@ internal class V2UpdateResponseTest { .build() ) .eventStream(V2UpdateResponse.EventStream.AUTHORIZATION) + .lithicManaged(true) .name("name") .programLevel(true) .state(V2UpdateResponse.AuthRuleState.ACTIVE) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt index 455cc706c..16239d0ee 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/VelocityLimitParamsTest.kt @@ -14,31 +14,37 @@ internal class VelocityLimitParamsTest { val velocityLimitParams = VelocityLimitParams.builder() .filters( - VelocityLimitParams.Filters.builder() + VelocityLimitParams.VelocityLimitFilters.builder() .addExcludeCountry("USD") .addExcludeMcc("5542") .addIncludeCountry("USD") .addIncludeMcc("5542") + .addIncludePanEntryMode( + VelocityLimitParams.VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY + ) .build() ) .period(10L) - .scope(VelocityLimitParams.Scope.CARD) + .scope(VelocityLimitParams.VelocityScope.CARD) .limitAmount(10000L) .limitCount(0L) .build() assertThat(velocityLimitParams.filters()) .isEqualTo( - VelocityLimitParams.Filters.builder() + VelocityLimitParams.VelocityLimitFilters.builder() .addExcludeCountry("USD") .addExcludeMcc("5542") .addIncludeCountry("USD") .addIncludeMcc("5542") + .addIncludePanEntryMode( + VelocityLimitParams.VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY + ) .build() ) assertThat(velocityLimitParams.period()) .isEqualTo(VelocityLimitParamsPeriodWindow.ofTrailing(10L)) - assertThat(velocityLimitParams.scope()).isEqualTo(VelocityLimitParams.Scope.CARD) + assertThat(velocityLimitParams.scope()).isEqualTo(VelocityLimitParams.VelocityScope.CARD) assertThat(velocityLimitParams.limitAmount()).contains(10000L) assertThat(velocityLimitParams.limitCount()).contains(0L) } @@ -49,15 +55,18 @@ internal class VelocityLimitParamsTest { val velocityLimitParams = VelocityLimitParams.builder() .filters( - VelocityLimitParams.Filters.builder() + VelocityLimitParams.VelocityLimitFilters.builder() .addExcludeCountry("USD") .addExcludeMcc("5542") .addIncludeCountry("USD") .addIncludeMcc("5542") + .addIncludePanEntryMode( + VelocityLimitParams.VelocityLimitFilters.IncludePanEntryMode.AUTO_ENTRY + ) .build() ) .period(10L) - .scope(VelocityLimitParams.Scope.CARD) + .scope(VelocityLimitParams.VelocityScope.CARD) .limitAmount(10000L) .limitCount(0L) .build() diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncTest.kt index 3db652d79..e2db4cc8c 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/async/authRules/V2ServiceAsyncTest.kt @@ -8,6 +8,7 @@ import com.lithic.api.models.AuthRuleCondition import com.lithic.api.models.AuthRuleV2ApplyParams import com.lithic.api.models.AuthRuleV2CreateParams import com.lithic.api.models.AuthRuleV2DraftParams +import com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams import com.lithic.api.models.AuthRuleV2RetrieveReportParams import com.lithic.api.models.AuthRuleV2UpdateParams import com.lithic.api.models.ConditionalAttribute @@ -223,6 +224,28 @@ internal class V2ServiceAsyncTest { response.validate() } + @Test + fun retrieveFeatures() { + val client = + LithicOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val v2ServiceAsync = client.authRules().v2() + + val responseFuture = + v2ServiceAsync.retrieveFeatures( + AuthRuleV2RetrieveFeaturesParams.builder() + .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Test fun retrieveReport() { val client = diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceTest.kt index 63b6d21c2..ca766cf99 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/authRules/V2ServiceTest.kt @@ -8,6 +8,7 @@ import com.lithic.api.models.AuthRuleCondition import com.lithic.api.models.AuthRuleV2ApplyParams import com.lithic.api.models.AuthRuleV2CreateParams import com.lithic.api.models.AuthRuleV2DraftParams +import com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams import com.lithic.api.models.AuthRuleV2RetrieveReportParams import com.lithic.api.models.AuthRuleV2UpdateParams import com.lithic.api.models.ConditionalAttribute @@ -213,6 +214,27 @@ internal class V2ServiceTest { response.validate() } + @Test + fun retrieveFeatures() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val v2Service = client.authRules().v2() + + val response = + v2Service.retrieveFeatures( + AuthRuleV2RetrieveFeaturesParams.builder() + .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + response.validate() + } + @Test fun retrieveReport() { val client = From f570594523a79991077963e08e3ce3f666a4d31b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:17:39 +0000 Subject: [PATCH 2/2] release: 0.107.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f371d2758..bd34dce09 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.106.0" + ".": "0.107.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ba16bf9fa..a70ccacb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.107.0 (2025-09-30) + +Full Changelog: [v0.106.0...v0.107.0](https://github.com/lithic-com/lithic-java/compare/v0.106.0...v0.107.0) + +### Features + +* **api:** adds support for Auth Rule features ([eaccb51](https://github.com/lithic-com/lithic-java/commit/eaccb5155082fcef9a208de71d7ab402ac40ea36)) + ## 0.106.0 (2025-09-25) Full Changelog: [v0.105.1...v0.106.0](https://github.com/lithic-com/lithic-java/compare/v0.105.1...v0.106.0) diff --git a/README.md b/README.md index dbd8825cc..368dce0a3 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.106.0) -[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.106.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.106.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.107.0) +[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.107.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.107.0) @@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc -The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.106.0). +The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.107.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic ### Gradle ```kotlin -implementation("com.lithic.api:lithic-java:0.106.0") +implementation("com.lithic.api:lithic-java:0.107.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.106.0") com.lithic.api lithic-java - 0.106.0 + 0.107.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 545b35568..af84497a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.lithic.api" - version = "0.106.0" // x-release-please-version + version = "0.107.0" // x-release-please-version } subprojects {