Skip to content

Commit 842bb3f

Browse files
feat(api): api update (#523)
1 parent c7265b7 commit 842bb3f

20 files changed

+241
-554
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: 40
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-df94542d153a8558bbe63b273e8d6ae79f46b8d81df1ebeeacd07fee6f9ee22a.yml
3-
openapi_spec_hash: aeb92e382ee0a9b86e2ba39e54cdfe9a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-972e563922dedeeb94dca9a3ca8bac536488fcee56b55fcf09e6af044d3740e3.yml
3+
openapi_spec_hash: 08b86ecbec3323717d48e4aaee48ed54
44
config_hash: 8303e755d3e16cf28542d5f0aec83851

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.tryfinch.api.core.Enum
77
import com.tryfinch.api.core.JsonField
88
import com.tryfinch.api.errors.FinchInvalidDataException
99

10+
/** The frequency of the benefit deduction/contribution. */
1011
class BenefitFrequency @JsonCreator private constructor(private val value: JsonField<String>) :
1112
Enum {
1213

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ private constructor(
3939
) : this(benefitId, description, frequency, type, mutableMapOf())
4040

4141
/**
42+
* The id of the benefit.
43+
*
4244
* @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
4345
* missing or null (e.g. if the server responded with an unexpected value).
4446
*/
@@ -52,6 +54,8 @@ private constructor(
5254
Optional.ofNullable(description.getNullable("description"))
5355

5456
/**
57+
* The frequency of the benefit deduction/contribution.
58+
*
5559
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
5660
* server responded with an unexpected value).
5761
*/
@@ -142,6 +146,7 @@ private constructor(
142146
additionalProperties = companyBenefit.additionalProperties.toMutableMap()
143147
}
144148

149+
/** The id of the benefit. */
145150
fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId))
146151

147152
/**
@@ -167,6 +172,7 @@ private constructor(
167172
*/
168173
fun description(description: JsonField<String>) = apply { this.description = description }
169174

175+
/** The frequency of the benefit deduction/contribution. */
170176
fun frequency(frequency: BenefitFrequency?) = frequency(JsonField.ofNullable(frequency))
171177

172178
/** Alias for calling [Builder.frequency] with `frequency.orElse(null)`. */

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ private constructor(
2727
) : this(benefitId, mutableMapOf())
2828

2929
/**
30+
* The id of the benefit.
31+
*
3032
* @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
3133
* missing or null (e.g. if the server responded with an unexpected value).
3234
*/
@@ -77,6 +79,7 @@ private constructor(
7779
additionalProperties = createCompanyBenefitsResponse.additionalProperties.toMutableMap()
7880
}
7981

82+
/** The id of the benefit. */
8083
fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId))
8184

8285
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private constructor(
224224
) : this(finchCode, message, name, mutableMapOf())
225225

226226
/**
227-
* A descriptive identifier for the response
227+
* A descriptive identifier for the response.
228228
*
229229
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
230230
* server responded with an unexpected value).
@@ -302,7 +302,7 @@ private constructor(
302302
additionalProperties = body.additionalProperties.toMutableMap()
303303
}
304304

305-
/** A descriptive identifier for the response */
305+
/** A descriptive identifier for the response. */
306306
fun finchCode(finchCode: String?) = finchCode(JsonField.ofNullable(finchCode))
307307

