diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPage.kt index 5653f2148..d414eb29b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPage.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPage.kt @@ -20,10 +20,7 @@ import java.util.stream.Stream import java.util.stream.StreamSupport import kotlin.jvm.optionals.getOrNull -/** - * (Available March 4, 2025) List network total records with optional filters. Not available in - * sandbox. - */ +/** List network total records with optional filters. Not available in sandbox. */ class ReportSettlementNetworkTotalListPage private constructor( private val networkTotalsService: NetworkTotalService, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageAsync.kt index ef857e485..4b34c34f4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListPageAsync.kt @@ -20,10 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate -/** - * (Available March 4, 2025) List network total records with optional filters. Not available in - * sandbox. - */ +/** List network total records with optional filters. Not available in sandbox. */ class ReportSettlementNetworkTotalListPageAsync private constructor( private val networkTotalsService: NetworkTotalServiceAsync, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt index ec15d86e2..49994dea5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalListParams.kt @@ -17,10 +17,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** - * (Available March 4, 2025) List network total records with optional filters. Not available in - * sandbox. - */ +/** List network total records with optional filters. Not available in sandbox. */ class ReportSettlementNetworkTotalListParams private constructor( private val begin: OffsetDateTime?, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalRetrieveParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalRetrieveParams.kt index 5efae55d8..f633204b8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalRetrieveParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalRetrieveParams.kt @@ -9,10 +9,7 @@ import com.lithic.api.core.http.Headers import com.lithic.api.core.http.QueryParams import java.util.Objects -/** - * (Available March 4, 2025) Retrieve a specific network total record by token. Not available in - * sandbox. - */ +/** Retrieve a specific network total record by token. Not available in sandbox. */ class ReportSettlementNetworkTotalRetrieveParams private constructor( private val token: String, 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 a5f26305e..5742374e6 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 @@ -285,6 +285,12 @@ private constructor( class Filters @JsonCreator private constructor( + @JsonProperty("exclude_countries") + @ExcludeMissing + private val excludeCountries: JsonField> = JsonMissing.of(), + @JsonProperty("exclude_mccs") + @ExcludeMissing + private val excludeMccs: JsonField> = JsonMissing.of(), @JsonProperty("include_countries") @ExcludeMissing private val includeCountries: JsonField> = JsonMissing.of(), @@ -295,6 +301,20 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { + /** + * 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(): Optional> = + Optional.ofNullable(excludeCountries.getNullable("exclude_countries")) + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions matching + * this MCC will be excluded from the calculated velocity. + */ + fun excludeMccs(): Optional> = + Optional.ofNullable(excludeMccs.getNullable("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. @@ -309,6 +329,22 @@ private constructor( fun includeMccs(): Optional> = Optional.ofNullable(includeMccs.getNullable("include_mccs")) + /** + * 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. + */ + @JsonProperty("exclude_countries") + @ExcludeMissing + fun _excludeCountries(): JsonField> = excludeCountries + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions matching + * this MCC will be excluded from the calculated velocity. + */ + @JsonProperty("exclude_mccs") + @ExcludeMissing + fun _excludeMccs(): JsonField> = excludeMccs + /** * 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. @@ -336,6 +372,8 @@ private constructor( return@apply } + excludeCountries() + excludeMccs() includeCountries() includeMccs() validated = true @@ -352,17 +390,91 @@ private constructor( /** A builder for [Filters]. */ 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 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() } + /** + * 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)) + + /** + * 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: Optional>) = + excludeCountries(excludeCountries.getOrNull()) + + /** + * 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: JsonField>) = apply { + this.excludeCountries = excludeCountries.map { it.toMutableList() } + } + + /** + * 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 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)) + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions + * matching this MCC will be excluded from the calculated velocity. + */ + fun excludeMccs(excludeMccs: Optional>) = + excludeMccs(excludeMccs.getOrNull()) + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions + * matching this MCC will be excluded from the calculated velocity. + */ + fun excludeMccs(excludeMccs: JsonField>) = apply { + this.excludeMccs = excludeMccs.map { it.toMutableList() } + } + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions + * matching this MCC will be excluded from the calculated velocity. + */ + 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. @@ -450,6 +562,8 @@ private constructor( fun build(): Filters = Filters( + (excludeCountries ?: JsonMissing.of()).map { it.toImmutable() }, + (excludeMccs ?: JsonMissing.of()).map { it.toImmutable() }, (includeCountries ?: JsonMissing.of()).map { it.toImmutable() }, (includeMccs ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toImmutable(), @@ -461,17 +575,17 @@ private constructor( return true } - return /* spotless:off */ other is Filters && includeCountries == other.includeCountries && includeMccs == other.includeMccs && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Filters && excludeCountries == other.excludeCountries && excludeMccs == other.excludeMccs && includeCountries == other.includeCountries && includeMccs == other.includeMccs && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(includeCountries, includeMccs, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(excludeCountries, excludeMccs, includeCountries, includeMccs, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Filters{includeCountries=$includeCountries, includeMccs=$includeMccs, additionalProperties=$additionalProperties}" + "Filters{excludeCountries=$excludeCountries, excludeMccs=$excludeMccs, includeCountries=$includeCountries, includeMccs=$includeMccs, additionalProperties=$additionalProperties}" } /** diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/settlement/NetworkTotalServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/settlement/NetworkTotalServiceAsync.kt index 2c2157d1f..f434840f1 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/settlement/NetworkTotalServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/settlement/NetworkTotalServiceAsync.kt @@ -18,10 +18,7 @@ interface NetworkTotalServiceAsync { */ fun withRawResponse(): WithRawResponse - /** - * (Available March 4, 2025) Retrieve a specific network total record by token. Not available in - * sandbox. - */ + /** Retrieve a specific network total record by token. Not available in sandbox. */ fun retrieve( params: ReportSettlementNetworkTotalRetrieveParams ): CompletableFuture = retrieve(params, RequestOptions.none()) @@ -32,10 +29,7 @@ interface NetworkTotalServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture - /** - * (Available March 4, 2025) List network total records with optional filters. Not available in - * sandbox. - */ + /** List network total records with optional filters. Not available in sandbox. */ fun list(): CompletableFuture = list(ReportSettlementNetworkTotalListParams.none()) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/settlement/NetworkTotalService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/settlement/NetworkTotalService.kt index 86c7f7ccf..a6d7f3fb3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/settlement/NetworkTotalService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/settlement/NetworkTotalService.kt @@ -17,10 +17,7 @@ interface NetworkTotalService { */ fun withRawResponse(): WithRawResponse - /** - * (Available March 4, 2025) Retrieve a specific network total record by token. Not available in - * sandbox. - */ + /** Retrieve a specific network total record by token. Not available in sandbox. */ fun retrieve(params: ReportSettlementNetworkTotalRetrieveParams): NetworkTotalRetrieveResponse = retrieve(params, RequestOptions.none()) @@ -30,10 +27,7 @@ interface NetworkTotalService { requestOptions: RequestOptions = RequestOptions.none(), ): NetworkTotalRetrieveResponse - /** - * (Available March 4, 2025) List network total records with optional filters. Not available in - * sandbox. - */ + /** List network total records with optional filters. Not available in sandbox. */ fun list(): ReportSettlementNetworkTotalListPage = list(ReportSettlementNetworkTotalListParams.none()) 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 be7ee3161..300f885a9 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 @@ -13,6 +13,8 @@ class VelocityLimitParamsTest { VelocityLimitParams.builder() .filters( VelocityLimitParams.Filters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") .addIncludeCountry("USD") .addIncludeMcc("5542") .build() @@ -26,6 +28,8 @@ class VelocityLimitParamsTest { assertThat(velocityLimitParams.filters()) .isEqualTo( VelocityLimitParams.Filters.builder() + .addExcludeCountry("USD") + .addExcludeMcc("5542") .addIncludeCountry("USD") .addIncludeMcc("5542") .build()