Skip to content

Commit 8afd29c

Browse files
feat(client): update enum asX methods (#487)
1 parent 7d8bf1b commit 8afd29c

118 files changed

Lines changed: 3338 additions & 290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,17 @@ private constructor(
618618
else -> throw LithicInvalidDataException("Unknown State: $value")
619619
}
620620

621-
fun asString(): String = _value().asStringOrThrow()
621+
/**
622+
* Returns this class instance's primitive wire representation.
623+
*
624+
* This differs from the [toString] method because that method is primarily for debugging
625+
* and generally doesn't throw.
626+
*
627+
* @throws LithicInvalidDataException if this class instance's value does not have the
628+
* expected primitive type.
629+
*/
630+
fun asString(): String =
631+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
622632

623633
override fun equals(other: Any?): Boolean {
624634
if (this === other) {

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@ private constructor(private val value: JsonField<String>) : Enum {
8686
else -> throw LithicInvalidDataException("Unknown AccountFinancialAccountType: $value")
8787
}
8888

89-
fun asString(): String = _value().asStringOrThrow()
89+
/**
90+
* Returns this class instance's primitive wire representation.
91+
*
92+
* This differs from the [toString] method because that method is primarily for debugging and
93+
* generally doesn't throw.
94+
*
95+
* @throws LithicInvalidDataException if this class instance's value does not have the expected
96+
* primitive type.
97+
*/
98+
fun asString(): String =
99+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
90100

91101
override fun equals(other: Any?): Boolean {
92102
if (this === other) {

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

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,17 @@ private constructor(
14301430
else -> throw LithicInvalidDataException("Unknown ExemptionType: $value")
14311431
}
14321432

1433-
fun asString(): String = _value().asStringOrThrow()
1433+
/**
1434+
* Returns this class instance's primitive wire representation.
1435+
*
1436+
* This differs from the [toString] method because that method is primarily for debugging
1437+
* and generally doesn't throw.
1438+
*
1439+
* @throws LithicInvalidDataException if this class instance's value does not have the
1440+
* expected primitive type.
1441+
*/
1442+
fun asString(): String =
1443+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
14341444

14351445
override fun equals(other: Any?): Boolean {
14361446
if (this === other) {
@@ -1544,7 +1554,17 @@ private constructor(
15441554
else -> throw LithicInvalidDataException("Unknown Status: $value")
15451555
}
15461556

1547-
fun asString(): String = _value().asStringOrThrow()
1557+
/**
1558+
* Returns this class instance's primitive wire representation.
1559+
*
1560+
* This differs from the [toString] method because that method is primarily for debugging
1561+
* and generally doesn't throw.
1562+
*
1563+
* @throws LithicInvalidDataException if this class instance's value does not have the
1564+
* expected primitive type.
1565+
*/
1566+
fun asString(): String =
1567+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
15481568

15491569
override fun equals(other: Any?): Boolean {
15501570
if (this === other) {
@@ -1689,7 +1709,17 @@ private constructor(
16891709
else -> throw LithicInvalidDataException("Unknown StatusReason: $value")
16901710
}
16911711

1692-
fun asString(): String = _value().asStringOrThrow()
1712+
/**
1713+
* Returns this class instance's primitive wire representation.
1714+
*
1715+
* This differs from the [toString] method because that method is primarily for debugging
1716+
* and generally doesn't throw.
1717+
*
1718+
* @throws LithicInvalidDataException if this class instance's value does not have the
1719+
* expected primitive type.
1720+
*/
1721+
fun asString(): String =
1722+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
16931723

16941724
override fun equals(other: Any?): Boolean {
16951725
if (this === other) {
@@ -1783,7 +1813,17 @@ private constructor(
17831813
else -> throw LithicInvalidDataException("Unknown UserType: $value")
17841814
}
17851815

1786-
fun asString(): String = _value().asStringOrThrow()
1816+
/**
1817+
* Returns this class instance's primitive wire representation.
1818+
*
1819+
* This differs from the [toString] method because that method is primarily for debugging
1820+
* and generally doesn't throw.
1821+
*
1822+
* @throws LithicInvalidDataException if this class instance's value does not have the
1823+
* expected primitive type.
1824+
*/
1825+
fun asString(): String =
1826+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
17871827

17881828
override fun equals(other: Any?): Boolean {
17891829
if (this === other) {
@@ -2084,7 +2124,19 @@ private constructor(
20842124
else -> throw LithicInvalidDataException("Unknown Status: $value")
20852125
}
20862126

2087-
fun asString(): String = _value().asStringOrThrow()
2127+
/**
2128+
* Returns this class instance's primitive wire representation.
2129+
*
2130+
* This differs from the [toString] method because that method is primarily for
2131+
* debugging and generally doesn't throw.
2132+
*
2133+
* @throws LithicInvalidDataException if this class instance's value does not have the
2134+
* expected primitive type.
2135+
*/
2136+
fun asString(): String =
2137+
_value().asString().orElseThrow {
2138+
LithicInvalidDataException("Value is not a String")
2139+
}
20882140

20892141
override fun equals(other: Any?): Boolean {
20902142
if (this === other) {
@@ -2230,7 +2282,19 @@ private constructor(
22302282
else -> throw LithicInvalidDataException("Unknown StatusReason: $value")
22312283
}
22322284

2233-
fun asString(): String = _value().asStringOrThrow()
2285+
/**
2286+
* Returns this class instance's primitive wire representation.
2287+
*
2288+
* This differs from the [toString] method because that method is primarily for
2289+
* debugging and generally doesn't throw.
2290+
*
2291+
* @throws LithicInvalidDataException if this class instance's value does not have the
2292+
* expected primitive type.
2293+
*/
2294+
fun asString(): String =
2295+
_value().asString().orElseThrow {
2296+
LithicInvalidDataException("Value is not a String")
2297+
}
22342298

22352299
override fun equals(other: Any?): Boolean {
22362300
if (this === other) {

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,17 @@ private constructor(
402402
else -> throw LithicInvalidDataException("Unknown Status: $value")
403403
}
404404

405-
fun asString(): String = _value().asStringOrThrow()
405+
/**
406+
* Returns this class instance's primitive wire representation.
407+
*
408+
* This differs from the [toString] method because that method is primarily for debugging
409+
* and generally doesn't throw.
410+
*
411+
* @throws LithicInvalidDataException if this class instance's value does not have the
412+
* expected primitive type.
413+
*/
414+
fun asString(): String =
415+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
406416

407417
override fun equals(other: Any?): Boolean {
408418
if (this === other) {
@@ -676,7 +686,17 @@ private constructor(
676686
else -> throw LithicInvalidDataException("Unknown StatusReasons: $value")
677687
}
678688

679-
fun asString(): String = _value().asStringOrThrow()
689+
/**
690+
* Returns this class instance's primitive wire representation.
691+
*
692+
* This differs from the [toString] method because that method is primarily for debugging
693+
* and generally doesn't throw.
694+
*
695+
* @throws LithicInvalidDataException if this class instance's value does not have the
696+
* expected primitive type.
697+
*/
698+
fun asString(): String =
699+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
680700

681701
override fun equals(other: Any?): Boolean {
682702
if (this === other) {

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,17 @@ private constructor(
572572
else -> throw LithicInvalidDataException("Unknown Status: $value")
573573
}
574574

575-
fun asString(): String = _value().asStringOrThrow()
575+
/**
576+
* Returns this class instance's primitive wire representation.
577+
*
578+
* This differs from the [toString] method because that method is primarily for debugging
579+
* and generally doesn't throw.
580+
*
581+
* @throws LithicInvalidDataException if this class instance's value does not have the
582+
* expected primitive type.
583+
*/
584+
fun asString(): String =
585+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
576586

577587
override fun equals(other: Any?): Boolean {
578588
if (this === other) {
@@ -727,7 +737,17 @@ private constructor(
727737
throw LithicInvalidDataException("Unknown DocumentUploadStatusReasons: $value")
728738
}
729739

730-
fun asString(): String = _value().asStringOrThrow()
740+
/**
741+
* Returns this class instance's primitive wire representation.
742+
*
743+
* This differs from the [toString] method because that method is primarily for debugging
744+
* and generally doesn't throw.
745+
*
746+
* @throws LithicInvalidDataException if this class instance's value does not have the
747+
* expected primitive type.
748+
*/
749+
fun asString(): String =
750+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
731751

732752
override fun equals(other: Any?): Boolean {
733753
if (this === other) {

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,17 @@ private constructor(
517517
else -> throw LithicInvalidDataException("Unknown Status: $value")
518518
}
519519

520-
fun asString(): String = _value().asStringOrThrow()
520+
/**
521+
* Returns this class instance's primitive wire representation.
522+
*
523+
* This differs from the [toString] method because that method is primarily for debugging
524+
* and generally doesn't throw.
525+
*
526+
* @throws LithicInvalidDataException if this class instance's value does not have the
527+
* expected primitive type.
528+
*/
529+
fun asString(): String =
530+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
521531

522532
override fun equals(other: Any?): Boolean {
523533
if (this === other) {
@@ -763,7 +773,17 @@ private constructor(
763773
else -> throw LithicInvalidDataException("Unknown StatusReason: $value")
764774
}
765775

766-
fun asString(): String = _value().asStringOrThrow()
776+
/**
777+
* Returns this class instance's primitive wire representation.
778+
*
779+
* This differs from the [toString] method because that method is primarily for debugging
780+
* and generally doesn't throw.
781+
*
782+
* @throws LithicInvalidDataException if this class instance's value does not have the
783+
* expected primitive type.
784+
*/
785+
fun asString(): String =
786+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
767787

768788
override fun equals(other: Any?): Boolean {
769789
if (this === other) {

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

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,17 @@ private constructor(
19721972
else -> throw LithicInvalidDataException("Unknown ExemptionType: $value")
19731973
}
19741974

1975-
fun asString(): String = _value().asStringOrThrow()
1975+
/**
1976+
* Returns this class instance's primitive wire representation.
1977+
*
1978+
* This differs from the [toString] method because that method is primarily for debugging
1979+
* and generally doesn't throw.
1980+
*
1981+
* @throws LithicInvalidDataException if this class instance's value does not have the
1982+
* expected primitive type.
1983+
*/
1984+
fun asString(): String =
1985+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
19761986

19771987
override fun equals(other: Any?): Boolean {
19781988
if (this === other) {
@@ -2080,7 +2090,17 @@ private constructor(
20802090
else -> throw LithicInvalidDataException("Unknown Status: $value")
20812091
}
20822092

2083-
fun asString(): String = _value().asStringOrThrow()
2093+
/**
2094+
* Returns this class instance's primitive wire representation.
2095+
*
2096+
* This differs from the [toString] method because that method is primarily for debugging
2097+
* and generally doesn't throw.
2098+
*
2099+
* @throws LithicInvalidDataException if this class instance's value does not have the
2100+
* expected primitive type.
2101+
*/
2102+
fun asString(): String =
2103+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
20842104

20852105
override fun equals(other: Any?): Boolean {
20862106
if (this === other) {
@@ -2354,7 +2374,17 @@ private constructor(
23542374
else -> throw LithicInvalidDataException("Unknown StatusReasons: $value")
23552375
}
23562376

2357-
fun asString(): String = _value().asStringOrThrow()
2377+
/**
2378+
* Returns this class instance's primitive wire representation.
2379+
*
2380+
* This differs from the [toString] method because that method is primarily for debugging
2381+
* and generally doesn't throw.
2382+
*
2383+
* @throws LithicInvalidDataException if this class instance's value does not have the
2384+
* expected primitive type.
2385+
*/
2386+
fun asString(): String =
2387+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
23582388

23592389
override fun equals(other: Any?): Boolean {
23602390
if (this === other) {
@@ -2451,7 +2481,17 @@ private constructor(
24512481
else -> throw LithicInvalidDataException("Unknown UserType: $value")
24522482
}
24532483

2454-
fun asString(): String = _value().asStringOrThrow()
2484+
/**
2485+
* Returns this class instance's primitive wire representation.
2486+
*
2487+
* This differs from the [toString] method because that method is primarily for debugging
2488+
* and generally doesn't throw.
2489+
*
2490+
* @throws LithicInvalidDataException if this class instance's value does not have the
2491+
* expected primitive type.
2492+
*/
2493+
fun asString(): String =
2494+
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
24552495

24562496
override fun equals(other: Any?): Boolean {
24572497
if (this === other) {
@@ -2739,7 +2779,19 @@ private constructor(
27392779
else -> throw LithicInvalidDataException("Unknown Status: $value")
27402780
}
27412781

2742-
fun asString(): String = _value().asStringOrThrow()
2782+
/**
2783+
* Returns this class instance's primitive wire representation.
2784+
*
2785+
* This differs from the [toString] method because that method is primarily for
2786+
* debugging and generally doesn't throw.
2787+
*
2788+
* @throws LithicInvalidDataException if this class instance's value does not have the
2789+
* expected primitive type.
2790+
*/
2791+
fun asString(): String =
2792+
_value().asString().orElseThrow {
2793+
LithicInvalidDataException("Value is not a String")
2794+
}
27432795

27442796
override fun equals(other: Any?): Boolean {
27452797
if (this === other) {
@@ -3016,7 +3068,19 @@ private constructor(
30163068
else -> throw LithicInvalidDataException("Unknown StatusReasons: $value")
30173069
}
30183070

3019-
fun asString(): String = _value().asStringOrThrow()
3071+
/**
3072+
* Returns this class instance's primitive wire representation.
3073+
*
3074+
* This differs from the [toString] method because that method is primarily for
3075+
* debugging and generally doesn't throw.
3076+
*
3077+
* @throws LithicInvalidDataException if this class instance's value does not have the
3078+
* expected primitive type.
3079+
*/
3080+
fun asString(): String =
3081+
_value().asString().orElseThrow {
3082+
LithicInvalidDataException("Value is not a String")
3083+
}
30203084

30213085
override fun equals(other: Any?): Boolean {
30223086
if (this === other) {

0 commit comments

Comments
 (0)