Skip to content

Commit 47ecda9

Browse files
feat(api): api update
1 parent 7d931e7 commit 47ecda9

File tree

89 files changed

+1919
-1262
lines changed

Some content is hidden

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

89 files changed

+1919
-1262
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-03a89ccdf10add981e714ad74c145cd3a2408bd0223108bbfe01cef4256ef7ed.yml
3-
openapi_spec_hash: 4179c69ca2f55a9fcfab41710a2f452c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml
3+
openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb
44
config_hash: 6d3585c0032e08d723d077d660fc8448

README.md

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ FinchClient client = FinchOkHttpClient.builder()
6060
.accessToken("My Access Token")
6161
.build();
6262

63-
HrisDirectoryListParams params = HrisDirectoryListParams.builder()
64-
.addEntityId("550e8400-e29b-41d4-a716-446655440000")
65-
.build();
66-
HrisDirectoryListPage page = client.hris().directory().list(params);
63+
HrisDirectoryListPage page = client.hris().directory().list();
6764
```
6865

6966
## Client configuration
@@ -169,10 +166,7 @@ FinchClient client = FinchOkHttpClient.builder()
169166
.accessToken("My Access Token")
170167
.build();
171168

172-
HrisDirectoryListParams params = HrisDirectoryListParams.builder()
173-
.addEntityId("550e8400-e29b-41d4-a716-446655440000")
174-
.build();
175-
CompletableFuture<HrisDirectoryListPageAsync> page = client.async().hris().directory().list(params);
169+
CompletableFuture<HrisDirectoryListPageAsync> page = client.async().hris().directory().list();
176170
```
177171

178172
Or create an asynchronous client from the beginning:
@@ -191,10 +185,7 @@ FinchClientAsync client = FinchOkHttpClientAsync.builder()
191185
.accessToken("My Access Token")
192186
.build();
193187

194-
HrisDirectoryListParams params = HrisDirectoryListParams.builder()
195-
.addEntityId("550e8400-e29b-41d4-a716-446655440000")
196-
.build();
197-
CompletableFuture<HrisDirectoryListPageAsync> page = client.hris().directory().list(params);
188+
CompletableFuture<HrisDirectoryListPageAsync> page = client.hris().directory().list();
198189
```
199190

200191
The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.
@@ -211,10 +202,7 @@ import com.tryfinch.api.core.http.HttpResponseFor;
211202
import com.tryfinch.api.models.HrisDirectoryListPage;
212203
import com.tryfinch.api.models.HrisDirectoryListParams;
213204

214-
HrisDirectoryListParams params = HrisDirectoryListParams.builder()
215-
.addEntityId("550e8400-e29b-41d4-a716-446655440000")
216-
.build();
217-
HttpResponseFor<HrisDirectoryListPage> page = client.hris().directory().withRawResponse().list(params);
205+
HttpResponseFor<HrisDirectoryListPage> page = client.hris().directory().withRawResponse().list();
218206

219207
int statusCode = page.statusCode();
220208
Headers headers = page.headers();
@@ -267,7 +255,7 @@ When using the synchronous client, the method returns an [`Iterable`](https://do
267255
import com.tryfinch.api.models.HrisDirectoryListPage;
268256
import com.tryfinch.api.models.IndividualInDirectory;
269257

270-
HrisDirectoryListPage page = client.hris().directory().list(params);
258+
HrisDirectoryListPage page = client.hris().directory().list();
271259

272260
// Process as an Iterable
273261
for (IndividualInDirectory directory : page.autoPager()) {
@@ -290,7 +278,7 @@ import com.tryfinch.api.models.IndividualInDirectory;
290278
import java.util.Optional;
291279
import java.util.concurrent.CompletableFuture;
292280

293-
CompletableFuture<HrisDirectoryListPageAsync> pageFuture = client.async().hris().directory().list(params);
281+
CompletableFuture<HrisDirectoryListPageAsync> pageFuture = client.async().hris().directory().list();
294282

295283
pageFuture.thenRun(page -> page.autoPager().subscribe(directory -> {
296284
System.out.println(directory);
@@ -339,7 +327,7 @@ To access individual page items and manually request the next page, use the `ite
339327
import com.tryfinch.api.models.HrisDirectoryListPage;
340328
import com.tryfinch.api.models.IndividualInDirectory;
341329

