Skip to content

Commit f1f21d9

Browse files
feat(api): api update
1 parent f1f1119 commit f1f21d9

18 files changed

+1720
-1031
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 45
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-71150944bd4857b4e440c82129013be70c3493cf844b70b8f3e61ef963d04297.yml
3-
openapi_spec_hash: 258a53bb485ab17eef5736d88f4d8259
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-73c284d36c1ed2d9963fc733e421005fad76e559de8efe9baa6511a43dd72668.yml
3+
openapi_spec_hash: 1e58c4445919b71c77e5c7f16bd6fa7d
44
config_hash: 5146b12344dae76238940989dac1e8a0

finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.tryfinch.api.core.ExcludeMissing
1111
import com.tryfinch.api.core.JsonField
1212
import com.tryfinch.api.core.JsonMissing
1313
import com.tryfinch.api.core.JsonValue
14+
import com.tryfinch.api.core.checkRequired
1415
import com.tryfinch.api.errors.FinchInvalidDataException
1516
import java.util.Collections
1617
import java.util.Objects
@@ -74,15 +75,23 @@ private constructor(
7475

7576
companion object {
7677

77-
/** Returns a mutable builder for constructing an instance of [BenefitContribution]. */
78+
/**
79+
* Returns a mutable builder for constructing an instance of [BenefitContribution].
80+
*
81+
* The following fields are required:
82+
* ```java
83+
* .amount()
84+
* .type()
85+
* ```
86+
*/
7887
@JvmStatic fun builder() = Builder()
7988
}
8089

8190
/** A builder for [BenefitContribution]. */
8291
class Builder internal constructor() {
8392

84-
private var amount: JsonField<Long> = JsonMissing.of()
85-
private var type: JsonField<Type> = JsonMissing.of()
93+
private var amount: JsonField<Long>? = null
94+
private var type: JsonField<Type>? = null
8695
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
8796

8897
@JvmSynthetic
@@ -150,9 +159,21 @@ private constructor(
150159
* Returns an immutable instance of [BenefitContribution].
151160
*
152161
* Further updates to this [Builder] will not mutate the returned instance.
162+
*
163+
* The following fields are required:
164+
* ```java
165+
* .amount()
166+
* .type()
167+
* ```
168+
*
169+
* @throws IllegalStateException if any required field is unset.
153170
*/
154171
fun build(): BenefitContribution =
155-
BenefitContribution(amount, type, additionalProperties.toMutableMap())
172+
BenefitContribution(
173+
checkRequired("amount", amount),
174+
checkRequired("type", type),
175+
additionalProperties.toMutableMap(),
176+
)
156177
}
157178

158179
private var validated: Boolean = false

finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFrequency.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ class BenefitFrequency @JsonCreator private constructor(private val value: JsonF
2222

2323
companion object {
2424

25-
@JvmField val ONE_TIME = of("one_time")
26-
2725
@JvmField val EVERY_PAYCHECK = of("every_paycheck")
2826

2927
@JvmField val MONTHLY = of("monthly")
3028

29+
@JvmField val ONE_TIME = of("one_time")
30+
3131
@JvmStatic fun of(value: String) = BenefitFrequency(JsonField.of(value))
3232
}
3333

3434
/** An enum containing [BenefitFrequency]'s known values. */
3535
enum class Known {
36-
ONE_TIME,
3736
EVERY_PAYCHECK,
3837
MONTHLY,
38+
ONE_TIME,
3939
}
4040

4141
/**
@@ -48,9 +48,9 @@ class BenefitFrequency @JsonCreator private constructor(private val value: JsonF
4848
* - It was constructed with an arbitrary value using the [of] method.
4949
*/
5050
enum class Value {
51-
ONE_TIME,
5251
EVERY_PAYCHECK,
5352
MONTHLY,
53+
ONE_TIME,
5454
/**
5555
* An enum member indicating that [BenefitFrequency] was instantiated with an unknown value.
5656
*/
@@ -66,9 +66,9 @@ class BenefitFrequency @JsonCreator private constructor(private val value: JsonF
6666
*/
6767
fun value(): Value =
6868
when (this) {
69-
ONE_TIME -> Value.ONE_TIME
7069
EVERY_PAYCHECK -> Value.EVERY_PAYCHECK
7170
MONTHLY -> Value.MONTHLY
71+
ONE_TIME -> Value.ONE_TIME
7272
else -> Value._UNKNOWN
7373
}
7474

@@ -82,9 +82,9 @@ class BenefitFrequency @JsonCreator private constructor(private val value: JsonF
8282
*/
8383
fun known(): Known =
8484
when (this) {
85-
ONE_TIME -> Known.ONE_TIME
8685
EVERY_PAYCHECK -> Known.EVERY_PAYCHECK
8786
MONTHLY -> Known.MONTHLY
87+
ONE_TIME -> Known.ONE_TIME
8888
else -> throw FinchInvalidDataException("Unknown BenefitFrequency: $value")
8989
}
9090

0 commit comments

Comments
 (0)