308308
/** Alias for calling [Builder.finchCode] with `finchCode.orElse(null)`. */

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ private constructor(
4040
fun description(): Optional<String> = body.description()
4141

4242
/**
43+
* The frequency of the benefit deduction/contribution.
44+
*
4345
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
4446
* server responded with an unexpected value).
4547
*/
@@ -119,6 +121,7 @@ private constructor(
119121
*/
120122
fun description(description: JsonField<String>) = apply { body.description(description) }
121123

124+
/** The frequency of the benefit deduction/contribution. */
122125
fun frequency(frequency: BenefitFrequency?) = apply { body.frequency(frequency) }
123126

124127
/** Alias for calling [Builder.frequency] with `frequency.orElse(null)`. */
@@ -314,6 +317,8 @@ private constructor(
314317
Optional.ofNullable(description.getNullable("description"))
315318

316319
/**
320+
* The frequency of the benefit deduction/contribution.
321+
*
317322
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
318323
* server responded with an unexpected value).
319324
*/
@@ -405,6 +410,7 @@ private constructor(
405410
this.description = description
406411
}
407412

413+
/** The frequency of the benefit deduction/contribution. */
408414
fun frequency(frequency: BenefitFrequency?) = frequency(JsonField.ofNullable(frequency))
409415

410416
/** Alias for calling [Builder.frequency] with `frequency.orElse(null)`. */

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private constructor(
2929

3030
fun response(): Response = response
3131

32-
fun items(): List<UnenrolledIndividual> = response().items()
32+
fun items(): List<IndividualUnenrollManyResponse> = response().items()
3333

3434
override fun equals(other: Any?): Boolean {
3535
if (this === other) {
@@ -69,19 +69,21 @@ private constructor(
6969
}
7070

7171
class Response(
72-
private val items: JsonField<List<UnenrolledIndividual>>,
72+
private val items: JsonField<List<IndividualUnenrollManyResponse>>,
7373
private val additionalProperties: MutableMap<String, JsonValue>,
7474
) {
7575

7676
@JsonCreator
7777
private constructor(
78-
@JsonProperty("items") items: JsonField<List<UnenrolledIndividual>> = JsonMissing.of()
78+
@JsonProperty("items")
79+
items: JsonField<List<IndividualUnenrollManyResponse>> = JsonMissing.of()
7980
) : this(items, mutableMapOf())
8081

81-
fun items(): List<UnenrolledIndividual> = items.getNullable("items") ?: listOf()
82+
fun items(): List<IndividualUnenrollManyResponse> = items.getNullable("items") ?: listOf()
8283

8384
@JsonProperty("items")
84-
fun _items(): Optional<JsonField<List<UnenrolledIndividual>>> = Optional.ofNullable(items)
85+
fun _items(): Optional<JsonField<List<IndividualUnenrollManyResponse>>> =
86+
Optional.ofNullable(items)
8587

8688
@JsonAnySetter
8789
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -138,7 +140,7 @@ private constructor(
138140

139141
class Builder {
140142

141-
private var items: JsonField<List<UnenrolledIndividual>> = JsonMissing.of()
143+
private var items: JsonField<List<IndividualUnenrollManyResponse>> = JsonMissing.of()
142144
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
143145

144146
@JvmSynthetic
@@ -147,9 +149,11 @@ private constructor(
147149
this.additionalProperties.putAll(page.additionalProperties)
148150
}
149151

150-
fun items(items: List<UnenrolledIndividual>) = items(JsonField.of(items))
152+
fun items(items: List<IndividualUnenrollManyResponse>) = items(JsonField.of(items))
151153

152-
fun items(items: JsonField<List<UnenrolledIndividual>>) = apply { this.items = items }
154+
fun items(items: JsonField<List<IndividualUnenrollManyResponse>>) = apply {
155+
this.items = items
156+
}
153157

154158
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
155159
this.additionalProperties.put(key, value)
@@ -165,9 +169,9 @@ private constructor(
165169
}
166170

167171
class AutoPager(private val firstPage: HrisBenefitIndividualUnenrollManyPage) :
168-
Iterable<UnenrolledIndividual> {
172+
Iterable<IndividualUnenrollManyResponse> {
169173

170-
override fun iterator(): Iterator<UnenrolledIndividual> = iterator {
174+
override fun iterator(): Iterator<IndividualUnenrollManyResponse> = iterator {
171175
var page = firstPage
172176
var index = 0
173177
while (true) {
@@ -179,7 +183,7 @@ private constructor(
179183
}
180184
}
181185

182-
fun stream(): Stream<UnenrolledIndividual> {
186+
fun stream(): Stream<IndividualUnenrollManyResponse> {
183187
return StreamSupport.stream(spliterator(), false)
184188
}
185189
}

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private constructor(
2929

3030
fun response(): Response = response
3131

32-
fun items(): List<UnenrolledIndividual> = response().items()
32+
fun items(): List<IndividualUnenrollManyResponse> = response().items()
3333

3434
override fun equals(other: Any?): Boolean {
3535
if (this === other) {
@@ -71,19 +71,21 @@ private constructor(
7171
}
7272

7373
class Response(
74-
private val items: JsonField<List<UnenrolledIndividual>>,
74+
private val items: JsonField<List<IndividualUnenrollManyResponse>>,
7575
private val additionalProperties: MutableMap<String, JsonValue>,
7676
) {
7777

7878
@JsonCreator
7979
private constructor(
80-
@JsonProperty("items") items: JsonField<List<UnenrolledIndividual>> = JsonMissing.of()
80+
@JsonProperty("items")
81+
items: JsonField<List<IndividualUnenrollManyResponse>> = JsonMissing.of()
8182
) : this(items, mutableMapOf())
8283

83-
fun items(): List<UnenrolledIndividual> = items.getNullable("items") ?: listOf()
84+
fun items(): List<IndividualUnenrollManyResponse> = items.getNullable("items") ?: listOf()
8485

8586
@JsonProperty("items")
86-
fun _items(): Optional<JsonField<List<UnenrolledIndividual>>> = Optional.ofNullable(items)
87+
fun _items(): Optional<JsonField<List<IndividualUnenrollManyResponse>>> =
88+
Optional.ofNullable(items)
8789

8890
@JsonAnySetter
8991
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -140,7 +142,7 @@ private constructor(
140142

141143
class Builder {
142144

143-
private var items: JsonField<List<UnenrolledIndividual>> = JsonMissing.of()
145+
private var items: JsonField<List<IndividualUnenrollManyResponse>> = JsonMissing.of()
144146
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
145147

146148
@JvmSynthetic
@@ -149,9 +151,11 @@ private constructor(
149151
this.additionalProperties.putAll(page.additionalProperties)
150152
}
151153

152-
fun items(items: List<UnenrolledIndividual>) = items(JsonField.of(items))
154+
fun items(items: List<IndividualUnenrollManyResponse>) = items(JsonField.of(items))
153155

154-
fun items(items: JsonField<List<UnenrolledIndividual>>) = apply { this.items = items }
156+
fun items(items: JsonField<List<IndividualUnenrollManyResponse>>) = apply {
157+
this.items = items
158+
}
155159

156160
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
157161
this.additionalProperties.put(key, value)
@@ -169,11 +173,11 @@ private constructor(
169173
class AutoPager(private val firstPage: HrisBenefitIndividualUnenrollManyPageAsync) {
170174

171175
fun forEach(
172-
action: Predicate<UnenrolledIndividual>,
176+
action: Predicate<IndividualUnenrollManyResponse>,
173177
executor: Executor,
174178
): CompletableFuture<Void> {
175179
fun CompletableFuture<Optional<HrisBenefitIndividualUnenrollManyPageAsync>>.forEach(
176-
action: (UnenrolledIndividual) -> Boolean,
180+
action: (IndividualUnenrollManyResponse) -> Boolean,
177181
executor: Executor,
178182
): CompletableFuture<Void> =
179183
thenComposeAsync(
@@ -189,8 +193,8 @@ private constructor(
189193
.forEach(action::test, executor)
190194
}
191195

192-
fun toList(executor: Executor): CompletableFuture<List<UnenrolledIndividual>> {
193-
val values = mutableListOf<UnenrolledIndividual>()
196+
fun toList(executor: Executor): CompletableFuture<List<IndividualUnenrollManyResponse>> {
197+
val values = mutableListOf<IndividualUnenrollManyResponse>()
194198
return forEach(values::add, executor).thenApply { values }
195199
}
196200
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ private constructor(
3434
) : this(benefitId, individualIds, mutableMapOf())
3535

3636
/**
37+
* The id of the benefit.
38+
*
3739
* @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
3840
* missing or null (e.g. if the server responded with an unexpected value).
3941
*/
@@ -102,6 +104,7 @@ private constructor(
102104
additionalProperties = individualEnrolledIdsResponse.additionalProperties.toMutableMap()
103105
}
104106

107+
/** The id of the benefit. */
105108
fun benefitId(benefitId: String) = benefitId(JsonField.of(benefitId))
106109

107110
/**

0 commit comments

Comments
 (0)