Skip to content

Commit

Permalink
feat(api)!: update model FinancialAccount (#308)
Browse files Browse the repository at this point in the history
feat(api): add resource `auth_rules.v2`
feat(api): add shared model `InstanceFinancialAccountType`
feat(api): add shared model `AccountFinancialAccountType`
feat(api): add shared model `VelocityLimitParams` and `VelocityLimitParamsPeriodWindow`
feat(api): add resource `external_payments`
chore(docs): update various doc strings
# Migration
While changes to `FinancialAccount` are technically breaking change, they are done as a fix to match the actual behaviour of the API.
  • Loading branch information
stainless-app[bot] committed Sep 19, 2024
1 parent 78e33f4 commit 431804c
Show file tree
Hide file tree
Showing 108 changed files with 30,911 additions and 790 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 131
configured_endpoints: 146
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ interface LithicClient {

fun creditProducts(): CreditProductService

fun externalPayments(): ExternalPaymentService

/** Status of api */
@JvmOverloads
fun apiStatus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ interface LithicClientAsync {

fun creditProducts(): CreditProductServiceAsync

fun externalPayments(): ExternalPaymentServiceAsync

/** Status of api */
@JvmOverloads
fun apiStatus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ constructor(
CreditProductServiceAsyncImpl(clientOptions)
}

private val externalPayments: ExternalPaymentServiceAsync by lazy {
ExternalPaymentServiceAsyncImpl(clientOptions)
}

override fun sync(): LithicClient = sync

override fun accounts(): AccountServiceAsync = accounts
Expand Down Expand Up @@ -149,6 +153,8 @@ constructor(

override fun creditProducts(): CreditProductServiceAsync = creditProducts

override fun externalPayments(): ExternalPaymentServiceAsync = externalPayments

private val apiStatusHandler: Handler<ApiStatus> =
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ constructor(
CreditProductServiceImpl(clientOptions)
}

private val externalPayments: ExternalPaymentService by lazy {
ExternalPaymentServiceImpl(clientOptions)
}

override fun async(): LithicClientAsync = async

override fun accounts(): AccountService = accounts
Expand Down Expand Up @@ -143,6 +147,8 @@ constructor(

override fun creditProducts(): CreditProductService = creditProducts

override fun externalPayments(): ExternalPaymentService = externalPayments

private val apiStatusHandler: Handler<ApiStatus> =
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// File generated from our OpenAPI spec by Stainless.

package com.lithic.api.models

import com.fasterxml.jackson.annotation.JsonCreator
import com.lithic.api.core.Enum
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonValue
import com.lithic.api.errors.LithicInvalidDataException

class AccountFinancialAccountType
@JsonCreator
private constructor(
private val value: JsonField<String>,
) : Enum {

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is AccountFinancialAccountType && this.value == other.value
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val ISSUING = AccountFinancialAccountType(JsonField.of("ISSUING"))

@JvmField val OPERATING = AccountFinancialAccountType(JsonField.of("OPERATING"))

@JvmStatic fun of(value: String) = AccountFinancialAccountType(JsonField.of(value))
}

enum class Known {
ISSUING,
OPERATING,
}

enum class Value {
ISSUING,
OPERATING,
_UNKNOWN,
}

fun value(): Value =
when (this) {
ISSUING -> Value.ISSUING
OPERATING -> Value.OPERATING
else -> Value._UNKNOWN
}

fun known(): Known =
when (this) {
ISSUING -> Known.ISSUING
OPERATING -> Known.OPERATING
else -> throw LithicInvalidDataException("Unknown AccountFinancialAccountType: $value")
}

fun asString(): String = _value().asStringOrThrow()
}
Loading

0 comments on commit 431804c

Please sign in to comment.