Skip to content

Commit d6b79ed

Browse files
fix(client): update pagination
1 parent 6e3128c commit d6b79ed

13 files changed

+567
-3393
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 45
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-1a82d3230c420c8562600b0ad45133d79ab68ffd21d524ab26eef11e163dba09.yml
33
openapi_spec_hash: 7bd02ce73505e51c5fd78608fed55c62
4-
config_hash: bb896000dc7e790e5c9ddda2549fb7ac
4+
config_hash: 9c795d6cb8440ac8e7e760997a486fc4

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

Lines changed: 8 additions & 928 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 918 deletions
This file was deleted.

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class HrisBenefitListSupportedBenefitsPage
1515
private constructor(
1616
private val service: BenefitService,
1717
private val params: HrisBenefitListSupportedBenefitsParams,
18-
private val items: List<BenefitListSupportedBenefitsResponse>,
19-
) : Page<BenefitListSupportedBenefitsResponse> {
18+
private val items: List<SupportedBenefit>,
19+
) : Page<SupportedBenefit> {
2020

2121
override fun hasNextPage(): Boolean = false
2222

@@ -26,13 +26,13 @@ private constructor(
2626
override fun nextPage(): HrisBenefitListSupportedBenefitsPage =
2727
service.listSupportedBenefits(nextPageParams())
2828

29-
fun autoPager(): AutoPager<BenefitListSupportedBenefitsResponse> = AutoPager.from(this)
29+
fun autoPager(): AutoPager<SupportedBenefit> = AutoPager.from(this)
3030

3131
/** The parameters that were used to request this page. */
3232
fun params(): HrisBenefitListSupportedBenefitsParams = params
3333

3434
/** The response that this page was parsed from. */
35-
override fun items(): List<BenefitListSupportedBenefitsResponse> = items
35+
override fun items(): List<SupportedBenefit> = items
3636

3737
fun toBuilder() = Builder().from(this)
3838

@@ -57,7 +57,7 @@ private constructor(
5757

5858
private var service: BenefitService? = null
5959
private var params: HrisBenefitListSupportedBenefitsParams? = null
60-
private var items: Optional<List<BenefitListSupportedBenefitsResponse>>? = null
60+
private var items: Optional<List<SupportedBenefit>>? = null
6161

6262
@JvmSynthetic
6363
internal fun from(
@@ -74,9 +74,7 @@ private constructor(
7474
fun params(params: HrisBenefitListSupportedBenefitsParams) = apply { this.params = params }
7575

7676
/** The response that this page was parsed from. */
77-
fun items(items: Optional<List<BenefitListSupportedBenefitsResponse>>) = apply {
78-
this.items = items
79-
}
77+
fun items(items: Optional<List<SupportedBenefit>>) = apply { this.items = items }
8078

8179
/**
8280
* Returns an immutable instance of [HrisBenefitListSupportedBenefitsPage].

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ private constructor(
1818
private val service: BenefitServiceAsync,
1919
private val streamHandlerExecutor: Executor,
2020
private val params: HrisBenefitListSupportedBenefitsParams,
21-
private val items: List<BenefitListSupportedBenefitsResponse>,
22-
) : PageAsync<BenefitListSupportedBenefitsResponse> {
21+
private val items: List<SupportedBenefit>,
22+
) : PageAsync<SupportedBenefit> {
2323

2424
override fun hasNextPage(): Boolean = false
2525

@@ -29,14 +29,14 @@ private constructor(
2929
override fun nextPage(): CompletableFuture<HrisBenefitListSupportedBenefitsPageAsync> =
3030
service.listSupportedBenefits(nextPageParams())
3131

32-
fun autoPager(): AutoPagerAsync<BenefitListSupportedBenefitsResponse> =
32+
fun autoPager(): AutoPagerAsync<SupportedBenefit> =
3333
AutoPagerAsync.from(this, streamHandlerExecutor)
3434

3535
/** The parameters that were used to request this page. */
3636
fun params(): HrisBenefitListSupportedBenefitsParams = params
3737

3838
/** The response that this page was parsed from. */
39-
override fun items(): List<BenefitListSupportedBenefitsResponse> = items
39+
override fun items(): List<SupportedBenefit> = items
4040

4141
fun toBuilder() = Builder().from(this)
4242

@@ -63,7 +63,7 @@ private constructor(
6363
private var service: BenefitServiceAsync? = null
6464
private var streamHandlerExecutor: Executor? = null
6565
private var params: HrisBenefitListSupportedBenefitsParams? = null
66-
private var items: Optional<List<BenefitListSupportedBenefitsResponse>>? = null
66+
private var items: Optional<List<SupportedBenefit>>? = null
6767

6868
@JvmSynthetic
6969
internal fun from(
@@ -85,9 +85,7 @@ private constructor(
8585
fun params(params: HrisBenefitListSupportedBenefitsParams) = apply { this.params = params }
8686

8787
/** The response that this page was parsed from. */
88-
fun items(items: Optional<List<BenefitListSupportedBenefitsResponse>>) = apply {
89-
this.items = items
90-
}
88+
fun items(items: Optional<List<SupportedBenefit>>) = apply { this.items = items }
9189

9290
/**
9391
* Returns an immutable instance of [HrisBenefitListSupportedBenefitsPageAsync].

finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsyncImpl.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.HttpResponseFor
1616
import com.tryfinch.api.core.http.json
1717
import com.tryfinch.api.core.http.parseable
1818
import com.tryfinch.api.core.prepareAsync
19-
import com.tryfinch.api.models.BenefitListSupportedBenefitsResponse
2019
import com.tryfinch.api.models.CompanyBenefit
2120
import com.tryfinch.api.models.CreateCompanyBenefitsResponse
2221
import com.tryfinch.api.models.HrisBenefitCreateParams
@@ -26,6 +25,7 @@ import com.tryfinch.api.models.HrisBenefitListSupportedBenefitsPageAsync
2625
import com.tryfinch.api.models.HrisBenefitListSupportedBenefitsParams
2726
import com.tryfinch.api.models.HrisBenefitRetrieveParams
2827
import com.tryfinch.api.models.HrisBenefitUpdateParams
28+
import com.tryfinch.api.models.SupportedBenefit
2929
import com.tryfinch.api.models.UpdateCompanyBenefitResponse
3030
import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsync
3131
import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsyncImpl
@@ -229,11 +229,8 @@ class BenefitServiceAsyncImpl internal constructor(private val clientOptions: Cl
229229
}
230230
}
231231

232-
private val listSupportedBenefitsHandler:
233-
Handler<Optional<List<BenefitListSupportedBenefitsResponse>>> =
234-
jsonHandler<Optional<List<BenefitListSupportedBenefitsResponse>>>(
235-
clientOptions.jsonMapper
236-
)
232+
private val listSupportedBenefitsHandler: Handler<Optional<List<SupportedBenefit>>> =
233+
jsonHandler<Optional<List<SupportedBenefit>>>(clientOptions.jsonMapper)
237234
.withErrorHandler(errorHandler)
238235

239236
override fun listSupportedBenefits(

finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceImpl.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.HttpResponseFor
1616
import com.tryfinch.api.core.http.json
1717
import com.tryfinch.api.core.http.parseable
1818
import com.tryfinch.api.core.prepare
19-
import com.tryfinch.api.models.BenefitListSupportedBenefitsResponse
2019
import com.tryfinch.api.models.CompanyBenefit
2120
import com.tryfinch.api.models.CreateCompanyBenefitsResponse
2221
import com.tryfinch.api.models.HrisBenefitCreateParams
@@ -26,6 +25,7 @@ import com.tryfinch.api.models.HrisBenefitListSupportedBenefitsPage
2625
import com.tryfinch.api.models.HrisBenefitListSupportedBenefitsParams
2726
import com.tryfinch.api.models.HrisBenefitRetrieveParams
2827
import com.tryfinch.api.models.HrisBenefitUpdateParams
28+
import com.tryfinch.api.models.SupportedBenefit
2929
import com.tryfinch.api.models.UpdateCompanyBenefitResponse
3030
import com.tryfinch.api.services.blocking.hris.benefits.IndividualService
3131
import com.tryfinch.api.services.blocking.hris.benefits.IndividualServiceImpl
@@ -213,11 +213,8 @@ class BenefitServiceImpl internal constructor(private val clientOptions: ClientO
213213
}
214214
}
215215

216-
private val listSupportedBenefitsHandler:
217-
Handler<Optional<List<BenefitListSupportedBenefitsResponse>>> =
218-
jsonHandler<Optional<List<BenefitListSupportedBenefitsResponse>>>(
219-
clientOptions.jsonMapper
220-
)
216+
private val listSupportedBenefitsHandler: Handler<Optional<List<SupportedBenefit>>> =
217+
jsonHandler<Optional<List<SupportedBenefit>>>(clientOptions.jsonMapper)
221218
.withErrorHandler(errorHandler)
222219

223220
override fun listSupportedBenefits(

0 commit comments

Comments
 (0)