├── .release-please-manifest.json ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── scripts ├── build ├── kotlin-format ├── java-format ├── format ├── lint ├── mock └── fast-format ├── .gitattributes ├── lithic-java-lib └── .keep ├── lithic-java-core └── src │ ├── main │ └── kotlin │ │ └── com │ │ └── lithic │ │ └── api │ │ ├── errors │ │ ├── LithicException.kt │ │ ├── LithicIoException.kt │ │ ├── LithicInvalidDataException.kt │ │ ├── LithicServiceException.kt │ │ └── LithicRetryableException.kt │ │ ├── core │ │ ├── http │ │ │ ├── HttpMethod.kt │ │ │ ├── HttpResponse.kt │ │ │ ├── StreamResponse.kt │ │ │ ├── HttpResponseFor.kt │ │ │ ├── PhantomReachableClosingStreamResponse.kt │ │ │ ├── HttpRequestBody.kt │ │ │ ├── HttpClient.kt │ │ │ └── PhantomReachableClosingHttpClient.kt │ │ ├── BaseSerializer.kt │ │ ├── handlers │ │ │ ├── EmptyHandler.kt │ │ │ ├── StringHandler.kt │ │ │ └── JsonHandler.kt │ │ ├── Params.kt │ │ ├── AutoPager.kt │ │ ├── Sleeper.kt │ │ ├── PhantomReachableSleeper.kt │ │ ├── DefaultSleeper.kt │ │ ├── PrepareRequest.kt │ │ ├── Page.kt │ │ ├── PageAsync.kt │ │ └── Properties.kt │ │ └── services │ │ ├── blocking │ │ ├── InternalTransactionService.kt │ │ ├── AuthRuleService.kt │ │ ├── FraudService.kt │ │ ├── ReportService.kt │ │ ├── InternalTransactionServiceImpl.kt │ │ └── transactions │ │ │ └── EventService.kt │ │ └── async │ │ ├── InternalTransactionServiceAsync.kt │ │ ├── AuthRuleServiceAsync.kt │ │ ├── FraudServiceAsync.kt │ │ ├── ReportServiceAsync.kt │ │ ├── InternalTransactionServiceAsyncImpl.kt │ │ └── transactions │ │ └── EventServiceAsync.kt │ └── test │ └── kotlin │ └── com │ └── lithic │ └── api │ ├── models │ ├── ClientApiStatusParamsTest.kt │ ├── ThreeDSDecisioningRotateSecretParamsTest.kt │ ├── AuthStreamEnrollmentRotateSecretParamsTest.kt │ ├── ThreeDSDecisioningRetrieveSecretParamsTest.kt │ ├── AuthStreamEnrollmentRetrieveSecretParamsTest.kt │ ├── TokenizationDecisioningRotateSecretParamsTest.kt │ ├── TokenizationDecisioningRetrieveSecretParamsTest.kt │ ├── CardSearchByPanParamsTest.kt │ ├── EventRetrieveParamsTest.kt │ ├── CardRetrieveParamsTest.kt │ ├── FundingEventRetrieveParamsTest.kt │ ├── PaymentRetryParamsTest.kt │ ├── DisputeDeleteParamsTest.kt │ ├── AccountRetrieveParamsTest.kt │ ├── DisputeRetrieveParamsTest.kt │ ├── PaymentRetrieveParamsTest.kt │ ├── PaymentSimulateReleaseParamsTest.kt │ ├── ReportSettlementSummaryParamsTest.kt │ ├── TransactionSimulateReturnReversalParamsTest.kt │ ├── AuthRuleV2DeleteParamsTest.kt │ ├── AuthRuleV2PromoteParamsTest.kt │ ├── DisputesV2RetrieveParamsTest.kt │ ├── AuthRuleV2RetrieveParamsTest.kt │ ├── EventSubscriptionDeleteParamsTest.kt │ ├── TokenizationPauseParamsTest.kt │ ├── CardBulkOrderRetrieveParamsTest.kt │ ├── CardProgramRetrieveParamsTest.kt │ ├── CardRetrieveSpendLimitsParamsTest.kt │ ├── EventSubscriptionRetrieveParamsTest.kt │ ├── TokenizationUnpauseParamsTest.kt │ ├── TransactionRetrieveParamsTest.kt │ ├── BookTransferRetrieveParamsTest.kt │ ├── TokenizationActivateParamsTest.kt │ ├── TokenizationRetrieveParamsTest.kt │ ├── AccountHolderRetrieveParamsTest.kt │ ├── TokenizationDeactivateParamsTest.kt │ ├── DigitalCardArtRetrieveParamsTest.kt │ ├── EventSubscriptionRotateSecretParamsTest.kt │ ├── NetworkProgramRetrieveParamsTest.kt │ ├── AccountRetrieveSpendLimitsParamsTest.kt │ ├── CardEmbedParamsTest.kt │ ├── CarrierTest.kt │ ├── CreditProductExtendedCreditRetrieveParamsTest.kt │ ├── EventSubscriptionRetrieveSecretParamsTest.kt │ ├── ExternalPaymentRetrieveParamsTest.kt │ ├── FraudTransactionRetrieveParamsTest.kt │ ├── AccountHolderListDocumentsParamsTest.kt │ ├── FinancialAccountRetrieveParamsTest.kt │ ├── FundingEventRetrieveDetailsParamsTest.kt │ ├── ExternalBankAccountUnpauseParamsTest.kt │ ├── TransactionExpireAuthorizationParamsTest.kt │ ├── ExternalBankAccountRetrieveParamsTest.kt │ ├── ManagementOperationRetrieveParamsTest.kt │ ├── ReportSettlementNetworkTotalRetrieveParamsTest.kt │ ├── AccountActivityRetrieveTransactionParamsTest.kt │ ├── ThreeDSAuthenticationRetrieveParamsTest.kt │ ├── ResponderEndpointDeleteParamsTest.kt │ ├── TransactionEnhancedCommercialDataRetrieveParamsTest.kt │ ├── ApiStatusTest.kt │ ├── ResponderEndpointCheckStatusParamsTest.kt │ ├── TransactionEventEnhancedCommercialDataRetrieveParamsTest.kt │ ├── FinancialAccountCreditConfigurationRetrieveParamsTest.kt │ ├── ThreeDSAuthenticationSimulateOtpEntryParamsTest.kt │ ├── TransactionSimulateAuthorizationAdviceParamsTest.kt │ ├── ExtendedCreditTest.kt │ ├── TransactionSimulateReturnParamsTest.kt │ ├── TokenInfoTest.kt │ ├── EventEventSubscriptionResendParamsTest.kt │ ├── DisputeDeleteEvidenceParamsTest.kt │ ├── FinancialAccountLoanTapeRetrieveParamsTest.kt │ ├── FinancialAccountStatementRetrieveParamsTest.kt │ ├── DisputeRetrieveEvidenceParamsTest.kt │ ├── AuthRuleV2BacktestRetrieveParamsTest.kt │ ├── AccountHolderRetrieveDocumentParamsTest.kt │ ├── CardFinancialTransactionRetrieveParamsTest.kt │ ├── FinancialTransactionRetrieveParamsTest.kt │ ├── ResponderEndpointCreateParamsTest.kt │ ├── CategoryBalancesTest.kt │ ├── CardProvisionResponseTest.kt │ ├── AggregateBalanceListParamsTest.kt │ ├── ResponderEndpointCreateResponseTest.kt │ ├── ResponderEndpointStatusTest.kt │ ├── SubscriptionRetrieveSecretResponseTest.kt │ ├── AuthStreamSecretTest.kt │ ├── TransactionSimulateClearingParamsTest.kt │ ├── TokenizationSecretTest.kt │ ├── DeviceTest.kt │ ├── BacktestCreateResponseTest.kt │ ├── PaymentSimulateReturnParamsTest.kt │ ├── AuthenticationSimulateResponseTest.kt │ ├── CardBulkOrderUpdateParamsTest.kt │ ├── ChallengeResponseTest.kt │ ├── CardAggregateBalanceListParamsTest.kt │ ├── FinancialAccountRegisterAccountNumberParamsTest.kt │ └── TransactionSimulateVoidResponseTest.kt │ ├── core │ ├── PhantomReachableTest.kt │ ├── AutoPagerTest.kt │ ├── ClientOptionsTest.kt │ └── UtilsTest.kt │ └── services │ ├── blocking │ ├── BalanceServiceTest.kt │ ├── AggregateBalanceServiceTest.kt │ ├── cards │ │ ├── BalanceServiceTest.kt │ │ └── AggregateBalanceServiceTest.kt │ ├── financialAccounts │ │ ├── BalanceServiceTest.kt │ │ └── statements │ │ │ └── LineItemServiceTest.kt │ ├── creditProducts │ │ └── ExtendedCreditServiceTest.kt │ ├── transactions │ │ ├── EnhancedCommercialDataServiceTest.kt │ │ └── events │ │ │ └── EnhancedCommercialDataServiceTest.kt │ ├── events │ │ └── EventSubscriptionServiceTest.kt │ ├── TransferServiceTest.kt │ ├── DisputesV2ServiceTest.kt │ ├── CardProgramServiceTest.kt │ ├── externalBankAccounts │ │ └── MicroDepositServiceTest.kt │ ├── AuthStreamEnrollmentServiceTest.kt │ ├── DigitalCardArtServiceTest.kt │ ├── NetworkProgramServiceTest.kt │ ├── AccountActivityServiceTest.kt │ ├── TokenizationDecisioningServiceTest.kt │ └── reports │ │ ├── settlement │ │ └── NetworkTotalServiceTest.kt │ │ └── SettlementServiceTest.kt │ └── async │ ├── BalanceServiceAsyncTest.kt │ ├── AggregateBalanceServiceAsyncTest.kt │ ├── cards │ ├── BalanceServiceAsyncTest.kt │ └── AggregateBalanceServiceAsyncTest.kt │ ├── financialAccounts │ ├── BalanceServiceAsyncTest.kt │ └── statements │ │ └── LineItemServiceAsyncTest.kt │ ├── creditProducts │ └── ExtendedCreditServiceAsyncTest.kt │ ├── transactions │ ├── EnhancedCommercialDataServiceAsyncTest.kt │ └── events │ │ └── EnhancedCommercialDataServiceAsyncTest.kt │ ├── events │ └── EventSubscriptionServiceAsyncTest.kt │ ├── TransferServiceAsyncTest.kt │ ├── externalBankAccounts │ └── MicroDepositServiceAsyncTest.kt │ ├── DisputesV2ServiceAsyncTest.kt │ ├── CardProgramServiceAsyncTest.kt │ ├── AuthStreamEnrollmentServiceAsyncTest.kt │ ├── DigitalCardArtServiceAsyncTest.kt │ ├── NetworkProgramServiceAsyncTest.kt │ └── AccountActivityServiceAsyncTest.kt ├── examples └── .keep ├── .stats.yml ├── lithic-java-proguard-test └── test.pro ├── lithic-java-example ├── README.md └── build.gradle.kts ├── settings.gradle.kts ├── lithic-java-client-okhttp └── build.gradle.kts ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── gradle.properties ├── lithic-java └── build.gradle.kts ├── .github └── workflows │ └── release-doctor.yml ├── bin └── check-release-environment └── SECURITY.md /.release-please-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | ".": "0.114.0" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .prism.log 2 | .gradle 3 | .idea 4 | .kotlin 5 | build/ 6 | codegen.log 7 | kls_database.db 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lithic-com/lithic-java/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /scripts/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | echo "==> Building classes" 8 | ./gradlew build testClasses -x test 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | -------------------------------------------------------------------------------- /scripts/kotlin-format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | find . -name "*.kt" -not -path "./buildSrc/build/*" -print0 | xargs -0 -r ktfmt --kotlinlang-style "$@" 8 | -------------------------------------------------------------------------------- /scripts/java-format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | find . -name "*.java" -not -path "./buildSrc/build/*" -print0 | xargs -0 -r palantir-java-format --palantir --replace "$@" 8 | -------------------------------------------------------------------------------- /lithic-java-lib/.keep: -------------------------------------------------------------------------------- 1 | File generated from our OpenAPI spec by Stainless. 2 | 3 | This directory can be used to store custom files to expand the SDK. 4 | It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicException.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.errors 2 | 3 | open class LithicException 4 | @JvmOverloads 5 | constructor(message: String? = null, cause: Throwable? = null) : RuntimeException(message, cause) 6 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicIoException.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.errors 2 | 3 | class LithicIoException 4 | @JvmOverloads 5 | constructor(message: String? = null, cause: Throwable? = null) : LithicException(message, cause) 6 | -------------------------------------------------------------------------------- /examples/.keep: -------------------------------------------------------------------------------- 1 | File generated from our OpenAPI spec by Stainless. 2 | 3 | This directory can be used to store example files demonstrating usage of this SDK. 4 | It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.errors 2 | 3 | class LithicInvalidDataException 4 | @JvmOverloads 5 | constructor(message: String? = null, cause: Throwable? = null) : LithicException(message, cause) 6 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpMethod.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | enum class HttpMethod { 4 | GET, 5 | HEAD, 6 | POST, 7 | PUT, 8 | DELETE, 9 | CONNECT, 10 | OPTIONS, 11 | TRACE, 12 | PATCH, 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/BaseSerializer.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import com.fasterxml.jackson.databind.ser.std.StdSerializer 4 | import kotlin.reflect.KClass 5 | 6 | abstract class BaseSerializer(type: KClass) : StdSerializer(type.java) 7 | -------------------------------------------------------------------------------- /.stats.yml: -------------------------------------------------------------------------------- 1 | configured_endpoints: 176 2 | openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml 3 | openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f 4 | config_hash: 739714a3fead0b26ee3a3b7bc51081f6 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /lithic-java-proguard-test/test.pro: -------------------------------------------------------------------------------- 1 | # Specify the entrypoint where ProGuard starts to determine what's reachable. 2 | -keep class com.lithic.api.proguard.** { *; } 3 | 4 | # For the testing framework. 5 | -keep class org.junit.** { *; } 6 | 7 | # Many warnings don't apply for our testing purposes. 8 | -dontnote 9 | -dontwarn -------------------------------------------------------------------------------- /lithic-java-example/README.md: -------------------------------------------------------------------------------- 1 | # `lithic-java-example` 2 | 3 | This is an example project to demonstrate how a java project would look like 4 | that uses the `lithic-java` sdk. 5 | 6 | ## Running the project 7 | 8 | The example program is in `src/main/java/com/lithic/example/Main.java`. Run the program 9 | with: 10 | 11 | `./gradlew :lithic-java-example:run` 12 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ClientApiStatusParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class ClientApiStatusParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | ClientApiStatusParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSDecisioningRotateSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class ThreeDSDecisioningRotateSecretParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | ThreeDSDecisioningRotateSecretParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthStreamEnrollmentRotateSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class AuthStreamEnrollmentRotateSecretParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | AuthStreamEnrollmentRotateSecretParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSDecisioningRetrieveSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class ThreeDSDecisioningRetrieveSecretParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | ThreeDSDecisioningRetrieveSecretParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthStreamEnrollmentRetrieveSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class AuthStreamEnrollmentRetrieveSecretParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | AuthStreamEnrollmentRetrieveSecretParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationDecisioningRotateSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class TokenizationDecisioningRotateSecretParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | TokenizationDecisioningRotateSecretParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationDecisioningRetrieveSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class TokenizationDecisioningRetrieveSecretParamsTest { 8 | 9 | @Test 10 | fun create() { 11 | TokenizationDecisioningRetrieveSecretParams.builder().build() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "lithic-java-root" 2 | 3 | val projectNames = rootDir.listFiles() 4 | ?.asSequence() 5 | .orEmpty() 6 | .filter { file -> 7 | file.isDirectory && 8 | file.name.startsWith("lithic-java") && 9 | file.listFiles()?.asSequence().orEmpty().any { it.name == "build.gradle.kts" } 10 | } 11 | .map { it.name } 12 | .toList() 13 | println("projects: $projectNames") 14 | projectNames.forEach { include(it) } 15 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/handlers/EmptyHandler.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("EmptyHandler") 2 | 3 | package com.lithic.api.core.handlers 4 | 5 | import com.lithic.api.core.http.HttpResponse 6 | import com.lithic.api.core.http.HttpResponse.Handler 7 | 8 | @JvmSynthetic internal fun emptyHandler(): Handler = EmptyHandlerInternal 9 | 10 | private object EmptyHandlerInternal : Handler { 11 | override fun handle(response: HttpResponse): Void? = null 12 | } 13 | -------------------------------------------------------------------------------- /lithic-java-client-okhttp/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("lithic.kotlin") 3 | id("lithic.publish") 4 | } 5 | 6 | dependencies { 7 | api(project(":lithic-java-core")) 8 | 9 | implementation("com.squareup.okhttp3:okhttp:4.12.0") 10 | implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") 11 | 12 | testImplementation(kotlin("test")) 13 | testImplementation("org.assertj:assertj-core:3.25.3") 14 | testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") 15 | } 16 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | FROM debian:bookworm-slim 3 | 4 | RUN apt-get update && apt-get install -y --no-install-recommends \ 5 | libxkbcommon0 \ 6 | ca-certificates \ 7 | ca-certificates-java \ 8 | make \ 9 | curl \ 10 | git \ 11 | openjdk-17-jdk-headless \ 12 | unzip \ 13 | libc++1 \ 14 | vim \ 15 | && apt-get clean autoclean 16 | 17 | # Ensure UTF-8 encoding 18 | ENV LANG=C.UTF-8 19 | ENV LC_ALL=C.UTF-8 20 | 21 | WORKDIR /workspace 22 | 23 | COPY . /workspace 24 | -------------------------------------------------------------------------------- /scripts/format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | if command -v ktfmt &> /dev/null; then 8 | echo "==> Running ktfmt" 9 | ./scripts/kotlin-format 10 | else 11 | echo "==> Running gradlew formatKotlin" 12 | ./gradlew formatKotlin 13 | fi 14 | 15 | if command -v palantir-java-format &> /dev/null; then 16 | echo "==> Running palantir-java-format" 17 | ./scripts/java-format 18 | else 19 | echo "==> Running gradlew formatJava" 20 | ./gradlew formatJava 21 | fi 22 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/handlers/StringHandler.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("StringHandler") 2 | 3 | package com.lithic.api.core.handlers 4 | 5 | import com.lithic.api.core.http.HttpResponse 6 | import com.lithic.api.core.http.HttpResponse.Handler 7 | 8 | @JvmSynthetic internal fun stringHandler(): Handler = StringHandlerInternal 9 | 10 | private object StringHandlerInternal : Handler { 11 | override fun handle(response: HttpResponse): String = 12 | response.body().readBytes().toString(Charsets.UTF_8) 13 | } 14 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicServiceException.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.errors 4 | 5 | import com.lithic.api.core.JsonValue 6 | import com.lithic.api.core.http.Headers 7 | 8 | abstract class LithicServiceException 9 | protected constructor(message: String, cause: Throwable? = null) : LithicException(message, cause) { 10 | 11 | abstract fun statusCode(): Int 12 | 13 | abstract fun headers(): Headers 14 | 15 | abstract fun body(): JsonValue 16 | } 17 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpResponse.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.core.http 4 | 5 | import java.io.InputStream 6 | 7 | interface HttpResponse : AutoCloseable { 8 | 9 | fun statusCode(): Int 10 | 11 | fun headers(): Headers 12 | 13 | fun body(): InputStream 14 | 15 | /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ 16 | override fun close() 17 | 18 | interface Handler { 19 | 20 | fun handle(response: HttpResponse): T 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/Params.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import com.lithic.api.core.http.Headers 4 | import com.lithic.api.core.http.QueryParams 5 | 6 | /** An interface representing parameters passed to a service method. */ 7 | interface Params { 8 | /** The full set of headers in the parameters, including both fixed and additional headers. */ 9 | fun _headers(): Headers 10 | 11 | /** 12 | * The full set of query params in the parameters, including both fixed and additional query 13 | * params. 14 | */ 15 | fun _queryParams(): QueryParams 16 | } 17 | -------------------------------------------------------------------------------- /scripts/lint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | echo "==> Running lints" 8 | 9 | if command -v ktfmt &> /dev/null; then 10 | echo "==> Checking ktfmt" 11 | ./scripts/kotlin-format --dry-run --set-exit-if-changed 12 | else 13 | echo "==> Running gradlew lintKotlin" 14 | ./gradlew lintKotlin 15 | fi 16 | 17 | if command -v palantir-java-format &> /dev/null; then 18 | echo "==> Checking palantir-java-format" 19 | ./scripts/java-format --dry-run --set-exit-if-changed 20 | else 21 | echo "==> Running gradlew lintJava" 22 | ./gradlew lintJava 23 | fi 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.caching=true 2 | org.gradle.configuration-cache=true 3 | org.gradle.parallel=true 4 | org.gradle.daemon=false 5 | # These options improve our compilation and test performance. They are inherited by the Kotlin daemon. 6 | org.gradle.jvmargs=\ 7 | -Xms2g \ 8 | -Xmx8g \ 9 | -XX:+UseParallelGC \ 10 | -XX:InitialCodeCacheSize=256m \ 11 | -XX:ReservedCodeCacheSize=1G \ 12 | -XX:MetaspaceSize=512m \ 13 | -XX:MaxMetaspaceSize=2G \ 14 | -XX:TieredStopAtLevel=1 \ 15 | -XX:GCTimeRatio=4 \ 16 | -XX:CICompilerCount=4 \ 17 | -XX:+OptimizeStringConcat \ 18 | -XX:+UseStringDeduplication 19 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicRetryableException.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.errors 2 | 3 | /** 4 | * Exception that indicates a transient error that can be retried. 5 | * 6 | * When this exception is thrown during an HTTP request, the SDK will automatically retry the 7 | * request up to the maximum number of retries. 8 | * 9 | * @param message A descriptive error message 10 | * @param cause The underlying cause of this exception, if any 11 | */ 12 | class LithicRetryableException 13 | @JvmOverloads 14 | constructor(message: String? = null, cause: Throwable? = null) : LithicException(message, cause) 15 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/StreamResponse.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | import java.util.stream.Stream 4 | 5 | interface StreamResponse : AutoCloseable { 6 | 7 | fun stream(): Stream 8 | 9 | /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ 10 | override fun close() 11 | } 12 | 13 | @JvmSynthetic 14 | internal fun StreamResponse.map(transform: (T) -> R): StreamResponse = 15 | object : StreamResponse { 16 | override fun stream(): Stream = this@map.stream().map(transform) 17 | 18 | override fun close() = this@map.close() 19 | } 20 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardSearchByPanParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardSearchByPanParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardSearchByPanParams.builder().pan("4111111289144142").build() 13 | } 14 | 15 | @Test 16 | fun body() { 17 | val params = CardSearchByPanParams.builder().pan("4111111289144142").build() 18 | 19 | val body = params._body() 20 | 21 | assertThat(body.pan()).isEqualTo("4111111289144142") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/debian 3 | { 4 | "name": "Debian", 5 | "build": { 6 | "dockerfile": "Dockerfile" 7 | } 8 | 9 | // Features to add to the dev container. More info: https://containers.dev/features. 10 | // "features": {}, 11 | 12 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 13 | // "forwardPorts": [], 14 | 15 | // Configure tool-specific properties. 16 | // "customizations": {}, 17 | 18 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 19 | // "remoteUser": "root" 20 | } 21 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/AutoPager.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.core 4 | 5 | import java.util.stream.Stream 6 | import java.util.stream.StreamSupport 7 | 8 | class AutoPager private constructor(private val firstPage: Page) : Iterable { 9 | 10 | companion object { 11 | 12 | fun from(firstPage: Page): AutoPager = AutoPager(firstPage) 13 | } 14 | 15 | override fun iterator(): Iterator = 16 | generateSequence(firstPage) { if (it.hasNextPage()) it.nextPage() else null } 17 | .flatMap { it.items() } 18 | .iterator() 19 | 20 | fun stream(): Stream = StreamSupport.stream(spliterator(), false) 21 | } 22 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/Sleeper.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import java.time.Duration 4 | import java.util.concurrent.CompletableFuture 5 | 6 | /** 7 | * An interface for delaying execution for a specified amount of time. 8 | * 9 | * Useful for testing and cleaning up resources. 10 | */ 11 | interface Sleeper : AutoCloseable { 12 | 13 | /** Synchronously pauses execution for the given [duration]. */ 14 | fun sleep(duration: Duration) 15 | 16 | /** Asynchronously pauses execution for the given [duration]. */ 17 | fun sleepAsync(duration: Duration): CompletableFuture 18 | 19 | /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ 20 | override fun close() 21 | } 22 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/EventRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class EventRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | EventRetrieveParams.builder().eventToken("event_token").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = EventRetrieveParams.builder().eventToken("event_token").build() 18 | 19 | assertThat(params._pathParam(0)).isEqualTo("event_token") 20 | // out-of-bound path param 21 | assertThat(params._pathParam(1)).isEqualTo("") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpResponseFor.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | import java.io.InputStream 4 | 5 | interface HttpResponseFor : HttpResponse { 6 | 7 | fun parse(): T 8 | } 9 | 10 | @JvmSynthetic 11 | internal fun HttpResponse.parseable(parse: () -> T): HttpResponseFor = 12 | object : HttpResponseFor { 13 | 14 | private val parsed: T by lazy { parse() } 15 | 16 | override fun parse(): T = parsed 17 | 18 | override fun statusCode(): Int = this@parseable.statusCode() 19 | 20 | override fun headers(): Headers = this@parseable.headers() 21 | 22 | override fun body(): InputStream = this@parseable.body() 23 | 24 | override fun close() = this@parseable.close() 25 | } 26 | -------------------------------------------------------------------------------- /lithic-java-example/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("lithic.java") 3 | application 4 | } 5 | 6 | repositories { 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | implementation(project(":lithic-java")) 12 | } 13 | 14 | tasks.withType().configureEach { 15 | // Allow using more modern APIs, like `List.of` and `Map.of`, in examples. 16 | options.release.set(9) 17 | } 18 | 19 | application { 20 | // Use `./gradlew :lithic-java-example:run` to run `Main` 21 | // Use `./gradlew :lithic-java-example:run -Pexample=Something` to run `SomethingExample` 22 | mainClass = "com.lithic.api.example.${ 23 | if (project.hasProperty("example")) 24 | "${project.property("example")}Example" 25 | else 26 | "Main" 27 | }" 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/PhantomReachableClosingStreamResponse.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | import com.lithic.api.core.closeWhenPhantomReachable 4 | import java.util.stream.Stream 5 | 6 | /** 7 | * A delegating wrapper around a `StreamResponse` that closes it once it's only phantom reachable. 8 | * 9 | * This class ensures the `StreamResponse` is closed even if the user forgets to close it. 10 | */ 11 | internal class PhantomReachableClosingStreamResponse( 12 | private val streamResponse: StreamResponse 13 | ) : StreamResponse { 14 | init { 15 | closeWhenPhantomReachable(this, streamResponse) 16 | } 17 | 18 | override fun stream(): Stream = streamResponse.stream() 19 | 20 | override fun close() = streamResponse.close() 21 | } 22 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/PhantomReachableSleeper.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import java.time.Duration 4 | import java.util.concurrent.CompletableFuture 5 | 6 | /** 7 | * A delegating wrapper around a [Sleeper] that closes it once it's only phantom reachable. 8 | * 9 | * This class ensures the [Sleeper] is closed even if the user forgets to do it. 10 | */ 11 | internal class PhantomReachableSleeper(private val sleeper: Sleeper) : Sleeper { 12 | 13 | init { 14 | closeWhenPhantomReachable(this, sleeper) 15 | } 16 | 17 | override fun sleep(duration: Duration) = sleeper.sleep(duration) 18 | 19 | override fun sleepAsync(duration: Duration): CompletableFuture = 20 | sleeper.sleepAsync(duration) 21 | 22 | override fun close() = sleeper.close() 23 | } 24 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/core/PhantomReachableTest.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import org.assertj.core.api.Assertions.assertThat 4 | import org.junit.jupiter.api.Test 5 | 6 | internal class PhantomReachableTest { 7 | 8 | @Test 9 | fun closeWhenPhantomReachable_whenObservedIsGarbageCollected_closesCloseable() { 10 | var closed = false 11 | val closeable = AutoCloseable { closed = true } 12 | 13 | closeWhenPhantomReachable( 14 | // Pass an inline object for the object to observe so that it becomes immediately 15 | // unreachable. 16 | Any(), 17 | closeable, 18 | ) 19 | 20 | assertThat(closed).isFalse() 21 | 22 | System.gc() 23 | Thread.sleep(100) 24 | 25 | assertThat(closed).isTrue() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardRetrieveParams.builder().cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | CardRetrieveParams.builder().cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 19 | 20 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 21 | // out-of-bound path param 22 | assertThat(params._pathParam(1)).isEqualTo("") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FundingEventRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FundingEventRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FundingEventRetrieveParams.builder().fundingEventToken("funding_event_token").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | FundingEventRetrieveParams.builder().fundingEventToken("funding_event_token").build() 19 | 20 | assertThat(params._pathParam(0)).isEqualTo("funding_event_token") 21 | // out-of-bound path param 22 | assertThat(params._pathParam(1)).isEqualTo("") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpRequestBody.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | import java.io.OutputStream 4 | import java.lang.AutoCloseable 5 | 6 | interface HttpRequestBody : AutoCloseable { 7 | 8 | fun writeTo(outputStream: OutputStream) 9 | 10 | fun contentType(): String? 11 | 12 | fun contentLength(): Long 13 | 14 | /** 15 | * Determines if a request can be repeated in a meaningful way, for example before doing a 16 | * retry. 17 | * 18 | * The most typical case when a request can't be retried is if the request body is being 19 | * streamed. In this case the body data isn't available on subsequent attempts. 20 | */ 21 | fun repeatable(): Boolean 22 | 23 | /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ 24 | override fun close() 25 | } 26 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/handlers/JsonHandler.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("JsonHandler") 2 | 3 | package com.lithic.api.core.handlers 4 | 5 | import com.fasterxml.jackson.databind.json.JsonMapper 6 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 7 | import com.lithic.api.core.http.HttpResponse 8 | import com.lithic.api.core.http.HttpResponse.Handler 9 | import com.lithic.api.errors.LithicInvalidDataException 10 | 11 | @JvmSynthetic 12 | internal inline fun jsonHandler(jsonMapper: JsonMapper): Handler = 13 | object : Handler { 14 | override fun handle(response: HttpResponse): T = 15 | try { 16 | jsonMapper.readValue(response.body(), jacksonTypeRef()) 17 | } catch (e: Exception) { 18 | throw LithicInvalidDataException("Error reading response", e) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/BalanceServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class BalanceServiceTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val balanceService = client.balances() 21 | 22 | val page = balanceService.list() 23 | 24 | page.response().validate() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentRetryParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class PaymentRetryParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | PaymentRetryParams.builder().paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | PaymentRetryParams.builder() 19 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 20 | .build() 21 | 22 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | // out-of-bound path param 24 | assertThat(params._pathParam(1)).isEqualTo("") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/DefaultSleeper.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import java.time.Duration 4 | import java.util.Timer 5 | import java.util.TimerTask 6 | import java.util.concurrent.CompletableFuture 7 | 8 | class DefaultSleeper : Sleeper { 9 | 10 | private val timer = Timer("DefaultSleeper", true) 11 | 12 | override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis()) 13 | 14 | override fun sleepAsync(duration: Duration): CompletableFuture { 15 | val future = CompletableFuture() 16 | timer.schedule( 17 | object : TimerTask() { 18 | override fun run() { 19 | future.complete(null) 20 | } 21 | }, 22 | duration.toMillis(), 23 | ) 24 | return future 25 | } 26 | 27 | override fun close() = timer.cancel() 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeDeleteParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class DisputeDeleteParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | DisputeDeleteParams.builder().disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | DisputeDeleteParams.builder() 19 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 20 | .build() 21 | 22 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | // out-of-bound path param 24 | assertThat(params._pathParam(1)).isEqualTo("") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("lithic.kotlin") 3 | id("lithic.publish") 4 | } 5 | 6 | dependencies { 7 | api(project(":lithic-java-client-okhttp")) 8 | } 9 | 10 | // Redefine `dokkaJavadoc` to: 11 | // - Depend on the root project's task for merging the docs of all the projects 12 | // - Forward that task's output to this task's output 13 | tasks.named("dokkaJavadoc").configure { 14 | actions.clear() 15 | 16 | val dokkaJavadocCollector = rootProject.tasks["dokkaJavadocCollector"] 17 | dependsOn(dokkaJavadocCollector) 18 | 19 | val outputDirectory = project.layout.buildDirectory.dir("dokka/javadoc") 20 | doLast { 21 | copy { 22 | from(dokkaJavadocCollector.outputs.files) 23 | into(outputDirectory) 24 | duplicatesStrategy = DuplicatesStrategy.INCLUDE 25 | } 26 | } 27 | 28 | outputs.dir(outputDirectory) 29 | } 30 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AccountRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AccountRetrieveParams.builder().accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | AccountRetrieveParams.builder() 19 | .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 20 | .build() 21 | 22 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | // out-of-bound path param 24 | assertThat(params._pathParam(1)).isEqualTo("") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class DisputeRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | DisputeRetrieveParams.builder().disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | DisputeRetrieveParams.builder() 19 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 20 | .build() 21 | 22 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | // out-of-bound path param 24 | assertThat(params._pathParam(1)).isEqualTo("") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class PaymentRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | PaymentRetrieveParams.builder().paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() 13 | } 14 | 15 | @Test 16 | fun pathParams() { 17 | val params = 18 | PaymentRetrieveParams.builder() 19 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 20 | .build() 21 | 22 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | // out-of-bound path param 24 | assertThat(params._pathParam(1)).isEqualTo("") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReleaseParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class PaymentSimulateReleaseParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | PaymentSimulateReleaseParams.builder() 13 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun body() { 19 | val params = 20 | PaymentSimulateReleaseParams.builder() 21 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | val body = params._body() 25 | 26 | assertThat(body.paymentToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportSettlementSummaryParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import java.time.LocalDate 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | 9 | internal class ReportSettlementSummaryParamsTest { 10 | 11 | @Test 12 | fun create() { 13 | ReportSettlementSummaryParams.builder().reportDate(LocalDate.parse("2023-09-01")).build() 14 | } 15 | 16 | @Test 17 | fun pathParams() { 18 | val params = 19 | ReportSettlementSummaryParams.builder() 20 | .reportDate(LocalDate.parse("2023-09-01")) 21 | .build() 22 | 23 | assertThat(params._pathParam(0)).isEqualTo("2023-09-01") 24 | // out-of-bound path param 25 | assertThat(params._pathParam(1)).isEqualTo("") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AggregateBalanceServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AggregateBalanceServiceTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val aggregateBalanceService = client.aggregateBalances() 21 | 22 | val page = aggregateBalanceService.list() 23 | 24 | page.response().validate() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionSimulateReturnReversalParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionSimulateReturnReversalParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionSimulateReturnReversalParams.builder() 13 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun body() { 19 | val params = 20 | TransactionSimulateReturnReversalParams.builder() 21 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 22 | .build() 23 | 24 | val body = params._body() 25 | 26 | assertThat(body.token()).isEqualTo("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/cards/BalanceServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.cards 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class BalanceServiceTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val balanceService = client.cards().balances() 21 | 22 | val page = balanceService.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | page.response().validate() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/cards/AggregateBalanceServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.cards 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AggregateBalanceServiceTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val aggregateBalanceService = client.cards().aggregateBalances() 21 | 22 | val page = aggregateBalanceService.list() 23 | 24 | page.response().validate() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2DeleteParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AuthRuleV2DeleteParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AuthRuleV2DeleteParams.builder() 13 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AuthRuleV2DeleteParams.builder() 21 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/BalanceServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class BalanceServiceAsyncTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val balanceServiceAsync = client.balances() 21 | 22 | val pageFuture = balanceServiceAsync.list() 23 | 24 | val page = pageFuture.get() 25 | page.response().validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2PromoteParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AuthRuleV2PromoteParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AuthRuleV2PromoteParams.builder() 13 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AuthRuleV2PromoteParams.builder() 21 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputesV2RetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class DisputesV2RetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | DisputesV2RetrieveParams.builder() 13 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | DisputesV2RetrieveParams.builder() 21 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2RetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AuthRuleV2RetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AuthRuleV2RetrieveParams.builder() 13 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AuthRuleV2RetrieveParams.builder() 21 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/EventSubscriptionDeleteParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class EventSubscriptionDeleteParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | EventSubscriptionDeleteParams.builder() 13 | .eventSubscriptionToken("event_subscription_token") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | EventSubscriptionDeleteParams.builder() 21 | .eventSubscriptionToken("event_subscription_token") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("event_subscription_token") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationPauseParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TokenizationPauseParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TokenizationPauseParams.builder() 13 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TokenizationPauseParams.builder() 21 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/PrepareRequest.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("PrepareRequest") 2 | 3 | package com.lithic.api.core 4 | 5 | import com.lithic.api.core.http.HttpRequest 6 | import java.util.concurrent.CompletableFuture 7 | 8 | @JvmSynthetic 9 | internal fun HttpRequest.prepare(clientOptions: ClientOptions, params: Params): HttpRequest = 10 | toBuilder() 11 | .putAllQueryParams(clientOptions.queryParams) 12 | .replaceAllQueryParams(params._queryParams()) 13 | .putAllHeaders(clientOptions.headers) 14 | .replaceAllHeaders(params._headers()) 15 | .build() 16 | 17 | @JvmSynthetic 18 | internal fun HttpRequest.prepareAsync( 19 | clientOptions: ClientOptions, 20 | params: Params, 21 | ): CompletableFuture = 22 | // This async version exists to make it easier to add async specific preparation logic in the 23 | // future. 24 | CompletableFuture.completedFuture(prepare(clientOptions, params)) 25 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardBulkOrderRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardBulkOrderRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardBulkOrderRetrieveParams.builder() 13 | .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | CardBulkOrderRetrieveParams.builder() 21 | .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardProgramRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardProgramRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardProgramRetrieveParams.builder() 13 | .cardProgramToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | CardProgramRetrieveParams.builder() 21 | .cardProgramToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardRetrieveSpendLimitsParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardRetrieveSpendLimitsParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardRetrieveSpendLimitsParams.builder() 13 | .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | CardRetrieveSpendLimitsParams.builder() 21 | .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/EventSubscriptionRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class EventSubscriptionRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | EventSubscriptionRetrieveParams.builder() 13 | .eventSubscriptionToken("event_subscription_token") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | EventSubscriptionRetrieveParams.builder() 21 | .eventSubscriptionToken("event_subscription_token") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("event_subscription_token") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationUnpauseParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TokenizationUnpauseParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TokenizationUnpauseParams.builder() 13 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TokenizationUnpauseParams.builder() 21 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionRetrieveParams.builder() 13 | .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TransactionRetrieveParams.builder() 21 | .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/BookTransferRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class BookTransferRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | BookTransferRetrieveParams.builder() 13 | .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | BookTransferRetrieveParams.builder() 21 | .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationActivateParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TokenizationActivateParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TokenizationActivateParams.builder() 13 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TokenizationActivateParams.builder() 21 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TokenizationRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TokenizationRetrieveParams.builder() 13 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TokenizationRetrieveParams.builder() 21 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/financialAccounts/BalanceServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.financialAccounts 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class BalanceServiceTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val balanceService = client.financialAccounts().balances() 21 | 22 | val page = balanceService.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | page.response().validate() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AccountHolderRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AccountHolderRetrieveParams.builder() 13 | .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AccountHolderRetrieveParams.builder() 21 | .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationDeactivateParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TokenizationDeactivateParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TokenizationDeactivateParams.builder() 13 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TokenizationDeactivateParams.builder() 21 | .tokenizationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DigitalCardArtRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class DigitalCardArtRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | DigitalCardArtRetrieveParams.builder() 13 | .digitalCardArtToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | DigitalCardArtRetrieveParams.builder() 21 | .digitalCardArtToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/EventSubscriptionRotateSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class EventSubscriptionRotateSecretParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | EventSubscriptionRotateSecretParams.builder() 13 | .eventSubscriptionToken("event_subscription_token") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | EventSubscriptionRotateSecretParams.builder() 21 | .eventSubscriptionToken("event_subscription_token") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("event_subscription_token") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/NetworkProgramRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class NetworkProgramRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | NetworkProgramRetrieveParams.builder() 13 | .networkProgramToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | NetworkProgramRetrieveParams.builder() 21 | .networkProgramToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpClient.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | import com.lithic.api.core.RequestOptions 4 | import java.lang.AutoCloseable 5 | import java.util.concurrent.CompletableFuture 6 | 7 | interface HttpClient : AutoCloseable { 8 | 9 | fun execute( 10 | request: HttpRequest, 11 | requestOptions: RequestOptions = RequestOptions.none(), 12 | ): HttpResponse 13 | 14 | fun execute(request: HttpRequest): HttpResponse = execute(request, RequestOptions.none()) 15 | 16 | fun executeAsync( 17 | request: HttpRequest, 18 | requestOptions: RequestOptions = RequestOptions.none(), 19 | ): CompletableFuture 20 | 21 | fun executeAsync(request: HttpRequest): CompletableFuture = 22 | executeAsync(request, RequestOptions.none()) 23 | 24 | /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ 25 | override fun close() 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountRetrieveSpendLimitsParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AccountRetrieveSpendLimitsParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AccountRetrieveSpendLimitsParams.builder() 13 | .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AccountRetrieveSpendLimitsParams.builder() 21 | .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardEmbedParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.lithic.api.core.http.QueryParams 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | 9 | internal class CardEmbedParamsTest { 10 | 11 | @Test 12 | fun create() { 13 | CardEmbedParams.builder().embedRequest("embed_request").hmac("hmac").build() 14 | } 15 | 16 | @Test 17 | fun queryParams() { 18 | val params = CardEmbedParams.builder().embedRequest("embed_request").hmac("hmac").build() 19 | 20 | val queryParams = params._queryParams() 21 | 22 | assertThat(queryParams) 23 | .isEqualTo( 24 | QueryParams.builder() 25 | .put("embed_request", "embed_request") 26 | .put("hmac", "hmac") 27 | .build() 28 | ) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CarrierTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class CarrierTest { 11 | 12 | @Test 13 | fun create() { 14 | val carrier = Carrier.builder().qrCodeUrl("qr_code_url").build() 15 | 16 | assertThat(carrier.qrCodeUrl()).contains("qr_code_url") 17 | } 18 | 19 | @Test 20 | fun roundtrip() { 21 | val jsonMapper = jsonMapper() 22 | val carrier = Carrier.builder().qrCodeUrl("qr_code_url").build() 23 | 24 | val roundtrippedCarrier = 25 | jsonMapper.readValue(jsonMapper.writeValueAsString(carrier), jacksonTypeRef()) 26 | 27 | assertThat(roundtrippedCarrier).isEqualTo(carrier) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CreditProductExtendedCreditRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CreditProductExtendedCreditRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CreditProductExtendedCreditRetrieveParams.builder() 13 | .creditProductToken("credit_product_token") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | CreditProductExtendedCreditRetrieveParams.builder() 21 | .creditProductToken("credit_product_token") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("credit_product_token") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/EventSubscriptionRetrieveSecretParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class EventSubscriptionRetrieveSecretParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | EventSubscriptionRetrieveSecretParams.builder() 13 | .eventSubscriptionToken("event_subscription_token") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | EventSubscriptionRetrieveSecretParams.builder() 21 | .eventSubscriptionToken("event_subscription_token") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("event_subscription_token") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalPaymentRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ExternalPaymentRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ExternalPaymentRetrieveParams.builder() 13 | .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | ExternalPaymentRetrieveParams.builder() 21 | .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FraudTransactionRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FraudTransactionRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FraudTransactionRetrieveParams.builder() 13 | .transactionToken("00000000-0000-0000-0000-000000000000") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | FraudTransactionRetrieveParams.builder() 21 | .transactionToken("00000000-0000-0000-0000-000000000000") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("00000000-0000-0000-0000-000000000000") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AggregateBalanceServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AggregateBalanceServiceAsyncTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val aggregateBalanceServiceAsync = client.aggregateBalances() 21 | 22 | val pageFuture = aggregateBalanceServiceAsync.list() 23 | 24 | val page = pageFuture.get() 25 | page.response().validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderListDocumentsParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AccountHolderListDocumentsParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AccountHolderListDocumentsParams.builder() 13 | .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AccountHolderListDocumentsParams.builder() 21 | .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FinancialAccountRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FinancialAccountRetrieveParams.builder() 13 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | FinancialAccountRetrieveParams.builder() 21 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FundingEventRetrieveDetailsParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FundingEventRetrieveDetailsParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FundingEventRetrieveDetailsParams.builder() 13 | .fundingEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | FundingEventRetrieveDetailsParams.builder() 21 | .fundingEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/creditProducts/ExtendedCreditServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.creditProducts 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class ExtendedCreditServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val extendedCreditService = client.creditProducts().extendedCredit() 21 | 22 | val extendedCredit = extendedCreditService.retrieve("credit_product_token") 23 | 24 | extendedCredit.validate() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUnpauseParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ExternalBankAccountUnpauseParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ExternalBankAccountUnpauseParams.builder() 13 | .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | ExternalBankAccountUnpauseParams.builder() 21 | .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionExpireAuthorizationParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionExpireAuthorizationParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionExpireAuthorizationParams.builder() 13 | .transactionToken("00000000-0000-0000-0000-000000000000") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TransactionExpireAuthorizationParams.builder() 21 | .transactionToken("00000000-0000-0000-0000-000000000000") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("00000000-0000-0000-0000-000000000000") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/cards/BalanceServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.cards 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class BalanceServiceAsyncTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val balanceServiceAsync = client.cards().balances() 21 | 22 | val pageFuture = balanceServiceAsync.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | val page = pageFuture.get() 25 | page.response().validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ExternalBankAccountRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ExternalBankAccountRetrieveParams.builder() 13 | .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | ExternalBankAccountRetrieveParams.builder() 21 | .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ManagementOperationRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ManagementOperationRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ManagementOperationRetrieveParams.builder() 13 | .managementOperationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | ManagementOperationRetrieveParams.builder() 21 | .managementOperationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ReportSettlementNetworkTotalRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ReportSettlementNetworkTotalRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ReportSettlementNetworkTotalRetrieveParams.builder() 13 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | ReportSettlementNetworkTotalRetrieveParams.builder() 21 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/cards/AggregateBalanceServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.cards 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AggregateBalanceServiceAsyncTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val aggregateBalanceServiceAsync = client.cards().aggregateBalances() 21 | 22 | val pageFuture = aggregateBalanceServiceAsync.list() 23 | 24 | val page = pageFuture.get() 25 | page.response().validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AccountActivityRetrieveTransactionParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AccountActivityRetrieveTransactionParams.builder() 13 | .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | AccountActivityRetrieveTransactionParams.builder() 21 | .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ThreeDSAuthenticationRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ThreeDSAuthenticationRetrieveParams.builder() 13 | .threeDSAuthenticationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | ThreeDSAuthenticationRetrieveParams.builder() 21 | .threeDSAuthenticationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ResponderEndpointDeleteParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.lithic.api.core.http.QueryParams 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | 9 | internal class ResponderEndpointDeleteParamsTest { 10 | 11 | @Test 12 | fun create() { 13 | ResponderEndpointDeleteParams.builder() 14 | .type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS) 15 | .build() 16 | } 17 | 18 | @Test 19 | fun queryParams() { 20 | val params = 21 | ResponderEndpointDeleteParams.builder() 22 | .type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS) 23 | .build() 24 | 25 | val queryParams = params._queryParams() 26 | 27 | assertThat(queryParams) 28 | .isEqualTo(QueryParams.builder().put("type", "AUTH_STREAM_ACCESS").build()) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/financialAccounts/BalanceServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.financialAccounts 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class BalanceServiceAsyncTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val balanceServiceAsync = client.financialAccounts().balances() 21 | 22 | val pageFuture = balanceServiceAsync.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | val page = pageFuture.get() 25 | page.response().validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scripts/mock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | if [[ -n "$1" && "$1" != '--'* ]]; then 8 | URL="$1" 9 | shift 10 | else 11 | URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" 12 | fi 13 | 14 | # Check if the URL is empty 15 | if [ -z "$URL" ]; then 16 | echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" 17 | exit 1 18 | fi 19 | 20 | echo "==> Starting mock server with URL ${URL}" 21 | 22 | # Run prism mock on the given spec 23 | if [ "$1" == "--daemon" ]; then 24 | npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & 25 | 26 | # Wait for server to come online 27 | echo -n "Waiting for server" 28 | while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do 29 | echo -n "." 30 | sleep 0.1 31 | done 32 | 33 | if grep -q "✖ fatal" ".prism.log"; then 34 | cat .prism.log 35 | exit 1 36 | fi 37 | 38 | echo 39 | else 40 | npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" 41 | fi 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionEnhancedCommercialDataRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionEnhancedCommercialDataRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionEnhancedCommercialDataRetrieveParams.builder() 13 | .transactionToken("00000000-0000-0000-0000-000000000000") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TransactionEnhancedCommercialDataRetrieveParams.builder() 21 | .transactionToken("00000000-0000-0000-0000-000000000000") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("00000000-0000-0000-0000-000000000000") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ApiStatusTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class ApiStatusTest { 11 | 12 | @Test 13 | fun create() { 14 | val apiStatus = ApiStatus.builder().message("message").build() 15 | 16 | assertThat(apiStatus.message()).contains("message") 17 | } 18 | 19 | @Test 20 | fun roundtrip() { 21 | val jsonMapper = jsonMapper() 22 | val apiStatus = ApiStatus.builder().message("message").build() 23 | 24 | val roundtrippedApiStatus = 25 | jsonMapper.readValue( 26 | jsonMapper.writeValueAsString(apiStatus), 27 | jacksonTypeRef(), 28 | ) 29 | 30 | assertThat(roundtrippedApiStatus).isEqualTo(apiStatus) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.github/workflows/release-doctor.yml: -------------------------------------------------------------------------------- 1 | name: Release Doctor 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | workflow_dispatch: 7 | 8 | jobs: 9 | release_doctor: 10 | name: release doctor 11 | runs-on: ubuntu-latest 12 | if: github.repository == 'lithic-com/lithic-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Check release environment 18 | run: | 19 | bash ./bin/check-release-environment 20 | env: 21 | SONATYPE_USERNAME: ${{ secrets.LITHIC_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} 22 | SONATYPE_PASSWORD: ${{ secrets.LITHIC_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} 23 | GPG_SIGNING_KEY: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} 24 | GPG_SIGNING_PASSWORD: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} 25 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.lithic.api.core.http.QueryParams 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | 9 | internal class ResponderEndpointCheckStatusParamsTest { 10 | 11 | @Test 12 | fun create() { 13 | ResponderEndpointCheckStatusParams.builder() 14 | .type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS) 15 | .build() 16 | } 17 | 18 | @Test 19 | fun queryParams() { 20 | val params = 21 | ResponderEndpointCheckStatusParams.builder() 22 | .type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS) 23 | .build() 24 | 25 | val queryParams = params._queryParams() 26 | 27 | assertThat(queryParams) 28 | .isEqualTo(QueryParams.builder().put("type", "AUTH_STREAM_ACCESS").build()) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionEventEnhancedCommercialDataRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionEventEnhancedCommercialDataRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionEventEnhancedCommercialDataRetrieveParams.builder() 13 | .eventToken("00000000-0000-0000-0000-000000000000") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | TransactionEventEnhancedCommercialDataRetrieveParams.builder() 21 | .eventToken("00000000-0000-0000-0000-000000000000") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("00000000-0000-0000-0000-000000000000") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountCreditConfigurationRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FinancialAccountCreditConfigurationRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FinancialAccountCreditConfigurationRetrieveParams.builder() 13 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .build() 15 | } 16 | 17 | @Test 18 | fun pathParams() { 19 | val params = 20 | FinancialAccountCreditConfigurationRetrieveParams.builder() 21 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 22 | .build() 23 | 24 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 25 | // out-of-bound path param 26 | assertThat(params._pathParam(1)).isEqualTo("") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateOtpEntryParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ThreeDSAuthenticationSimulateOtpEntryParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ThreeDSAuthenticationSimulateOtpEntryParams.builder() 13 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 14 | .otp("123456") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun body() { 20 | val params = 21 | ThreeDSAuthenticationSimulateOtpEntryParams.builder() 22 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 23 | .otp("123456") 24 | .build() 25 | 26 | val body = params._body() 27 | 28 | assertThat(body.token()).isEqualTo("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 29 | assertThat(body.otp()).isEqualTo("123456") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionSimulateAuthorizationAdviceParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionSimulateAuthorizationAdviceParams.builder() 13 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 14 | .amount(3831L) 15 | .build() 16 | } 17 | 18 | @Test 19 | fun body() { 20 | val params = 21 | TransactionSimulateAuthorizationAdviceParams.builder() 22 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 23 | .amount(3831L) 24 | .build() 25 | 26 | val body = params._body() 27 | 28 | assertThat(body.token()).isEqualTo("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 29 | assertThat(body.amount()).isEqualTo(3831L) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/transactions/EnhancedCommercialDataServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.transactions 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class EnhancedCommercialDataServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val enhancedCommercialDataService = client.transactions().enhancedCommercialData() 21 | 22 | val enhancedCommercialData = 23 | enhancedCommercialDataService.retrieve("00000000-0000-0000-0000-000000000000") 24 | 25 | enhancedCommercialData.validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/transactions/events/EnhancedCommercialDataServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.transactions.events 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class EnhancedCommercialDataServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val enhancedCommercialDataService = client.transactions().events().enhancedCommercialData() 21 | 22 | val enhancedData = 23 | enhancedCommercialDataService.retrieve("00000000-0000-0000-0000-000000000000") 24 | 25 | enhancedData.validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/creditProducts/ExtendedCreditServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.creditProducts 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class ExtendedCreditServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val extendedCreditServiceAsync = client.creditProducts().extendedCredit() 21 | 22 | val extendedCreditFuture = extendedCreditServiceAsync.retrieve("credit_product_token") 23 | 24 | val extendedCredit = extendedCreditFuture.get() 25 | extendedCredit.validate() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/http/PhantomReachableClosingHttpClient.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core.http 2 | 3 | import com.lithic.api.core.RequestOptions 4 | import com.lithic.api.core.closeWhenPhantomReachable 5 | import java.util.concurrent.CompletableFuture 6 | 7 | /** 8 | * A delegating wrapper around an `HttpClient` that closes it once it's only phantom reachable. 9 | * 10 | * This class ensures the `HttpClient` is closed even if the user forgets to close it. 11 | */ 12 | internal class PhantomReachableClosingHttpClient(private val httpClient: HttpClient) : HttpClient { 13 | init { 14 | closeWhenPhantomReachable(this, httpClient) 15 | } 16 | 17 | override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse = 18 | httpClient.execute(request, requestOptions) 19 | 20 | override fun executeAsync( 21 | request: HttpRequest, 22 | requestOptions: RequestOptions, 23 | ): CompletableFuture = httpClient.executeAsync(request, requestOptions) 24 | 25 | override fun close() = httpClient.close() 26 | } 27 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ExtendedCreditTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class ExtendedCreditTest { 11 | 12 | @Test 13 | fun create() { 14 | val extendedCredit = ExtendedCredit.builder().creditExtended(0L).build() 15 | 16 | assertThat(extendedCredit.creditExtended()).isEqualTo(0L) 17 | } 18 | 19 | @Test 20 | fun roundtrip() { 21 | val jsonMapper = jsonMapper() 22 | val extendedCredit = ExtendedCredit.builder().creditExtended(0L).build() 23 | 24 | val roundtrippedExtendedCredit = 25 | jsonMapper.readValue( 26 | jsonMapper.writeValueAsString(extendedCredit), 27 | jacksonTypeRef(), 28 | ) 29 | 30 | assertThat(roundtrippedExtendedCredit).isEqualTo(extendedCredit) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionSimulateReturnParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionSimulateReturnParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionSimulateReturnParams.builder() 13 | .amount(3831L) 14 | .descriptor("COFFEE SHOP") 15 | .pan("4111111289144142") 16 | .build() 17 | } 18 | 19 | @Test 20 | fun body() { 21 | val params = 22 | TransactionSimulateReturnParams.builder() 23 | .amount(3831L) 24 | .descriptor("COFFEE SHOP") 25 | .pan("4111111289144142") 26 | .build() 27 | 28 | val body = params._body() 29 | 30 | assertThat(body.amount()).isEqualTo(3831L) 31 | assertThat(body.descriptor()).isEqualTo("COFFEE SHOP") 32 | assertThat(body.pan()).isEqualTo("4111111289144142") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenInfoTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class TokenInfoTest { 11 | 12 | @Test 13 | fun create() { 14 | val tokenInfo = TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build() 15 | 16 | assertThat(tokenInfo.walletType()).isEqualTo(TokenInfo.WalletType.APPLE_PAY) 17 | } 18 | 19 | @Test 20 | fun roundtrip() { 21 | val jsonMapper = jsonMapper() 22 | val tokenInfo = TokenInfo.builder().walletType(TokenInfo.WalletType.APPLE_PAY).build() 23 | 24 | val roundtrippedTokenInfo = 25 | jsonMapper.readValue( 26 | jsonMapper.writeValueAsString(tokenInfo), 27 | jacksonTypeRef(), 28 | ) 29 | 30 | assertThat(roundtrippedTokenInfo).isEqualTo(tokenInfo) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/EventEventSubscriptionResendParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class EventEventSubscriptionResendParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | EventEventSubscriptionResendParams.builder() 13 | .eventToken("event_token") 14 | .eventSubscriptionToken("event_subscription_token") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | EventEventSubscriptionResendParams.builder() 22 | .eventToken("event_token") 23 | .eventSubscriptionToken("event_subscription_token") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("event_token") 27 | assertThat(params._pathParam(1)).isEqualTo("event_subscription_token") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bin/check-release-environment: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | errors=() 4 | 5 | if [ -z "${SONATYPE_USERNAME}" ]; then 6 | errors+=("The SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") 7 | fi 8 | 9 | if [ -z "${SONATYPE_PASSWORD}" ]; then 10 | errors+=("The SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets") 11 | fi 12 | 13 | if [ -z "${GPG_SIGNING_KEY}" ]; then 14 | errors+=("The GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") 15 | fi 16 | 17 | if [ -z "${GPG_SIGNING_PASSWORD}" ]; then 18 | errors+=("The GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets") 19 | fi 20 | 21 | lenErrors=${#errors[@]} 22 | 23 | if [[ lenErrors -gt 0 ]]; then 24 | echo -e "Found the following errors in the release environment:\n" 25 | 26 | for error in "${errors[@]}"; do 27 | echo -e "- $error\n" 28 | done 29 | 30 | exit 1 31 | fi 32 | 33 | echo "The environment is ready to push releases!" 34 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/transactions/EnhancedCommercialDataServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.transactions 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class EnhancedCommercialDataServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val enhancedCommercialDataServiceAsync = client.transactions().enhancedCommercialData() 21 | 22 | val enhancedCommercialDataFuture = 23 | enhancedCommercialDataServiceAsync.retrieve("00000000-0000-0000-0000-000000000000") 24 | 25 | val enhancedCommercialData = enhancedCommercialDataFuture.get() 26 | enhancedCommercialData.validate() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/transactions/events/EnhancedCommercialDataServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.transactions.events 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class EnhancedCommercialDataServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val enhancedCommercialDataServiceAsync = 21 | client.transactions().events().enhancedCommercialData() 22 | 23 | val enhancedDataFuture = 24 | enhancedCommercialDataServiceAsync.retrieve("00000000-0000-0000-0000-000000000000") 25 | 26 | val enhancedData = enhancedDataFuture.get() 27 | enhancedData.validate() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/events/EventSubscriptionServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.events 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import com.lithic.api.models.EventEventSubscriptionResendParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class EventSubscriptionServiceTest { 13 | 14 | @Test 15 | fun resend() { 16 | val client = 17 | LithicOkHttpClient.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val eventSubscriptionService = client.events().eventSubscriptions() 22 | 23 | eventSubscriptionService.resend( 24 | EventEventSubscriptionResendParams.builder() 25 | .eventToken("event_token") 26 | .eventSubscriptionToken("event_subscription_token") 27 | .build() 28 | ) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeDeleteEvidenceParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class DisputeDeleteEvidenceParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | DisputeDeleteEvidenceParams.builder() 13 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | DisputeDeleteEvidenceParams.builder() 22 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountLoanTapeRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FinancialAccountLoanTapeRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FinancialAccountLoanTapeRetrieveParams.builder() 13 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .loanTapeToken("loan_tape_token") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | FinancialAccountLoanTapeRetrieveParams.builder() 22 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .loanTapeToken("loan_tape_token") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("loan_tape_token") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountStatementRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FinancialAccountStatementRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FinancialAccountStatementRetrieveParams.builder() 13 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .statementToken("statement_token") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | FinancialAccountStatementRetrieveParams.builder() 22 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .statementToken("statement_token") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("statement_token") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeRetrieveEvidenceParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class DisputeRetrieveEvidenceParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | DisputeRetrieveEvidenceParams.builder() 13 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | DisputeRetrieveEvidenceParams.builder() 22 | .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthRuleV2BacktestRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AuthRuleV2BacktestRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AuthRuleV2BacktestRetrieveParams.builder() 13 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .authRuleBacktestToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | AuthRuleV2BacktestRetrieveParams.builder() 22 | .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .authRuleBacktestToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderRetrieveDocumentParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AccountHolderRetrieveDocumentParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | AccountHolderRetrieveDocumentParams.builder() 13 | .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .documentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | AccountHolderRetrieveDocumentParams.builder() 22 | .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .documentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/Page.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.core 4 | 5 | /** 6 | * An interface representing a single page, with items of type [T], from a paginated endpoint 7 | * response. 8 | * 9 | * Implementations of this interface are expected to request additional pages synchronously. For 10 | * asynchronous pagination, see the [PageAsync] interface. 11 | */ 12 | interface Page { 13 | 14 | /** 15 | * Returns whether there's another page after this one. 16 | * 17 | * The method generally doesn't make requests so the result depends entirely on the data in this 18 | * page. If a significant amount of time has passed between requesting this page and calling 19 | * this method, then the result could be stale. 20 | */ 21 | fun hasNextPage(): Boolean 22 | 23 | /** 24 | * Returns the page after this one by making another request. 25 | * 26 | * @throws IllegalStateException if it's impossible to get the next page. This exception is 27 | * avoidable by calling [hasNextPage] first. 28 | */ 29 | fun nextPage(): Page 30 | 31 | /** Returns the items in this page. */ 32 | fun items(): List 33 | } 34 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardFinancialTransactionRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardFinancialTransactionRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardFinancialTransactionRetrieveParams.builder() 13 | .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | CardFinancialTransactionRetrieveParams.builder() 22 | .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialTransactionRetrieveParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FinancialTransactionRetrieveParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FinancialTransactionRetrieveParams.builder() 13 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | FinancialTransactionRetrieveParams.builder() 22 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | assertThat(params._pathParam(1)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | // out-of-bound path param 29 | assertThat(params._pathParam(2)).isEqualTo("") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ResponderEndpointCreateParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class ResponderEndpointCreateParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | ResponderEndpointCreateParams.builder() 13 | .type(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS) 14 | .url("https://example.com") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun body() { 20 | val params = 21 | ResponderEndpointCreateParams.builder() 22 | .type(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS) 23 | .url("https://example.com") 24 | .build() 25 | 26 | val body = params._body() 27 | 28 | assertThat(body.type()).contains(ResponderEndpointCreateParams.Type.AUTH_STREAM_ACCESS) 29 | assertThat(body.url()).contains("https://example.com") 30 | } 31 | 32 | @Test 33 | fun bodyWithoutOptionalFields() { 34 | val params = ResponderEndpointCreateParams.builder().build() 35 | 36 | val body = params._body() 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting Security Issues 4 | 5 | This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. 6 | 7 | To report a security issue, please contact the Stainless team at security@stainless.com. 8 | 9 | ## Responsible Disclosure 10 | 11 | We appreciate the efforts of security researchers and individuals who help us maintain the security of 12 | SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible 13 | disclosure practices by allowing us a reasonable amount of time to investigate and address the issue 14 | before making any information public. 15 | 16 | ## Reporting Non-SDK Related Security Issues 17 | 18 | If you encounter security issues that are not directly related to SDKs but pertain to the services 19 | or products provided by Lithic, please follow the respective company's security reporting guidelines. 20 | 21 | ### Lithic Terms and Policies 22 | 23 | Please contact sdk-feedback@lithic.com for any questions or concerns regarding the security of our services. 24 | 25 | --- 26 | 27 | Thank you for helping us keep the SDKs and systems they interact with secure. 28 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/events/EventSubscriptionServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.events 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import com.lithic.api.models.EventEventSubscriptionResendParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class EventSubscriptionServiceAsyncTest { 13 | 14 | @Test 15 | fun resend() { 16 | val client = 17 | LithicOkHttpClientAsync.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val eventSubscriptionServiceAsync = client.events().eventSubscriptions() 22 | 23 | val future = 24 | eventSubscriptionServiceAsync.resend( 25 | EventEventSubscriptionResendParams.builder() 26 | .eventToken("event_token") 27 | .eventSubscriptionToken("event_subscription_token") 28 | .build() 29 | ) 30 | 31 | val response = future.get() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/InternalTransactionService.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import java.util.function.Consumer 7 | 8 | interface InternalTransactionService { 9 | 10 | /** 11 | * Returns a view of this service that provides access to raw HTTP responses for each method. 12 | */ 13 | fun withRawResponse(): WithRawResponse 14 | 15 | /** 16 | * Returns a view of this service with the given option modifications applied. 17 | * 18 | * The original service is not modified. 19 | */ 20 | fun withOptions(modifier: Consumer): InternalTransactionService 21 | 22 | /** 23 | * A view of [InternalTransactionService] that provides access to raw HTTP responses for each 24 | * method. 25 | */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions( 34 | modifier: Consumer 35 | ): InternalTransactionService.WithRawResponse 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CategoryBalancesTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class CategoryBalancesTest { 11 | 12 | @Test 13 | fun create() { 14 | val categoryBalances = 15 | CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() 16 | 17 | assertThat(categoryBalances.fees()).isEqualTo(0L) 18 | assertThat(categoryBalances.interest()).isEqualTo(0L) 19 | assertThat(categoryBalances.principal()).isEqualTo(0L) 20 | } 21 | 22 | @Test 23 | fun roundtrip() { 24 | val jsonMapper = jsonMapper() 25 | val categoryBalances = 26 | CategoryBalances.builder().fees(0L).interest(0L).principal(0L).build() 27 | 28 | val roundtrippedCategoryBalances = 29 | jsonMapper.readValue( 30 | jsonMapper.writeValueAsString(categoryBalances), 31 | jacksonTypeRef(), 32 | ) 33 | 34 | assertThat(roundtrippedCategoryBalances).isEqualTo(categoryBalances) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardProvisionResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class CardProvisionResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val cardProvisionResponse = 15 | CardProvisionResponse.builder().provisioningPayload("string").build() 16 | 17 | assertThat(cardProvisionResponse.provisioningPayload()) 18 | .contains(CardProvisionResponse.ProvisioningPayload.ofString("string")) 19 | } 20 | 21 | @Test 22 | fun roundtrip() { 23 | val jsonMapper = jsonMapper() 24 | val cardProvisionResponse = 25 | CardProvisionResponse.builder().provisioningPayload("string").build() 26 | 27 | val roundtrippedCardProvisionResponse = 28 | jsonMapper.readValue( 29 | jsonMapper.writeValueAsString(cardProvisionResponse), 30 | jacksonTypeRef(), 31 | ) 32 | 33 | assertThat(roundtrippedCardProvisionResponse).isEqualTo(cardProvisionResponse) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/financialAccounts/statements/LineItemServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.financialAccounts.statements 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import com.lithic.api.models.FinancialAccountStatementLineItemListParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class LineItemServiceTest { 13 | 14 | @Test 15 | fun list() { 16 | val client = 17 | LithicOkHttpClient.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val lineItemService = client.financialAccounts().statements().lineItems() 22 | 23 | val page = 24 | lineItemService.list( 25 | FinancialAccountStatementLineItemListParams.builder() 26 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | .statementToken("statement_token") 28 | .build() 29 | ) 30 | 31 | page.response().validate() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/async/InternalTransactionServiceAsync.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import java.util.function.Consumer 7 | 8 | interface InternalTransactionServiceAsync { 9 | 10 | /** 11 | * Returns a view of this service that provides access to raw HTTP responses for each method. 12 | */ 13 | fun withRawResponse(): WithRawResponse 14 | 15 | /** 16 | * Returns a view of this service with the given option modifications applied. 17 | * 18 | * The original service is not modified. 19 | */ 20 | fun withOptions(modifier: Consumer): InternalTransactionServiceAsync 21 | 22 | /** 23 | * A view of [InternalTransactionServiceAsync] that provides access to raw HTTP responses for 24 | * each method. 25 | */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions( 34 | modifier: Consumer 35 | ): InternalTransactionServiceAsync.WithRawResponse 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import com.lithic.api.models.TransferCreateParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class TransferServiceTest { 13 | 14 | @Test 15 | fun create() { 16 | val client = 17 | LithicOkHttpClient.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val transferService = client.transfers() 22 | 23 | val transfer = 24 | transferService.create( 25 | TransferCreateParams.builder() 26 | .amount(0L) 27 | .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 29 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 30 | .memo("memo") 31 | .build() 32 | ) 33 | 34 | transfer.validate() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/PageAsync.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.core 4 | 5 | import java.util.concurrent.CompletableFuture 6 | 7 | /** 8 | * An interface representing a single page, with items of type [T], from a paginated endpoint 9 | * response. 10 | * 11 | * Implementations of this interface are expected to request additional pages asynchronously. For 12 | * synchronous pagination, see the [Page] interface. 13 | */ 14 | interface PageAsync { 15 | 16 | /** 17 | * Returns whether there's another page after this one. 18 | * 19 | * The method generally doesn't make requests so the result depends entirely on the data in this 20 | * page. If a significant amount of time has passed between requesting this page and calling 21 | * this method, then the result could be stale. 22 | */ 23 | fun hasNextPage(): Boolean 24 | 25 | /** 26 | * Returns the page after this one by making another request. 27 | * 28 | * @throws IllegalStateException if it's impossible to get the next page. This exception is 29 | * avoidable by calling [hasNextPage] first. 30 | */ 31 | fun nextPage(): CompletableFuture> 32 | 33 | /** Returns the items in this page. */ 34 | fun items(): List 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AggregateBalanceListParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.lithic.api.core.http.QueryParams 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | 9 | internal class AggregateBalanceListParamsTest { 10 | 11 | @Test 12 | fun create() { 13 | AggregateBalanceListParams.builder() 14 | .financialAccountType(AggregateBalanceListParams.FinancialAccountType.ISSUING) 15 | .build() 16 | } 17 | 18 | @Test 19 | fun queryParams() { 20 | val params = 21 | AggregateBalanceListParams.builder() 22 | .financialAccountType(AggregateBalanceListParams.FinancialAccountType.ISSUING) 23 | .build() 24 | 25 | val queryParams = params._queryParams() 26 | 27 | assertThat(queryParams) 28 | .isEqualTo(QueryParams.builder().put("financial_account_type", "ISSUING").build()) 29 | } 30 | 31 | @Test 32 | fun queryParamsWithoutOptionalFields() { 33 | val params = AggregateBalanceListParams.builder().build() 34 | 35 | val queryParams = params._queryParams() 36 | 37 | assertThat(queryParams).isEqualTo(QueryParams.builder().build()) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AuthRuleService.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.blocking.authRules.V2Service 7 | import java.util.function.Consumer 8 | 9 | interface AuthRuleService { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): AuthRuleService 22 | 23 | fun v2(): V2Service 24 | 25 | /** A view of [AuthRuleService] that provides access to raw HTTP responses for each method. */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions(modifier: Consumer): AuthRuleService.WithRawResponse 34 | 35 | fun v2(): V2Service.WithRawResponse 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/core/AutoPagerTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.core 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class AutoPagerTest { 9 | 10 | private class PageImpl( 11 | private val items: List, 12 | private val nextPage: Page? = null, 13 | ) : Page { 14 | 15 | override fun hasNextPage(): Boolean = nextPage != null 16 | 17 | override fun nextPage(): Page = nextPage!! 18 | 19 | override fun items(): List = items 20 | } 21 | 22 | @Test 23 | fun iterator() { 24 | val firstPage = 25 | PageImpl(listOf("chunk1", "chunk2"), nextPage = PageImpl(listOf("chunk3", "chunk4"))) 26 | 27 | val autoPager = AutoPager.from(firstPage) 28 | 29 | assertThat(autoPager).containsExactly("chunk1", "chunk2", "chunk3", "chunk4") 30 | } 31 | 32 | @Test 33 | fun stream() { 34 | val firstPage = 35 | PageImpl(listOf("chunk1", "chunk2"), nextPage = PageImpl(listOf("chunk3", "chunk4"))) 36 | 37 | val autoPager = AutoPager.from(firstPage) 38 | 39 | assertThat(autoPager.stream()).containsExactly("chunk1", "chunk2", "chunk3", "chunk4") 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ResponderEndpointCreateResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class ResponderEndpointCreateResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val responderEndpointCreateResponse = 15 | ResponderEndpointCreateResponse.builder().enrolled(true).build() 16 | 17 | assertThat(responderEndpointCreateResponse.enrolled()).contains(true) 18 | } 19 | 20 | @Test 21 | fun roundtrip() { 22 | val jsonMapper = jsonMapper() 23 | val responderEndpointCreateResponse = 24 | ResponderEndpointCreateResponse.builder().enrolled(true).build() 25 | 26 | val roundtrippedResponderEndpointCreateResponse = 27 | jsonMapper.readValue( 28 | jsonMapper.writeValueAsString(responderEndpointCreateResponse), 29 | jacksonTypeRef(), 30 | ) 31 | 32 | assertThat(roundtrippedResponderEndpointCreateResponse) 33 | .isEqualTo(responderEndpointCreateResponse) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/DisputesV2ServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class DisputesV2ServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val disputesV2Service = client.disputesV2() 21 | 22 | val disputeV2 = disputesV2Service.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | disputeV2.validate() 25 | } 26 | 27 | @Test 28 | fun list() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val disputesV2Service = client.disputesV2() 35 | 36 | val page = disputesV2Service.list() 37 | 38 | page.response().validate() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/core/Properties.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("Properties") 2 | 3 | package com.lithic.api.core 4 | 5 | import com.lithic.api.client.LithicClient 6 | 7 | fun getOsArch(): String { 8 | val osArch = System.getProperty("os.arch") 9 | 10 | return when (osArch) { 11 | null -> "unknown" 12 | "i386", 13 | "x32", 14 | "x86" -> "x32" 15 | "amd64", 16 | "x86_64" -> "x64" 17 | "arm" -> "arm" 18 | "aarch64" -> "arm64" 19 | else -> "other:$osArch" 20 | } 21 | } 22 | 23 | fun getOsName(): String { 24 | val osName = System.getProperty("os.name") 25 | val vendorUrl = System.getProperty("java.vendor.url") 26 | 27 | return when { 28 | osName == null -> "Unknown" 29 | osName.startsWith("Linux") && vendorUrl == "http://www.android.com/" -> "Android" 30 | osName.startsWith("Linux") -> "Linux" 31 | osName.startsWith("Mac OS") -> "MacOS" 32 | osName.startsWith("Windows") -> "Windows" 33 | else -> "Other:$osName" 34 | } 35 | } 36 | 37 | fun getOsVersion(): String = System.getProperty("os.version", "unknown") 38 | 39 | fun getPackageVersion(): String = 40 | LithicClient::class.java.`package`.implementationVersion ?: "unknown" 41 | 42 | fun getJavaVersion(): String = System.getProperty("java.version", "unknown") 43 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardProgramServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class CardProgramServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val cardProgramService = client.cardPrograms() 21 | 22 | val cardProgram = cardProgramService.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | cardProgram.validate() 25 | } 26 | 27 | @Test 28 | fun list() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val cardProgramService = client.cardPrograms() 35 | 36 | val page = cardProgramService.list() 37 | 38 | page.response().validate() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/core/ClientOptionsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.core 4 | 5 | import com.lithic.api.core.http.HttpClient 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | import org.mockito.junit.jupiter.MockitoExtension 10 | import org.mockito.kotlin.mock 11 | import org.mockito.kotlin.never 12 | import org.mockito.kotlin.verify 13 | 14 | @ExtendWith(MockitoExtension::class) 15 | internal class ClientOptionsTest { 16 | 17 | private val httpClient = mock() 18 | 19 | @Test 20 | fun toBuilder_whenOriginalClientOptionsGarbageCollected_doesNotCloseOriginalClient() { 21 | var clientOptions = 22 | ClientOptions.builder().httpClient(httpClient).apiKey("My Lithic API Key").build() 23 | verify(httpClient, never()).close() 24 | 25 | // Overwrite the `clientOptions` variable so that the original `ClientOptions` is GC'd. 26 | clientOptions = clientOptions.toBuilder().build() 27 | System.gc() 28 | Thread.sleep(100) 29 | 30 | verify(httpClient, never()).close() 31 | // This exists so that `clientOptions` is still reachable. 32 | assertThat(clientOptions).isEqualTo(clientOptions) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/externalBankAccounts/MicroDepositServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.externalBankAccounts 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import com.lithic.api.models.ExternalBankAccountMicroDepositCreateParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class MicroDepositServiceTest { 13 | 14 | @Test 15 | fun create() { 16 | val client = 17 | LithicOkHttpClient.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val microDepositService = client.externalBankAccounts().microDeposits() 22 | 23 | val microDeposit = 24 | microDepositService.create( 25 | ExternalBankAccountMicroDepositCreateParams.builder() 26 | .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | .addMicroDeposit(0L) 28 | .addMicroDeposit(0L) 29 | .build() 30 | ) 31 | 32 | microDeposit.validate() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/FraudService.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.blocking.fraud.TransactionService 7 | import java.util.function.Consumer 8 | 9 | interface FraudService { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): FraudService 22 | 23 | fun transactions(): TransactionService 24 | 25 | /** A view of [FraudService] that provides access to raw HTTP responses for each method. */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions(modifier: Consumer): FraudService.WithRawResponse 34 | 35 | fun transactions(): TransactionService.WithRawResponse 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/ReportService.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.blocking.reports.SettlementService 7 | import java.util.function.Consumer 8 | 9 | interface ReportService { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): ReportService 22 | 23 | fun settlement(): SettlementService 24 | 25 | /** A view of [ReportService] that provides access to raw HTTP responses for each method. */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions(modifier: Consumer): ReportService.WithRawResponse 34 | 35 | fun settlement(): SettlementService.WithRawResponse 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ResponderEndpointStatusTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class ResponderEndpointStatusTest { 11 | 12 | @Test 13 | fun create() { 14 | val responderEndpointStatus = 15 | ResponderEndpointStatus.builder().enrolled(true).url("https://example.com").build() 16 | 17 | assertThat(responderEndpointStatus.enrolled()).contains(true) 18 | assertThat(responderEndpointStatus.url()).contains("https://example.com") 19 | } 20 | 21 | @Test 22 | fun roundtrip() { 23 | val jsonMapper = jsonMapper() 24 | val responderEndpointStatus = 25 | ResponderEndpointStatus.builder().enrolled(true).url("https://example.com").build() 26 | 27 | val roundtrippedResponderEndpointStatus = 28 | jsonMapper.readValue( 29 | jsonMapper.writeValueAsString(responderEndpointStatus), 30 | jacksonTypeRef(), 31 | ) 32 | 33 | assertThat(roundtrippedResponderEndpointStatus).isEqualTo(responderEndpointStatus) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AuthStreamEnrollmentServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AuthStreamEnrollmentServiceTest { 12 | 13 | @Test 14 | fun retrieveSecret() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val authStreamEnrollmentService = client.authStreamEnrollment() 21 | 22 | val authStreamSecret = authStreamEnrollmentService.retrieveSecret() 23 | 24 | authStreamSecret.validate() 25 | } 26 | 27 | @Test 28 | fun rotateSecret() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val authStreamEnrollmentService = client.authStreamEnrollment() 35 | 36 | authStreamEnrollmentService.rotateSecret() 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/SubscriptionRetrieveSecretResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class SubscriptionRetrieveSecretResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val subscriptionRetrieveSecretResponse = 15 | SubscriptionRetrieveSecretResponse.builder().secret("secret").build() 16 | 17 | assertThat(subscriptionRetrieveSecretResponse.secret()).contains("secret") 18 | } 19 | 20 | @Test 21 | fun roundtrip() { 22 | val jsonMapper = jsonMapper() 23 | val subscriptionRetrieveSecretResponse = 24 | SubscriptionRetrieveSecretResponse.builder().secret("secret").build() 25 | 26 | val roundtrippedSubscriptionRetrieveSecretResponse = 27 | jsonMapper.readValue( 28 | jsonMapper.writeValueAsString(subscriptionRetrieveSecretResponse), 29 | jacksonTypeRef(), 30 | ) 31 | 32 | assertThat(roundtrippedSubscriptionRetrieveSecretResponse) 33 | .isEqualTo(subscriptionRetrieveSecretResponse) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/DigitalCardArtServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class DigitalCardArtServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val digitalCardArtService = client.digitalCardArt() 21 | 22 | val digitalCardArt = digitalCardArtService.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | digitalCardArt.validate() 25 | } 26 | 27 | @Test 28 | fun list() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val digitalCardArtService = client.digitalCardArt() 35 | 36 | val page = digitalCardArtService.list() 37 | 38 | page.response().validate() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/NetworkProgramServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class NetworkProgramServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val networkProgramService = client.networkPrograms() 21 | 22 | val networkProgram = networkProgramService.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | networkProgram.validate() 25 | } 26 | 27 | @Test 28 | fun list() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val networkProgramService = client.networkPrograms() 35 | 36 | val page = networkProgramService.list() 37 | 38 | page.response().validate() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthStreamSecretTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class AuthStreamSecretTest { 11 | 12 | @Test 13 | fun create() { 14 | val authStreamSecret = 15 | AuthStreamSecret.builder() 16 | .secret("whsec_1NDsYinMGr951KuDEaj78VtWzlyPaOnwUVagFiWIPJs=") 17 | .build() 18 | 19 | assertThat(authStreamSecret.secret()) 20 | .contains("whsec_1NDsYinMGr951KuDEaj78VtWzlyPaOnwUVagFiWIPJs=") 21 | } 22 | 23 | @Test 24 | fun roundtrip() { 25 | val jsonMapper = jsonMapper() 26 | val authStreamSecret = 27 | AuthStreamSecret.builder() 28 | .secret("whsec_1NDsYinMGr951KuDEaj78VtWzlyPaOnwUVagFiWIPJs=") 29 | .build() 30 | 31 | val roundtrippedAuthStreamSecret = 32 | jsonMapper.readValue( 33 | jsonMapper.writeValueAsString(authStreamSecret), 34 | jacksonTypeRef(), 35 | ) 36 | 37 | assertThat(roundtrippedAuthStreamSecret).isEqualTo(authStreamSecret) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/financialAccounts/statements/LineItemServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.financialAccounts.statements 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import com.lithic.api.models.FinancialAccountStatementLineItemListParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class LineItemServiceAsyncTest { 13 | 14 | @Test 15 | fun list() { 16 | val client = 17 | LithicOkHttpClientAsync.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val lineItemServiceAsync = client.financialAccounts().statements().lineItems() 22 | 23 | val pageFuture = 24 | lineItemServiceAsync.list( 25 | FinancialAccountStatementLineItemListParams.builder() 26 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | .statementToken("statement_token") 28 | .build() 29 | ) 30 | 31 | val page = pageFuture.get() 32 | page.response().validate() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionSimulateClearingParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class TransactionSimulateClearingParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | TransactionSimulateClearingParams.builder() 13 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 14 | .amount(0L) 15 | .build() 16 | } 17 | 18 | @Test 19 | fun body() { 20 | val params = 21 | TransactionSimulateClearingParams.builder() 22 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 23 | .amount(0L) 24 | .build() 25 | 26 | val body = params._body() 27 | 28 | assertThat(body.token()).isEqualTo("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 29 | assertThat(body.amount()).contains(0L) 30 | } 31 | 32 | @Test 33 | fun bodyWithoutOptionalFields() { 34 | val params = 35 | TransactionSimulateClearingParams.builder() 36 | .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 37 | .build() 38 | 39 | val body = params._body() 40 | 41 | assertThat(body.token()).isEqualTo("fabd829d-7f7b-4432-a8f2-07ea4889aaac") 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/InternalTransactionServiceImpl.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import java.util.function.Consumer 7 | 8 | class InternalTransactionServiceImpl 9 | internal constructor(private val clientOptions: ClientOptions) : InternalTransactionService { 10 | 11 | private val withRawResponse: InternalTransactionService.WithRawResponse by lazy { 12 | WithRawResponseImpl(clientOptions) 13 | } 14 | 15 | override fun withRawResponse(): InternalTransactionService.WithRawResponse = withRawResponse 16 | 17 | override fun withOptions( 18 | modifier: Consumer 19 | ): InternalTransactionService = 20 | InternalTransactionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) 21 | 22 | class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : 23 | InternalTransactionService.WithRawResponse { 24 | 25 | override fun withOptions( 26 | modifier: Consumer 27 | ): InternalTransactionService.WithRawResponse = 28 | InternalTransactionServiceImpl.WithRawResponseImpl( 29 | clientOptions.toBuilder().apply(modifier::accept).build() 30 | ) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/core/UtilsTest.kt: -------------------------------------------------------------------------------- 1 | package com.lithic.api.core 2 | 3 | import org.assertj.core.api.Assertions.assertThat 4 | import org.junit.jupiter.api.Test 5 | 6 | internal class UtilsTest { 7 | @Test 8 | fun contentDeepEquals() { 9 | assertThat(42 contentEquals 42).isTrue() 10 | assertThat(42 contentEquals "Hello World!").isFalse() 11 | assertThat(byteArrayOf(1, 2, 3) contentEquals byteArrayOf(1, 2, 3)).isTrue() 12 | assertThat(byteArrayOf(1, 2, 3) contentEquals byteArrayOf(1, 2, 4)).isFalse() 13 | assertThat( 14 | arrayOf(byteArrayOf(1, 2), byteArrayOf(3)) contentEquals 15 | arrayOf(byteArrayOf(1, 2), byteArrayOf(3)) 16 | ) 17 | .isTrue() 18 | assertThat( 19 | arrayOf(byteArrayOf(1, 2), byteArrayOf(3)) contentEquals 20 | arrayOf(byteArrayOf(1), byteArrayOf(2, 3)) 21 | ) 22 | .isFalse() 23 | } 24 | 25 | @Test 26 | fun contentToString() { 27 | assertThat((42).contentToString()).isEqualTo("42") 28 | assertThat("Hello World!".contentToString()).isEqualTo("Hello World!") 29 | assertThat(byteArrayOf(1, 2, 3).contentToString()).isEqualTo("[1, 2, 3]") 30 | assertThat(arrayOf(byteArrayOf(1, 2), byteArrayOf(3)).contentToString()) 31 | .isEqualTo("[[1, 2], [3]]") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/TransferServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import com.lithic.api.models.TransferCreateParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class TransferServiceAsyncTest { 13 | 14 | @Test 15 | fun create() { 16 | val client = 17 | LithicOkHttpClientAsync.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val transferServiceAsync = client.transfers() 22 | 23 | val transferFuture = 24 | transferServiceAsync.create( 25 | TransferCreateParams.builder() 26 | .amount(0L) 27 | .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 28 | .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 29 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 30 | .memo("memo") 31 | .build() 32 | ) 33 | 34 | val transfer = transferFuture.get() 35 | transfer.validate() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TokenizationSecretTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class TokenizationSecretTest { 11 | 12 | @Test 13 | fun create() { 14 | val tokenizationSecret = 15 | TokenizationSecret.builder() 16 | .secret("whsec_1NDsYinMGr951KuDEaj78VtWzlyPaOnwUVagFiWIPJs=") 17 | .build() 18 | 19 | assertThat(tokenizationSecret.secret()) 20 | .contains("whsec_1NDsYinMGr951KuDEaj78VtWzlyPaOnwUVagFiWIPJs=") 21 | } 22 | 23 | @Test 24 | fun roundtrip() { 25 | val jsonMapper = jsonMapper() 26 | val tokenizationSecret = 27 | TokenizationSecret.builder() 28 | .secret("whsec_1NDsYinMGr951KuDEaj78VtWzlyPaOnwUVagFiWIPJs=") 29 | .build() 30 | 31 | val roundtrippedTokenizationSecret = 32 | jsonMapper.readValue( 33 | jsonMapper.writeValueAsString(tokenizationSecret), 34 | jacksonTypeRef(), 35 | ) 36 | 37 | assertThat(roundtrippedTokenizationSecret).isEqualTo(tokenizationSecret) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AccountActivityServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AccountActivityServiceTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val accountActivityService = client.accountActivity() 21 | 22 | val page = accountActivityService.list() 23 | 24 | page.response().validate() 25 | } 26 | 27 | @Test 28 | fun retrieveTransaction() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val accountActivityService = client.accountActivity() 35 | 36 | val response = 37 | accountActivityService.retrieveTransaction("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 38 | 39 | response.validate() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/DeviceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class DeviceTest { 11 | 12 | @Test 13 | fun create() { 14 | val device = 15 | Device.builder() 16 | .imei("123456789012345") 17 | .ipAddress("1.1.1.1") 18 | .location("37.3860517/-122.0838511") 19 | .build() 20 | 21 | assertThat(device.imei()).contains("123456789012345") 22 | assertThat(device.ipAddress()).contains("1.1.1.1") 23 | assertThat(device.location()).contains("37.3860517/-122.0838511") 24 | } 25 | 26 | @Test 27 | fun roundtrip() { 28 | val jsonMapper = jsonMapper() 29 | val device = 30 | Device.builder() 31 | .imei("123456789012345") 32 | .ipAddress("1.1.1.1") 33 | .location("37.3860517/-122.0838511") 34 | .build() 35 | 36 | val roundtrippedDevice = 37 | jsonMapper.readValue(jsonMapper.writeValueAsString(device), jacksonTypeRef()) 38 | 39 | assertThat(roundtrippedDevice).isEqualTo(device) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AuthRuleServiceAsync.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.async.authRules.V2ServiceAsync 7 | import java.util.function.Consumer 8 | 9 | interface AuthRuleServiceAsync { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): AuthRuleServiceAsync 22 | 23 | fun v2(): V2ServiceAsync 24 | 25 | /** 26 | * A view of [AuthRuleServiceAsync] that provides access to raw HTTP responses for each method. 27 | */ 28 | interface WithRawResponse { 29 | 30 | /** 31 | * Returns a view of this service with the given option modifications applied. 32 | * 33 | * The original service is not modified. 34 | */ 35 | fun withOptions( 36 | modifier: Consumer 37 | ): AuthRuleServiceAsync.WithRawResponse 38 | 39 | fun v2(): V2ServiceAsync.WithRawResponse 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/async/FraudServiceAsync.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.async.fraud.TransactionServiceAsync 7 | import java.util.function.Consumer 8 | 9 | interface FraudServiceAsync { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): FraudServiceAsync 22 | 23 | fun transactions(): TransactionServiceAsync 24 | 25 | /** A view of [FraudServiceAsync] that provides access to raw HTTP responses for each method. */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions( 34 | modifier: Consumer 35 | ): FraudServiceAsync.WithRawResponse 36 | 37 | fun transactions(): TransactionServiceAsync.WithRawResponse 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/BacktestCreateResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class BacktestCreateResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val backtestCreateResponse = 15 | BacktestCreateResponse.builder() 16 | .backtestToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 17 | .build() 18 | 19 | assertThat(backtestCreateResponse.backtestToken()) 20 | .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 21 | } 22 | 23 | @Test 24 | fun roundtrip() { 25 | val jsonMapper = jsonMapper() 26 | val backtestCreateResponse = 27 | BacktestCreateResponse.builder() 28 | .backtestToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 29 | .build() 30 | 31 | val roundtrippedBacktestCreateResponse = 32 | jsonMapper.readValue( 33 | jsonMapper.writeValueAsString(backtestCreateResponse), 34 | jacksonTypeRef(), 35 | ) 36 | 37 | assertThat(roundtrippedBacktestCreateResponse).isEqualTo(backtestCreateResponse) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class PaymentSimulateReturnParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | PaymentSimulateReturnParams.builder() 13 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .returnReasonCode("R12") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun body() { 20 | val params = 21 | PaymentSimulateReturnParams.builder() 22 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .returnReasonCode("R12") 24 | .build() 25 | 26 | val body = params._body() 27 | 28 | assertThat(body.paymentToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 29 | assertThat(body.returnReasonCode()).contains("R12") 30 | } 31 | 32 | @Test 33 | fun bodyWithoutOptionalFields() { 34 | val params = 35 | PaymentSimulateReturnParams.builder() 36 | .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 37 | .build() 38 | 39 | val body = params._body() 40 | 41 | assertThat(body.paymentToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/externalBankAccounts/MicroDepositServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.externalBankAccounts 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import com.lithic.api.models.ExternalBankAccountMicroDepositCreateParams 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class MicroDepositServiceAsyncTest { 13 | 14 | @Test 15 | fun create() { 16 | val client = 17 | LithicOkHttpClientAsync.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val microDepositServiceAsync = client.externalBankAccounts().microDeposits() 22 | 23 | val microDepositFuture = 24 | microDepositServiceAsync.create( 25 | ExternalBankAccountMicroDepositCreateParams.builder() 26 | .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | .addMicroDeposit(0L) 28 | .addMicroDeposit(0L) 29 | .build() 30 | ) 31 | 32 | val microDeposit = microDepositFuture.get() 33 | microDeposit.validate() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TokenizationDecisioningServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class TokenizationDecisioningServiceTest { 12 | 13 | @Test 14 | fun retrieveSecret() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val tokenizationDecisioningService = client.tokenizationDecisioning() 21 | 22 | val tokenizationSecret = tokenizationDecisioningService.retrieveSecret() 23 | 24 | tokenizationSecret.validate() 25 | } 26 | 27 | @Test 28 | fun rotateSecret() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val tokenizationDecisioningService = client.tokenizationDecisioning() 35 | 36 | val response = tokenizationDecisioningService.rotateSecret() 37 | 38 | response.validate() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/reports/settlement/NetworkTotalServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.reports.settlement 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class NetworkTotalServiceTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClient.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val networkTotalService = client.reports().settlement().networkTotals() 21 | 22 | val networkTotal = networkTotalService.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | 24 | networkTotal.validate() 25 | } 26 | 27 | @Test 28 | fun list() { 29 | val client = 30 | LithicOkHttpClient.builder() 31 | .baseUrl(TestServerExtension.BASE_URL) 32 | .apiKey("My Lithic API Key") 33 | .build() 34 | val networkTotalService = client.reports().settlement().networkTotals() 35 | 36 | val page = networkTotalService.list() 37 | 38 | page.response().validate() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/async/ReportServiceAsync.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.async.reports.SettlementServiceAsync 7 | import java.util.function.Consumer 8 | 9 | interface ReportServiceAsync { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): ReportServiceAsync 22 | 23 | fun settlement(): SettlementServiceAsync 24 | 25 | /** 26 | * A view of [ReportServiceAsync] that provides access to raw HTTP responses for each method. 27 | */ 28 | interface WithRawResponse { 29 | 30 | /** 31 | * Returns a view of this service with the given option modifications applied. 32 | * 33 | * The original service is not modified. 34 | */ 35 | fun withOptions( 36 | modifier: Consumer 37 | ): ReportServiceAsync.WithRawResponse 38 | 39 | fun settlement(): SettlementServiceAsync.WithRawResponse 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.reports 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClient 7 | import java.time.LocalDate 8 | import org.junit.jupiter.api.Test 9 | import org.junit.jupiter.api.extension.ExtendWith 10 | 11 | @ExtendWith(TestServerExtension::class) 12 | internal class SettlementServiceTest { 13 | 14 | @Test 15 | fun listDetails() { 16 | val client = 17 | LithicOkHttpClient.builder() 18 | .baseUrl(TestServerExtension.BASE_URL) 19 | .apiKey("My Lithic API Key") 20 | .build() 21 | val settlementService = client.reports().settlement() 22 | 23 | val page = settlementService.listDetails(LocalDate.parse("2023-09-01")) 24 | 25 | page.response().validate() 26 | } 27 | 28 | @Test 29 | fun summary() { 30 | val client = 31 | LithicOkHttpClient.builder() 32 | .baseUrl(TestServerExtension.BASE_URL) 33 | .apiKey("My Lithic API Key") 34 | .build() 35 | val settlementService = client.reports().settlement() 36 | 37 | val settlementReport = settlementService.summary(LocalDate.parse("2023-09-01")) 38 | 39 | settlementReport.validate() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /scripts/fast-format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | echo "Script started with $# arguments" 6 | echo "Arguments: $*" 7 | echo "Script location: $(dirname "$0")" 8 | 9 | cd "$(dirname "$0")/.." 10 | echo "Changed to directory: $(pwd)" 11 | 12 | if [ $# -eq 0 ]; then 13 | echo "Usage: $0 [additional-formatter-args...]" 14 | echo "The file should contain one file path per line" 15 | exit 1 16 | fi 17 | 18 | FILE_LIST="$1" 19 | 20 | echo "Looking for file: $FILE_LIST" 21 | 22 | if [ ! -f "$FILE_LIST" ]; then 23 | echo "Error: File '$FILE_LIST' not found" 24 | exit 1 25 | fi 26 | 27 | if ! command -v ktfmt-fast-format &> /dev/null; then 28 | echo "Error: ktfmt-fast-format not found" 29 | exit 1 30 | fi 31 | 32 | # Process Kotlin files 33 | echo "==> Looking for Kotlin files" 34 | kt_files=$(grep -E '\.kt$' "$FILE_LIST" | grep -v './buildSrc/build/' || true) 35 | echo "==> Done looking for Kotlin files" 36 | 37 | if [[ -n "$kt_files" ]]; then 38 | echo "==> will format Kotlin files" 39 | echo "$kt_files" | tr '\n' '\0' | xargs -0 ktfmt-fast-format --kotlinlang-style "$@" 40 | else 41 | echo "No Kotlin files to format -- expected outcome during incremental formatting" 42 | fi 43 | 44 | # TODO(mbudayr): support palantir-java-format 45 | # Process Java files 46 | # grep -E '\.java$' "$FILE_LIST" | grep -v './buildSrc/build/' | tr '\n' '\0' | xargs -0 -r palantir-java-format --palantir --replace "$@" 47 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/transactions/EventService.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.blocking.transactions 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.blocking.transactions.events.EnhancedCommercialDataService 7 | import java.util.function.Consumer 8 | 9 | interface EventService { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): EventService 22 | 23 | fun enhancedCommercialData(): EnhancedCommercialDataService 24 | 25 | /** A view of [EventService] that provides access to raw HTTP responses for each method. */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions(modifier: Consumer): EventService.WithRawResponse 34 | 35 | fun enhancedCommercialData(): EnhancedCommercialDataService.WithRawResponse 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/async/InternalTransactionServiceAsyncImpl.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import java.util.function.Consumer 7 | 8 | class InternalTransactionServiceAsyncImpl 9 | internal constructor(private val clientOptions: ClientOptions) : InternalTransactionServiceAsync { 10 | 11 | private val withRawResponse: InternalTransactionServiceAsync.WithRawResponse by lazy { 12 | WithRawResponseImpl(clientOptions) 13 | } 14 | 15 | override fun withRawResponse(): InternalTransactionServiceAsync.WithRawResponse = 16 | withRawResponse 17 | 18 | override fun withOptions( 19 | modifier: Consumer 20 | ): InternalTransactionServiceAsync = 21 | InternalTransactionServiceAsyncImpl( 22 | clientOptions.toBuilder().apply(modifier::accept).build() 23 | ) 24 | 25 | class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : 26 | InternalTransactionServiceAsync.WithRawResponse { 27 | 28 | override fun withOptions( 29 | modifier: Consumer 30 | ): InternalTransactionServiceAsync.WithRawResponse = 31 | InternalTransactionServiceAsyncImpl.WithRawResponseImpl( 32 | clientOptions.toBuilder().apply(modifier::accept).build() 33 | ) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/DisputesV2ServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class DisputesV2ServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val disputesV2ServiceAsync = client.disputesV2() 21 | 22 | val disputeV2Future = 23 | disputesV2ServiceAsync.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | 25 | val disputeV2 = disputeV2Future.get() 26 | disputeV2.validate() 27 | } 28 | 29 | @Test 30 | fun list() { 31 | val client = 32 | LithicOkHttpClientAsync.builder() 33 | .baseUrl(TestServerExtension.BASE_URL) 34 | .apiKey("My Lithic API Key") 35 | .build() 36 | val disputesV2ServiceAsync = client.disputesV2() 37 | 38 | val pageFuture = disputesV2ServiceAsync.list() 39 | 40 | val page = pageFuture.get() 41 | page.response().validate() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/CardProgramServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class CardProgramServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val cardProgramServiceAsync = client.cardPrograms() 21 | 22 | val cardProgramFuture = 23 | cardProgramServiceAsync.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | 25 | val cardProgram = cardProgramFuture.get() 26 | cardProgram.validate() 27 | } 28 | 29 | @Test 30 | fun list() { 31 | val client = 32 | LithicOkHttpClientAsync.builder() 33 | .baseUrl(TestServerExtension.BASE_URL) 34 | .apiKey("My Lithic API Key") 35 | .build() 36 | val cardProgramServiceAsync = client.cardPrograms() 37 | 38 | val pageFuture = cardProgramServiceAsync.list() 39 | 40 | val page = pageFuture.get() 41 | page.response().validate() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/main/kotlin/com/lithic/api/services/async/transactions/EventServiceAsync.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async.transactions 4 | 5 | import com.lithic.api.core.ClientOptions 6 | import com.lithic.api.services.async.transactions.events.EnhancedCommercialDataServiceAsync 7 | import java.util.function.Consumer 8 | 9 | interface EventServiceAsync { 10 | 11 | /** 12 | * Returns a view of this service that provides access to raw HTTP responses for each method. 13 | */ 14 | fun withRawResponse(): WithRawResponse 15 | 16 | /** 17 | * Returns a view of this service with the given option modifications applied. 18 | * 19 | * The original service is not modified. 20 | */ 21 | fun withOptions(modifier: Consumer): EventServiceAsync 22 | 23 | fun enhancedCommercialData(): EnhancedCommercialDataServiceAsync 24 | 25 | /** A view of [EventServiceAsync] that provides access to raw HTTP responses for each method. */ 26 | interface WithRawResponse { 27 | 28 | /** 29 | * Returns a view of this service with the given option modifications applied. 30 | * 31 | * The original service is not modified. 32 | */ 33 | fun withOptions( 34 | modifier: Consumer 35 | ): EventServiceAsync.WithRawResponse 36 | 37 | fun enhancedCommercialData(): EnhancedCommercialDataServiceAsync.WithRawResponse 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationSimulateResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class AuthenticationSimulateResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val authenticationSimulateResponse = 15 | AuthenticationSimulateResponse.builder() 16 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 17 | .build() 18 | 19 | assertThat(authenticationSimulateResponse.token()) 20 | .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 21 | } 22 | 23 | @Test 24 | fun roundtrip() { 25 | val jsonMapper = jsonMapper() 26 | val authenticationSimulateResponse = 27 | AuthenticationSimulateResponse.builder() 28 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 29 | .build() 30 | 31 | val roundtrippedAuthenticationSimulateResponse = 32 | jsonMapper.readValue( 33 | jsonMapper.writeValueAsString(authenticationSimulateResponse), 34 | jacksonTypeRef(), 35 | ) 36 | 37 | assertThat(roundtrippedAuthenticationSimulateResponse) 38 | .isEqualTo(authenticationSimulateResponse) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardBulkOrderUpdateParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class CardBulkOrderUpdateParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | CardBulkOrderUpdateParams.builder() 13 | .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .status(CardBulkOrderUpdateParams.Status.LOCKED) 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | CardBulkOrderUpdateParams.builder() 22 | .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .status(CardBulkOrderUpdateParams.Status.LOCKED) 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | // out-of-bound path param 28 | assertThat(params._pathParam(1)).isEqualTo("") 29 | } 30 | 31 | @Test 32 | fun body() { 33 | val params = 34 | CardBulkOrderUpdateParams.builder() 35 | .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 36 | .status(CardBulkOrderUpdateParams.Status.LOCKED) 37 | .build() 38 | 39 | val body = params._body() 40 | 41 | assertThat(body.status()).isEqualTo(CardBulkOrderUpdateParams.Status.LOCKED) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AuthStreamEnrollmentServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AuthStreamEnrollmentServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieveSecret() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val authStreamEnrollmentServiceAsync = client.authStreamEnrollment() 21 | 22 | val authStreamSecretFuture = authStreamEnrollmentServiceAsync.retrieveSecret() 23 | 24 | val authStreamSecret = authStreamSecretFuture.get() 25 | authStreamSecret.validate() 26 | } 27 | 28 | @Test 29 | fun rotateSecret() { 30 | val client = 31 | LithicOkHttpClientAsync.builder() 32 | .baseUrl(TestServerExtension.BASE_URL) 33 | .apiKey("My Lithic API Key") 34 | .build() 35 | val authStreamEnrollmentServiceAsync = client.authStreamEnrollment() 36 | 37 | val future = authStreamEnrollmentServiceAsync.rotateSecret() 38 | 39 | val response = future.get() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/DigitalCardArtServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class DigitalCardArtServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val digitalCardArtServiceAsync = client.digitalCardArt() 21 | 22 | val digitalCardArtFuture = 23 | digitalCardArtServiceAsync.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | 25 | val digitalCardArt = digitalCardArtFuture.get() 26 | digitalCardArt.validate() 27 | } 28 | 29 | @Test 30 | fun list() { 31 | val client = 32 | LithicOkHttpClientAsync.builder() 33 | .baseUrl(TestServerExtension.BASE_URL) 34 | .apiKey("My Lithic API Key") 35 | .build() 36 | val digitalCardArtServiceAsync = client.digitalCardArt() 37 | 38 | val pageFuture = digitalCardArtServiceAsync.list() 39 | 40 | val page = pageFuture.get() 41 | page.response().validate() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/NetworkProgramServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class NetworkProgramServiceAsyncTest { 12 | 13 | @Test 14 | fun retrieve() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val networkProgramServiceAsync = client.networkPrograms() 21 | 22 | val networkProgramFuture = 23 | networkProgramServiceAsync.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 24 | 25 | val networkProgram = networkProgramFuture.get() 26 | networkProgram.validate() 27 | } 28 | 29 | @Test 30 | fun list() { 31 | val client = 32 | LithicOkHttpClientAsync.builder() 33 | .baseUrl(TestServerExtension.BASE_URL) 34 | .apiKey("My Lithic API Key") 35 | .build() 36 | val networkProgramServiceAsync = client.networkPrograms() 37 | 38 | val pageFuture = networkProgramServiceAsync.list() 39 | 40 | val page = pageFuture.get() 41 | page.response().validate() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/services/async/AccountActivityServiceAsyncTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.services.async 4 | 5 | import com.lithic.api.TestServerExtension 6 | import com.lithic.api.client.okhttp.LithicOkHttpClientAsync 7 | import org.junit.jupiter.api.Test 8 | import org.junit.jupiter.api.extension.ExtendWith 9 | 10 | @ExtendWith(TestServerExtension::class) 11 | internal class AccountActivityServiceAsyncTest { 12 | 13 | @Test 14 | fun list() { 15 | val client = 16 | LithicOkHttpClientAsync.builder() 17 | .baseUrl(TestServerExtension.BASE_URL) 18 | .apiKey("My Lithic API Key") 19 | .build() 20 | val accountActivityServiceAsync = client.accountActivity() 21 | 22 | val pageFuture = accountActivityServiceAsync.list() 23 | 24 | val page = pageFuture.get() 25 | page.response().validate() 26 | } 27 | 28 | @Test 29 | fun retrieveTransaction() { 30 | val client = 31 | LithicOkHttpClientAsync.builder() 32 | .baseUrl(TestServerExtension.BASE_URL) 33 | .apiKey("My Lithic API Key") 34 | .build() 35 | val accountActivityServiceAsync = client.accountActivity() 36 | 37 | val responseFuture = 38 | accountActivityServiceAsync.retrieveTransaction("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 39 | 40 | val response = responseFuture.get() 41 | response.validate() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/ChallengeResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class ChallengeResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val challengeResponse = 15 | ChallengeResponse.builder() 16 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 17 | .challengeResponse(ChallengeResult.APPROVE) 18 | .build() 19 | 20 | assertThat(challengeResponse.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 21 | assertThat(challengeResponse.challengeResponse()).isEqualTo(ChallengeResult.APPROVE) 22 | } 23 | 24 | @Test 25 | fun roundtrip() { 26 | val jsonMapper = jsonMapper() 27 | val challengeResponse = 28 | ChallengeResponse.builder() 29 | .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 30 | .challengeResponse(ChallengeResult.APPROVE) 31 | .build() 32 | 33 | val roundtrippedChallengeResponse = 34 | jsonMapper.readValue( 35 | jsonMapper.writeValueAsString(challengeResponse), 36 | jacksonTypeRef(), 37 | ) 38 | 39 | assertThat(roundtrippedChallengeResponse).isEqualTo(challengeResponse) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/CardAggregateBalanceListParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.lithic.api.core.http.QueryParams 6 | import org.assertj.core.api.Assertions.assertThat 7 | import org.junit.jupiter.api.Test 8 | 9 | internal class CardAggregateBalanceListParamsTest { 10 | 11 | @Test 12 | fun create() { 13 | CardAggregateBalanceListParams.builder() 14 | .accountToken("account_token") 15 | .businessAccountToken("business_account_token") 16 | .build() 17 | } 18 | 19 | @Test 20 | fun queryParams() { 21 | val params = 22 | CardAggregateBalanceListParams.builder() 23 | .accountToken("account_token") 24 | .businessAccountToken("business_account_token") 25 | .build() 26 | 27 | val queryParams = params._queryParams() 28 | 29 | assertThat(queryParams) 30 | .isEqualTo( 31 | QueryParams.builder() 32 | .put("account_token", "account_token") 33 | .put("business_account_token", "business_account_token") 34 | .build() 35 | ) 36 | } 37 | 38 | @Test 39 | fun queryParamsWithoutOptionalFields() { 40 | val params = CardAggregateBalanceListParams.builder().build() 41 | 42 | val queryParams = params._queryParams() 43 | 44 | assertThat(queryParams).isEqualTo(QueryParams.builder().build()) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialAccountRegisterAccountNumberParamsTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import org.assertj.core.api.Assertions.assertThat 6 | import org.junit.jupiter.api.Test 7 | 8 | internal class FinancialAccountRegisterAccountNumberParamsTest { 9 | 10 | @Test 11 | fun create() { 12 | FinancialAccountRegisterAccountNumberParams.builder() 13 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 14 | .accountNumber("account_number") 15 | .build() 16 | } 17 | 18 | @Test 19 | fun pathParams() { 20 | val params = 21 | FinancialAccountRegisterAccountNumberParams.builder() 22 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 23 | .accountNumber("account_number") 24 | .build() 25 | 26 | assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 27 | // out-of-bound path param 28 | assertThat(params._pathParam(1)).isEqualTo("") 29 | } 30 | 31 | @Test 32 | fun body() { 33 | val params = 34 | FinancialAccountRegisterAccountNumberParams.builder() 35 | .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 36 | .accountNumber("account_number") 37 | .build() 38 | 39 | val body = params._body() 40 | 41 | assertThat(body.accountNumber()).isEqualTo("account_number") 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionSimulateVoidResponseTest.kt: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec by Stainless. 2 | 3 | package com.lithic.api.models 4 | 5 | import com.fasterxml.jackson.module.kotlin.jacksonTypeRef 6 | import com.lithic.api.core.jsonMapper 7 | import org.assertj.core.api.Assertions.assertThat 8 | import org.junit.jupiter.api.Test 9 | 10 | internal class TransactionSimulateVoidResponseTest { 11 | 12 | @Test 13 | fun create() { 14 | val transactionSimulateVoidResponse = 15 | TransactionSimulateVoidResponse.builder() 16 | .debuggingRequestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 17 | .build() 18 | 19 | assertThat(transactionSimulateVoidResponse.debuggingRequestId()) 20 | .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 21 | } 22 | 23 | @Test 24 | fun roundtrip() { 25 | val jsonMapper = jsonMapper() 26 | val transactionSimulateVoidResponse = 27 | TransactionSimulateVoidResponse.builder() 28 | .debuggingRequestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") 29 | .build() 30 | 31 | val roundtrippedTransactionSimulateVoidResponse = 32 | jsonMapper.readValue( 33 | jsonMapper.writeValueAsString(transactionSimulateVoidResponse), 34 | jacksonTypeRef(), 35 | ) 36 | 37 | assertThat(roundtrippedTransactionSimulateVoidResponse) 38 | .isEqualTo(transactionSimulateVoidResponse) 39 | } 40 | } 41 | --------------------------------------------------------------------------------