From d99bfbd5804ffa1af491491cf0ef40b4eda5ac29 Mon Sep 17 00:00:00 2001 From: stainless-bot <dev@stainlessapi.com> Date: Fri, 5 Jul 2024 19:57:09 +0000 Subject: [PATCH] feat(api): update via SDK Studio --- .stats.yml | 2 +- .../ProjectInferencePipelineCreateParams.kt | 573 ---------- .../ProjectInferencePipelineCreateResponse.kt | 733 ------------ .../ProjectInferencePipelineListParams.kt | 194 ---- .../ProjectInferencePipelineListResponse.kt | 1017 ----------------- .../projects/InferencePipelineServiceAsync.kt | 24 +- .../InferencePipelineServiceAsyncImpl.kt | 72 -- .../projects/InferencePipelineService.kt | 23 +- .../projects/InferencePipelineServiceImpl.kt | 69 -- ...rojectInferencePipelineCreateParamsTest.kt | 66 -- ...jectInferencePipelineCreateResponseTest.kt | 77 -- .../ProjectInferencePipelineListParamsTest.kt | 59 - ...rojectInferencePipelineListResponseTest.kt | 98 -- .../projects/InferencePipelineServiceTest.kt | 49 +- 14 files changed, 4 insertions(+), 3052 deletions(-) delete mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt delete mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt delete mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParams.kt delete mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt delete mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt delete mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt delete mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParamsTest.kt delete mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt diff --git a/.stats.yml b/.stats.yml index 699660e..2b7dbf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 8 +configured_endpoints: 6 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt deleted file mode 100644 index a6465b1..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt +++ /dev/null @@ -1,573 +0,0 @@ -// 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.JsonValue -import com.openlayer.api.core.NoAutoDetect -import com.openlayer.api.core.toUnmodifiable -import com.openlayer.api.errors.OpenlayerInvalidDataException -import com.openlayer.api.models.* -import java.util.Objects -import java.util.Optional - -class ProjectInferencePipelineCreateParams -constructor( - private val id: String, - private val description: String?, - private val name: String, - private val referenceDatasetUri: String?, - private val storageType: StorageType?, - private val additionalQueryParams: Map<String, List<String>>, - private val additionalHeaders: Map<String, List<String>>, - private val additionalBodyProperties: Map<String, JsonValue>, -) { - - fun id(): String = id - - fun description(): Optional<String> = Optional.ofNullable(description) - - fun name(): String = name - - fun referenceDatasetUri(): Optional<String> = Optional.ofNullable(referenceDatasetUri) - - fun storageType(): Optional<StorageType> = Optional.ofNullable(storageType) - - @JvmSynthetic - internal fun getBody(): ProjectInferencePipelineCreateBody { - return ProjectInferencePipelineCreateBody( - description, - name, - referenceDatasetUri, - storageType, - additionalBodyProperties, - ) - } - - @JvmSynthetic internal fun getQueryParams(): Map<String, List<String>> = additionalQueryParams - - @JvmSynthetic internal fun getHeaders(): Map<String, List<String>> = additionalHeaders - - fun getPathParam(index: Int): String { - return when (index) { - 0 -> id - else -> "" - } - } - - @JsonDeserialize(builder = ProjectInferencePipelineCreateBody.Builder::class) - @NoAutoDetect - class ProjectInferencePipelineCreateBody - internal constructor( - private val description: String?, - private val name: String?, - private val referenceDatasetUri: String?, - private val storageType: StorageType?, - private val additionalProperties: Map<String, JsonValue>, - ) { - - private var hashCode: Int = 0 - - /** The inference pipeline description. */ - @JsonProperty("description") fun description(): String? = description - - /** The inference pipeline name. */ - @JsonProperty("name") fun name(): String? = name - - /** The reference dataset URI. */ - @JsonProperty("referenceDatasetUri") - fun referenceDatasetUri(): String? = referenceDatasetUri - - /** The storage type. */ - @JsonProperty("storageType") fun storageType(): StorageType? = storageType - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map<String, JsonValue> = additionalProperties - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectInferencePipelineCreateBody && - this.description == other.description && - this.name == other.name && - this.referenceDatasetUri == other.referenceDatasetUri && - this.storageType == other.storageType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - description, - name, - referenceDatasetUri, - storageType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectInferencePipelineCreateBody{description=$description, name=$name, referenceDatasetUri=$referenceDatasetUri, storageType=$storageType, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var description: String? = null - private var name: String? = null - private var referenceDatasetUri: String? = null - private var storageType: StorageType? = null - private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from( - projectInferencePipelineCreateBody: ProjectInferencePipelineCreateBody - ) = apply { - this.description = projectInferencePipelineCreateBody.description - this.name = projectInferencePipelineCreateBody.name - this.referenceDatasetUri = projectInferencePipelineCreateBody.referenceDatasetUri - this.storageType = projectInferencePipelineCreateBody.storageType - additionalProperties(projectInferencePipelineCreateBody.additionalProperties) - } - - /** The inference pipeline description. */ - @JsonProperty("description") - fun description(description: String) = apply { this.description = description } - - /** The inference pipeline name. */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } - - /** The reference dataset URI. */ - @JsonProperty("referenceDatasetUri") - fun referenceDatasetUri(referenceDatasetUri: String) = apply { - this.referenceDatasetUri = referenceDatasetUri - } - - /** The storage type. */ - @JsonProperty("storageType") - fun storageType(storageType: StorageType) = apply { this.storageType = storageType } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): ProjectInferencePipelineCreateBody = - ProjectInferencePipelineCreateBody( - description, - checkNotNull(name) { "`name` is required but was not set" }, - referenceDatasetUri, - storageType, - additionalProperties.toUnmodifiable(), - ) - } - } - - fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams - - fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders - - fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectInferencePipelineCreateParams && - this.id == other.id && - this.description == other.description && - this.name == other.name && - this.referenceDatasetUri == other.referenceDatasetUri && - this.storageType == other.storageType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties - } - - override fun hashCode(): Int { - return Objects.hash( - id, - description, - name, - referenceDatasetUri, - storageType, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) - } - - override fun toString() = - "ProjectInferencePipelineCreateParams{id=$id, description=$description, name=$name, referenceDatasetUri=$referenceDatasetUri, storageType=$storageType, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - @NoAutoDetect - class Builder { - - private var id: String? = null - private var description: String? = null - private var name: String? = null - private var referenceDatasetUri: String? = null - private var storageType: StorageType? = null - private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf() - private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf() - private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from( - projectInferencePipelineCreateParams: ProjectInferencePipelineCreateParams - ) = apply { - this.id = projectInferencePipelineCreateParams.id - this.description = projectInferencePipelineCreateParams.description - this.name = projectInferencePipelineCreateParams.name - this.referenceDatasetUri = projectInferencePipelineCreateParams.referenceDatasetUri - this.storageType = projectInferencePipelineCreateParams.storageType - additionalQueryParams(projectInferencePipelineCreateParams.additionalQueryParams) - additionalHeaders(projectInferencePipelineCreateParams.additionalHeaders) - additionalBodyProperties(projectInferencePipelineCreateParams.additionalBodyProperties) - } - - fun id(id: String) = apply { this.id = id } - - /** The inference pipeline description. */ - fun description(description: String) = apply { this.description = description } - - /** The inference pipeline name. */ - fun name(name: String) = apply { this.name = name } - - /** The reference dataset URI. */ - fun referenceDatasetUri(referenceDatasetUri: String) = apply { - this.referenceDatasetUri = referenceDatasetUri - } - - /** The storage type. */ - fun storageType(storageType: StorageType) = apply { this.storageType = storageType } - - fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = 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<String>) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply { - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { - this.additionalQueryParams.put(name, mutableListOf()) - } - - fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = 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<String>) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply { - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } - - fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply { - this.additionalBodyProperties.clear() - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - this.additionalBodyProperties.put(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = - apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun build(): ProjectInferencePipelineCreateParams = - ProjectInferencePipelineCreateParams( - checkNotNull(id) { "`id` is required but was not set" }, - description, - checkNotNull(name) { "`name` is required but was not set" }, - referenceDatasetUri, - storageType, - additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalBodyProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = Links.Builder::class) - @NoAutoDetect - class Links - private constructor( - private val app: String?, - private val additionalProperties: Map<String, JsonValue>, - ) { - - private var hashCode: Int = 0 - - @JsonProperty("app") fun app(): String? = app - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map<String, JsonValue> = additionalProperties - - 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: String? = null - private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from(links: Links) = apply { - this.app = links.app - additionalProperties(links.additionalProperties) - } - - @JsonProperty("app") fun app(app: String) = apply { this.app = app } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Links = - Links( - checkNotNull(app) { "`app` is required but was not set" }, - additionalProperties.toUnmodifiable() - ) - } - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField<String>, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = 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() - } - - class StorageType - @JsonCreator - private constructor( - private val value: JsonField<String>, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is StorageType && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val LOCAL = StorageType(JsonField.of("local")) - - @JvmField val S3 = StorageType(JsonField.of("s3")) - - @JvmField val GCS = StorageType(JsonField.of("gcs")) - - @JvmField val AZURE = StorageType(JsonField.of("azure")) - - @JvmStatic fun of(value: String) = StorageType(JsonField.of(value)) - } - - enum class Known { - LOCAL, - S3, - GCS, - AZURE, - } - - enum class Value { - LOCAL, - S3, - GCS, - AZURE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - LOCAL -> Value.LOCAL - S3 -> Value.S3 - GCS -> Value.GCS - AZURE -> Value.AZURE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - LOCAL -> Known.LOCAL - S3 -> Known.S3 - GCS -> Known.GCS - AZURE -> Known.AZURE - else -> throw OpenlayerInvalidDataException("Unknown StorageType: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt deleted file mode 100644 index 02a9a38..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt +++ /dev/null @@ -1,733 +0,0 @@ -// 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 = ProjectInferencePipelineCreateResponse.Builder::class) -@NoAutoDetect -class ProjectInferencePipelineCreateResponse -private constructor( - private val id: JsonField<String>, - private val projectId: JsonField<String>, - private val name: JsonField<String>, - private val dateCreated: JsonField<OffsetDateTime>, - private val dateUpdated: JsonField<OffsetDateTime>, - private val dateLastSampleReceived: JsonField<OffsetDateTime>, - private val description: JsonField<String>, - private val dateLastEvaluated: JsonField<OffsetDateTime>, - private val dateOfNextEvaluation: JsonField<OffsetDateTime>, - private val passingGoalCount: JsonField<Long>, - private val failingGoalCount: JsonField<Long>, - private val totalGoalCount: JsonField<Long>, - private val referenceDatasetUri: JsonField<String>, - private val status: JsonField<Status>, - private val statusMessage: JsonField<String>, - private val storageType: JsonField<StorageType>, - private val links: JsonField<Links>, - private val additionalProperties: Map<String, JsonValue>, -) { - - 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<OffsetDateTime> = - Optional.ofNullable(dateLastSampleReceived.getNullable("dateLastSampleReceived")) - - /** The inference pipeline description. */ - fun description(): Optional<String> = - Optional.ofNullable(description.getNullable("description")) - - /** The last test evaluation date. */ - fun dateLastEvaluated(): Optional<OffsetDateTime> = - Optional.ofNullable(dateLastEvaluated.getNullable("dateLastEvaluated")) - - /** The next test evaluation date. */ - fun dateOfNextEvaluation(): Optional<OffsetDateTime> = - 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 reference dataset URI. */ - fun referenceDatasetUri(): Optional<String> = - Optional.ofNullable(referenceDatasetUri.getNullable("referenceDatasetUri")) - - /** 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<String> = - Optional.ofNullable(statusMessage.getNullable("statusMessage")) - - /** The storage type. */ - fun storageType(): Optional<StorageType> = - Optional.ofNullable(storageType.getNullable("storageType")) - - 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 reference dataset URI. */ - @JsonProperty("referenceDatasetUri") - @ExcludeMissing - fun _referenceDatasetUri() = referenceDatasetUri - - /** 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 - - /** The storage type. */ - @JsonProperty("storageType") @ExcludeMissing fun _storageType() = storageType - - @JsonProperty("links") @ExcludeMissing fun _links() = links - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map<String, JsonValue> = additionalProperties - - fun validate(): ProjectInferencePipelineCreateResponse = apply { - if (!validated) { - id() - projectId() - name() - dateCreated() - dateUpdated() - dateLastSampleReceived() - description() - dateLastEvaluated() - dateOfNextEvaluation() - passingGoalCount() - failingGoalCount() - totalGoalCount() - referenceDatasetUri() - status() - statusMessage() - storageType() - links().validate() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectInferencePipelineCreateResponse && - 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.referenceDatasetUri == other.referenceDatasetUri && - this.status == other.status && - this.statusMessage == other.statusMessage && - this.storageType == other.storageType && - 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, - referenceDatasetUri, - status, - statusMessage, - storageType, - links, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectInferencePipelineCreateResponse{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, referenceDatasetUri=$referenceDatasetUri, status=$status, statusMessage=$statusMessage, storageType=$storageType, links=$links, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField<String> = JsonMissing.of() - private var projectId: JsonField<String> = JsonMissing.of() - private var name: JsonField<String> = JsonMissing.of() - private var dateCreated: JsonField<OffsetDateTime> = JsonMissing.of() - private var dateUpdated: JsonField<OffsetDateTime> = JsonMissing.of() - private var dateLastSampleReceived: JsonField<OffsetDateTime> = JsonMissing.of() - private var description: JsonField<String> = JsonMissing.of() - private var dateLastEvaluated: JsonField<OffsetDateTime> = JsonMissing.of() - private var dateOfNextEvaluation: JsonField<OffsetDateTime> = JsonMissing.of() - private var passingGoalCount: JsonField<Long> = JsonMissing.of() - private var failingGoalCount: JsonField<Long> = JsonMissing.of() - private var totalGoalCount: JsonField<Long> = JsonMissing.of() - private var referenceDatasetUri: JsonField<String> = JsonMissing.of() - private var status: JsonField<Status> = JsonMissing.of() - private var statusMessage: JsonField<String> = JsonMissing.of() - private var storageType: JsonField<StorageType> = JsonMissing.of() - private var links: JsonField<Links> = JsonMissing.of() - private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from( - projectInferencePipelineCreateResponse: ProjectInferencePipelineCreateResponse - ) = apply { - this.id = projectInferencePipelineCreateResponse.id - this.projectId = projectInferencePipelineCreateResponse.projectId - this.name = projectInferencePipelineCreateResponse.name - this.dateCreated = projectInferencePipelineCreateResponse.dateCreated - this.dateUpdated = projectInferencePipelineCreateResponse.dateUpdated - this.dateLastSampleReceived = - projectInferencePipelineCreateResponse.dateLastSampleReceived - this.description = projectInferencePipelineCreateResponse.description - this.dateLastEvaluated = projectInferencePipelineCreateResponse.dateLastEvaluated - this.dateOfNextEvaluation = projectInferencePipelineCreateResponse.dateOfNextEvaluation - this.passingGoalCount = projectInferencePipelineCreateResponse.passingGoalCount - this.failingGoalCount = projectInferencePipelineCreateResponse.failingGoalCount - this.totalGoalCount = projectInferencePipelineCreateResponse.totalGoalCount - this.referenceDatasetUri = projectInferencePipelineCreateResponse.referenceDatasetUri - this.status = projectInferencePipelineCreateResponse.status - this.statusMessage = projectInferencePipelineCreateResponse.statusMessage - this.storageType = projectInferencePipelineCreateResponse.storageType - this.links = projectInferencePipelineCreateResponse.links - additionalProperties(projectInferencePipelineCreateResponse.additionalProperties) - } - - /** The inference pipeline id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** The inference pipeline id. */ - @JsonProperty("id") @ExcludeMissing fun id(id: JsonField<String>) = 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<String>) = 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<String>) = 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<OffsetDateTime>) = 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<OffsetDateTime>) = 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<OffsetDateTime>) = 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<String>) = 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<OffsetDateTime>) = 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<OffsetDateTime>) = 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<Long>) = 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<Long>) = 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<Long>) = apply { - this.totalGoalCount = totalGoalCount - } - - /** The reference dataset URI. */ - fun referenceDatasetUri(referenceDatasetUri: String) = - referenceDatasetUri(JsonField.of(referenceDatasetUri)) - - /** The reference dataset URI. */ - @JsonProperty("referenceDatasetUri") - @ExcludeMissing - fun referenceDatasetUri(referenceDatasetUri: JsonField<String>) = apply { - this.referenceDatasetUri = referenceDatasetUri - } - - /** 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<Status>) = 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<String>) = apply { - this.statusMessage = statusMessage - } - - /** The storage type. */ - fun storageType(storageType: StorageType) = storageType(JsonField.of(storageType)) - - /** The storage type. */ - @JsonProperty("storageType") - @ExcludeMissing - fun storageType(storageType: JsonField<StorageType>) = apply { - this.storageType = storageType - } - - fun links(links: Links) = links(JsonField.of(links)) - - @JsonProperty("links") - @ExcludeMissing - fun links(links: JsonField<Links>) = apply { this.links = links } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): ProjectInferencePipelineCreateResponse = - ProjectInferencePipelineCreateResponse( - id, - projectId, - name, - dateCreated, - dateUpdated, - dateLastSampleReceived, - description, - dateLastEvaluated, - dateOfNextEvaluation, - passingGoalCount, - failingGoalCount, - totalGoalCount, - referenceDatasetUri, - status, - statusMessage, - storageType, - links, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = Links.Builder::class) - @NoAutoDetect - class Links - private constructor( - private val app: JsonField<String>, - private val additionalProperties: Map<String, JsonValue>, - ) { - - 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<String, JsonValue> = 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<String> = JsonMissing.of() - private var additionalProperties: MutableMap<String, JsonValue> = 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<String>) = apply { this.app = app } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Links = Links(app, additionalProperties.toUnmodifiable()) - } - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField<String>, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = 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() - } - - class StorageType - @JsonCreator - private constructor( - private val value: JsonField<String>, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is StorageType && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val LOCAL = StorageType(JsonField.of("local")) - - @JvmField val S3 = StorageType(JsonField.of("s3")) - - @JvmField val GCS = StorageType(JsonField.of("gcs")) - - @JvmField val AZURE = StorageType(JsonField.of("azure")) - - @JvmStatic fun of(value: String) = StorageType(JsonField.of(value)) - } - - enum class Known { - LOCAL, - S3, - GCS, - AZURE, - } - - enum class Value { - LOCAL, - S3, - GCS, - AZURE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - LOCAL -> Value.LOCAL - S3 -> Value.S3 - GCS -> Value.GCS - AZURE -> Value.AZURE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - LOCAL -> Known.LOCAL - S3 -> Known.S3 - GCS -> Known.GCS - AZURE -> Known.AZURE - else -> throw OpenlayerInvalidDataException("Unknown StorageType: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParams.kt deleted file mode 100644 index a7d94dc..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParams.kt +++ /dev/null @@ -1,194 +0,0 @@ -// 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 ProjectInferencePipelineListParams -constructor( - private val id: String, - private val name: String?, - private val page: Long?, - private val perPage: Long?, - private val additionalQueryParams: Map<String, List<String>>, - private val additionalHeaders: Map<String, List<String>>, - private val additionalBodyProperties: Map<String, JsonValue>, -) { - - fun id(): String = id - - fun name(): Optional<String> = Optional.ofNullable(name) - - fun page(): Optional<Long> = Optional.ofNullable(page) - - fun perPage(): Optional<Long> = Optional.ofNullable(perPage) - - @JvmSynthetic - internal fun getQueryParams(): Map<String, List<String>> { - val params = mutableMapOf<String, List<String>>() - this.name?.let { params.put("name", listOf(it.toString())) } - this.page?.let { params.put("page", listOf(it.toString())) } - this.perPage?.let { params.put("perPage", listOf(it.toString())) } - params.putAll(additionalQueryParams) - return params.toUnmodifiable() - } - - @JvmSynthetic internal fun getHeaders(): Map<String, List<String>> = additionalHeaders - - fun getPathParam(index: Int): String { - return when (index) { - 0 -> id - else -> "" - } - } - - fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams - - fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders - - fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectInferencePipelineListParams && - this.id == other.id && - this.name == other.name && - this.page == other.page && - this.perPage == other.perPage && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties - } - - override fun hashCode(): Int { - return Objects.hash( - id, - name, - page, - perPage, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) - } - - override fun toString() = - "ProjectInferencePipelineListParams{id=$id, name=$name, page=$page, perPage=$perPage, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - @NoAutoDetect - class Builder { - - private var id: String? = null - private var name: String? = null - private var page: Long? = null - private var perPage: Long? = null - private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf() - private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf() - private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from(projectInferencePipelineListParams: ProjectInferencePipelineListParams) = - apply { - this.id = projectInferencePipelineListParams.id - this.name = projectInferencePipelineListParams.name - this.page = projectInferencePipelineListParams.page - this.perPage = projectInferencePipelineListParams.perPage - additionalQueryParams(projectInferencePipelineListParams.additionalQueryParams) - additionalHeaders(projectInferencePipelineListParams.additionalHeaders) - additionalBodyProperties( - projectInferencePipelineListParams.additionalBodyProperties - ) - } - - fun id(id: String) = apply { this.id = id } - - /** Filter list of items by name. */ - fun name(name: String) = apply { this.name = name } - - /** The page to return in a paginated query. */ - fun page(page: Long) = apply { this.page = page } - - /** Maximum number of items to return per page. */ - fun perPage(perPage: Long) = apply { this.perPage = perPage } - - fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = 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<String>) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply { - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { - this.additionalQueryParams.put(name, mutableListOf()) - } - - fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = 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<String>) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply { - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } - - fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply { - this.additionalBodyProperties.clear() - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - this.additionalBodyProperties.put(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = - apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun build(): ProjectInferencePipelineListParams = - ProjectInferencePipelineListParams( - checkNotNull(id) { "`id` is required but was not set" }, - name, - page, - perPage, - 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/ProjectInferencePipelineListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt deleted file mode 100644 index 2d678f9..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt +++ /dev/null @@ -1,1017 +0,0 @@ -// 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 = ProjectInferencePipelineListResponse.Builder::class) -@NoAutoDetect -class ProjectInferencePipelineListResponse -private constructor( - private val _meta: JsonField<_Meta>, - private val items: JsonField<List<Item>>, - private val additionalProperties: Map<String, JsonValue>, -) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun _meta(): _Meta = _meta.getRequired("_meta") - - fun items(): List<Item> = items.getRequired("items") - - @JsonProperty("_meta") @ExcludeMissing fun __meta() = _meta - - @JsonProperty("items") @ExcludeMissing fun _items() = items - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map<String, JsonValue> = additionalProperties - - fun validate(): ProjectInferencePipelineListResponse = apply { - if (!validated) { - _meta().validate() - items().forEach { it.validate() } - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectInferencePipelineListResponse && - this._meta == other._meta && - this.items == other.items && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - _meta, - items, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectInferencePipelineListResponse{_meta=$_meta, items=$items, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var _meta: JsonField<_Meta> = JsonMissing.of() - private var items: JsonField<List<Item>> = JsonMissing.of() - private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from( - projectInferencePipelineListResponse: ProjectInferencePipelineListResponse - ) = apply { - this._meta = projectInferencePipelineListResponse._meta - this.items = projectInferencePipelineListResponse.items - additionalProperties(projectInferencePipelineListResponse.additionalProperties) - } - - fun _meta(_meta: _Meta) = _meta(JsonField.of(_meta)) - - @JsonProperty("_meta") - @ExcludeMissing - fun _meta(_meta: JsonField<_Meta>) = apply { this._meta = _meta } - - fun items(items: List<Item>) = items(JsonField.of(items)) - - @JsonProperty("items") - @ExcludeMissing - fun items(items: JsonField<List<Item>>) = apply { this.items = items } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): ProjectInferencePipelineListResponse = - ProjectInferencePipelineListResponse( - _meta, - items.map { it.toUnmodifiable() }, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = _Meta.Builder::class) - @NoAutoDetect - class _Meta - private constructor( - private val page: JsonField<Long>, - private val perPage: JsonField<Long>, - private val totalItems: JsonField<Long>, - private val totalPages: JsonField<Long>, - private val additionalProperties: Map<String, JsonValue>, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The current page. */ - fun page(): Long = page.getRequired("page") - - /** The number of items per page. */ - fun perPage(): Long = perPage.getRequired("perPage") - - /** The total number of items. */ - fun totalItems(): Long = totalItems.getRequired("totalItems") - - /** The total number of pages. */ - fun totalPages(): Long = totalPages.getRequired("totalPages") - - /** The current page. */ - @JsonProperty("page") @ExcludeMissing fun _page() = page - - /** The number of items per page. */ - @JsonProperty("perPage") @ExcludeMissing fun _perPage() = perPage - - /** The total number of items. */ - @JsonProperty("totalItems") @ExcludeMissing fun _totalItems() = totalItems - - /** The total number of pages. */ - @JsonProperty("totalPages") @ExcludeMissing fun _totalPages() = totalPages - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map<String, JsonValue> = additionalProperties - - fun validate(): _Meta = apply { - if (!validated) { - page() - perPage() - totalItems() - totalPages() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is _Meta && - this.page == other.page && - this.perPage == other.perPage && - this.totalItems == other.totalItems && - this.totalPages == other.totalPages && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - page, - perPage, - totalItems, - totalPages, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "_Meta{page=$page, perPage=$perPage, totalItems=$totalItems, totalPages=$totalPages, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var page: JsonField<Long> = JsonMissing.of() - private var perPage: JsonField<Long> = JsonMissing.of() - private var totalItems: JsonField<Long> = JsonMissing.of() - private var totalPages: JsonField<Long> = JsonMissing.of() - private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from(_meta: _Meta) = apply { - this.page = _meta.page - this.perPage = _meta.perPage - this.totalItems = _meta.totalItems - this.totalPages = _meta.totalPages - additionalProperties(_meta.additionalProperties) - } - - /** The current page. */ - fun page(page: Long) = page(JsonField.of(page)) - - /** The current page. */ - @JsonProperty("page") - @ExcludeMissing - fun page(page: JsonField<Long>) = apply { this.page = page } - - /** The number of items per page. */ - fun perPage(perPage: Long) = perPage(JsonField.of(perPage)) - - /** The number of items per page. */ - @JsonProperty("perPage") - @ExcludeMissing - fun perPage(perPage: JsonField<Long>) = apply { this.perPage = perPage } - - /** The total number of items. */ - fun totalItems(totalItems: Long) = totalItems(JsonField.of(totalItems)) - - /** The total number of items. */ - @JsonProperty("totalItems") - @ExcludeMissing - fun totalItems(totalItems: JsonField<Long>) = apply { this.totalItems = totalItems } - - /** The total number of pages. */ - fun totalPages(totalPages: Long) = totalPages(JsonField.of(totalPages)) - - /** The total number of pages. */ - @JsonProperty("totalPages") - @ExcludeMissing - fun totalPages(totalPages: JsonField<Long>) = apply { this.totalPages = totalPages } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): _Meta = - _Meta( - page, - perPage, - totalItems, - totalPages, - additionalProperties.toUnmodifiable(), - ) - } - } - - @JsonDeserialize(builder = Item.Builder::class) - @NoAutoDetect - class Item - private constructor( - private val id: JsonField<String>, - private val projectId: JsonField<String>, - private val name: JsonField<String>, - private val dateCreated: JsonField<OffsetDateTime>, - private val dateUpdated: JsonField<OffsetDateTime>, - private val dateLastSampleReceived: JsonField<OffsetDateTime>, - private val description: JsonField<String>, - private val dateLastEvaluated: JsonField<OffsetDateTime>, - private val dateOfNextEvaluation: JsonField<OffsetDateTime>, - private val passingGoalCount: JsonField<Long>, - private val failingGoalCount: JsonField<Long>, - private val totalGoalCount: JsonField<Long>, - private val referenceDatasetUri: JsonField<String>, - private val status: JsonField<Status>, - private val statusMessage: JsonField<String>, - private val storageType: JsonField<StorageType>, - private val links: JsonField<Links>, - private val additionalProperties: Map<String, JsonValue>, - ) { - - 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<OffsetDateTime> = - Optional.ofNullable(dateLastSampleReceived.getNullable("dateLastSampleReceived")) - - /** The inference pipeline description. */ - fun description(): Optional<String> = - Optional.ofNullable(description.getNullable("description")) - - /** The last test evaluation date. */ - fun dateLastEvaluated(): Optional<OffsetDateTime> = - Optional.ofNullable(dateLastEvaluated.getNullable("dateLastEvaluated")) - - /** The next test evaluation date. */ - fun dateOfNextEvaluation(): Optional<OffsetDateTime> = - 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 reference dataset URI. */ - fun referenceDatasetUri(): Optional<String> = - Optional.ofNullable(referenceDatasetUri.getNullable("referenceDatasetUri")) - - /** 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<String> = - Optional.ofNullable(statusMessage.getNullable("statusMessage")) - - /** The storage type. */ - fun storageType(): Optional<StorageType> = - Optional.ofNullable(storageType.getNullable("storageType")) - - 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 reference dataset URI. */ - @JsonProperty("referenceDatasetUri") - @ExcludeMissing - fun _referenceDatasetUri() = referenceDatasetUri - - /** 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 - - /** The storage type. */ - @JsonProperty("storageType") @ExcludeMissing fun _storageType() = storageType - - @JsonProperty("links") @ExcludeMissing fun _links() = links - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map<String, JsonValue> = additionalProperties - - fun validate(): Item = apply { - if (!validated) { - id() - projectId() - name() - dateCreated() - dateUpdated() - dateLastSampleReceived() - description() - dateLastEvaluated() - dateOfNextEvaluation() - passingGoalCount() - failingGoalCount() - totalGoalCount() - referenceDatasetUri() - status() - statusMessage() - storageType() - links().validate() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Item && - 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.referenceDatasetUri == other.referenceDatasetUri && - this.status == other.status && - this.statusMessage == other.statusMessage && - this.storageType == other.storageType && - 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, - referenceDatasetUri, - status, - statusMessage, - storageType, - links, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Item{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, referenceDatasetUri=$referenceDatasetUri, status=$status, statusMessage=$statusMessage, storageType=$storageType, links=$links, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField<String> = JsonMissing.of() - private var projectId: JsonField<String> = JsonMissing.of() - private var name: JsonField<String> = JsonMissing.of() - private var dateCreated: JsonField<OffsetDateTime> = JsonMissing.of() - private var dateUpdated: JsonField<OffsetDateTime> = JsonMissing.of() - private var dateLastSampleReceived: JsonField<OffsetDateTime> = JsonMissing.of() - private var description: JsonField<String> = JsonMissing.of() - private var dateLastEvaluated: JsonField<OffsetDateTime> = JsonMissing.of() - private var dateOfNextEvaluation: JsonField<OffsetDateTime> = JsonMissing.of() - private var passingGoalCount: JsonField<Long> = JsonMissing.of() - private var failingGoalCount: JsonField<Long> = JsonMissing.of() - private var totalGoalCount: JsonField<Long> = JsonMissing.of() - private var referenceDatasetUri: JsonField<String> = JsonMissing.of() - private var status: JsonField<Status> = JsonMissing.of() - private var statusMessage: JsonField<String> = JsonMissing.of() - private var storageType: JsonField<StorageType> = JsonMissing.of() - private var links: JsonField<Links> = JsonMissing.of() - private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - this.id = item.id - this.projectId = item.projectId - this.name = item.name - this.dateCreated = item.dateCreated - this.dateUpdated = item.dateUpdated - this.dateLastSampleReceived = item.dateLastSampleReceived - this.description = item.description - this.dateLastEvaluated = item.dateLastEvaluated - this.dateOfNextEvaluation = item.dateOfNextEvaluation - this.passingGoalCount = item.passingGoalCount - this.failingGoalCount = item.failingGoalCount - this.totalGoalCount = item.totalGoalCount - this.referenceDatasetUri = item.referenceDatasetUri - this.status = item.status - this.statusMessage = item.statusMessage - this.storageType = item.storageType - this.links = item.links - additionalProperties(item.additionalProperties) - } - - /** The inference pipeline id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** The inference pipeline id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField<String>) = 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<String>) = 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<String>) = 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<OffsetDateTime>) = 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<OffsetDateTime>) = 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<OffsetDateTime>) = 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<String>) = 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<OffsetDateTime>) = 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<OffsetDateTime>) = 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<Long>) = 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<Long>) = 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<Long>) = apply { - this.totalGoalCount = totalGoalCount - } - - /** The reference dataset URI. */ - fun referenceDatasetUri(referenceDatasetUri: String) = - referenceDatasetUri(JsonField.of(referenceDatasetUri)) - - /** The reference dataset URI. */ - @JsonProperty("referenceDatasetUri") - @ExcludeMissing - fun referenceDatasetUri(referenceDatasetUri: JsonField<String>) = apply { - this.referenceDatasetUri = referenceDatasetUri - } - - /** 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<Status>) = 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<String>) = apply { - this.statusMessage = statusMessage - } - - /** The storage type. */ - fun storageType(storageType: StorageType) = storageType(JsonField.of(storageType)) - - /** The storage type. */ - @JsonProperty("storageType") - @ExcludeMissing - fun storageType(storageType: JsonField<StorageType>) = apply { - this.storageType = storageType - } - - fun links(links: Links) = links(JsonField.of(links)) - - @JsonProperty("links") - @ExcludeMissing - fun links(links: JsonField<Links>) = apply { this.links = links } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Item = - Item( - id, - projectId, - name, - dateCreated, - dateUpdated, - dateLastSampleReceived, - description, - dateLastEvaluated, - dateOfNextEvaluation, - passingGoalCount, - failingGoalCount, - totalGoalCount, - referenceDatasetUri, - status, - statusMessage, - storageType, - links, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = Links.Builder::class) - @NoAutoDetect - class Links - private constructor( - private val app: JsonField<String>, - private val additionalProperties: Map<String, JsonValue>, - ) { - - 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<String, JsonValue> = 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<String> = JsonMissing.of() - private var additionalProperties: MutableMap<String, JsonValue> = 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<String>) = apply { this.app = app } - - fun additionalProperties(additionalProperties: Map<String, JsonValue>) = 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<String, JsonValue>) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Links = Links(app, additionalProperties.toUnmodifiable()) - } - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField<String>, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = 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() - } - - class StorageType - @JsonCreator - private constructor( - private val value: JsonField<String>, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is StorageType && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val LOCAL = StorageType(JsonField.of("local")) - - @JvmField val S3 = StorageType(JsonField.of("s3")) - - @JvmField val GCS = StorageType(JsonField.of("gcs")) - - @JvmField val AZURE = StorageType(JsonField.of("azure")) - - @JvmStatic fun of(value: String) = StorageType(JsonField.of(value)) - } - - enum class Known { - LOCAL, - S3, - GCS, - AZURE, - } - - enum class Value { - LOCAL, - S3, - GCS, - AZURE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - LOCAL -> Value.LOCAL - S3 -> Value.S3 - GCS -> Value.GCS - AZURE -> Value.AZURE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - LOCAL -> Known.LOCAL - S3 -> Known.S3 - GCS -> Known.GCS - AZURE -> Known.AZURE - else -> throw OpenlayerInvalidDataException("Unknown StorageType: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsync.kt index 9f53829..39d03aa 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsync.kt @@ -4,26 +4,4 @@ package com.openlayer.api.services.async.projects -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.ProjectInferencePipelineCreateParams -import com.openlayer.api.models.ProjectInferencePipelineCreateResponse -import com.openlayer.api.models.ProjectInferencePipelineListParams -import com.openlayer.api.models.ProjectInferencePipelineListResponse -import java.util.concurrent.CompletableFuture - -interface InferencePipelineServiceAsync { - - /** Create an inference pipeline under a project. */ - @JvmOverloads - fun create( - params: ProjectInferencePipelineCreateParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture<ProjectInferencePipelineCreateResponse> - - /** List the inference pipelines in a project. */ - @JvmOverloads - fun list( - params: ProjectInferencePipelineListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture<ProjectInferencePipelineListResponse> -} +interface InferencePipelineServiceAsync diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncImpl.kt index 7c01cde..77cb45d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncImpl.kt @@ -3,20 +3,9 @@ package com.openlayer.api.services.async.projects 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.ProjectInferencePipelineCreateParams -import com.openlayer.api.models.ProjectInferencePipelineCreateResponse -import com.openlayer.api.models.ProjectInferencePipelineListParams -import com.openlayer.api.models.ProjectInferencePipelineListResponse 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( @@ -24,65 +13,4 @@ constructor( ) : InferencePipelineServiceAsync { private val errorHandler: Handler<OpenlayerError> = errorHandler(clientOptions.jsonMapper) - - private val createHandler: Handler<ProjectInferencePipelineCreateResponse> = - jsonHandler<ProjectInferencePipelineCreateResponse>(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Create an inference pipeline under a project. */ - override fun create( - params: ProjectInferencePipelineCreateParams, - requestOptions: RequestOptions - ): CompletableFuture<ProjectInferencePipelineCreateResponse> { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .addPathSegments("projects", params.getPathParam(0), "inference-pipelines") - .putAllQueryParams(clientOptions.queryParams) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } - } - } - } - - private val listHandler: Handler<ProjectInferencePipelineListResponse> = - jsonHandler<ProjectInferencePipelineListResponse>(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the inference pipelines in a project. */ - override fun list( - params: ProjectInferencePipelineListParams, - requestOptions: RequestOptions - ): CompletableFuture<ProjectInferencePipelineListResponse> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("projects", params.getPathParam(0), "inference-pipelines") - .putAllQueryParams(clientOptions.queryParams) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } - } - } - } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineService.kt index e9fb6bf..e1f61c9 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineService.kt @@ -4,25 +4,4 @@ package com.openlayer.api.services.blocking.projects -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.ProjectInferencePipelineCreateParams -import com.openlayer.api.models.ProjectInferencePipelineCreateResponse -import com.openlayer.api.models.ProjectInferencePipelineListParams -import com.openlayer.api.models.ProjectInferencePipelineListResponse - -interface InferencePipelineService { - - /** Create an inference pipeline under a project. */ - @JvmOverloads - fun create( - params: ProjectInferencePipelineCreateParams, - requestOptions: RequestOptions = RequestOptions.none() - ): ProjectInferencePipelineCreateResponse - - /** List the inference pipelines in a project. */ - @JvmOverloads - fun list( - params: ProjectInferencePipelineListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): ProjectInferencePipelineListResponse -} +interface InferencePipelineService diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceImpl.kt index bb3414c..3b4bc5d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceImpl.kt @@ -3,19 +3,9 @@ package com.openlayer.api.services.blocking.projects 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.ProjectInferencePipelineCreateParams -import com.openlayer.api.models.ProjectInferencePipelineCreateResponse -import com.openlayer.api.models.ProjectInferencePipelineListParams -import com.openlayer.api.models.ProjectInferencePipelineListResponse 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( @@ -23,63 +13,4 @@ constructor( ) : InferencePipelineService { private val errorHandler: Handler<OpenlayerError> = errorHandler(clientOptions.jsonMapper) - - private val createHandler: Handler<ProjectInferencePipelineCreateResponse> = - jsonHandler<ProjectInferencePipelineCreateResponse>(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Create an inference pipeline under a project. */ - override fun create( - params: ProjectInferencePipelineCreateParams, - requestOptions: RequestOptions - ): ProjectInferencePipelineCreateResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .addPathSegments("projects", params.getPathParam(0), "inference-pipelines") - .putAllQueryParams(clientOptions.queryParams) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } - } - } - } - - private val listHandler: Handler<ProjectInferencePipelineListResponse> = - jsonHandler<ProjectInferencePipelineListResponse>(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the inference pipelines in a project. */ - override fun list( - params: ProjectInferencePipelineListParams, - requestOptions: RequestOptions - ): ProjectInferencePipelineListResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("projects", params.getPathParam(0), "inference-pipelines") - .putAllQueryParams(clientOptions.queryParams) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } - } - } - } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt deleted file mode 100644 index fc267a2..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt +++ /dev/null @@ -1,66 +0,0 @@ -// 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 ProjectInferencePipelineCreateParamsTest { - - @Test - fun createProjectInferencePipelineCreateParams() { - ProjectInferencePipelineCreateParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .description("This pipeline is used for production.") - .name("production") - .referenceDatasetUri("s3://...") - .storageType(ProjectInferencePipelineCreateParams.StorageType.LOCAL) - .build() - } - - @Test - fun getBody() { - val params = - ProjectInferencePipelineCreateParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .description("This pipeline is used for production.") - .name("production") - .referenceDatasetUri("s3://...") - .storageType(ProjectInferencePipelineCreateParams.StorageType.LOCAL) - .build() - val body = params.getBody() - assertThat(body).isNotNull - assertThat(body.description()).isEqualTo("This pipeline is used for production.") - assertThat(body.name()).isEqualTo("production") - assertThat(body.referenceDatasetUri()).isEqualTo("s3://...") - assertThat(body.storageType()) - .isEqualTo(ProjectInferencePipelineCreateParams.StorageType.LOCAL) - } - - @Test - fun getBodyWithoutOptionalFields() { - val params = - ProjectInferencePipelineCreateParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .name("production") - .build() - val body = params.getBody() - assertThat(body).isNotNull - assertThat(body.name()).isEqualTo("production") - } - - @Test - fun getPathParam() { - val params = - ProjectInferencePipelineCreateParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .name("production") - .build() - assertThat(params).isNotNull - // path param "id" - 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/ProjectInferencePipelineCreateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt deleted file mode 100644 index 506e8ca..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt +++ /dev/null @@ -1,77 +0,0 @@ -// 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 ProjectInferencePipelineCreateResponseTest { - - @Test - fun createProjectInferencePipelineCreateResponse() { - val projectInferencePipelineCreateResponse = - ProjectInferencePipelineCreateResponse.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( - ProjectInferencePipelineCreateResponse.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(ProjectInferencePipelineCreateResponse.Status.QUEUED) - .statusMessage("Tests successfully evaluated") - .totalGoalCount(123L) - .referenceDatasetUri("s3://...") - .storageType(ProjectInferencePipelineCreateResponse.StorageType.LOCAL) - .build() - assertThat(projectInferencePipelineCreateResponse).isNotNull - assertThat(projectInferencePipelineCreateResponse.id()) - .isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") - assertThat(projectInferencePipelineCreateResponse.dateCreated()) - .isEqualTo(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - assertThat(projectInferencePipelineCreateResponse.dateLastEvaluated()) - .contains(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - assertThat(projectInferencePipelineCreateResponse.dateLastSampleReceived()) - .contains(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - assertThat(projectInferencePipelineCreateResponse.dateOfNextEvaluation()) - .contains(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - assertThat(projectInferencePipelineCreateResponse.dateUpdated()) - .isEqualTo(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - assertThat(projectInferencePipelineCreateResponse.description()) - .contains("This pipeline is used for production.") - assertThat(projectInferencePipelineCreateResponse.failingGoalCount()).isEqualTo(123L) - assertThat(projectInferencePipelineCreateResponse.links()) - .isEqualTo( - ProjectInferencePipelineCreateResponse.Links.builder() - .app( - "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6/inference-pipeline/3fa85f64-5717-4562-b3fc-2c963f66afa6" - ) - .build() - ) - assertThat(projectInferencePipelineCreateResponse.name()).isEqualTo("production") - assertThat(projectInferencePipelineCreateResponse.passingGoalCount()).isEqualTo(123L) - assertThat(projectInferencePipelineCreateResponse.projectId()) - .isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") - assertThat(projectInferencePipelineCreateResponse.status()) - .isEqualTo(ProjectInferencePipelineCreateResponse.Status.QUEUED) - assertThat(projectInferencePipelineCreateResponse.statusMessage()) - .contains("Tests successfully evaluated") - assertThat(projectInferencePipelineCreateResponse.totalGoalCount()).isEqualTo(123L) - assertThat(projectInferencePipelineCreateResponse.referenceDatasetUri()) - .contains("s3://...") - assertThat(projectInferencePipelineCreateResponse.storageType()) - .contains(ProjectInferencePipelineCreateResponse.StorageType.LOCAL) - } -} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParamsTest.kt deleted file mode 100644 index 14617b0..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListParamsTest.kt +++ /dev/null @@ -1,59 +0,0 @@ -// 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 ProjectInferencePipelineListParamsTest { - - @Test - fun createProjectInferencePipelineListParams() { - ProjectInferencePipelineListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .name("string") - .page(123L) - .perPage(100L) - .build() - } - - @Test - fun getQueryParams() { - val params = - ProjectInferencePipelineListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .name("string") - .page(123L) - .perPage(100L) - .build() - val expected = mutableMapOf<String, List<String>>() - expected.put("name", listOf("string")) - expected.put("page", listOf("123")) - expected.put("perPage", listOf("100")) - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getQueryParamsWithoutOptionalFields() { - val params = - ProjectInferencePipelineListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - val expected = mutableMapOf<String, List<String>>() - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getPathParam() { - val params = - ProjectInferencePipelineListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - assertThat(params).isNotNull - // path param "id" - 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/ProjectInferencePipelineListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt deleted file mode 100644 index bb7a9ef..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt +++ /dev/null @@ -1,98 +0,0 @@ -// 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 ProjectInferencePipelineListResponseTest { - - @Test - fun createProjectInferencePipelineListResponse() { - val projectInferencePipelineListResponse = - ProjectInferencePipelineListResponse.builder() - ._meta( - ProjectInferencePipelineListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - .items( - listOf( - ProjectInferencePipelineListResponse.Item.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( - ProjectInferencePipelineListResponse.Item.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(ProjectInferencePipelineListResponse.Item.Status.QUEUED) - .statusMessage("Tests successfully evaluated") - .totalGoalCount(123L) - .referenceDatasetUri("s3://...") - .storageType( - ProjectInferencePipelineListResponse.Item.StorageType.LOCAL - ) - .build() - ) - ) - .build() - assertThat(projectInferencePipelineListResponse).isNotNull - assertThat(projectInferencePipelineListResponse._meta()) - .isEqualTo( - ProjectInferencePipelineListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - assertThat(projectInferencePipelineListResponse.items()) - .containsExactly( - ProjectInferencePipelineListResponse.Item.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( - ProjectInferencePipelineListResponse.Item.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(ProjectInferencePipelineListResponse.Item.Status.QUEUED) - .statusMessage("Tests successfully evaluated") - .totalGoalCount(123L) - .referenceDatasetUri("s3://...") - .storageType(ProjectInferencePipelineListResponse.Item.StorageType.LOCAL) - .build() - ) - } -} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt index 22e13d5..778a046 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt @@ -3,54 +3,7 @@ package com.openlayer.api.services.blocking.projects 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 { - - @Test - fun callCreate() { - val client = - OpenlayerOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val inferencePipelineService = client.projects().inferencePipelines() - val projectInferencePipelineCreateResponse = - inferencePipelineService.create( - ProjectInferencePipelineCreateParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .description("This pipeline is used for production.") - .name("production") - .referenceDatasetUri("s3://...") - .storageType(ProjectInferencePipelineCreateParams.StorageType.LOCAL) - .build() - ) - println(projectInferencePipelineCreateResponse) - projectInferencePipelineCreateResponse.validate() - } - - @Test - fun callList() { - val client = - OpenlayerOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val inferencePipelineService = client.projects().inferencePipelines() - val projectInferencePipelineListResponse = - inferencePipelineService.list( - ProjectInferencePipelineListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .name("string") - .page(123L) - .perPage(100L) - .build() - ) - println(projectInferencePipelineListResponse) - projectInferencePipelineListResponse.validate() - } -} +@ExtendWith(TestServerExtension::class) class InferencePipelineServiceTest