Skip to content

Commit 999bba7

Browse files
feat(api): api update
1 parent 017f196 commit 999bba7

4 files changed

Lines changed: 174 additions & 5 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 165
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa684ff2a2af585fe502a6e44520ddd883f5141a1113fc9dbe7830027842aa09.yml
3-
openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bc4173417a899a1519326ae60cb481186c1a1c976f3d00b2b305278808db44cd.yml
3+
openapi_spec_hash: 1c1dd981efeffb5276544baa34cf3d17
44
config_hash: 1a83dceb58f6f525b19a5775018db7e8

lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt

Lines changed: 166 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7659,6 +7659,7 @@ private constructor(
76597659
private val result: JsonField<DeclineResult>,
76607660
private val ruleResults: JsonField<List<RuleResult>>,
76617661
private val type: JsonField<Type>,
7662+
private val accountType: JsonField<Type>,
76627663
private val networkSpecificData: JsonField<NetworkSpecificData>,
76637664
private val additionalProperties: MutableMap<String, JsonValue>,
76647665
) {
@@ -7689,6 +7690,9 @@ private constructor(
76897690
@ExcludeMissing
76907691
ruleResults: JsonField<List<RuleResult>> = JsonMissing.of(),
76917692
@JsonProperty("type") @ExcludeMissing type: JsonField<Type> = JsonMissing.of(),
7693+
@JsonProperty("account_type")
7694+
@ExcludeMissing
7695+
accountType: JsonField<Type> = JsonMissing.of(),
76927696
@JsonProperty("network_specific_data")
76937697
@ExcludeMissing
76947698
networkSpecificData: JsonField<NetworkSpecificData> = JsonMissing.of(),
@@ -7703,6 +7707,7 @@ private constructor(
77037707
result,
77047708
ruleResults,
77057709
type,
7710+
accountType,
77067711
networkSpecificData,
77077712
mutableMapOf(),
77087713
)
@@ -7788,6 +7793,12 @@ private constructor(
77887793
*/
77897794
fun type(): Type = type.getRequired("type")
77907795

7796+
/**
7797+
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
7798+
* server responded with an unexpected value).
7799+
*/
7800+
fun accountType(): Optional<Type> = accountType.getOptional("account_type")
7801+
77917802
/**
77927803
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
77937804
* server responded with an unexpected value).
@@ -7880,6 +7891,15 @@ private constructor(
78807891
*/
78817892
@JsonProperty("type") @ExcludeMissing fun _type(): JsonField<Type> = type
78827893

7894+
/**
7895+
* Returns the raw JSON value of [accountType].
7896+
*
7897+
* Unlike [accountType], this method doesn't throw if the JSON field has an unexpected type.
7898+
*/
7899+
@JsonProperty("account_type")
7900+
@ExcludeMissing
7901+
fun _accountType(): JsonField<Type> = accountType
7902+
78837903
/**
78847904
* Returns the raw JSON value of [networkSpecificData].
78857905
*
@@ -7937,6 +7957,7 @@ private constructor(
79377957
private var result: JsonField<DeclineResult>? = null
79387958
private var ruleResults: JsonField<MutableList<RuleResult>>? = null
79397959
private var type: JsonField<Type>? = null
7960+
private var accountType: JsonField<Type> = JsonMissing.of()
79407961
private var networkSpecificData: JsonField<NetworkSpecificData> = JsonMissing.of()
79417962
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
79427963

@@ -7952,6 +7973,7 @@ private constructor(
79527973
result = transactionEvent.result
79537974
ruleResults = transactionEvent.ruleResults.map { it.toMutableList() }
79547975
type = transactionEvent.type
7976+
accountType = transactionEvent.accountType
79557977
networkSpecificData = transactionEvent.networkSpecificData
79567978
additionalProperties = transactionEvent.additionalProperties.toMutableMap()
79577979
}
@@ -8124,6 +8146,17 @@ private constructor(
81248146
*/
81258147
fun type(type: JsonField<Type>) = apply { this.type = type }
81268148

8149+
fun accountType(accountType: Type) = accountType(JsonField.of(accountType))
8150+
8151+
/**
8152+
* Sets [Builder.accountType] to an arbitrary JSON value.
8153+
*
8154+
* You should usually call [Builder.accountType] with a well-typed [Type] value instead.
8155+
* This method is primarily for setting the field to an undocumented or not yet
8156+
* supported value.
8157+
*/
8158+
fun accountType(accountType: JsonField<Type>) = apply { this.accountType = accountType }
8159+
81278160
fun networkSpecificData(networkSpecificData: NetworkSpecificData) =
81288161
networkSpecificData(JsonField.of(networkSpecificData))
81298162

@@ -8190,6 +8223,7 @@ private constructor(
81908223
checkRequired("result", result),
81918224
checkRequired("ruleResults", ruleResults).map { it.toImmutable() },
81928225
checkRequired("type", type),
8226+
accountType,
81938227
networkSpecificData,
81948228
additionalProperties.toMutableMap(),
81958229
)
@@ -8212,6 +8246,7 @@ private constructor(
82128246
result().validate()
82138247
ruleResults().forEach { it.validate() }
82148248
type().validate()
8249+
accountType().ifPresent { it.validate() }
82158250
networkSpecificData().ifPresent { it.validate() }
82168251
validated = true
82178252
}
@@ -8242,6 +8277,7 @@ private constructor(
82428277
(result.asKnown().getOrNull()?.validity() ?: 0) +
82438278
(ruleResults.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
82448279
(type.asKnown().getOrNull()?.validity() ?: 0) +
8280+
(accountType.asKnown().getOrNull()?.validity() ?: 0) +
82458281
(networkSpecificData.asKnown().getOrNull()?.validity() ?: 0)
82468282

82478283
class TransactionEventAmounts
@@ -12465,6 +12501,133 @@ private constructor(
1246512501
override fun toString() = value.toString()
1246612502
}
1246712503

12504+
class Type @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
12505+
12506+
/**
12507+
* Returns this class instance's raw value.
12508+
*
12509+
* This is usually only useful if this instance was deserialized from data that doesn't
12510+
* match any known member, and you want to know that value. For example, if the SDK is
12511+
* on an older version than the API, then the API may respond with new members that the
12512+
* SDK is unaware of.
12513+
*/
12514+
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
12515+
12516+
companion object {
12517+
12518+
@JvmField val CHECKING = of("CHECKING")
12519+
12520+
@JvmField val SAVINGS = of("SAVINGS")
12521+
12522+
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
12523+
}
12524+
12525+
/** An enum containing [Type]'s known values. */
12526+
enum class Known {
12527+
CHECKING,
12528+
SAVINGS,
12529+
}
12530+
12531+
/**
12532+
* An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
12533+
*
12534+
* An instance of [Type] can contain an unknown value in a couple of cases:
12535+
* - It was deserialized from data that doesn't match any known member. For example, if
12536+
* the SDK is on an older version than the API, then the API may respond with new
12537+
* members that the SDK is unaware of.
12538+
* - It was constructed with an arbitrary value using the [of] method.
12539+
*/
12540+
enum class Value {
12541+
CHECKING,
12542+
SAVINGS,
12543+
/** An enum member indicating that [Type] was instantiated with an unknown value. */
12544+
_UNKNOWN,
12545+
}
12546+
12547+
/**
12548+
* Returns an enum member corresponding to this class instance's value, or
12549+
* [Value._UNKNOWN] if the class was instantiated with an unknown value.
12550+
*
12551+
* Use the [known] method instead if you're certain the value is always known or if you
12552+
* want to throw for the unknown case.
12553+
*/
12554+
fun value(): Value =
12555+
when (this) {
12556+
CHECKING -> Value.CHECKING
12557+
SAVINGS -> Value.SAVINGS
12558+
else -> Value._UNKNOWN
12559+
}
12560+
12561+
/**
12562+
* Returns an enum member corresponding to this class instance's value.
12563+
*
12564+
* Use the [value] method instead if you're uncertain the value is always known and
12565+
* don't want to throw for the unknown case.
12566+
*
12567+
* @throws LithicInvalidDataException if this class instance's value is a not a known
12568+
* member.
12569+
*/
12570+
fun known(): Known =
12571+
when (this) {
12572+
CHECKING -> Known.CHECKING
12573+
SAVINGS -> Known.SAVINGS
12574+
else -> throw LithicInvalidDataException("Unknown Type: $value")
12575+
}
12576+
12577+
/**
12578+
* Returns this class instance's primitive wire representation.
12579+
*
12580+
* This differs from the [toString] method because that method is primarily for
12581+
* debugging and generally doesn't throw.
12582+
*
12583+
* @throws LithicInvalidDataException if this class instance's value does not have the
12584+
* expected primitive type.
12585+
*/
12586+
fun asString(): String =
12587+
_value().asString().orElseThrow {
12588+
LithicInvalidDataException("Value is not a String")
12589+
}
12590+
12591+
private var validated: Boolean = false
12592+
12593+
fun validate(): Type = apply {
12594+
if (validated) {
12595+
return@apply
12596+
}
12597+
12598+
known()
12599+
validated = true
12600+
}
12601+
12602+
fun isValid(): Boolean =
12603+
try {
12604+
validate()
12605+
true
12606+
} catch (e: LithicInvalidDataException) {
12607+
false
12608+
}
12609+
12610+
/**
12611+
* Returns a score indicating how many valid values are contained in this object
12612+
* recursively.
12613+
*
12614+
* Used for best match union deserialization.
12615+
*/
12616+
@JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
12617+
12618+
override fun equals(other: Any?): Boolean {
12619+
if (this === other) {
12620+
return true
12621+
}
12622+
12623+
return /* spotless:off */ other is Type && value == other.value /* spotless:on */
12624+
}
12625+
12626+
override fun hashCode() = value.hashCode()
12627+
12628+
override fun toString() = value.toString()
12629+
}
12630+
1246812631
class NetworkSpecificData
1246912632
private constructor(
1247012633
private val mastercard: JsonField<MastercardNetworkSpecificData>,
@@ -13466,17 +13629,17 @@ private constructor(
1346613629
return true
1346713630
}
1346813631

13469-
return /* spotless:off */ other is TransactionEvent && token == other.token && amount == other.amount && amounts == other.amounts && created == other.created && detailedResults == other.detailedResults && effectivePolarity == other.effectivePolarity && networkInfo == other.networkInfo && result == other.result && ruleResults == other.ruleResults && type == other.type && networkSpecificData == other.networkSpecificData && additionalProperties == other.additionalProperties /* spotless:on */
13632+
return /* spotless:off */ other is TransactionEvent && token == other.token && amount == other.amount && amounts == other.amounts && created == other.created && detailedResults == other.detailedResults && effectivePolarity == other.effectivePolarity && networkInfo == other.networkInfo && result == other.result && ruleResults == other.ruleResults && type == other.type && accountType == other.accountType && networkSpecificData == other.networkSpecificData && additionalProperties == other.additionalProperties /* spotless:on */
1347013633
}
1347113634

1347213635
/* spotless:off */
13473-
private val hashCode: Int by lazy { Objects.hash(token, amount, amounts, created, detailedResults, effectivePolarity, networkInfo, result, ruleResults, type, networkSpecificData, additionalProperties) }
13636+
private val hashCode: Int by lazy { Objects.hash(token, amount, amounts, created, detailedResults, effectivePolarity, networkInfo, result, ruleResults, type, accountType, networkSpecificData, additionalProperties) }
1347413637
/* spotless:on */
1347513638

1347613639
override fun hashCode(): Int = hashCode
1347713640

1347813641
override fun toString() =
13479-
"TransactionEvent{token=$token, amount=$amount, amounts=$amounts, created=$created, detailedResults=$detailedResults, effectivePolarity=$effectivePolarity, networkInfo=$networkInfo, result=$result, ruleResults=$ruleResults, type=$type, networkSpecificData=$networkSpecificData, additionalProperties=$additionalProperties}"
13642+
"TransactionEvent{token=$token, amount=$amount, amounts=$amounts, created=$created, detailedResults=$detailedResults, effectivePolarity=$effectivePolarity, networkInfo=$networkInfo, result=$result, ruleResults=$ruleResults, type=$type, accountType=$accountType, networkSpecificData=$networkSpecificData, additionalProperties=$additionalProperties}"
1348013643
}
1348113644

1348213645
override fun equals(other: Any?): Boolean {

lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionListPageResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ internal class TransactionListPageResponseTest {
238238
.build()
239239
)
240240
.type(Transaction.TransactionEvent.Type.CLEARING)
241+
.accountType(Transaction.TransactionEvent.Type.CHECKING)
241242
.networkSpecificData(
242243
Transaction.TransactionEvent.NetworkSpecificData.builder()
243244
.mastercard(
@@ -483,6 +484,7 @@ internal class TransactionListPageResponseTest {
483484
.build()
484485
)
485486
.type(Transaction.TransactionEvent.Type.CLEARING)
487+
.accountType(Transaction.TransactionEvent.Type.CHECKING)
486488
.networkSpecificData(
487489
Transaction.TransactionEvent.NetworkSpecificData.builder()
488490
.mastercard(
@@ -747,6 +749,7 @@ internal class TransactionListPageResponseTest {
747749
.build()
748750
)
749751
.type(Transaction.TransactionEvent.Type.CLEARING)
752+
.accountType(Transaction.TransactionEvent.Type.CHECKING)
750753
.networkSpecificData(
751754
Transaction.TransactionEvent.NetworkSpecificData.builder()
752755
.mastercard(

lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ internal class TransactionTest {
210210
.build()
211211
)
212212
.type(Transaction.TransactionEvent.Type.CLEARING)
213+
.accountType(Transaction.TransactionEvent.Type.CHECKING)
213214
.networkSpecificData(
214215
Transaction.TransactionEvent.NetworkSpecificData.builder()
215216
.mastercard(
@@ -441,6 +442,7 @@ internal class TransactionTest {
441442
.build()
442443
)
443444
.type(Transaction.TransactionEvent.Type.CLEARING)
445+
.accountType(Transaction.TransactionEvent.Type.CHECKING)
444446
.networkSpecificData(
445447
Transaction.TransactionEvent.NetworkSpecificData.builder()
446448
.mastercard(
@@ -674,6 +676,7 @@ internal class TransactionTest {
674676
.build()
675677
)
676678
.type(Transaction.TransactionEvent.Type.CLEARING)
679+
.accountType(Transaction.TransactionEvent.Type.CHECKING)
677680
.networkSpecificData(
678681
Transaction.TransactionEvent.NetworkSpecificData.builder()
679682
.mastercard(

0 commit comments

Comments
 (0)