Skip to content

Commit 5917df4

Browse files
feat(api): update POST /rows to use list method name
1 parent 1a6b3bf commit 5917df4

File tree

13 files changed

+366
-374
lines changed

13 files changed

+366
-374
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,18 @@ jobs:
6565
run: ./scripts/build
6666

6767
- name: Get GitHub OIDC Token
68-
if: github.repository == 'stainless-sdks/openlayer-java'
68+
if: |-
69+
github.repository == 'stainless-sdks/openlayer-java' &&
70+
!startsWith(github.ref, 'refs/heads/stl/')
6971
id: github-oidc
7072
uses: actions/github-script@v8
7173
with:
7274
script: core.setOutput('github_token', await core.getIDToken());
7375

7476
- name: Build and upload Maven artifacts
75-
if: github.repository == 'stainless-sdks/openlayer-java'
77+
if: |-
78+
github.repository == 'stainless-sdks/openlayer-java' &&
79+
!startsWith(github.ref, 'refs/heads/stl/')
7680
env:
7781
URL: https://pkg.stainless.com/s
7882
AUTH: ${{ steps.github-oidc.outputs.github_token }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 28
22
openapi_spec_hash: 5f7962599290c70cb47c05c3b29fdbd8
3-
config_hash: 38b7fc7dfc9af970e9e1cb7b81ccc56b
3+
config_hash: f1c0c034bd832878eb47146c51afdd55

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowCreateParams.kt renamed to openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListParams.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import java.util.Optional
3535
import kotlin.jvm.optionals.getOrNull
3636

3737
/** A list of rows for an inference pipeline. */
38-
class RowCreateParams
38+
class RowListParams
3939
private constructor(
4040
private val inferencePipelineId: String?,
4141
private val asc: Boolean?,
@@ -167,13 +167,13 @@ private constructor(
167167

168168
companion object {
169169

170-
@JvmStatic fun none(): RowCreateParams = builder().build()
170+
@JvmStatic fun none(): RowListParams = builder().build()
171171

172-
/** Returns a mutable builder for constructing an instance of [RowCreateParams]. */
172+
/** Returns a mutable builder for constructing an instance of [RowListParams]. */
173173
@JvmStatic fun builder() = Builder()
174174
}
175175

176-
/** A builder for [RowCreateParams]. */
176+
/** A builder for [RowListParams]. */
177177
class Builder internal constructor() {
178178

179179
private var inferencePipelineId: String? = null
@@ -186,15 +186,15 @@ private constructor(
186186
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
187187

188188
@JvmSynthetic
189-
internal fun from(rowCreateParams: RowCreateParams) = apply {
190-
inferencePipelineId = rowCreateParams.inferencePipelineId
191-
asc = rowCreateParams.asc
192-
page = rowCreateParams.page
193-
perPage = rowCreateParams.perPage
194-
sortColumn = rowCreateParams.sortColumn
195-
body = rowCreateParams.body.toBuilder()
196-
additionalHeaders = rowCreateParams.additionalHeaders.toBuilder()
197-
additionalQueryParams = rowCreateParams.additionalQueryParams.toBuilder()
189+
internal fun from(rowListParams: RowListParams) = apply {
190+
inferencePipelineId = rowListParams.inferencePipelineId
191+
asc = rowListParams.asc
192+
page = rowListParams.page
193+
perPage = rowListParams.perPage
194+
sortColumn = rowListParams.sortColumn
195+
body = rowListParams.body.toBuilder()
196+
additionalHeaders = rowListParams.additionalHeaders.toBuilder()
197+
additionalQueryParams = rowListParams.additionalQueryParams.toBuilder()
198198
}
199199

200200
fun inferencePipelineId(inferencePipelineId: String?) = apply {
@@ -584,12 +584,12 @@ private constructor(
584584
}
585585

586586
/**
587-
* Returns an immutable instance of [RowCreateParams].
587+
* Returns an immutable instance of [RowListParams].
588588
*
589589
* Further updates to this [Builder] will not mutate the returned instance.
590590
*/
591-
fun build(): RowCreateParams =
592-
RowCreateParams(
591+
fun build(): RowListParams =
592+
RowListParams(
593593
inferencePipelineId,
594594
asc,
595595
page,
@@ -2931,7 +2931,7 @@ private constructor(
29312931
return true
29322932
}
29332933

2934-
return other is RowCreateParams &&
2934+
return other is RowListParams &&
29352935
inferencePipelineId == other.inferencePipelineId &&
29362936
asc == other.asc &&
29372937
page == other.page &&
@@ -2955,5 +2955,5 @@ private constructor(
29552955
)
29562956

29572957
override fun toString() =
2958-
"RowCreateParams{inferencePipelineId=$inferencePipelineId, asc=$asc, page=$page, perPage=$perPage, sortColumn=$sortColumn, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
2958+
"RowListParams{inferencePipelineId=$inferencePipelineId, asc=$asc, page=$page, perPage=$perPage, sortColumn=$sortColumn, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
29592959
}

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowCreateResponse.kt renamed to openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListResponse.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import java.util.Collections
1818
import java.util.Objects
1919
import kotlin.jvm.optionals.getOrNull
2020

21-
class RowCreateResponse
21+
class RowListResponse
2222
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2323
private constructor(
2424
private val items: JsonField<List<Item>>,
@@ -58,7 +58,7 @@ private constructor(
5858
companion object {
5959

6060
/**
61-
* Returns a mutable builder for constructing an instance of [RowCreateResponse].
61+
* Returns a mutable builder for constructing an instance of [RowListResponse].
6262
*
6363
* The following fields are required:
6464
* ```java
@@ -68,16 +68,16 @@ private constructor(
6868
@JvmStatic fun builder() = Builder()
6969
}
7070

71-
/** A builder for [RowCreateResponse]. */
71+
/** A builder for [RowListResponse]. */
7272
class Builder internal constructor() {
7373

7474
private var items: JsonField<MutableList<Item>>? = null
7575
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
7676

7777
@JvmSynthetic
78-
internal fun from(rowCreateResponse: RowCreateResponse) = apply {
79-
items = rowCreateResponse.items.map { it.toMutableList() }
80-
additionalProperties = rowCreateResponse.additionalProperties.toMutableMap()
78+
internal fun from(rowListResponse: RowListResponse) = apply {
79+
items = rowListResponse.items.map { it.toMutableList() }
80+
additionalProperties = rowListResponse.additionalProperties.toMutableMap()
8181
}
8282

8383
fun items(items: List<Item>) = items(JsonField.of(items))
@@ -123,7 +123,7 @@ private constructor(
123123
}
124124

125125
/**
126-
* Returns an immutable instance of [RowCreateResponse].
126+
* Returns an immutable instance of [RowListResponse].
127127
*
128128
* Further updates to this [Builder] will not mutate the returned instance.
129129
*
@@ -134,16 +134,16 @@ private constructor(
134134
*
135135
* @throws IllegalStateException if any required field is unset.
136136
*/
137-
fun build(): RowCreateResponse =
138-
RowCreateResponse(
137+
fun build(): RowListResponse =
138+
RowListResponse(
139139
checkRequired("items", items).map { it.toImmutable() },
140140
additionalProperties.toMutableMap(),
141141
)
142142
}
143143

144144
private var validated: Boolean = false
145145

146-
fun validate(): RowCreateResponse = apply {
146+
fun validate(): RowListResponse = apply {
147147
if (validated) {
148148
return@apply
149149
}
@@ -338,7 +338,7 @@ private constructor(
338338
return true
339339
}
340340

341-
return other is RowCreateResponse &&
341+
return other is RowListResponse &&
342342
items == other.items &&
343343
additionalProperties == other.additionalProperties
344344
}
@@ -348,5 +348,5 @@ private constructor(
348348
override fun hashCode(): Int = hashCode
349349

350350
override fun toString() =
351-
"RowCreateResponse{items=$items, additionalProperties=$additionalProperties}"
351+
"RowListResponse{items=$items, additionalProperties=$additionalProperties}"
352352
}

openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsync.kt

Lines changed: 79 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ package com.openlayer.api.services.async.inferencepipelines
55
import com.openlayer.api.core.ClientOptions
66
import com.openlayer.api.core.RequestOptions
77
import com.openlayer.api.core.http.HttpResponseFor
8-
import com.openlayer.api.models.inferencepipelines.rows.RowCreateParams
9-
import com.openlayer.api.models.inferencepipelines.rows.RowCreateResponse
8+
import com.openlayer.api.models.inferencepipelines.rows.RowListParams
9+
import com.openlayer.api.models.inferencepipelines.rows.RowListResponse
1010
import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams
1111
import com.openlayer.api.models.inferencepipelines.rows.RowUpdateResponse
1212
import java.util.concurrent.CompletableFuture
@@ -26,42 +26,6 @@ interface RowServiceAsync {
2626
*/
2727
fun withOptions(modifier: Consumer<ClientOptions.Builder>): RowServiceAsync
2828

29-
/** A list of rows for an inference pipeline. */
30-
fun create(inferencePipelineId: String): CompletableFuture<RowCreateResponse> =
31-
create(inferencePipelineId, RowCreateParams.none())
32-
33-
/** @see create */
34-
fun create(
35-
inferencePipelineId: String,
36-
params: RowCreateParams = RowCreateParams.none(),
37-
requestOptions: RequestOptions = RequestOptions.none(),
38-
): CompletableFuture<RowCreateResponse> =
39-
create(params.toBuilder().inferencePipelineId(inferencePipelineId).build(), requestOptions)
40-
41-
/** @see create */
42-
fun create(
43-
inferencePipelineId: String,
44-
params: RowCreateParams = RowCreateParams.none(),
45-
): CompletableFuture<RowCreateResponse> =
46-
create(inferencePipelineId, params, RequestOptions.none())
47-
48-
/** @see create */
49-
fun create(
50-
params: RowCreateParams,
51-
requestOptions: RequestOptions = RequestOptions.none(),
52-
): CompletableFuture<RowCreateResponse>
53-
54-
/** @see create */
55-
fun create(params: RowCreateParams): CompletableFuture<RowCreateResponse> =
56-
create(params, RequestOptions.none())
57-
58-
/** @see create */
59-
fun create(
60-
inferencePipelineId: String,
61-
requestOptions: RequestOptions,
62-
): CompletableFuture<RowCreateResponse> =
63-
create(inferencePipelineId, RowCreateParams.none(), requestOptions)
64-
6529
/** Update an inference data point in an inference pipeline. */
6630
fun update(
6731
inferencePipelineId: String,
@@ -87,6 +51,41 @@ interface RowServiceAsync {
8751
requestOptions: RequestOptions = RequestOptions.none(),
8852
): CompletableFuture<RowUpdateResponse>
8953

54+
/** A list of rows for an inference pipeline. */
55+
fun list(inferencePipelineId: String): CompletableFuture<RowListResponse> =
56+
list(inferencePipelineId, RowListParams.none())
57+
58+
/** @see list */
59+
fun list(
60+
inferencePipelineId: String,
61+
params: RowListParams = RowListParams.none(),
62+
requestOptions: RequestOptions = RequestOptions.none(),
63+
): CompletableFuture<RowListResponse> =
64+
list(params.toBuilder().inferencePipelineId(inferencePipelineId).build(), requestOptions)
65+
66+
/** @see list */
67+
fun list(
68+
inferencePipelineId: String,
69+
params: RowListParams = RowListParams.none(),
70+
): CompletableFuture<RowListResponse> = list(inferencePipelineId, params, RequestOptions.none())
71+
72+
/** @see list */
73+
fun list(
74+
params: RowListParams,
75+
requestOptions: RequestOptions = RequestOptions.none(),
76+
): CompletableFuture<RowListResponse>
77+
78+
/** @see list */
79+
fun list(params: RowListParams): CompletableFuture<RowListResponse> =
80+
list(params, RequestOptions.none())
81+
82+
/** @see list */
83+
fun list(
84+
inferencePipelineId: String,
85+
requestOptions: RequestOptions,
86+
): CompletableFuture<RowListResponse> =
87+
list(inferencePipelineId, RowListParams.none(), requestOptions)
88+
9089
/** A view of [RowServiceAsync] that provides access to raw HTTP responses for each method. */
9190
interface WithRawResponse {
9291

@@ -97,50 +96,6 @@ interface RowServiceAsync {
9796
*/
9897
fun withOptions(modifier: Consumer<ClientOptions.Builder>): RowServiceAsync.WithRawResponse
9998

100-
/**
101-
* Returns a raw HTTP response for `post /inference-pipelines/{inferencePipelineId}/rows`,
102-
* but is otherwise the same as [RowServiceAsync.create].
103-
*/
104-
fun create(
105-
inferencePipelineId: String
106-
): CompletableFuture<HttpResponseFor<RowCreateResponse>> =
107-
create(inferencePipelineId, RowCreateParams.none())
108-
109-
/** @see create */
110-
fun create(
111-
inferencePipelineId: String,
112-
params: RowCreateParams = RowCreateParams.none(),
113-
requestOptions: RequestOptions = RequestOptions.none(),
114-
): CompletableFuture<HttpResponseFor<RowCreateResponse>> =
115-
create(
116-
params.toBuilder().inferencePipelineId(inferencePipelineId).build(),
117-
requestOptions,
118-
)
119-
120-
/** @see create */
121-
fun create(
122-
inferencePipelineId: String,
123-
params: RowCreateParams = RowCreateParams.none(),
124-
): CompletableFuture<HttpResponseFor<RowCreateResponse>> =
125-
create(inferencePipelineId, params, RequestOptions.none())
126-
127-
/** @see create */
128-
fun create(
129-
params: RowCreateParams,
130-
requestOptions: RequestOptions = RequestOptions.none(),
131-
): CompletableFuture<HttpResponseFor<RowCreateResponse>>
132-
133-
/** @see create */
134-
fun create(params: RowCreateParams): CompletableFuture<HttpResponseFor<RowCreateResponse>> =
135-
create(params, RequestOptions.none())
136-
137-
/** @see create */
138-
fun create(
139-
inferencePipelineId: String,
140-
requestOptions: RequestOptions,
141-
): CompletableFuture<HttpResponseFor<RowCreateResponse>> =
142-
create(inferencePipelineId, RowCreateParams.none(), requestOptions)
143-
14499
/**
145100
* Returns a raw HTTP response for `put /inference-pipelines/{inferencePipelineId}/rows`,
146101
* but is otherwise the same as [RowServiceAsync.update].
@@ -171,5 +126,47 @@ interface RowServiceAsync {
171126
params: RowUpdateParams,
172127
requestOptions: RequestOptions = RequestOptions.none(),
173128
): CompletableFuture<HttpResponseFor<RowUpdateResponse>>
129+
130+
/**
131+
* Returns a raw HTTP response for `post /inference-pipelines/{inferencePipelineId}/rows`,
132+
* but is otherwise the same as [RowServiceAsync.list].
133+
*/
134+
fun list(inferencePipelineId: String): CompletableFuture<HttpResponseFor<RowListResponse>> =
135+
list(inferencePipelineId, RowListParams.none())
136+
137+
/** @see list */
138+
fun list(
139+
inferencePipelineId: String,
140+
params: RowListParams = RowListParams.none(),
141+
requestOptions: RequestOptions = RequestOptions.none(),
142+
): CompletableFuture<HttpResponseFor<RowListResponse>> =
143+
list(
144+
params.toBuilder().inferencePipelineId(inferencePipelineId).build(),
145+
requestOptions,
146+
)
147+
148+
/** @see list */
149+
fun list(
150+
inferencePipelineId: String,
151+
params: RowListParams = RowListParams.none(),
152+
): CompletableFuture<HttpResponseFor<RowListResponse>> =
153+
list(inferencePipelineId, params, RequestOptions.none())
154+
155+
/** @see list */
156+
fun list(
157+
params: RowListParams,
158+
requestOptions: RequestOptions = RequestOptions.none(),
159+
): CompletableFuture<HttpResponseFor<RowListResponse>>
160+
161+
/** @see list */
162+
fun list(params: RowListParams): CompletableFuture<HttpResponseFor<RowListResponse>> =
163+
list(params, RequestOptions.none())
164+
165+
/** @see list */
166+
fun list(
167+
inferencePipelineId: String,
168+
requestOptions: RequestOptions,
169+
): CompletableFuture<HttpResponseFor<RowListResponse>> =
170+
list(inferencePipelineId, RowListParams.none(), requestOptions)
174171
}
175172
}

0 commit comments

Comments
 (0)