342-
HrisDirectoryListPage page = client.hris().directory().list(params);
330+
HrisDirectoryListPage page = client.hris().directory().list();
343331
while (true) {
344332
for (IndividualInDirectory directory : page.items()) {
345333
System.out.println(directory);
@@ -434,9 +422,7 @@ To set a custom timeout, configure the method call using the `timeout` method:
434422
```java
435423
import com.tryfinch.api.models.HrisDirectoryListPage;
436424

437-
HrisDirectoryListPage page = client.hris().directory().list(
438-
params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()
439-
);
425+
HrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
440426
```
441427

442428
Or configure the default for all method calls at the client level:
@@ -558,9 +544,7 @@ To set a documented parameter or property to an undocumented or not yet supporte
558544
```java
559545
import com.tryfinch.api.models.HrisDirectoryListParams;
560546

561-
HrisDirectoryListParams params = HrisDirectoryListParams.builder()
562-
.addEntityId("550e8400-e29b-41d4-a716-446655440000")
563-
.build();
547+
HrisDirectoryListParams params = HrisDirectoryListParams.builder().build();
564548
```
565549

566550
The most straightforward way to create a [`JsonValue`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt) is using its `from(...)` method:
@@ -608,10 +592,11 @@ To forcibly omit a required parameter or property, pass [`JsonMissing`](finch-ja
608592

609593
```java
610594
import com.tryfinch.api.core.JsonMissing;
595+
import com.tryfinch.api.models.AccessTokenCreateParams;
611596
import com.tryfinch.api.models.HrisDirectoryListParams;
612597

613-
HrisDirectoryListParams params = HrisDirectoryListParams.builder()
614-
.entityIds(JsonMissing.of())
598+
HrisDirectoryListParams params = AccessTokenCreateParams.builder()
599+
.code(JsonMissing.of())
615600
.build();
616601
```
617602

@@ -688,9 +673,7 @@ Or configure the method call to validate the response using the `responseValidat
688673
```java
689674
import com.tryfinch.api.models.HrisDirectoryListPage;
690675

691-
HrisDirectoryListPage page = client.hris().directory().list(
692-
params, RequestOptions.builder().responseValidation(true).build()
693-
);
676+
HrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().responseValidation(true).build());
694677
```
695678

696679
Or configure the default for all method calls at the client level:

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

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ import kotlin.jvm.optionals.getOrNull
2929
*/
3030
class HrisBenefitCreateParams
3131
private constructor(
32-
private val entityIds: List<String>,
32+
private val entityIds: List<String>?,
3333
private val body: Body,
3434
private val additionalHeaders: Headers,
3535
private val additionalQueryParams: QueryParams,
3636
) : Params {
3737

3838
/** The entity IDs to specify which entities' data to access. */
39-
fun entityIds(): List<String> = entityIds
39+
fun entityIds(): Optional<List<String>> = Optional.ofNullable(entityIds)
4040

4141
/**
4242
* The company match for this benefit.
@@ -114,14 +114,9 @@ private constructor(
114114

115115
companion object {
116116

117-
/**
118-
* Returns a mutable builder for constructing an instance of [HrisBenefitCreateParams].
119-
*
120-
* The following fields are required:
121-
* ```java
122-
* .entityIds()
123-
* ```
124-
*/
117+
@JvmStatic fun none(): HrisBenefitCreateParams = builder().build()
118+
119+
/** Returns a mutable builder for constructing an instance of [HrisBenefitCreateParams]. */
125120
@JvmStatic fun builder() = Builder()
126121
}
127122

@@ -135,17 +130,20 @@ private constructor(
135130

136131
@JvmSynthetic
137132
internal fun from(hrisBenefitCreateParams: HrisBenefitCreateParams) = apply {
138-
entityIds = hrisBenefitCreateParams.entityIds.toMutableList()
133+
entityIds = hrisBenefitCreateParams.entityIds?.toMutableList()
139134
body = hrisBenefitCreateParams.body.toBuilder()
140135
additionalHeaders = hrisBenefitCreateParams.additionalHeaders.toBuilder()
141136
additionalQueryParams = hrisBenefitCreateParams.additionalQueryParams.toBuilder()
142137
}
143138

144139
/** The entity IDs to specify which entities' data to access. */
145-
fun entityIds(entityIds: List<String>) = apply {
146-
this.entityIds = entityIds.toMutableList()
140+
fun entityIds(entityIds: List<String>?) = apply {
141+
this.entityIds = entityIds?.toMutableList()
147142
}
148143

144+
/** Alias for calling [Builder.entityIds] with `entityIds.orElse(null)`. */
145+
fun entityIds(entityIds: Optional<List<String>>) = entityIds(entityIds.getOrNull())
146+
149147
/**
150148
* Adds a single [String] to [entityIds].
151149
*
@@ -356,17 +354,10 @@ private constructor(
356354
* Returns an immutable instance of [HrisBenefitCreateParams].
357355
*
358356
* Further updates to this [Builder] will not mutate the returned instance.
359-
*
360-
* The following fields are required:
361-
* ```java
362-
* .entityIds()
363-
* ```
364-
*
365-
* @throws IllegalStateException if any required field is unset.
366357
*/
367358
fun build(): HrisBenefitCreateParams =
368359
HrisBenefitCreateParams(
369-
checkRequired("entityIds", entityIds).toImmutable(),
360+
entityIds?.toImmutable(),
370361
body.build(),
371362
additionalHeaders.build(),
372363
additionalQueryParams.build(),
@@ -380,7 +371,7 @@ private constructor(
380371
override fun _queryParams(): QueryParams =
381372
QueryParams.builder()
382373
.apply {
383-
entityIds.forEach { put("entity_ids[]", it) }
374+
entityIds?.forEach { put("entity_ids[]", it) }
384375
putAll(additionalQueryParams)
385376
}
386377
.build()

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

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package com.tryfinch.api.models
44

55
import com.tryfinch.api.core.Params
6-
import com.tryfinch.api.core.checkRequired
76
import com.tryfinch.api.core.http.Headers
87
import com.tryfinch.api.core.http.QueryParams
98
import com.tryfinch.api.core.toImmutable
@@ -15,15 +14,15 @@ import kotlin.jvm.optionals.getOrNull
1514
class HrisBenefitIndividualEnrolledIdsParams
1615
private constructor(
1716
private val benefitId: String?,
18-
private val entityIds: List<String>,
17+
private val entityIds: List<String>?,
1918
private val additionalHeaders: Headers,
2019
private val additionalQueryParams: QueryParams,
2120
) : Params {
2221

2322
fun benefitId(): Optional<String> = Optional.ofNullable(benefitId)
2423

2524
/** The entity IDs to specify which entities' data to access. */
26-
fun entityIds(): List<String> = entityIds
25+
fun entityIds(): Optional<List<String>> = Optional.ofNullable(entityIds)
2726

2827
/** Additional headers to send with the request. */
2928
fun _additionalHeaders(): Headers = additionalHeaders
@@ -35,14 +34,11 @@ private constructor(
3534

3635
companion object {
3736

37+
@JvmStatic fun none(): HrisBenefitIndividualEnrolledIdsParams = builder().build()
38+
3839
/**
3940
* Returns a mutable builder for constructing an instance of
4041
* [HrisBenefitIndividualEnrolledIdsParams].
41-
*
42-
* The following fields are required:
43-
* ```java
44-
* .entityIds()
45-
* ```
4642
*/
4743
@JvmStatic fun builder() = Builder()
4844
}
@@ -60,7 +56,7 @@ private constructor(
6056
hrisBenefitIndividualEnrolledIdsParams: HrisBenefitIndividualEnrolledIdsParams
6157
) = apply {
6258
benefitId = hrisBenefitIndividualEnrolledIdsParams.benefitId
63-
entityIds = hrisBenefitIndividualEnrolledIdsParams.entityIds.toMutableList()
59+
entityIds = hrisBenefitIndividualEnrolledIdsParams.entityIds?.toMutableList()
6460
additionalHeaders = hrisBenefitIndividualEnrolledIdsParams.additionalHeaders.toBuilder()
6561
additionalQueryParams =
6662
hrisBenefitIndividualEnrolledIdsParams.additionalQueryParams.toBuilder()
@@ -72,10 +68,13 @@ private constructor(
7268
fun benefitId(benefitId: Optional<String>) = benefitId(benefitId.getOrNull())
7369

7470
/** The entity IDs to specify which entities' data to access. */
75-
fun entityIds(entityIds: List<String>) = apply {
76-
this.entityIds = entityIds.toMutableList()
71+
fun entityIds(entityIds: List<String>?) = apply {
72+
this.entityIds = entityIds?.toMutableList()
7773
}
7874

75+
/** Alias for calling [Builder.entityIds] with `entityIds.orElse(null)`. */
76+
fun entityIds(entityIds: Optional<List<String>>) = entityIds(entityIds.getOrNull())
77+
7978
/**
8079
* Adds a single [String] to [entityIds].
8180
*
@@ -187,18 +186,11 @@ private constructor(
187186
* Returns an immutable instance of [HrisBenefitIndividualEnrolledIdsParams].
188187
*
189188
* Further updates to this [Builder] will not mutate the returned instance.
190-
*
191-
* The following fields are required:
192-
* ```java
193-
* .entityIds()
194-
* ```
195-
*
196-
* @throws IllegalStateException if any required field is unset.
197189
*/
198190
fun build(): HrisBenefitIndividualEnrolledIdsParams =
199191
HrisBenefitIndividualEnrolledIdsParams(
200192
benefitId,
201-
checkRequired("entityIds", entityIds).toImmutable(),
193+
entityIds?.toImmutable(),
202194
additionalHeaders.build(),
203195
additionalQueryParams.build(),
204196
)
@@ -215,7 +207,7 @@ private constructor(
215207
override fun _queryParams(): QueryParams =
216208
QueryParams.builder()
217209
.apply {
218-
entityIds.forEach { put("entity_ids[]", it) }
210+
entityIds?.forEach { put("entity_ids[]", it) }
219211
putAll(additionalQueryParams)
220212
}
221213
.build()

0 commit comments

Comments
 (0)