Added blocking calls to async BankingClient

This commit is contained in:
dankito 2024-08-17 03:25:24 +02:00
parent 0c9d1ab91c
commit fad7a98d9d
4 changed files with 45 additions and 0 deletions

View File

@ -72,6 +72,8 @@ kotlin {
commonMain {
dependencies {
api(project(":BankingClientModel"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
}
}
commonTest {

View File

@ -0,0 +1,21 @@
package net.codinux.banking.client
import kotlinx.coroutines.runBlocking
import net.codinux.banking.client.model.AccountCredentials
import net.codinux.banking.client.model.options.GetAccountDataOptions
fun BankingClient.getAccountData(credentials: AccountCredentials) = runBlocking {
this@getAccountData.getAccountDataAsync(credentials)
}
fun BankingClient.getAccountData(credentials: AccountCredentials, options: GetAccountDataOptions) = runBlocking {
this@getAccountData.getAccountDataAsync(credentials, options)
}
fun BankingClientForCustomer.getAccountData() = runBlocking {
this@getAccountData.getAccountDataAsync()
}
fun BankingClientForCustomer.getAccountData(options: GetAccountDataOptions) = runBlocking {
this@getAccountData.getAccountDataAsync(options)
}

View File

@ -0,0 +1,21 @@
package net.codinux.banking.client
import kotlinx.coroutines.runBlocking
import net.codinux.banking.client.model.AccountCredentials
import net.codinux.banking.client.model.options.GetAccountDataOptions
fun BankingClient.getAccountData(credentials: AccountCredentials) = runBlocking {
this@getAccountData.getAccountDataAsync(credentials)
}
fun BankingClient.getAccountData(credentials: AccountCredentials, options: GetAccountDataOptions) = runBlocking {
this@getAccountData.getAccountDataAsync(credentials, options)
}
fun BankingClientForCustomer.getAccountData() = runBlocking {
this@getAccountData.getAccountDataAsync()
}
fun BankingClientForCustomer.getAccountData(options: GetAccountDataOptions) = runBlocking {
this@getAccountData.getAccountDataAsync(options)
}

View File

@ -5,3 +5,4 @@ kotlinVersion=2.0.10
kotlinxDateTimeVersion=0.6.0
jsJodaTimeZoneVersion=2.3.0
coroutinesVersion=1.8.1