From 682a32d4bff9c731036a5828b3423141200fb08b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:44:13 +0000 Subject: [PATCH 1/2] docs(closes OPEN-9953): expose endpoints to get and delete a row --- .stats.yml | 6 +- .../rows/RowDeleteParams.kt | 263 ++++++++++++++++++ .../rows/RowRetrieveParams.kt | 219 +++++++++++++++ .../rows/RowRetrieveResponse.kt | 168 +++++++++++ .../inferencepipelines/RowServiceAsync.kt | 110 ++++++++ .../inferencepipelines/RowServiceAsyncImpl.kt | 88 ++++++ .../blocking/inferencepipelines/RowService.kt | 108 +++++++ .../inferencepipelines/RowServiceImpl.kt | 77 +++++ .../rows/RowDeleteParamsTest.kt | 31 +++ .../rows/RowRetrieveParamsTest.kt | 31 +++ .../rows/RowRetrieveResponseTest.kt | 42 +++ .../inferencepipelines/RowServiceAsyncTest.kt | 43 +++ .../inferencepipelines/RowServiceTest.kt | 39 +++ 13 files changed, 1222 insertions(+), 3 deletions(-) create mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParams.kt create mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParams.kt create mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt create mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParamsTest.kt create mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParamsTest.kt create mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponseTest.kt diff --git a/.stats.yml b/.stats.yml index 9f47e6b1..ae97cfa3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ -configured_endpoints: 29 -openapi_spec_hash: 20caa671b1b1a87c0a5cb6ebd7e4b064 -config_hash: aaf12ae1da71c62ca5195fc2b66f657c +configured_endpoints: 31 +openapi_spec_hash: a574ef9082e992c25120554886a9ab7a +config_hash: f8fb410519268f9f228074c9344acc1f diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParams.kt new file mode 100644 index 00000000..e00a4f49 --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParams.kt @@ -0,0 +1,263 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.inferencepipelines.rows + +import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.Params +import com.openlayer.api.core.checkRequired +import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.http.QueryParams +import com.openlayer.api.core.toImmutable +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Delete a single inference pipeline row by inference ID. Only project admins can perform this + * action. + */ +class RowDeleteParams +private constructor( + private val inferencePipelineId: String, + private val inferenceId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, + private val additionalBodyProperties: Map, +) : Params { + + fun inferencePipelineId(): String = inferencePipelineId + + fun inferenceId(): Optional = Optional.ofNullable(inferenceId) + + /** Additional body properties to send with the request. */ + fun _additionalBodyProperties(): Map = additionalBodyProperties + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [RowDeleteParams]. + * + * The following fields are required: + * ```java + * .inferencePipelineId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RowDeleteParams]. */ + class Builder internal constructor() { + + private var inferencePipelineId: String? = null + private var inferenceId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(rowDeleteParams: RowDeleteParams) = apply { + inferencePipelineId = rowDeleteParams.inferencePipelineId + inferenceId = rowDeleteParams.inferenceId + additionalHeaders = rowDeleteParams.additionalHeaders.toBuilder() + additionalQueryParams = rowDeleteParams.additionalQueryParams.toBuilder() + additionalBodyProperties = rowDeleteParams.additionalBodyProperties.toMutableMap() + } + + fun inferencePipelineId(inferencePipelineId: String) = apply { + this.inferencePipelineId = inferencePipelineId + } + + fun inferenceId(inferenceId: String?) = apply { this.inferenceId = inferenceId } + + /** Alias for calling [Builder.inferenceId] with `inferenceId.orElse(null)`. */ + fun inferenceId(inferenceId: Optional) = inferenceId(inferenceId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + putAllAdditionalBodyProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { + additionalBodyProperties.remove(key) + } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalBodyProperty) + } + + /** + * Returns an immutable instance of [RowDeleteParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .inferencePipelineId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RowDeleteParams = + RowDeleteParams( + checkRequired("inferencePipelineId", inferencePipelineId), + inferenceId, + additionalHeaders.build(), + additionalQueryParams.build(), + additionalBodyProperties.toImmutable(), + ) + } + + fun _body(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + + fun _pathParam(index: Int): String = + when (index) { + 0 -> inferencePipelineId + 1 -> inferenceId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RowDeleteParams && + inferencePipelineId == other.inferencePipelineId && + inferenceId == other.inferenceId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int = + Objects.hash( + inferencePipelineId, + inferenceId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) + + override fun toString() = + "RowDeleteParams{inferencePipelineId=$inferencePipelineId, inferenceId=$inferenceId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParams.kt new file mode 100644 index 00000000..6342962f --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParams.kt @@ -0,0 +1,219 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.inferencepipelines.rows + +import com.openlayer.api.core.Params +import com.openlayer.api.core.checkRequired +import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Fetch a single inference pipeline row by inference ID, including OTel steps. */ +class RowRetrieveParams +private constructor( + private val inferencePipelineId: String, + private val inferenceId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun inferencePipelineId(): String = inferencePipelineId + + fun inferenceId(): Optional = Optional.ofNullable(inferenceId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [RowRetrieveParams]. + * + * The following fields are required: + * ```java + * .inferencePipelineId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RowRetrieveParams]. */ + class Builder internal constructor() { + + private var inferencePipelineId: String? = null + private var inferenceId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(rowRetrieveParams: RowRetrieveParams) = apply { + inferencePipelineId = rowRetrieveParams.inferencePipelineId + inferenceId = rowRetrieveParams.inferenceId + additionalHeaders = rowRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = rowRetrieveParams.additionalQueryParams.toBuilder() + } + + fun inferencePipelineId(inferencePipelineId: String) = apply { + this.inferencePipelineId = inferencePipelineId + } + + fun inferenceId(inferenceId: String?) = apply { this.inferenceId = inferenceId } + + /** Alias for calling [Builder.inferenceId] with `inferenceId.orElse(null)`. */ + fun inferenceId(inferenceId: Optional) = inferenceId(inferenceId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [RowRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .inferencePipelineId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RowRetrieveParams = + RowRetrieveParams( + checkRequired("inferencePipelineId", inferencePipelineId), + inferenceId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> inferencePipelineId + 1 -> inferenceId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RowRetrieveParams && + inferencePipelineId == other.inferencePipelineId && + inferenceId == other.inferenceId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(inferencePipelineId, inferenceId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "RowRetrieveParams{inferencePipelineId=$inferencePipelineId, inferenceId=$inferenceId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt new file mode 100644 index 00000000..f0f1524e --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt @@ -0,0 +1,168 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.inferencepipelines.rows + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openlayer.api.core.ExcludeMissing +import com.openlayer.api.core.JsonField +import com.openlayer.api.core.JsonMissing +import com.openlayer.api.core.JsonValue +import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional + +class RowRetrieveResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val row: JsonValue, + private val success: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("row") @ExcludeMissing row: JsonValue = JsonMissing.of(), + @JsonProperty("success") @ExcludeMissing success: JsonField = JsonMissing.of(), + ) : this(row, success, mutableMapOf()) + + /** + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = rowRetrieveResponse.row().convert(MyClass.class); + * ``` + */ + @JsonProperty("row") @ExcludeMissing fun _row(): JsonValue = row + + /** + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun success(): Optional = success.getOptional("success") + + /** + * Returns the raw JSON value of [success]. + * + * Unlike [success], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("success") @ExcludeMissing fun _success(): JsonField = success + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [RowRetrieveResponse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RowRetrieveResponse]. */ + class Builder internal constructor() { + + private var row: JsonValue = JsonMissing.of() + private var success: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(rowRetrieveResponse: RowRetrieveResponse) = apply { + row = rowRetrieveResponse.row + success = rowRetrieveResponse.success + additionalProperties = rowRetrieveResponse.additionalProperties.toMutableMap() + } + + fun row(row: JsonValue) = apply { this.row = row } + + fun success(success: Boolean) = success(JsonField.of(success)) + + /** + * Sets [Builder.success] to an arbitrary JSON value. + * + * You should usually call [Builder.success] with a well-typed [Boolean] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun success(success: JsonField) = apply { this.success = success } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [RowRetrieveResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): RowRetrieveResponse = + RowRetrieveResponse(row, success, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): RowRetrieveResponse = apply { + if (validated) { + return@apply + } + + success() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenlayerInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (if (success.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RowRetrieveResponse && + row == other.row && + success == other.success && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(row, success, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RowRetrieveResponse{row=$row, success=$success, additionalProperties=$additionalProperties}" +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsync.kt index e999e050..3e80317e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsync.kt @@ -4,9 +4,13 @@ package com.openlayer.api.services.async.inferencepipelines import com.openlayer.api.core.ClientOptions import com.openlayer.api.core.RequestOptions +import com.openlayer.api.core.http.HttpResponse import com.openlayer.api.core.http.HttpResponseFor +import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams import com.openlayer.api.models.inferencepipelines.rows.RowListParams import com.openlayer.api.models.inferencepipelines.rows.RowListResponse +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveResponse import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams import com.openlayer.api.models.inferencepipelines.rows.RowUpdateResponse import java.util.concurrent.CompletableFuture @@ -26,6 +30,30 @@ interface RowServiceAsync { */ fun withOptions(modifier: Consumer): RowServiceAsync + /** Fetch a single inference pipeline row by inference ID, including OTel steps. */ + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + ): CompletableFuture = retrieve(inferenceId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve(params: RowRetrieveParams): CompletableFuture = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** Update an inference data point in an inference pipeline. */ fun update( inferencePipelineId: String, @@ -86,6 +114,31 @@ interface RowServiceAsync { ): CompletableFuture = list(inferencePipelineId, RowListParams.none(), requestOptions) + /** + * Delete a single inference pipeline row by inference ID. Only project admins can perform this + * action. + */ + fun delete(inferenceId: String, params: RowDeleteParams): CompletableFuture = + delete(inferenceId, params, RequestOptions.none()) + + /** @see delete */ + fun delete( + inferenceId: String, + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + delete(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see delete */ + fun delete(params: RowDeleteParams): CompletableFuture = + delete(params, RequestOptions.none()) + + /** @see delete */ + fun delete( + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** A view of [RowServiceAsync] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -96,6 +149,37 @@ interface RowServiceAsync { */ fun withOptions(modifier: Consumer): RowServiceAsync.WithRawResponse + /** + * Returns a raw HTTP response for `get + * /inference-pipelines/{inferencePipelineId}/rows/{inferenceId}`, but is otherwise the same + * as [RowServiceAsync.retrieve]. + */ + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + ): CompletableFuture> = + retrieve(inferenceId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + params: RowRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + /** * Returns a raw HTTP response for `put /inference-pipelines/{inferencePipelineId}/rows`, * but is otherwise the same as [RowServiceAsync.update]. @@ -168,5 +252,31 @@ interface RowServiceAsync { requestOptions: RequestOptions, ): CompletableFuture> = list(inferencePipelineId, RowListParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `delete + * /inference-pipelines/{inferencePipelineId}/rows/{inferenceId}`, but is otherwise the same + * as [RowServiceAsync.delete]. + */ + fun delete(inferenceId: String, params: RowDeleteParams): CompletableFuture = + delete(inferenceId, params, RequestOptions.none()) + + /** @see delete */ + fun delete( + inferenceId: String, + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + delete(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see delete */ + fun delete(params: RowDeleteParams): CompletableFuture = + delete(params, RequestOptions.none()) + + /** @see delete */ + fun delete( + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncImpl.kt index d6acb5ec..482fd89a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncImpl.kt @@ -5,6 +5,7 @@ package com.openlayer.api.services.async.inferencepipelines import com.openlayer.api.core.ClientOptions import com.openlayer.api.core.RequestOptions import com.openlayer.api.core.checkRequired +import com.openlayer.api.core.handlers.emptyHandler import com.openlayer.api.core.handlers.errorBodyHandler import com.openlayer.api.core.handlers.errorHandler import com.openlayer.api.core.handlers.jsonHandler @@ -16,8 +17,11 @@ import com.openlayer.api.core.http.HttpResponseFor import com.openlayer.api.core.http.json import com.openlayer.api.core.http.parseable import com.openlayer.api.core.prepareAsync +import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams import com.openlayer.api.models.inferencepipelines.rows.RowListParams import com.openlayer.api.models.inferencepipelines.rows.RowListResponse +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveResponse import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams import com.openlayer.api.models.inferencepipelines.rows.RowUpdateResponse import java.util.concurrent.CompletableFuture @@ -36,6 +40,13 @@ class RowServiceAsyncImpl internal constructor(private val clientOptions: Client override fun withOptions(modifier: Consumer): RowServiceAsync = RowServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /inference-pipelines/{inferencePipelineId}/rows/{inferenceId} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + override fun update( params: RowUpdateParams, requestOptions: RequestOptions, @@ -50,6 +61,13 @@ class RowServiceAsyncImpl internal constructor(private val clientOptions: Client // post /inference-pipelines/{inferencePipelineId}/rows withRawResponse().list(params, requestOptions).thenApply { it.parse() } + override fun delete( + params: RowDeleteParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // delete /inference-pipelines/{inferencePipelineId}/rows/{inferenceId} + withRawResponse().delete(params, requestOptions).thenAccept {} + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RowServiceAsync.WithRawResponse { @@ -63,6 +81,44 @@ class RowServiceAsyncImpl internal constructor(private val clientOptions: Client clientOptions.toBuilder().apply(modifier::accept).build() ) + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inferenceId", params.inferenceId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "inference-pipelines", + params._pathParam(0), + "rows", + params._pathParam(1), + ) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -130,5 +186,37 @@ class RowServiceAsyncImpl internal constructor(private val clientOptions: Client } } } + + private val deleteHandler: Handler = emptyHandler() + + override fun delete( + params: RowDeleteParams, + requestOptions: RequestOptions, + ): CompletableFuture { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inferenceId", params.inferenceId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "inference-pipelines", + params._pathParam(0), + "rows", + params._pathParam(1), + ) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response.use { deleteHandler.handle(it) } + } + } + } } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowService.kt index 527bb229..bf79120f 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowService.kt @@ -5,9 +5,13 @@ package com.openlayer.api.services.blocking.inferencepipelines import com.google.errorprone.annotations.MustBeClosed import com.openlayer.api.core.ClientOptions import com.openlayer.api.core.RequestOptions +import com.openlayer.api.core.http.HttpResponse import com.openlayer.api.core.http.HttpResponseFor +import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams import com.openlayer.api.models.inferencepipelines.rows.RowListParams import com.openlayer.api.models.inferencepipelines.rows.RowListResponse +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveResponse import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams import com.openlayer.api.models.inferencepipelines.rows.RowUpdateResponse import java.util.function.Consumer @@ -26,6 +30,28 @@ interface RowService { */ fun withOptions(modifier: Consumer): RowService + /** Fetch a single inference pipeline row by inference ID, including OTel steps. */ + fun retrieve(inferenceId: String, params: RowRetrieveParams): RowRetrieveResponse = + retrieve(inferenceId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): RowRetrieveResponse = + retrieve(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve(params: RowRetrieveParams): RowRetrieveResponse = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): RowRetrieveResponse + /** Update an inference data point in an inference pipeline. */ fun update(inferencePipelineId: String, params: RowUpdateParams): RowUpdateResponse = update(inferencePipelineId, params, RequestOptions.none()) @@ -78,6 +104,26 @@ interface RowService { fun list(inferencePipelineId: String, requestOptions: RequestOptions): RowListResponse = list(inferencePipelineId, RowListParams.none(), requestOptions) + /** + * Delete a single inference pipeline row by inference ID. Only project admins can perform this + * action. + */ + fun delete(inferenceId: String, params: RowDeleteParams) = + delete(inferenceId, params, RequestOptions.none()) + + /** @see delete */ + fun delete( + inferenceId: String, + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ) = delete(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see delete */ + fun delete(params: RowDeleteParams) = delete(params, RequestOptions.none()) + + /** @see delete */ + fun delete(params: RowDeleteParams, requestOptions: RequestOptions = RequestOptions.none()) + /** A view of [RowService] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -88,6 +134,39 @@ interface RowService { */ fun withOptions(modifier: Consumer): RowService.WithRawResponse + /** + * Returns a raw HTTP response for `get + * /inference-pipelines/{inferencePipelineId}/rows/{inferenceId}`, but is otherwise the same + * as [RowService.retrieve]. + */ + @MustBeClosed + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + ): HttpResponseFor = + retrieve(inferenceId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inferenceId: String, + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see retrieve */ + @MustBeClosed + fun retrieve(params: RowRetrieveParams): HttpResponseFor = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + /** * Returns a raw HTTP response for `put /inference-pipelines/{inferencePipelineId}/rows`, * but is otherwise the same as [RowService.update]. @@ -170,5 +249,34 @@ interface RowService { requestOptions: RequestOptions, ): HttpResponseFor = list(inferencePipelineId, RowListParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `delete + * /inference-pipelines/{inferencePipelineId}/rows/{inferenceId}`, but is otherwise the same + * as [RowService.delete]. + */ + @MustBeClosed + fun delete(inferenceId: String, params: RowDeleteParams): HttpResponse = + delete(inferenceId, params, RequestOptions.none()) + + /** @see delete */ + @MustBeClosed + fun delete( + inferenceId: String, + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponse = + delete(params.toBuilder().inferenceId(inferenceId).build(), requestOptions) + + /** @see delete */ + @MustBeClosed + fun delete(params: RowDeleteParams): HttpResponse = delete(params, RequestOptions.none()) + + /** @see delete */ + @MustBeClosed + fun delete( + params: RowDeleteParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponse } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceImpl.kt index 005c081d..31256392 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceImpl.kt @@ -5,6 +5,7 @@ package com.openlayer.api.services.blocking.inferencepipelines import com.openlayer.api.core.ClientOptions import com.openlayer.api.core.RequestOptions import com.openlayer.api.core.checkRequired +import com.openlayer.api.core.handlers.emptyHandler import com.openlayer.api.core.handlers.errorBodyHandler import com.openlayer.api.core.handlers.errorHandler import com.openlayer.api.core.handlers.jsonHandler @@ -16,8 +17,11 @@ import com.openlayer.api.core.http.HttpResponseFor import com.openlayer.api.core.http.json import com.openlayer.api.core.http.parseable import com.openlayer.api.core.prepare +import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams import com.openlayer.api.models.inferencepipelines.rows.RowListParams import com.openlayer.api.models.inferencepipelines.rows.RowListResponse +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveResponse import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams import com.openlayer.api.models.inferencepipelines.rows.RowUpdateResponse import java.util.function.Consumer @@ -34,6 +38,13 @@ class RowServiceImpl internal constructor(private val clientOptions: ClientOptio override fun withOptions(modifier: Consumer): RowService = RowServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions, + ): RowRetrieveResponse = + // get /inference-pipelines/{inferencePipelineId}/rows/{inferenceId} + withRawResponse().retrieve(params, requestOptions).parse() + override fun update( params: RowUpdateParams, requestOptions: RequestOptions, @@ -45,6 +56,11 @@ class RowServiceImpl internal constructor(private val clientOptions: ClientOptio // post /inference-pipelines/{inferencePipelineId}/rows withRawResponse().list(params, requestOptions).parse() + override fun delete(params: RowDeleteParams, requestOptions: RequestOptions) { + // delete /inference-pipelines/{inferencePipelineId}/rows/{inferenceId} + withRawResponse().delete(params, requestOptions) + } + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RowService.WithRawResponse { @@ -58,6 +74,41 @@ class RowServiceImpl internal constructor(private val clientOptions: ClientOptio clientOptions.toBuilder().apply(modifier::accept).build() ) + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: RowRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inferenceId", params.inferenceId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "inference-pipelines", + params._pathParam(0), + "rows", + params._pathParam(1), + ) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -119,5 +170,31 @@ class RowServiceImpl internal constructor(private val clientOptions: ClientOptio } } } + + private val deleteHandler: Handler = emptyHandler() + + override fun delete(params: RowDeleteParams, requestOptions: RequestOptions): HttpResponse { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inferenceId", params.inferenceId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "inference-pipelines", + params._pathParam(0), + "rows", + params._pathParam(1), + ) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response.use { deleteHandler.handle(it) } + } + } } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParamsTest.kt new file mode 100644 index 00000000..9e69e241 --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowDeleteParamsTest.kt @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.inferencepipelines.rows + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class RowDeleteParamsTest { + + @Test + fun create() { + RowDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + } + + @Test + fun pathParams() { + val params = + RowDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + + assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(params._pathParam(1)).isEqualTo("inferenceId") + // out-of-bound path param + assertThat(params._pathParam(2)).isEqualTo("") + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParamsTest.kt new file mode 100644 index 00000000..b82d9475 --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveParamsTest.kt @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.inferencepipelines.rows + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class RowRetrieveParamsTest { + + @Test + fun create() { + RowRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + } + + @Test + fun pathParams() { + val params = + RowRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + + assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(params._pathParam(1)).isEqualTo("inferenceId") + // out-of-bound path param + assertThat(params._pathParam(2)).isEqualTo("") + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponseTest.kt new file mode 100644 index 00000000..b2ec41c3 --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponseTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.inferencepipelines.rows + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class RowRetrieveResponseTest { + + @Test + fun create() { + val rowRetrieveResponse = + RowRetrieveResponse.builder() + .row(JsonValue.from(mapOf())) + .success(true) + .build() + + assertThat(rowRetrieveResponse._row()).isEqualTo(JsonValue.from(mapOf())) + assertThat(rowRetrieveResponse.success()).contains(true) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val rowRetrieveResponse = + RowRetrieveResponse.builder() + .row(JsonValue.from(mapOf())) + .success(true) + .build() + + val roundtrippedRowRetrieveResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(rowRetrieveResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedRowRetrieveResponse).isEqualTo(rowRetrieveResponse) + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncTest.kt index f678b40a..51727645 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/inferencepipelines/RowServiceAsyncTest.kt @@ -5,7 +5,9 @@ package com.openlayer.api.services.async.inferencepipelines import com.openlayer.api.TestServerExtension import com.openlayer.api.client.okhttp.OpenlayerOkHttpClientAsync import com.openlayer.api.core.JsonValue +import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams import com.openlayer.api.models.inferencepipelines.rows.RowListParams +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -13,6 +15,27 @@ import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestServerExtension::class) internal class RowServiceAsyncTest { + @Test + fun retrieve() { + val client = + OpenlayerOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val rowServiceAsync = client.inferencePipelines().rows() + + val rowFuture = + rowServiceAsync.retrieve( + RowRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + ) + + val row = rowFuture.get() + row.validate() + } + @Test fun update() { val client = @@ -82,4 +105,24 @@ internal class RowServiceAsyncTest { val rows = rowsFuture.get() rows.validate() } + + @Test + fun delete() { + val client = + OpenlayerOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val rowServiceAsync = client.inferencePipelines().rows() + + val future = + rowServiceAsync.delete( + RowDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + ) + + val response = future.get() + } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceTest.kt index 7745e1e0..36d44355 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencepipelines/RowServiceTest.kt @@ -5,7 +5,9 @@ package com.openlayer.api.services.blocking.inferencepipelines import com.openlayer.api.TestServerExtension import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient import com.openlayer.api.core.JsonValue +import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams import com.openlayer.api.models.inferencepipelines.rows.RowListParams +import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -13,6 +15,26 @@ import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestServerExtension::class) internal class RowServiceTest { + @Test + fun retrieve() { + val client = + OpenlayerOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val rowService = client.inferencePipelines().rows() + + val row = + rowService.retrieve( + RowRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + ) + + row.validate() + } + @Test fun update() { val client = @@ -80,4 +102,21 @@ internal class RowServiceTest { rows.validate() } + + @Test + fun delete() { + val client = + OpenlayerOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val rowService = client.inferencePipelines().rows() + + rowService.delete( + RowDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") + .build() + ) + } } From f4eb7ef92ca6cba559b3e93b378c9b5dad9087b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:44:32 +0000 Subject: [PATCH 2/2] release: 0.8.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca91..2b28d6ec 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.8.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 864f4153..df395195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.8.1 (2026-04-10) + +Full Changelog: [v0.8.0...v0.8.1](https://github.com/openlayer-ai/openlayer-java/compare/v0.8.0...v0.8.1) + +### Documentation + +* **closes OPEN-9953:** expose endpoints to get and delete a row ([682a32d](https://github.com/openlayer-ai/openlayer-java/commit/682a32d4bff9c731036a5828b3423141200fb08b)) + ## 0.8.0 (2026-04-01) Full Changelog: [v0.7.0...v0.8.0](https://github.com/openlayer-ai/openlayer-java/compare/v0.7.0...v0.8.0) diff --git a/README.md b/README.md index cdf76135..dc71ceaf 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.8.0) -[![javadoc](https://javadoc.io/badge2/com.openlayer.api/openlayer-java/0.8.0/javadoc.svg)](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.8.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.8.1) +[![javadoc](https://javadoc.io/badge2/com.openlayer.api/openlayer-java/0.8.1/javadoc.svg)](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.8.1) @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.8.0). +The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.8.1). @@ -24,7 +24,7 @@ The REST API documentation can be found on [openlayer.com](https://openlayer.com ### Gradle ```kotlin -implementation("com.openlayer.api:openlayer-java:0.8.0") +implementation("com.openlayer.api:openlayer-java:0.8.1") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.openlayer.api:openlayer-java:0.8.0") com.openlayer.api openlayer-java - 0.8.0 + 0.8.1 ``` diff --git a/build.gradle.kts b/build.gradle.kts index d9c835a7..317b1c2b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.openlayer.api" - version = "0.8.0" // x-release-please-version + version = "0.8.1" // x-release-please-version } subprojects {