Skip to content

Commit ac8eabd

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
docs: builder, enum, and union comments (#467)
1 parent 2e98bdf commit ac8eabd

File tree

266 files changed

+11325
-0
lines changed

Some content is hidden

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

266 files changed

+11325
-0
lines changed

lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class LithicOkHttpClient private constructor() {
2222
@JvmStatic fun fromEnv(): LithicClient = builder().fromEnv().build()
2323
}
2424

25+
/** A builder for [LithicOkHttpClient]. */
2526
class Builder internal constructor() {
2627

2728
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()

lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class LithicOkHttpClientAsync private constructor() {
2222
@JvmStatic fun fromEnv(): LithicClientAsync = builder().fromEnv().build()
2323
}
2424

25+
/** A builder for [LithicOkHttpClientAsync]. */
2526
class Builder internal constructor() {
2627

2728
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private constructor(
3939
@JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build()
4040
}
4141

42+
/** A builder for [ClientOptions]. */
4243
class Builder internal constructor() {
4344

4445
private var httpClient: HttpClient? = null

lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicError.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private constructor(
3030
@JvmStatic fun builder() = Builder()
3131
}
3232

33+
/** A builder for [LithicError]. */
3334
class Builder internal constructor() {
3435

3536
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ private constructor(
188188
@JvmStatic fun builder() = Builder()
189189
}
190190

191+
/** A builder for [Account]. */
191192
class Builder internal constructor() {
192193

193194
private var token: JsonField<String>? = null
@@ -448,6 +449,7 @@ private constructor(
448449
@JvmStatic fun builder() = Builder()
449450
}
450451

452+
/** A builder for [SpendLimit]. */
451453
class Builder internal constructor() {
452454

453455
private var daily: JsonField<Long>? = null
@@ -543,6 +545,14 @@ private constructor(
543545
private val value: JsonField<String>,
544546
) : Enum {
545547

548+
/**
549+
* Returns this class instance's raw value.
550+
*
551+
* This is usually only useful if this instance was deserialized from data that doesn't
552+
* match any known member, and you want to know that value. For example, if the SDK is on an
553+
* older version than the API, then the API may respond with new members that the SDK is
554+
* unaware of.
555+
*/
546556
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
547557

548558
companion object {
@@ -556,19 +566,37 @@ private constructor(
556566
@JvmStatic fun of(value: String) = State(JsonField.of(value))
557567
}
558568

569+
/** An enum containing [State]'s known values. */
559570
enum class Known {
560571
ACTIVE,
561572
PAUSED,
562573
CLOSED,
563574
}
564575

576+
/**
577+
* An enum containing [State]'s known values, as well as an [_UNKNOWN] member.
578+
*
579+
* An instance of [State] can contain an unknown value in a couple of cases:
580+
* - It was deserialized from data that doesn't match any known member. For example, if the
581+
* SDK is on an older version than the API, then the API may respond with new members that
582+
* the SDK is unaware of.
583+
* - It was constructed with an arbitrary value using the [of] method.
584+
*/
565585
enum class Value {
566586
ACTIVE,
567587
PAUSED,
568588
CLOSED,
589+
/** An enum member indicating that [State] was instantiated with an unknown value. */
569590
_UNKNOWN,
570591
}
571592

593+
/**
594+
* Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
595+
* if the class was instantiated with an unknown value.
596+
*
597+
* Use the [known] method instead if you're certain the value is always known or if you want
598+
* to throw for the unknown case.
599+
*/
572600
fun value(): Value =
573601
when (this) {
574602
ACTIVE -> Value.ACTIVE
@@ -577,6 +605,15 @@ private constructor(
577605
else -> Value._UNKNOWN
578606
}
579607

608+
/**
609+
* Returns an enum member corresponding to this class instance's value.
610+
*
611+
* Use the [value] method instead if you're uncertain the value is always known and don't
612+
* want to throw for the unknown case.
613+
*
614+
* @throws LithicInvalidDataException if this class instance's value is a not a known
615+
* member.
616+
*/
580617
fun known(): Known =
581618
when (this) {
582619
ACTIVE -> Known.ACTIVE
@@ -682,6 +719,7 @@ private constructor(
682719
@JvmStatic fun builder() = Builder()
683720
}
684721

722+
/** A builder for [AccountHolder]. */
685723
class Builder internal constructor() {
686724

687725
private var token: JsonField<String>? = null
@@ -887,6 +925,7 @@ private constructor(
887925
@JvmStatic fun builder() = Builder()
888926
}
889927

928+
/** A builder for [VerificationAddress]. */
890929
class Builder internal constructor() {
891930

892931
private var address1: JsonField<String>? = null

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ private constructor(
1414
private val value: JsonField<String>,
1515
) : Enum {
1616

17+
/**
18+
* Returns this class instance's raw value.
19+
*
20+
* This is usually only useful if this instance was deserialized from data that doesn't match
21+
* any known member, and you want to know that value. For example, if the SDK is on an older
22+
* version than the API, then the API may respond with new members that the SDK is unaware of.
23+
*/
1724
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
1825

1926
companion object {
@@ -25,24 +32,55 @@ private constructor(
2532
@JvmStatic fun of(value: String) = AccountFinancialAccountType(JsonField.of(value))
2633
}
2734

35+
/** An enum containing [AccountFinancialAccountType]'s known values. */
2836
enum class Known {
2937
ISSUING,
3038
OPERATING,
3139
}
3240

41+
/**
42+
* An enum containing [AccountFinancialAccountType]'s known values, as well as an [_UNKNOWN]
43+
* member.
44+
*
45+
* An instance of [AccountFinancialAccountType] can contain an unknown value in a couple of
46+
* cases:
47+
* - It was deserialized from data that doesn't match any known member. For example, if the SDK
48+
* is on an older version than the API, then the API may respond with new members that the SDK
49+
* is unaware of.
50+
* - It was constructed with an arbitrary value using the [of] method.
51+
*/
3352
enum class Value {
3453
ISSUING,
3554
OPERATING,
55+
/**
56+
* An enum member indicating that [AccountFinancialAccountType] was instantiated with an
57+
* unknown value.
58+
*/
3659
_UNKNOWN,
3760
}
3861

62+
/**
63+
* Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if
64+
* the class was instantiated with an unknown value.
65+
*
66+
* Use the [known] method instead if you're certain the value is always known or if you want to
67+
* throw for the unknown case.
68+
*/
3969
fun value(): Value =
4070
when (this) {
4171
ISSUING -> Value.ISSUING
4272
OPERATING -> Value.OPERATING
4373
else -> Value._UNKNOWN
4474
}
4575

76+
/**
77+
* Returns an enum member corresponding to this class instance's value.
78+
*
79+
* Use the [value] method instead if you're uncertain the value is always known and don't want
80+
* to throw for the unknown case.
81+
*
82+
* @throws LithicInvalidDataException if this class instance's value is a not a known member.
83+
*/
4684
fun known(): Known =
4785
when (this) {
4886
ISSUING -> Known.ISSUING

0 commit comments

Comments
 (0)