diff --git a/.stats.yml b/.stats.yml index af63a6f..6ecfe8d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 10 +configured_endpoints: 12 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDeleteParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDeleteParams.kt new file mode 100644 index 0000000..623bef1 --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDeleteParams.kt @@ -0,0 +1,159 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models + +import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.NoAutoDetect +import com.openlayer.api.core.toUnmodifiable +import com.openlayer.api.models.* +import java.util.Objects +import java.util.Optional + +class InferencePipelineDeleteParams +constructor( + private val inferencePipelineId: String, + private val additionalQueryParams: Map>, + private val additionalHeaders: Map>, + private val additionalBodyProperties: Map, +) { + + fun inferencePipelineId(): String = inferencePipelineId + + @JvmSynthetic + internal fun getBody(): Optional> { + return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + } + + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams + + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders + + fun getPathParam(index: Int): String { + return when (index) { + 0 -> inferencePipelineId + else -> "" + } + } + + fun _additionalQueryParams(): Map> = additionalQueryParams + + fun _additionalHeaders(): Map> = additionalHeaders + + fun _additionalBodyProperties(): Map = additionalBodyProperties + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InferencePipelineDeleteParams && + this.inferencePipelineId == other.inferencePipelineId && + this.additionalQueryParams == other.additionalQueryParams && + this.additionalHeaders == other.additionalHeaders && + this.additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int { + return Objects.hash( + inferencePipelineId, + additionalQueryParams, + additionalHeaders, + additionalBodyProperties, + ) + } + + override fun toString() = + "InferencePipelineDeleteParams{inferencePipelineId=$inferencePipelineId, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + @NoAutoDetect + class Builder { + + private var inferencePipelineId: String? = null + private var additionalQueryParams: MutableMap> = mutableMapOf() + private var additionalHeaders: MutableMap> = mutableMapOf() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(inferencePipelineDeleteParams: InferencePipelineDeleteParams) = apply { + this.inferencePipelineId = inferencePipelineDeleteParams.inferencePipelineId + additionalQueryParams(inferencePipelineDeleteParams.additionalQueryParams) + additionalHeaders(inferencePipelineDeleteParams.additionalHeaders) + additionalBodyProperties(inferencePipelineDeleteParams.additionalBodyProperties) + } + + fun inferencePipelineId(inferencePipelineId: String) = apply { + this.inferencePipelineId = inferencePipelineId + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } + + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { + this.additionalQueryParams.put(name, mutableListOf()) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) + } + + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun build(): InferencePipelineDeleteParams = + InferencePipelineDeleteParams( + checkNotNull(inferencePipelineId) { + "`inferencePipelineId` is required but was not set" + }, + additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalBodyProperties.toUnmodifiable(), + ) + } +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt new file mode 100644 index 0000000..1b2409f --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt @@ -0,0 +1,154 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models + +import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.NoAutoDetect +import com.openlayer.api.core.toUnmodifiable +import com.openlayer.api.models.* +import java.util.Objects + +class InferencePipelineRetrieveParams +constructor( + private val inferencePipelineId: String, + private val additionalQueryParams: Map>, + private val additionalHeaders: Map>, + private val additionalBodyProperties: Map, +) { + + fun inferencePipelineId(): String = inferencePipelineId + + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams + + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders + + fun getPathParam(index: Int): String { + return when (index) { + 0 -> inferencePipelineId + else -> "" + } + } + + fun _additionalQueryParams(): Map> = additionalQueryParams + + fun _additionalHeaders(): Map> = additionalHeaders + + fun _additionalBodyProperties(): Map = additionalBodyProperties + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InferencePipelineRetrieveParams && + this.inferencePipelineId == other.inferencePipelineId && + this.additionalQueryParams == other.additionalQueryParams && + this.additionalHeaders == other.additionalHeaders && + this.additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int { + return Objects.hash( + inferencePipelineId, + additionalQueryParams, + additionalHeaders, + additionalBodyProperties, + ) + } + + override fun toString() = + "InferencePipelineRetrieveParams{inferencePipelineId=$inferencePipelineId, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + @NoAutoDetect + class Builder { + + private var inferencePipelineId: String? = null + private var additionalQueryParams: MutableMap> = mutableMapOf() + private var additionalHeaders: MutableMap> = mutableMapOf() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(inferencePipelineRetrieveParams: InferencePipelineRetrieveParams) = + apply { + this.inferencePipelineId = inferencePipelineRetrieveParams.inferencePipelineId + additionalQueryParams(inferencePipelineRetrieveParams.additionalQueryParams) + additionalHeaders(inferencePipelineRetrieveParams.additionalHeaders) + additionalBodyProperties(inferencePipelineRetrieveParams.additionalBodyProperties) + } + + fun inferencePipelineId(inferencePipelineId: String) = apply { + this.inferencePipelineId = inferencePipelineId + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } + + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { + this.additionalQueryParams.put(name, mutableListOf()) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) + } + + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun build(): InferencePipelineRetrieveParams = + InferencePipelineRetrieveParams( + checkNotNull(inferencePipelineId) { + "`inferencePipelineId` is required but was not set" + }, + additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalBodyProperties.toUnmodifiable(), + ) + } +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt new file mode 100644 index 0000000..95ec229 --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt @@ -0,0 +1,612 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models + +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.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.openlayer.api.core.Enum +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.core.NoAutoDetect +import com.openlayer.api.core.toUnmodifiable +import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.OffsetDateTime +import java.util.Objects +import java.util.Optional + +@JsonDeserialize(builder = InferencePipelineRetrieveResponse.Builder::class) +@NoAutoDetect +class InferencePipelineRetrieveResponse +private constructor( + private val id: JsonField, + private val projectId: JsonField, + private val name: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val dateLastSampleReceived: JsonField, + private val description: JsonField, + private val dateLastEvaluated: JsonField, + private val dateOfNextEvaluation: JsonField, + private val passingGoalCount: JsonField, + private val failingGoalCount: JsonField, + private val totalGoalCount: JsonField, + private val status: JsonField, + private val statusMessage: JsonField, + private val links: JsonField, + private val additionalProperties: Map, +) { + + private var validated: Boolean = false + + private var hashCode: Int = 0 + + /** The inference pipeline id. */ + fun id(): String = id.getRequired("id") + + /** The project id. */ + fun projectId(): String = projectId.getRequired("projectId") + + /** The inference pipeline name. */ + fun name(): String = name.getRequired("name") + + /** The creation date. */ + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + /** The last updated date. */ + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** The last data sample received date. */ + fun dateLastSampleReceived(): Optional = + Optional.ofNullable(dateLastSampleReceived.getNullable("dateLastSampleReceived")) + + /** The inference pipeline description. */ + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) + + /** The last test evaluation date. */ + fun dateLastEvaluated(): Optional = + Optional.ofNullable(dateLastEvaluated.getNullable("dateLastEvaluated")) + + /** The next test evaluation date. */ + fun dateOfNextEvaluation(): Optional = + Optional.ofNullable(dateOfNextEvaluation.getNullable("dateOfNextEvaluation")) + + /** The number of tests passing. */ + fun passingGoalCount(): Long = passingGoalCount.getRequired("passingGoalCount") + + /** The number of tests failing. */ + fun failingGoalCount(): Long = failingGoalCount.getRequired("failingGoalCount") + + /** The total number of tests. */ + fun totalGoalCount(): Long = totalGoalCount.getRequired("totalGoalCount") + + /** The status of test evaluation for the inference pipeline. */ + fun status(): Status = status.getRequired("status") + + /** The status message of test evaluation for the inference pipeline. */ + fun statusMessage(): Optional = + Optional.ofNullable(statusMessage.getNullable("statusMessage")) + + fun links(): Links = links.getRequired("links") + + /** The inference pipeline id. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** The project id. */ + @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + + /** The inference pipeline name. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The creation date. */ + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + /** The last updated date. */ + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + /** The last data sample received date. */ + @JsonProperty("dateLastSampleReceived") + @ExcludeMissing + fun _dateLastSampleReceived() = dateLastSampleReceived + + /** The inference pipeline description. */ + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** The last test evaluation date. */ + @JsonProperty("dateLastEvaluated") @ExcludeMissing fun _dateLastEvaluated() = dateLastEvaluated + + /** The next test evaluation date. */ + @JsonProperty("dateOfNextEvaluation") + @ExcludeMissing + fun _dateOfNextEvaluation() = dateOfNextEvaluation + + /** The number of tests passing. */ + @JsonProperty("passingGoalCount") @ExcludeMissing fun _passingGoalCount() = passingGoalCount + + /** The number of tests failing. */ + @JsonProperty("failingGoalCount") @ExcludeMissing fun _failingGoalCount() = failingGoalCount + + /** The total number of tests. */ + @JsonProperty("totalGoalCount") @ExcludeMissing fun _totalGoalCount() = totalGoalCount + + /** The status of test evaluation for the inference pipeline. */ + @JsonProperty("status") @ExcludeMissing fun _status() = status + + /** The status message of test evaluation for the inference pipeline. */ + @JsonProperty("statusMessage") @ExcludeMissing fun _statusMessage() = statusMessage + + @JsonProperty("links") @ExcludeMissing fun _links() = links + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): InferencePipelineRetrieveResponse = apply { + if (!validated) { + id() + projectId() + name() + dateCreated() + dateUpdated() + dateLastSampleReceived() + description() + dateLastEvaluated() + dateOfNextEvaluation() + passingGoalCount() + failingGoalCount() + totalGoalCount() + status() + statusMessage() + links().validate() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InferencePipelineRetrieveResponse && + this.id == other.id && + this.projectId == other.projectId && + this.name == other.name && + this.dateCreated == other.dateCreated && + this.dateUpdated == other.dateUpdated && + this.dateLastSampleReceived == other.dateLastSampleReceived && + this.description == other.description && + this.dateLastEvaluated == other.dateLastEvaluated && + this.dateOfNextEvaluation == other.dateOfNextEvaluation && + this.passingGoalCount == other.passingGoalCount && + this.failingGoalCount == other.failingGoalCount && + this.totalGoalCount == other.totalGoalCount && + this.status == other.status && + this.statusMessage == other.statusMessage && + this.links == other.links && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = + Objects.hash( + id, + projectId, + name, + dateCreated, + dateUpdated, + dateLastSampleReceived, + description, + dateLastEvaluated, + dateOfNextEvaluation, + passingGoalCount, + failingGoalCount, + totalGoalCount, + status, + statusMessage, + links, + additionalProperties, + ) + } + return hashCode + } + + override fun toString() = + "InferencePipelineRetrieveResponse{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var projectId: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var dateLastSampleReceived: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var dateLastEvaluated: JsonField = JsonMissing.of() + private var dateOfNextEvaluation: JsonField = JsonMissing.of() + private var passingGoalCount: JsonField = JsonMissing.of() + private var failingGoalCount: JsonField = JsonMissing.of() + private var totalGoalCount: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var statusMessage: JsonField = JsonMissing.of() + private var links: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(inferencePipelineRetrieveResponse: InferencePipelineRetrieveResponse) = + apply { + this.id = inferencePipelineRetrieveResponse.id + this.projectId = inferencePipelineRetrieveResponse.projectId + this.name = inferencePipelineRetrieveResponse.name + this.dateCreated = inferencePipelineRetrieveResponse.dateCreated + this.dateUpdated = inferencePipelineRetrieveResponse.dateUpdated + this.dateLastSampleReceived = + inferencePipelineRetrieveResponse.dateLastSampleReceived + this.description = inferencePipelineRetrieveResponse.description + this.dateLastEvaluated = inferencePipelineRetrieveResponse.dateLastEvaluated + this.dateOfNextEvaluation = inferencePipelineRetrieveResponse.dateOfNextEvaluation + this.passingGoalCount = inferencePipelineRetrieveResponse.passingGoalCount + this.failingGoalCount = inferencePipelineRetrieveResponse.failingGoalCount + this.totalGoalCount = inferencePipelineRetrieveResponse.totalGoalCount + this.status = inferencePipelineRetrieveResponse.status + this.statusMessage = inferencePipelineRetrieveResponse.statusMessage + this.links = inferencePipelineRetrieveResponse.links + additionalProperties(inferencePipelineRetrieveResponse.additionalProperties) + } + + /** The inference pipeline id. */ + fun id(id: String) = id(JsonField.of(id)) + + /** The inference pipeline id. */ + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + /** The project id. */ + fun projectId(projectId: String) = projectId(JsonField.of(projectId)) + + /** The project id. */ + @JsonProperty("projectId") + @ExcludeMissing + fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + + /** The inference pipeline name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The inference pipeline name. */ + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + /** The creation date. */ + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + /** The creation date. */ + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + /** The last updated date. */ + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + /** The last updated date. */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + /** The last data sample received date. */ + fun dateLastSampleReceived(dateLastSampleReceived: OffsetDateTime) = + dateLastSampleReceived(JsonField.of(dateLastSampleReceived)) + + /** The last data sample received date. */ + @JsonProperty("dateLastSampleReceived") + @ExcludeMissing + fun dateLastSampleReceived(dateLastSampleReceived: JsonField) = apply { + this.dateLastSampleReceived = dateLastSampleReceived + } + + /** The inference pipeline description. */ + fun description(description: String) = description(JsonField.of(description)) + + /** The inference pipeline description. */ + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { this.description = description } + + /** The last test evaluation date. */ + fun dateLastEvaluated(dateLastEvaluated: OffsetDateTime) = + dateLastEvaluated(JsonField.of(dateLastEvaluated)) + + /** The last test evaluation date. */ + @JsonProperty("dateLastEvaluated") + @ExcludeMissing + fun dateLastEvaluated(dateLastEvaluated: JsonField) = apply { + this.dateLastEvaluated = dateLastEvaluated + } + + /** The next test evaluation date. */ + fun dateOfNextEvaluation(dateOfNextEvaluation: OffsetDateTime) = + dateOfNextEvaluation(JsonField.of(dateOfNextEvaluation)) + + /** The next test evaluation date. */ + @JsonProperty("dateOfNextEvaluation") + @ExcludeMissing + fun dateOfNextEvaluation(dateOfNextEvaluation: JsonField) = apply { + this.dateOfNextEvaluation = dateOfNextEvaluation + } + + /** The number of tests passing. */ + fun passingGoalCount(passingGoalCount: Long) = + passingGoalCount(JsonField.of(passingGoalCount)) + + /** The number of tests passing. */ + @JsonProperty("passingGoalCount") + @ExcludeMissing + fun passingGoalCount(passingGoalCount: JsonField) = apply { + this.passingGoalCount = passingGoalCount + } + + /** The number of tests failing. */ + fun failingGoalCount(failingGoalCount: Long) = + failingGoalCount(JsonField.of(failingGoalCount)) + + /** The number of tests failing. */ + @JsonProperty("failingGoalCount") + @ExcludeMissing + fun failingGoalCount(failingGoalCount: JsonField) = apply { + this.failingGoalCount = failingGoalCount + } + + /** The total number of tests. */ + fun totalGoalCount(totalGoalCount: Long) = totalGoalCount(JsonField.of(totalGoalCount)) + + /** The total number of tests. */ + @JsonProperty("totalGoalCount") + @ExcludeMissing + fun totalGoalCount(totalGoalCount: JsonField) = apply { + this.totalGoalCount = totalGoalCount + } + + /** The status of test evaluation for the inference pipeline. */ + fun status(status: Status) = status(JsonField.of(status)) + + /** The status of test evaluation for the inference pipeline. */ + @JsonProperty("status") + @ExcludeMissing + fun status(status: JsonField) = apply { this.status = status } + + /** The status message of test evaluation for the inference pipeline. */ + fun statusMessage(statusMessage: String) = statusMessage(JsonField.of(statusMessage)) + + /** The status message of test evaluation for the inference pipeline. */ + @JsonProperty("statusMessage") + @ExcludeMissing + fun statusMessage(statusMessage: JsonField) = apply { + this.statusMessage = statusMessage + } + + fun links(links: Links) = links(JsonField.of(links)) + + @JsonProperty("links") + @ExcludeMissing + fun links(links: JsonField) = apply { this.links = links } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): InferencePipelineRetrieveResponse = + InferencePipelineRetrieveResponse( + id, + projectId, + name, + dateCreated, + dateUpdated, + dateLastSampleReceived, + description, + dateLastEvaluated, + dateOfNextEvaluation, + passingGoalCount, + failingGoalCount, + totalGoalCount, + status, + statusMessage, + links, + additionalProperties.toUnmodifiable(), + ) + } + + @JsonDeserialize(builder = Links.Builder::class) + @NoAutoDetect + class Links + private constructor( + private val app: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + private var hashCode: Int = 0 + + fun app(): String = app.getRequired("app") + + @JsonProperty("app") @ExcludeMissing fun _app() = app + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Links = apply { + if (!validated) { + app() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Links && + this.app == other.app && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = Objects.hash(app, additionalProperties) + } + return hashCode + } + + override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var app: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(links: Links) = apply { + this.app = links.app + additionalProperties(links.additionalProperties) + } + + fun app(app: String) = app(JsonField.of(app)) + + @JsonProperty("app") + @ExcludeMissing + fun app(app: JsonField) = apply { this.app = app } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): Links = Links(app, additionalProperties.toUnmodifiable()) + } + } + + class Status + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val QUEUED = Status(JsonField.of("queued")) + + @JvmField val RUNNING = Status(JsonField.of("running")) + + @JvmField val PAUSED = Status(JsonField.of("paused")) + + @JvmField val FAILED = Status(JsonField.of("failed")) + + @JvmField val COMPLETED = Status(JsonField.of("completed")) + + @JvmField val UNKNOWN = Status(JsonField.of("unknown")) + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + enum class Known { + QUEUED, + RUNNING, + PAUSED, + FAILED, + COMPLETED, + UNKNOWN, + } + + enum class Value { + QUEUED, + RUNNING, + PAUSED, + FAILED, + COMPLETED, + UNKNOWN, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + QUEUED -> Value.QUEUED + RUNNING -> Value.RUNNING + PAUSED -> Value.PAUSED + FAILED -> Value.FAILED + COMPLETED -> Value.COMPLETED + UNKNOWN -> Value.UNKNOWN + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + QUEUED -> Known.QUEUED + RUNNING -> Known.RUNNING + PAUSED -> Known.PAUSED + FAILED -> Known.FAILED + COMPLETED -> Known.COMPLETED + UNKNOWN -> Known.UNKNOWN + else -> throw OpenlayerInvalidDataException("Unknown Status: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsync.kt index b4419d4..59d093a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsync.kt @@ -4,9 +4,14 @@ package com.openlayer.api.services.async +import com.openlayer.api.core.RequestOptions +import com.openlayer.api.models.InferencePipelineDeleteParams +import com.openlayer.api.models.InferencePipelineRetrieveParams +import com.openlayer.api.models.InferencePipelineRetrieveResponse import com.openlayer.api.services.async.inferencePipelines.DataServiceAsync import com.openlayer.api.services.async.inferencePipelines.RowServiceAsync import com.openlayer.api.services.async.inferencePipelines.TestResultServiceAsync +import java.util.concurrent.CompletableFuture interface InferencePipelineServiceAsync { @@ -15,4 +20,18 @@ interface InferencePipelineServiceAsync { fun rows(): RowServiceAsync fun testResults(): TestResultServiceAsync + + /** Retrieve inference pipeline. */ + @JvmOverloads + fun retrieve( + params: InferencePipelineRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture + + /** Delete inference pipeline. */ + @JvmOverloads + fun delete( + params: InferencePipelineDeleteParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsyncImpl.kt index 5518aff..04568a9 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/InferencePipelineServiceAsyncImpl.kt @@ -3,15 +3,26 @@ package com.openlayer.api.services.async import com.openlayer.api.core.ClientOptions +import com.openlayer.api.core.RequestOptions +import com.openlayer.api.core.http.HttpMethod +import com.openlayer.api.core.http.HttpRequest import com.openlayer.api.core.http.HttpResponse.Handler import com.openlayer.api.errors.OpenlayerError +import com.openlayer.api.models.InferencePipelineDeleteParams +import com.openlayer.api.models.InferencePipelineRetrieveParams +import com.openlayer.api.models.InferencePipelineRetrieveResponse import com.openlayer.api.services.async.inferencePipelines.DataServiceAsync import com.openlayer.api.services.async.inferencePipelines.DataServiceAsyncImpl import com.openlayer.api.services.async.inferencePipelines.RowServiceAsync import com.openlayer.api.services.async.inferencePipelines.RowServiceAsyncImpl import com.openlayer.api.services.async.inferencePipelines.TestResultServiceAsync import com.openlayer.api.services.async.inferencePipelines.TestResultServiceAsyncImpl +import com.openlayer.api.services.emptyHandler import com.openlayer.api.services.errorHandler +import com.openlayer.api.services.json +import com.openlayer.api.services.jsonHandler +import com.openlayer.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture class InferencePipelineServiceAsyncImpl constructor( @@ -33,4 +44,57 @@ constructor( override fun rows(): RowServiceAsync = rows override fun testResults(): TestResultServiceAsync = testResults + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Retrieve inference pipeline. */ + override fun retrieve( + params: InferencePipelineRetrieveParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("inference-pipelines", params.getPathParam(0)) + .putAllQueryParams(clientOptions.queryParams) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + + private val deleteHandler: Handler = emptyHandler().withErrorHandler(errorHandler) + + /** Delete inference pipeline. */ + override fun delete( + params: InferencePipelineDeleteParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .addPathSegments("inference-pipelines", params.getPathParam(0)) + .putAllQueryParams(clientOptions.queryParams) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response.use { deleteHandler.handle(it) } + } + } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineService.kt index 157d71f..259e545 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineService.kt @@ -4,6 +4,10 @@ package com.openlayer.api.services.blocking +import com.openlayer.api.core.RequestOptions +import com.openlayer.api.models.InferencePipelineDeleteParams +import com.openlayer.api.models.InferencePipelineRetrieveParams +import com.openlayer.api.models.InferencePipelineRetrieveResponse import com.openlayer.api.services.blocking.inferencePipelines.DataService import com.openlayer.api.services.blocking.inferencePipelines.RowService import com.openlayer.api.services.blocking.inferencePipelines.TestResultService @@ -15,4 +19,18 @@ interface InferencePipelineService { fun rows(): RowService fun testResults(): TestResultService + + /** Retrieve inference pipeline. */ + @JvmOverloads + fun retrieve( + params: InferencePipelineRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none() + ): InferencePipelineRetrieveResponse + + /** Delete inference pipeline. */ + @JvmOverloads + fun delete( + params: InferencePipelineDeleteParams, + requestOptions: RequestOptions = RequestOptions.none() + ) } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceImpl.kt index 2267d4a..2771de7 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceImpl.kt @@ -3,15 +3,25 @@ package com.openlayer.api.services.blocking import com.openlayer.api.core.ClientOptions +import com.openlayer.api.core.RequestOptions +import com.openlayer.api.core.http.HttpMethod +import com.openlayer.api.core.http.HttpRequest import com.openlayer.api.core.http.HttpResponse.Handler import com.openlayer.api.errors.OpenlayerError +import com.openlayer.api.models.InferencePipelineDeleteParams +import com.openlayer.api.models.InferencePipelineRetrieveParams +import com.openlayer.api.models.InferencePipelineRetrieveResponse import com.openlayer.api.services.blocking.inferencePipelines.DataService import com.openlayer.api.services.blocking.inferencePipelines.DataServiceImpl import com.openlayer.api.services.blocking.inferencePipelines.RowService import com.openlayer.api.services.blocking.inferencePipelines.RowServiceImpl import com.openlayer.api.services.blocking.inferencePipelines.TestResultService import com.openlayer.api.services.blocking.inferencePipelines.TestResultServiceImpl +import com.openlayer.api.services.emptyHandler import com.openlayer.api.services.errorHandler +import com.openlayer.api.services.json +import com.openlayer.api.services.jsonHandler +import com.openlayer.api.services.withErrorHandler class InferencePipelineServiceImpl constructor( @@ -31,4 +41,52 @@ constructor( override fun rows(): RowService = rows override fun testResults(): TestResultService = testResults + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Retrieve inference pipeline. */ + override fun retrieve( + params: InferencePipelineRetrieveParams, + requestOptions: RequestOptions + ): InferencePipelineRetrieveResponse { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("inference-pipelines", params.getPathParam(0)) + .putAllQueryParams(clientOptions.queryParams) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + + private val deleteHandler: Handler = emptyHandler().withErrorHandler(errorHandler) + + /** Delete inference pipeline. */ + override fun delete(params: InferencePipelineDeleteParams, requestOptions: RequestOptions) { + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .addPathSegments("inference-pipelines", params.getPathParam(0)) + .putAllQueryParams(clientOptions.queryParams) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } + } + } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDeleteParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDeleteParamsTest.kt new file mode 100644 index 0000000..8ee3a33 --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDeleteParamsTest.kt @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models + +import com.openlayer.api.models.* +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class InferencePipelineDeleteParamsTest { + + @Test + fun createInferencePipelineDeleteParams() { + InferencePipelineDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + } + + @Test + fun getPathParam() { + val params = + InferencePipelineDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + assertThat(params).isNotNull + // path param "inferencePipelineId" + assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + // out-of-bound path param + assertThat(params.getPathParam(1)).isEqualTo("") + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt new file mode 100644 index 0000000..663b546 --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models + +import com.openlayer.api.models.* +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class InferencePipelineRetrieveParamsTest { + + @Test + fun createInferencePipelineRetrieveParams() { + InferencePipelineRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + } + + @Test + fun getPathParam() { + val params = + InferencePipelineRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + assertThat(params).isNotNull + // path param "inferencePipelineId" + assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + // out-of-bound path param + assertThat(params.getPathParam(1)).isEqualTo("") + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt new file mode 100644 index 0000000..e259f06 --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt @@ -0,0 +1,71 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models + +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class InferencePipelineRetrieveResponseTest { + + @Test + fun createInferencePipelineRetrieveResponse() { + val inferencePipelineRetrieveResponse = + InferencePipelineRetrieveResponse.builder() + .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateLastEvaluated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateLastSampleReceived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateOfNextEvaluation(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .description("This pipeline is used for production.") + .failingGoalCount(123L) + .links( + InferencePipelineRetrieveResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6/inference-pipeline/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .name("production") + .passingGoalCount(123L) + .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .status(InferencePipelineRetrieveResponse.Status.QUEUED) + .statusMessage("Tests successfully evaluated") + .totalGoalCount(123L) + .build() + assertThat(inferencePipelineRetrieveResponse).isNotNull + assertThat(inferencePipelineRetrieveResponse.id()) + .isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") + assertThat(inferencePipelineRetrieveResponse.dateCreated()) + .isEqualTo(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(inferencePipelineRetrieveResponse.dateLastEvaluated()) + .contains(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(inferencePipelineRetrieveResponse.dateLastSampleReceived()) + .contains(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(inferencePipelineRetrieveResponse.dateOfNextEvaluation()) + .contains(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(inferencePipelineRetrieveResponse.dateUpdated()) + .isEqualTo(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(inferencePipelineRetrieveResponse.description()) + .contains("This pipeline is used for production.") + assertThat(inferencePipelineRetrieveResponse.failingGoalCount()).isEqualTo(123L) + assertThat(inferencePipelineRetrieveResponse.links()) + .isEqualTo( + InferencePipelineRetrieveResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6/inference-pipeline/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + assertThat(inferencePipelineRetrieveResponse.name()).isEqualTo("production") + assertThat(inferencePipelineRetrieveResponse.passingGoalCount()).isEqualTo(123L) + assertThat(inferencePipelineRetrieveResponse.projectId()) + .isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") + assertThat(inferencePipelineRetrieveResponse.status()) + .isEqualTo(InferencePipelineRetrieveResponse.Status.QUEUED) + assertThat(inferencePipelineRetrieveResponse.statusMessage()) + .contains("Tests successfully evaluated") + assertThat(inferencePipelineRetrieveResponse.totalGoalCount()).isEqualTo(123L) + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt index af33b2f..679b32c 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt @@ -3,7 +3,44 @@ package com.openlayer.api.services.blocking import com.openlayer.api.TestServerExtension +import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient import com.openlayer.api.models.* +import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith(TestServerExtension::class) class InferencePipelineServiceTest +@ExtendWith(TestServerExtension::class) +class InferencePipelineServiceTest { + + @Test + fun callRetrieve() { + val client = + OpenlayerOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inferencePipelineService = client.inferencePipelines() + val inferencePipelineRetrieveResponse = + inferencePipelineService.retrieve( + InferencePipelineRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + println(inferencePipelineRetrieveResponse) + inferencePipelineRetrieveResponse.validate() + } + + @Test + fun callDelete() { + val client = + OpenlayerOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inferencePipelineService = client.inferencePipelines() + inferencePipelineService.delete( + InferencePipelineDeleteParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } +}