diff --git a/.stats.yml b/.stats.yml index 2b7dbf3..fcbfe48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 6 +configured_endpoints: 2 diff --git a/README.md b/README.md index 4a4d0de..6885a35 100644 --- a/README.md +++ b/README.md @@ -68,25 +68,15 @@ Read the documentation for more configuration options. ### Example: creating a resource -To create a new inference pipeline data, first use the `InferencePipelineDataStreamParams` builder to specify attributes, -then pass that to the `stream` method of the `data` service. +To create a new project, first use the `ProjectCreateParams` builder to specify attributes, +then pass that to the `create` method of the `projects` service. ```java -import com.openlayer.api.models.InferencePipelineDataStreamParams; -import com.openlayer.api.models.InferencePipelineDataStreamResponse; -import java.util.List; - -InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder() - .rows(List.of(InferencePipelineDataStreamParams.Row.builder().build())) - .config(InferencePipelineDataStreamParams.Config.ofLlmData(InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .costColumnName("cost") - .inputVariableNames(List.of("user_query")) - .numOfTokenColumnName("tokens") - .timestampColumnName("timestamp") - .build())) - .build(); -InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse = client.inferencePipelines().data().stream(params); +import com.openlayer.api.models.ProjectCreateParams; +import com.openlayer.api.models.ProjectCreateResponse; + +ProjectCreateParams params = ProjectCreateParams.builder().build(); +ProjectCreateResponse projectCreateResponse = client.projects().create(params); ``` --- @@ -97,14 +87,14 @@ InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse = client To make a request to the Openlayer API, you generally build an instance of the appropriate `Params` class. -In [Example: creating a resource](#example-creating-a-resource) above, we used the `InferencePipelineDataStreamParams.builder()` to pass to -the `stream` method of the `data` service. +In [Example: creating a resource](#example-creating-a-resource) above, we used the `ProjectCreateParams.builder()` to pass to +the `create` method of the `projects` service. Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using the `putAdditionalProperty` method. ```java -InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder() +ProjectCreateParams params = ProjectCreateParams.builder() // ... normal properties .putAdditionalProperty("secret_param", "4242") .build(); @@ -117,7 +107,7 @@ InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.bui When receiving a response, the Openlayer Java SDK will deserialize it into instances of the typed model classes. In rare cases, the API may return a response property that doesn't match the expected Java type. If you directly access the mistaken property, the SDK will throw an unchecked `OpenlayerInvalidDataException` at runtime. If you would prefer to check in advance that that response is completely well-typed, call `.validate()` on the returned model. ```java -InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse = client.inferencePipelines().data().stream().validate(); +ProjectCreateResponse projectCreateResponse = client.projects().create().validate(); ``` ### Response properties as JSON @@ -147,7 +137,7 @@ if (field.isMissing()) { Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's `_additionalProperties` method: ```java -JsonValue secret = inferencePipelineDataStreamResponse._additionalProperties().get("secret_field"); +JsonValue secret = projectCreateResponse._additionalProperties().get("secret_field"); ``` --- diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListParams.kt deleted file mode 100644 index 5337a3c..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListParams.kt +++ /dev/null @@ -1,377 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.openlayer.api.models - -import com.fasterxml.jackson.annotation.JsonCreator -import com.openlayer.api.core.Enum -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 CommitTestResultListParams -constructor( - private val id: String, - private val includeArchived: Boolean?, - private val page: Long?, - private val perPage: Long?, - private val status: Status?, - private val type: Type?, - private val additionalQueryParams: Map>, - private val additionalHeaders: Map>, - private val additionalBodyProperties: Map, -) { - - fun id(): String = id - - fun includeArchived(): Optional = Optional.ofNullable(includeArchived) - - fun page(): Optional = Optional.ofNullable(page) - - fun perPage(): Optional = Optional.ofNullable(perPage) - - fun status(): Optional = Optional.ofNullable(status) - - fun type(): Optional = Optional.ofNullable(type) - - @JvmSynthetic - internal fun getQueryParams(): Map> { - val params = mutableMapOf>() - this.includeArchived?.let { params.put("includeArchived", listOf(it.toString())) } - this.page?.let { params.put("page", listOf(it.toString())) } - this.perPage?.let { params.put("perPage", listOf(it.toString())) } - this.status?.let { params.put("status", listOf(it.toString())) } - this.type?.let { params.put("type", listOf(it.toString())) } - params.putAll(additionalQueryParams) - return params.toUnmodifiable() - } - - @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - - fun getPathParam(index: Int): String { - return when (index) { - 0 -> id - else -> "" - } - } - - fun _additionalQueryParams(): Map> = additionalQueryParams - - fun _additionalHeaders(): Map> = additionalHeaders - - fun _additionalBodyProperties(): Map = additionalBodyProperties - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CommitTestResultListParams && - this.id == other.id && - this.includeArchived == other.includeArchived && - this.page == other.page && - this.perPage == other.perPage && - this.status == other.status && - this.type == other.type && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties - } - - override fun hashCode(): Int { - return Objects.hash( - id, - includeArchived, - page, - perPage, - status, - type, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) - } - - override fun toString() = - "CommitTestResultListParams{id=$id, includeArchived=$includeArchived, page=$page, perPage=$perPage, status=$status, type=$type, 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 includeArchived: Boolean? = null - private var page: Long? = null - private var perPage: Long? = null - private var status: Status? = null - private var type: Type? = null - private var additionalQueryParams: MutableMap> = mutableMapOf() - private var additionalHeaders: MutableMap> = mutableMapOf() - private var additionalBodyProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(commitTestResultListParams: CommitTestResultListParams) = apply { - this.id = commitTestResultListParams.id - this.includeArchived = commitTestResultListParams.includeArchived - this.page = commitTestResultListParams.page - this.perPage = commitTestResultListParams.perPage - this.status = commitTestResultListParams.status - this.type = commitTestResultListParams.type - additionalQueryParams(commitTestResultListParams.additionalQueryParams) - additionalHeaders(commitTestResultListParams.additionalHeaders) - additionalBodyProperties(commitTestResultListParams.additionalBodyProperties) - } - - fun id(id: String) = apply { this.id = id } - - /** Include archived goals. */ - fun includeArchived(includeArchived: Boolean) = apply { - this.includeArchived = includeArchived - } - - /** 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 } - - /** - * Filter list of test results by status. Available statuses are `running`, `passing`, - * `failing`, `skipped`, and `error`. - */ - fun status(status: Status) = apply { this.status = status } - - /** - * Filter objects by test type. Available types are `integrity`, `consistency`, - * `performance`, `fairness`, and `robustness`. - */ - fun type(type: Type) = apply { this.type = type } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = apply { - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { - this.additionalQueryParams.put(name, mutableListOf()) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = apply { - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } - - fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - this.additionalBodyProperties.put(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun build(): CommitTestResultListParams = - CommitTestResultListParams( - checkNotNull(id) { "`id` is required but was not set" }, - includeArchived, - page, - perPage, - status, - type, - additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalBodyProperties.toUnmodifiable(), - ) - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Status && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val RUNNING = Status(JsonField.of("running")) - - @JvmField val PASSING = Status(JsonField.of("passing")) - - @JvmField val FAILING = Status(JsonField.of("failing")) - - @JvmField val SKIPPED = Status(JsonField.of("skipped")) - - @JvmField val ERROR = Status(JsonField.of("error")) - - @JvmStatic fun of(value: String) = Status(JsonField.of(value)) - } - - enum class Known { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - } - - enum class Value { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - RUNNING -> Value.RUNNING - PASSING -> Value.PASSING - FAILING -> Value.FAILING - SKIPPED -> Value.SKIPPED - ERROR -> Value.ERROR - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - RUNNING -> Known.RUNNING - PASSING -> Known.PASSING - FAILING -> Known.FAILING - SKIPPED -> Known.SKIPPED - ERROR -> Known.ERROR - else -> throw OpenlayerInvalidDataException("Unknown Status: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val INTEGRITY = Type(JsonField.of("integrity")) - - @JvmField val CONSISTENCY = Type(JsonField.of("consistency")) - - @JvmField val PERFORMANCE = Type(JsonField.of("performance")) - - @JvmField val FAIRNESS = Type(JsonField.of("fairness")) - - @JvmField val ROBUSTNESS = Type(JsonField.of("robustness")) - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - enum class Known { - INTEGRITY, - CONSISTENCY, - PERFORMANCE, - FAIRNESS, - ROBUSTNESS, - } - - enum class Value { - INTEGRITY, - CONSISTENCY, - PERFORMANCE, - FAIRNESS, - ROBUSTNESS, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - INTEGRITY -> Value.INTEGRITY - CONSISTENCY -> Value.CONSISTENCY - PERFORMANCE -> Value.PERFORMANCE - FAIRNESS -> Value.FAIRNESS - ROBUSTNESS -> Value.ROBUSTNESS - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - INTEGRITY -> Known.INTEGRITY - CONSISTENCY -> Known.CONSISTENCY - PERFORMANCE -> Known.PERFORMANCE - FAIRNESS -> Known.FAIRNESS - ROBUSTNESS -> Known.ROBUSTNESS - else -> throw OpenlayerInvalidDataException("Unknown Type: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListResponse.kt deleted file mode 100644 index 731f3b5..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListResponse.kt +++ /dev/null @@ -1,1664 +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.core.JsonGenerator -import com.fasterxml.jackson.core.ObjectCodec -import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.SerializerProvider -import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import com.fasterxml.jackson.databind.annotation.JsonSerialize -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.openlayer.api.core.BaseDeserializer -import com.openlayer.api.core.BaseSerializer -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.getOrThrow -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 = CommitTestResultListResponse.Builder::class) -@NoAutoDetect -class CommitTestResultListResponse -private constructor( - private val _meta: JsonField<_Meta>, - private val items: JsonField>, - private val additionalProperties: Map, -) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun _meta(): _Meta = _meta.getRequired("_meta") - - fun items(): List = items.getRequired("items") - - @JsonProperty("_meta") @ExcludeMissing fun __meta() = _meta - - @JsonProperty("items") @ExcludeMissing fun _items() = items - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): CommitTestResultListResponse = 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 CommitTestResultListResponse && - 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() = - "CommitTestResultListResponse{_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> = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(commitTestResultListResponse: CommitTestResultListResponse) = apply { - this._meta = commitTestResultListResponse._meta - this.items = commitTestResultListResponse.items - additionalProperties(commitTestResultListResponse.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) = items(JsonField.of(items)) - - @JsonProperty("items") - @ExcludeMissing - fun items(items: JsonField>) = apply { this.items = items } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): CommitTestResultListResponse = - CommitTestResultListResponse( - _meta, - items.map { it.toUnmodifiable() }, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = _Meta.Builder::class) - @NoAutoDetect - class _Meta - private constructor( - private val page: JsonField, - private val perPage: JsonField, - private val totalItems: JsonField, - private val totalPages: JsonField, - private val additionalProperties: Map, - ) { - - 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 = 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 = JsonMissing.of() - private var perPage: JsonField = JsonMissing.of() - private var totalItems: JsonField = JsonMissing.of() - private var totalPages: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = 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) = 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) = 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) = 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) = apply { this.totalPages = totalPages } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): _Meta = - _Meta( - page, - perPage, - totalItems, - totalPages, - additionalProperties.toUnmodifiable(), - ) - } - } - - @JsonDeserialize(builder = Item.Builder::class) - @NoAutoDetect - class Item - private constructor( - private val id: JsonField, - private val goal: JsonField, - private val goalId: JsonField, - private val projectVersionId: JsonField, - private val inferencePipelineId: JsonField, - private val dateCreated: JsonField, - private val dateUpdated: JsonField, - private val dateDataStarts: JsonField, - private val dateDataEnds: JsonField, - private val status: JsonField, - private val statusMessage: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** Project version (commit) id. */ - fun id(): String = id.getRequired("id") - - fun goal(): Optional = Optional.ofNullable(goal.getNullable("goal")) - - /** The test id. */ - fun goalId(): Optional = Optional.ofNullable(goalId.getNullable("goalId")) - - /** The project version (commit) id. */ - fun projectVersionId(): Optional = - Optional.ofNullable(projectVersionId.getNullable("projectVersionId")) - - /** The inference pipeline id. */ - fun inferencePipelineId(): Optional = - Optional.ofNullable(inferencePipelineId.getNullable("inferencePipelineId")) - - /** The creation date. */ - fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") - - /** The last updated date. */ - fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") - - /** The data start date. */ - fun dateDataStarts(): Optional = - Optional.ofNullable(dateDataStarts.getNullable("dateDataStarts")) - - /** The data end date. */ - fun dateDataEnds(): Optional = - Optional.ofNullable(dateDataEnds.getNullable("dateDataEnds")) - - /** The status of the test. */ - fun status(): Status = status.getRequired("status") - - /** The status message. */ - fun statusMessage(): Optional = - Optional.ofNullable(statusMessage.getNullable("statusMessage")) - - /** Project version (commit) id. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - - @JsonProperty("goal") @ExcludeMissing fun _goal() = goal - - /** The test id. */ - @JsonProperty("goalId") @ExcludeMissing fun _goalId() = goalId - - /** The project version (commit) id. */ - @JsonProperty("projectVersionId") @ExcludeMissing fun _projectVersionId() = projectVersionId - - /** The inference pipeline id. */ - @JsonProperty("inferencePipelineId") - @ExcludeMissing - fun _inferencePipelineId() = inferencePipelineId - - /** The creation date. */ - @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated - - /** The last updated date. */ - @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated - - /** The data start date. */ - @JsonProperty("dateDataStarts") @ExcludeMissing fun _dateDataStarts() = dateDataStarts - - /** The data end date. */ - @JsonProperty("dateDataEnds") @ExcludeMissing fun _dateDataEnds() = dateDataEnds - - /** The status of the test. */ - @JsonProperty("status") @ExcludeMissing fun _status() = status - - /** The status message. */ - @JsonProperty("statusMessage") @ExcludeMissing fun _statusMessage() = statusMessage - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Item = apply { - if (!validated) { - id() - goal().map { it.validate() } - goalId() - projectVersionId() - inferencePipelineId() - dateCreated() - dateUpdated() - dateDataStarts() - dateDataEnds() - status() - statusMessage() - 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.goal == other.goal && - this.goalId == other.goalId && - this.projectVersionId == other.projectVersionId && - this.inferencePipelineId == other.inferencePipelineId && - this.dateCreated == other.dateCreated && - this.dateUpdated == other.dateUpdated && - this.dateDataStarts == other.dateDataStarts && - this.dateDataEnds == other.dateDataEnds && - this.status == other.status && - this.statusMessage == other.statusMessage && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - goal, - goalId, - projectVersionId, - inferencePipelineId, - dateCreated, - dateUpdated, - dateDataStarts, - dateDataEnds, - status, - statusMessage, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Item{id=$id, goal=$goal, goalId=$goalId, projectVersionId=$projectVersionId, inferencePipelineId=$inferencePipelineId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateDataStarts=$dateDataStarts, dateDataEnds=$dateDataEnds, status=$status, statusMessage=$statusMessage, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField = JsonMissing.of() - private var goal: JsonField = JsonMissing.of() - private var goalId: JsonField = JsonMissing.of() - private var projectVersionId: JsonField = JsonMissing.of() - private var inferencePipelineId: JsonField = JsonMissing.of() - private var dateCreated: JsonField = JsonMissing.of() - private var dateUpdated: JsonField = JsonMissing.of() - private var dateDataStarts: JsonField = JsonMissing.of() - private var dateDataEnds: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() - private var statusMessage: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - this.id = item.id - this.goal = item.goal - this.goalId = item.goalId - this.projectVersionId = item.projectVersionId - this.inferencePipelineId = item.inferencePipelineId - this.dateCreated = item.dateCreated - this.dateUpdated = item.dateUpdated - this.dateDataStarts = item.dateDataStarts - this.dateDataEnds = item.dateDataEnds - this.status = item.status - this.statusMessage = item.statusMessage - additionalProperties(item.additionalProperties) - } - - /** Project version (commit) id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** Project version (commit) id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField) = apply { this.id = id } - - fun goal(goal: Goal) = goal(JsonField.of(goal)) - - @JsonProperty("goal") - @ExcludeMissing - fun goal(goal: JsonField) = apply { this.goal = goal } - - /** The test id. */ - fun goalId(goalId: String) = goalId(JsonField.of(goalId)) - - /** The test id. */ - @JsonProperty("goalId") - @ExcludeMissing - fun goalId(goalId: JsonField) = apply { this.goalId = goalId } - - /** The project version (commit) id. */ - fun projectVersionId(projectVersionId: String) = - projectVersionId(JsonField.of(projectVersionId)) - - /** The project version (commit) id. */ - @JsonProperty("projectVersionId") - @ExcludeMissing - fun projectVersionId(projectVersionId: JsonField) = apply { - this.projectVersionId = projectVersionId - } - - /** The inference pipeline id. */ - fun inferencePipelineId(inferencePipelineId: String) = - inferencePipelineId(JsonField.of(inferencePipelineId)) - - /** The inference pipeline id. */ - @JsonProperty("inferencePipelineId") - @ExcludeMissing - fun inferencePipelineId(inferencePipelineId: JsonField) = apply { - this.inferencePipelineId = inferencePipelineId - } - - /** The creation date. */ - fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) - - /** The creation date. */ - @JsonProperty("dateCreated") - @ExcludeMissing - fun dateCreated(dateCreated: JsonField) = apply { - this.dateCreated = dateCreated - } - - /** The last updated date. */ - fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) - - /** The last updated date. */ - @JsonProperty("dateUpdated") - @ExcludeMissing - fun dateUpdated(dateUpdated: JsonField) = apply { - this.dateUpdated = dateUpdated - } - - /** The data start date. */ - fun dateDataStarts(dateDataStarts: OffsetDateTime) = - dateDataStarts(JsonField.of(dateDataStarts)) - - /** The data start date. */ - @JsonProperty("dateDataStarts") - @ExcludeMissing - fun dateDataStarts(dateDataStarts: JsonField) = apply { - this.dateDataStarts = dateDataStarts - } - - /** The data end date. */ - fun dateDataEnds(dateDataEnds: OffsetDateTime) = - dateDataEnds(JsonField.of(dateDataEnds)) - - /** The data end date. */ - @JsonProperty("dateDataEnds") - @ExcludeMissing - fun dateDataEnds(dateDataEnds: JsonField) = apply { - this.dateDataEnds = dateDataEnds - } - - /** The status of the test. */ - fun status(status: Status) = status(JsonField.of(status)) - - /** The status of the test. */ - @JsonProperty("status") - @ExcludeMissing - fun status(status: JsonField) = apply { this.status = status } - - /** The status message. */ - fun statusMessage(statusMessage: String) = statusMessage(JsonField.of(statusMessage)) - - /** The status message. */ - @JsonProperty("statusMessage") - @ExcludeMissing - fun statusMessage(statusMessage: JsonField) = apply { - this.statusMessage = statusMessage - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Item = - Item( - id, - goal, - goalId, - projectVersionId, - inferencePipelineId, - dateCreated, - dateUpdated, - dateDataStarts, - dateDataEnds, - status, - statusMessage, - additionalProperties.toUnmodifiable(), - ) - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Status && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val RUNNING = Status(JsonField.of("running")) - - @JvmField val PASSING = Status(JsonField.of("passing")) - - @JvmField val FAILING = Status(JsonField.of("failing")) - - @JvmField val SKIPPED = Status(JsonField.of("skipped")) - - @JvmField val ERROR = Status(JsonField.of("error")) - - @JvmStatic fun of(value: String) = Status(JsonField.of(value)) - } - - enum class Known { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - } - - enum class Value { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - RUNNING -> Value.RUNNING - PASSING -> Value.PASSING - FAILING -> Value.FAILING - SKIPPED -> Value.SKIPPED - ERROR -> Value.ERROR - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - RUNNING -> Known.RUNNING - PASSING -> Known.PASSING - FAILING -> Known.FAILING - SKIPPED -> Known.SKIPPED - ERROR -> Known.ERROR - else -> throw OpenlayerInvalidDataException("Unknown Status: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } - - @JsonDeserialize(builder = Goal.Builder::class) - @NoAutoDetect - class Goal - private constructor( - private val id: JsonField, - private val number: JsonField, - private val name: JsonField, - private val dateCreated: JsonField, - private val dateUpdated: JsonField, - private val description: JsonValue, - private val evaluationWindow: JsonField, - private val delayWindow: JsonField, - private val type: JsonField, - private val subtype: JsonField, - private val creatorId: JsonField, - private val originProjectVersionId: JsonField, - private val thresholds: JsonField>, - private val archived: JsonField, - private val dateArchived: JsonField, - private val suggested: JsonField, - private val commentCount: JsonField, - private val usesMlModel: JsonField, - private val usesValidationDataset: JsonField, - private val usesTrainingDataset: JsonField, - private val usesReferenceDataset: JsonField, - private val usesProductionData: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The test id. */ - fun id(): String = id.getRequired("id") - - /** The test number. */ - fun number(): Long = number.getRequired("number") - - /** The test 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 evaluation window in seconds. Only applies to tests that use production data. */ - fun evaluationWindow(): Optional = - Optional.ofNullable(evaluationWindow.getNullable("evaluationWindow")) - - /** The delay window in seconds. Only applies to tests that use production data. */ - fun delayWindow(): Optional = - Optional.ofNullable(delayWindow.getNullable("delayWindow")) - - /** The test type. */ - fun type(): String = type.getRequired("type") - - /** The test subtype. */ - fun subtype(): String = subtype.getRequired("subtype") - - /** The test creator id. */ - fun creatorId(): Optional = - Optional.ofNullable(creatorId.getNullable("creatorId")) - - /** The project version (commit) id where the test was created. */ - fun originProjectVersionId(): Optional = - Optional.ofNullable(originProjectVersionId.getNullable("originProjectVersionId")) - - fun thresholds(): List = thresholds.getRequired("thresholds") - - /** Whether the test is archived. */ - fun archived(): Optional = - Optional.ofNullable(archived.getNullable("archived")) - - /** The date the test was archived. */ - fun dateArchived(): Optional = - Optional.ofNullable(dateArchived.getNullable("dateArchived")) - - /** Whether the test is suggested or user-created. */ - fun suggested(): Boolean = suggested.getRequired("suggested") - - /** The number of comments on the test. */ - fun commentCount(): Long = commentCount.getRequired("commentCount") - - /** Whether the test uses an ML model. */ - fun usesMlModel(): Optional = - Optional.ofNullable(usesMlModel.getNullable("usesMlModel")) - - /** Whether the test uses a validation dataset. */ - fun usesValidationDataset(): Optional = - Optional.ofNullable(usesValidationDataset.getNullable("usesValidationDataset")) - - /** Whether the test uses a training dataset. */ - fun usesTrainingDataset(): Optional = - Optional.ofNullable(usesTrainingDataset.getNullable("usesTrainingDataset")) - - /** Whether the test uses a reference dataset (monitoring mode only). */ - fun usesReferenceDataset(): Optional = - Optional.ofNullable(usesReferenceDataset.getNullable("usesReferenceDataset")) - - /** Whether the test uses production data (monitoring mode only). */ - fun usesProductionData(): Optional = - Optional.ofNullable(usesProductionData.getNullable("usesProductionData")) - - /** The test id. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - - /** The test number. */ - @JsonProperty("number") @ExcludeMissing fun _number() = number - - /** The test 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 test description. */ - @JsonProperty("description") @ExcludeMissing fun _description() = description - - /** The evaluation window in seconds. Only applies to tests that use production data. */ - @JsonProperty("evaluationWindow") - @ExcludeMissing - fun _evaluationWindow() = evaluationWindow - - /** The delay window in seconds. Only applies to tests that use production data. */ - @JsonProperty("delayWindow") @ExcludeMissing fun _delayWindow() = delayWindow - - /** The test type. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** The test subtype. */ - @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype - - /** The test creator id. */ - @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId - - /** The project version (commit) id where the test was created. */ - @JsonProperty("originProjectVersionId") - @ExcludeMissing - fun _originProjectVersionId() = originProjectVersionId - - @JsonProperty("thresholds") @ExcludeMissing fun _thresholds() = thresholds - - /** Whether the test is archived. */ - @JsonProperty("archived") @ExcludeMissing fun _archived() = archived - - /** The date the test was archived. */ - @JsonProperty("dateArchived") @ExcludeMissing fun _dateArchived() = dateArchived - - /** Whether the test is suggested or user-created. */ - @JsonProperty("suggested") @ExcludeMissing fun _suggested() = suggested - - /** The number of comments on the test. */ - @JsonProperty("commentCount") @ExcludeMissing fun _commentCount() = commentCount - - /** Whether the test uses an ML model. */ - @JsonProperty("usesMlModel") @ExcludeMissing fun _usesMlModel() = usesMlModel - - /** Whether the test uses a validation dataset. */ - @JsonProperty("usesValidationDataset") - @ExcludeMissing - fun _usesValidationDataset() = usesValidationDataset - - /** Whether the test uses a training dataset. */ - @JsonProperty("usesTrainingDataset") - @ExcludeMissing - fun _usesTrainingDataset() = usesTrainingDataset - - /** Whether the test uses a reference dataset (monitoring mode only). */ - @JsonProperty("usesReferenceDataset") - @ExcludeMissing - fun _usesReferenceDataset() = usesReferenceDataset - - /** Whether the test uses production data (monitoring mode only). */ - @JsonProperty("usesProductionData") - @ExcludeMissing - fun _usesProductionData() = usesProductionData - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Goal = apply { - if (!validated) { - id() - number() - name() - dateCreated() - dateUpdated() - evaluationWindow() - delayWindow() - type() - subtype() - creatorId() - originProjectVersionId() - thresholds().forEach { it.validate() } - archived() - dateArchived() - suggested() - commentCount() - usesMlModel() - usesValidationDataset() - usesTrainingDataset() - usesReferenceDataset() - usesProductionData() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Goal && - this.id == other.id && - this.number == other.number && - this.name == other.name && - this.dateCreated == other.dateCreated && - this.dateUpdated == other.dateUpdated && - this.description == other.description && - this.evaluationWindow == other.evaluationWindow && - this.delayWindow == other.delayWindow && - this.type == other.type && - this.subtype == other.subtype && - this.creatorId == other.creatorId && - this.originProjectVersionId == other.originProjectVersionId && - this.thresholds == other.thresholds && - this.archived == other.archived && - this.dateArchived == other.dateArchived && - this.suggested == other.suggested && - this.commentCount == other.commentCount && - this.usesMlModel == other.usesMlModel && - this.usesValidationDataset == other.usesValidationDataset && - this.usesTrainingDataset == other.usesTrainingDataset && - this.usesReferenceDataset == other.usesReferenceDataset && - this.usesProductionData == other.usesProductionData && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - number, - name, - dateCreated, - dateUpdated, - description, - evaluationWindow, - delayWindow, - type, - subtype, - creatorId, - originProjectVersionId, - thresholds, - archived, - dateArchived, - suggested, - commentCount, - usesMlModel, - usesValidationDataset, - usesTrainingDataset, - usesReferenceDataset, - usesProductionData, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Goal{id=$id, number=$number, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, evaluationWindow=$evaluationWindow, delayWindow=$delayWindow, type=$type, subtype=$subtype, creatorId=$creatorId, originProjectVersionId=$originProjectVersionId, thresholds=$thresholds, archived=$archived, dateArchived=$dateArchived, suggested=$suggested, commentCount=$commentCount, usesMlModel=$usesMlModel, usesValidationDataset=$usesValidationDataset, usesTrainingDataset=$usesTrainingDataset, usesReferenceDataset=$usesReferenceDataset, usesProductionData=$usesProductionData, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField = JsonMissing.of() - private var number: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var dateCreated: JsonField = JsonMissing.of() - private var dateUpdated: JsonField = JsonMissing.of() - private var description: JsonValue = JsonMissing.of() - private var evaluationWindow: JsonField = JsonMissing.of() - private var delayWindow: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var subtype: JsonField = JsonMissing.of() - private var creatorId: JsonField = JsonMissing.of() - private var originProjectVersionId: JsonField = JsonMissing.of() - private var thresholds: JsonField> = JsonMissing.of() - private var archived: JsonField = JsonMissing.of() - private var dateArchived: JsonField = JsonMissing.of() - private var suggested: JsonField = JsonMissing.of() - private var commentCount: JsonField = JsonMissing.of() - private var usesMlModel: JsonField = JsonMissing.of() - private var usesValidationDataset: JsonField = JsonMissing.of() - private var usesTrainingDataset: JsonField = JsonMissing.of() - private var usesReferenceDataset: JsonField = JsonMissing.of() - private var usesProductionData: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(goal: Goal) = apply { - this.id = goal.id - this.number = goal.number - this.name = goal.name - this.dateCreated = goal.dateCreated - this.dateUpdated = goal.dateUpdated - this.description = goal.description - this.evaluationWindow = goal.evaluationWindow - this.delayWindow = goal.delayWindow - this.type = goal.type - this.subtype = goal.subtype - this.creatorId = goal.creatorId - this.originProjectVersionId = goal.originProjectVersionId - this.thresholds = goal.thresholds - this.archived = goal.archived - this.dateArchived = goal.dateArchived - this.suggested = goal.suggested - this.commentCount = goal.commentCount - this.usesMlModel = goal.usesMlModel - this.usesValidationDataset = goal.usesValidationDataset - this.usesTrainingDataset = goal.usesTrainingDataset - this.usesReferenceDataset = goal.usesReferenceDataset - this.usesProductionData = goal.usesProductionData - additionalProperties(goal.additionalProperties) - } - - /** The test id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** The test id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField) = apply { this.id = id } - - /** The test number. */ - fun number(number: Long) = number(JsonField.of(number)) - - /** The test number. */ - @JsonProperty("number") - @ExcludeMissing - fun number(number: JsonField) = apply { this.number = number } - - /** The test name. */ - fun name(name: String) = name(JsonField.of(name)) - - /** The test name. */ - @JsonProperty("name") - @ExcludeMissing - fun name(name: JsonField) = apply { this.name = name } - - /** The creation date. */ - fun dateCreated(dateCreated: OffsetDateTime) = - dateCreated(JsonField.of(dateCreated)) - - /** The creation date. */ - @JsonProperty("dateCreated") - @ExcludeMissing - fun dateCreated(dateCreated: JsonField) = apply { - this.dateCreated = dateCreated - } - - /** The last updated date. */ - fun dateUpdated(dateUpdated: OffsetDateTime) = - dateUpdated(JsonField.of(dateUpdated)) - - /** The last updated date. */ - @JsonProperty("dateUpdated") - @ExcludeMissing - fun dateUpdated(dateUpdated: JsonField) = apply { - this.dateUpdated = dateUpdated - } - - /** The test description. */ - @JsonProperty("description") - @ExcludeMissing - fun description(description: JsonValue) = apply { this.description = description } - - /** - * The evaluation window in seconds. Only applies to tests that use production data. - */ - fun evaluationWindow(evaluationWindow: Double) = - evaluationWindow(JsonField.of(evaluationWindow)) - - /** - * The evaluation window in seconds. Only applies to tests that use production data. - */ - @JsonProperty("evaluationWindow") - @ExcludeMissing - fun evaluationWindow(evaluationWindow: JsonField) = apply { - this.evaluationWindow = evaluationWindow - } - - /** The delay window in seconds. Only applies to tests that use production data. */ - fun delayWindow(delayWindow: Double) = delayWindow(JsonField.of(delayWindow)) - - /** The delay window in seconds. Only applies to tests that use production data. */ - @JsonProperty("delayWindow") - @ExcludeMissing - fun delayWindow(delayWindow: JsonField) = apply { - this.delayWindow = delayWindow - } - - /** The test type. */ - fun type(type: String) = type(JsonField.of(type)) - - /** The test type. */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** The test subtype. */ - fun subtype(subtype: String) = subtype(JsonField.of(subtype)) - - /** The test subtype. */ - @JsonProperty("subtype") - @ExcludeMissing - fun subtype(subtype: JsonField) = apply { this.subtype = subtype } - - /** The test creator id. */ - fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) - - /** The test creator id. */ - @JsonProperty("creatorId") - @ExcludeMissing - fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } - - /** The project version (commit) id where the test was created. */ - fun originProjectVersionId(originProjectVersionId: String) = - originProjectVersionId(JsonField.of(originProjectVersionId)) - - /** The project version (commit) id where the test was created. */ - @JsonProperty("originProjectVersionId") - @ExcludeMissing - fun originProjectVersionId(originProjectVersionId: JsonField) = apply { - this.originProjectVersionId = originProjectVersionId - } - - fun thresholds(thresholds: List) = thresholds(JsonField.of(thresholds)) - - @JsonProperty("thresholds") - @ExcludeMissing - fun thresholds(thresholds: JsonField>) = apply { - this.thresholds = thresholds - } - - /** Whether the test is archived. */ - fun archived(archived: Boolean) = archived(JsonField.of(archived)) - - /** Whether the test is archived. */ - @JsonProperty("archived") - @ExcludeMissing - fun archived(archived: JsonField) = apply { this.archived = archived } - - /** The date the test was archived. */ - fun dateArchived(dateArchived: OffsetDateTime) = - dateArchived(JsonField.of(dateArchived)) - - /** The date the test was archived. */ - @JsonProperty("dateArchived") - @ExcludeMissing - fun dateArchived(dateArchived: JsonField) = apply { - this.dateArchived = dateArchived - } - - /** Whether the test is suggested or user-created. */ - fun suggested(suggested: Boolean) = suggested(JsonField.of(suggested)) - - /** Whether the test is suggested or user-created. */ - @JsonProperty("suggested") - @ExcludeMissing - fun suggested(suggested: JsonField) = apply { this.suggested = suggested } - - /** The number of comments on the test. */ - fun commentCount(commentCount: Long) = commentCount(JsonField.of(commentCount)) - - /** The number of comments on the test. */ - @JsonProperty("commentCount") - @ExcludeMissing - fun commentCount(commentCount: JsonField) = apply { - this.commentCount = commentCount - } - - /** Whether the test uses an ML model. */ - fun usesMlModel(usesMlModel: Boolean) = usesMlModel(JsonField.of(usesMlModel)) - - /** Whether the test uses an ML model. */ - @JsonProperty("usesMlModel") - @ExcludeMissing - fun usesMlModel(usesMlModel: JsonField) = apply { - this.usesMlModel = usesMlModel - } - - /** Whether the test uses a validation dataset. */ - fun usesValidationDataset(usesValidationDataset: Boolean) = - usesValidationDataset(JsonField.of(usesValidationDataset)) - - /** Whether the test uses a validation dataset. */ - @JsonProperty("usesValidationDataset") - @ExcludeMissing - fun usesValidationDataset(usesValidationDataset: JsonField) = apply { - this.usesValidationDataset = usesValidationDataset - } - - /** Whether the test uses a training dataset. */ - fun usesTrainingDataset(usesTrainingDataset: Boolean) = - usesTrainingDataset(JsonField.of(usesTrainingDataset)) - - /** Whether the test uses a training dataset. */ - @JsonProperty("usesTrainingDataset") - @ExcludeMissing - fun usesTrainingDataset(usesTrainingDataset: JsonField) = apply { - this.usesTrainingDataset = usesTrainingDataset - } - - /** Whether the test uses a reference dataset (monitoring mode only). */ - fun usesReferenceDataset(usesReferenceDataset: Boolean) = - usesReferenceDataset(JsonField.of(usesReferenceDataset)) - - /** Whether the test uses a reference dataset (monitoring mode only). */ - @JsonProperty("usesReferenceDataset") - @ExcludeMissing - fun usesReferenceDataset(usesReferenceDataset: JsonField) = apply { - this.usesReferenceDataset = usesReferenceDataset - } - - /** Whether the test uses production data (monitoring mode only). */ - fun usesProductionData(usesProductionData: Boolean) = - usesProductionData(JsonField.of(usesProductionData)) - - /** Whether the test uses production data (monitoring mode only). */ - @JsonProperty("usesProductionData") - @ExcludeMissing - fun usesProductionData(usesProductionData: JsonField) = apply { - this.usesProductionData = usesProductionData - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Goal = - Goal( - id, - number, - name, - dateCreated, - dateUpdated, - description, - evaluationWindow, - delayWindow, - type, - subtype, - creatorId, - originProjectVersionId, - thresholds.map { it.toUnmodifiable() }, - archived, - dateArchived, - suggested, - commentCount, - usesMlModel, - usesValidationDataset, - usesTrainingDataset, - usesReferenceDataset, - usesProductionData, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = Threshold.Builder::class) - @NoAutoDetect - class Threshold - private constructor( - private val measurement: JsonField, - private val insightName: JsonField, - private val insightParameters: JsonField>, - private val operator: JsonField, - private val value: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The measurement to be evaluated. */ - fun measurement(): Optional = - Optional.ofNullable(measurement.getNullable("measurement")) - - /** The insight name to be evaluated. */ - fun insightName(): Optional = - Optional.ofNullable(insightName.getNullable("insightName")) - - fun insightParameters(): Optional> = - Optional.ofNullable(insightParameters.getNullable("insightParameters")) - - /** The operator to be used for the evaluation. */ - fun operator(): Optional = - Optional.ofNullable(operator.getNullable("operator")) - - /** The value to be compared. */ - fun value(): Optional = Optional.ofNullable(value.getNullable("value")) - - /** The measurement to be evaluated. */ - @JsonProperty("measurement") @ExcludeMissing fun _measurement() = measurement - - /** The insight name to be evaluated. */ - @JsonProperty("insightName") @ExcludeMissing fun _insightName() = insightName - - @JsonProperty("insightParameters") - @ExcludeMissing - fun _insightParameters() = insightParameters - - /** The operator to be used for the evaluation. */ - @JsonProperty("operator") @ExcludeMissing fun _operator() = operator - - /** The value to be compared. */ - @JsonProperty("value") @ExcludeMissing fun _value() = value - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Threshold = apply { - if (!validated) { - measurement() - insightName() - insightParameters() - operator() - value() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Threshold && - this.measurement == other.measurement && - this.insightName == other.insightName && - this.insightParameters == other.insightParameters && - this.operator == other.operator && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - measurement, - insightName, - insightParameters, - operator, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Threshold{measurement=$measurement, insightName=$insightName, insightParameters=$insightParameters, operator=$operator, value=$value, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var measurement: JsonField = JsonMissing.of() - private var insightName: JsonField = JsonMissing.of() - private var insightParameters: JsonField> = JsonMissing.of() - private var operator: JsonField = JsonMissing.of() - private var value: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(threshold: Threshold) = apply { - this.measurement = threshold.measurement - this.insightName = threshold.insightName - this.insightParameters = threshold.insightParameters - this.operator = threshold.operator - this.value = threshold.value - additionalProperties(threshold.additionalProperties) - } - - /** The measurement to be evaluated. */ - fun measurement(measurement: String) = measurement(JsonField.of(measurement)) - - /** The measurement to be evaluated. */ - @JsonProperty("measurement") - @ExcludeMissing - fun measurement(measurement: JsonField) = apply { - this.measurement = measurement - } - - /** The insight name to be evaluated. */ - fun insightName(insightName: String) = insightName(JsonField.of(insightName)) - - /** The insight name to be evaluated. */ - @JsonProperty("insightName") - @ExcludeMissing - fun insightName(insightName: JsonField) = apply { - this.insightName = insightName - } - - fun insightParameters(insightParameters: List) = - insightParameters(JsonField.of(insightParameters)) - - @JsonProperty("insightParameters") - @ExcludeMissing - fun insightParameters(insightParameters: JsonField>) = apply { - this.insightParameters = insightParameters - } - - /** The operator to be used for the evaluation. */ - fun operator(operator: String) = operator(JsonField.of(operator)) - - /** The operator to be used for the evaluation. */ - @JsonProperty("operator") - @ExcludeMissing - fun operator(operator: JsonField) = apply { this.operator = operator } - - /** The value to be compared. */ - fun value(value: Value) = value(JsonField.of(value)) - - /** The value to be compared. */ - @JsonProperty("value") - @ExcludeMissing - fun value(value: JsonField) = apply { this.value = value } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Threshold = - Threshold( - measurement, - insightName, - insightParameters.map { it.toUnmodifiable() }, - operator, - value, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(using = Value.Deserializer::class) - @JsonSerialize(using = Value.Serializer::class) - class Value - private constructor( - private val double: Double? = null, - private val boolean: Boolean? = null, - private val string: String? = null, - private val strings: List? = null, - private val _json: JsonValue? = null, - ) { - - private var validated: Boolean = false - - fun double(): Optional = Optional.ofNullable(double) - - fun boolean(): Optional = Optional.ofNullable(boolean) - - fun string(): Optional = Optional.ofNullable(string) - - fun strings(): Optional> = Optional.ofNullable(strings) - - fun isDouble(): Boolean = double != null - - fun isBoolean(): Boolean = boolean != null - - fun isString(): Boolean = string != null - - fun isStrings(): Boolean = strings != null - - fun asDouble(): Double = double.getOrThrow("double") - - fun asBoolean(): Boolean = boolean.getOrThrow("boolean") - - fun asString(): String = string.getOrThrow("string") - - fun asStrings(): List = strings.getOrThrow("strings") - - fun _json(): Optional = Optional.ofNullable(_json) - - fun accept(visitor: Visitor): T { - return when { - double != null -> visitor.visitDouble(double) - boolean != null -> visitor.visitBoolean(boolean) - string != null -> visitor.visitString(string) - strings != null -> visitor.visitStrings(strings) - else -> visitor.unknown(_json) - } - } - - fun validate(): Value = apply { - if (!validated) { - if ( - double == null && - boolean == null && - string == null && - strings == null - ) { - throw OpenlayerInvalidDataException("Unknown Value: $_json") - } - validated = true - } - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Value && - this.double == other.double && - this.boolean == other.boolean && - this.string == other.string && - this.strings == other.strings - } - - override fun hashCode(): Int { - return Objects.hash( - double, - boolean, - string, - strings, - ) - } - - override fun toString(): String { - return when { - double != null -> "Value{double=$double}" - boolean != null -> "Value{boolean=$boolean}" - string != null -> "Value{string=$string}" - strings != null -> "Value{strings=$strings}" - _json != null -> "Value{_unknown=$_json}" - else -> throw IllegalStateException("Invalid Value") - } - } - - companion object { - - @JvmStatic fun ofDouble(double: Double) = Value(double = double) - - @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - - @JvmStatic fun ofString(string: String) = Value(string = string) - - @JvmStatic fun ofStrings(strings: List) = Value(strings = strings) - } - - interface Visitor { - - fun visitDouble(double: Double): T - - fun visitBoolean(boolean: Boolean): T - - fun visitString(string: String): T - - fun visitStrings(strings: List): T - - fun unknown(json: JsonValue?): T { - throw OpenlayerInvalidDataException("Unknown Value: $json") - } - } - - class Deserializer : BaseDeserializer(Value::class) { - - override fun ObjectCodec.deserialize(node: JsonNode): Value { - val json = JsonValue.fromJsonNode(node) - tryDeserialize(node, jacksonTypeRef())?.let { - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef>())?.let { - return Value(strings = it, _json = json) - } - - return Value(_json = json) - } - } - - class Serializer : BaseSerializer(Value::class) { - - override fun serialize( - value: Value, - generator: JsonGenerator, - provider: SerializerProvider - ) { - when { - value.double != null -> generator.writeObject(value.double) - value.boolean != null -> generator.writeObject(value.boolean) - value.string != null -> generator.writeObject(value.string) - value.strings != null -> generator.writeObject(value.strings) - value._json != null -> generator.writeObject(value._json) - else -> throw IllegalStateException("Invalid Value") - } - } - } - } - } - } - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDataStreamParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDataStreamParams.kt deleted file mode 100644 index 3efe054..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDataStreamParams.kt +++ /dev/null @@ -1,2236 +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.JsonProperty -import com.fasterxml.jackson.core.JsonGenerator -import com.fasterxml.jackson.core.ObjectCodec -import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.SerializerProvider -import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import com.fasterxml.jackson.databind.annotation.JsonSerialize -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.openlayer.api.core.BaseDeserializer -import com.openlayer.api.core.BaseSerializer -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.getOrThrow -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 InferencePipelineDataStreamParams -constructor( - private val id: String, - private val config: Config, - private val rows: List, - private val additionalQueryParams: Map>, - private val additionalHeaders: Map>, - private val additionalBodyProperties: Map, -) { - - fun id(): String = id - - fun config(): Config = config - - fun rows(): List = rows - - @JvmSynthetic - internal fun getBody(): InferencePipelineDataStreamBody { - return InferencePipelineDataStreamBody( - config, - rows, - additionalBodyProperties, - ) - } - - @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - - @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - - fun getPathParam(index: Int): String { - return when (index) { - 0 -> id - else -> "" - } - } - - @JsonDeserialize(builder = InferencePipelineDataStreamBody.Builder::class) - @NoAutoDetect - class InferencePipelineDataStreamBody - internal constructor( - private val config: Config?, - private val rows: List?, - private val additionalProperties: Map, - ) { - - private var hashCode: Int = 0 - - /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ - @JsonProperty("config") fun config(): Config? = config - - /** A list of entries that represent rows of a csv file */ - @JsonProperty("rows") fun rows(): List? = rows - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InferencePipelineDataStreamBody && - this.config == other.config && - this.rows == other.rows && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - config, - rows, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InferencePipelineDataStreamBody{config=$config, rows=$rows, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var config: Config? = null - private var rows: List? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(inferencePipelineDataStreamBody: InferencePipelineDataStreamBody) = - apply { - this.config = inferencePipelineDataStreamBody.config - this.rows = inferencePipelineDataStreamBody.rows - additionalProperties(inferencePipelineDataStreamBody.additionalProperties) - } - - /** - * Configuration for the data stream. Depends on your **Openlayer project task type**. - */ - @JsonProperty("config") fun config(config: Config) = apply { this.config = config } - - /** A list of entries that represent rows of a csv file */ - @JsonProperty("rows") fun rows(rows: List) = apply { this.rows = rows } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): InferencePipelineDataStreamBody = - InferencePipelineDataStreamBody( - checkNotNull(config) { "`config` is required but was not set" }, - checkNotNull(rows) { "`rows` is required but was not set" }.toUnmodifiable(), - additionalProperties.toUnmodifiable(), - ) - } - } - - fun _additionalQueryParams(): Map> = additionalQueryParams - - fun _additionalHeaders(): Map> = additionalHeaders - - fun _additionalBodyProperties(): Map = additionalBodyProperties - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InferencePipelineDataStreamParams && - this.id == other.id && - this.config == other.config && - this.rows == other.rows && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties - } - - override fun hashCode(): Int { - return Objects.hash( - id, - config, - rows, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) - } - - override fun toString() = - "InferencePipelineDataStreamParams{id=$id, config=$config, rows=$rows, 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 config: Config? = null - private var rows: MutableList = mutableListOf() - private var additionalQueryParams: MutableMap> = mutableMapOf() - private var additionalHeaders: MutableMap> = mutableMapOf() - private var additionalBodyProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(inferencePipelineDataStreamParams: InferencePipelineDataStreamParams) = - apply { - this.id = inferencePipelineDataStreamParams.id - this.config = inferencePipelineDataStreamParams.config - this.rows(inferencePipelineDataStreamParams.rows) - additionalQueryParams(inferencePipelineDataStreamParams.additionalQueryParams) - additionalHeaders(inferencePipelineDataStreamParams.additionalHeaders) - additionalBodyProperties(inferencePipelineDataStreamParams.additionalBodyProperties) - } - - fun id(id: String) = apply { this.id = id } - - /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ - fun config(config: Config) = apply { this.config = config } - - /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ - fun config(llmData: Config.LlmData) = apply { this.config = Config.ofLlmData(llmData) } - - /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ - fun config(tabularClassificationData: Config.TabularClassificationData) = apply { - this.config = Config.ofTabularClassificationData(tabularClassificationData) - } - - /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ - fun config(tabularRegressionData: Config.TabularRegressionData) = apply { - this.config = Config.ofTabularRegressionData(tabularRegressionData) - } - - /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ - fun config(textClassificationData: Config.TextClassificationData) = apply { - this.config = Config.ofTextClassificationData(textClassificationData) - } - - /** A list of entries that represent rows of a csv file */ - fun rows(rows: List) = apply { - this.rows.clear() - this.rows.addAll(rows) - } - - /** A list of entries that represent rows of a csv file */ - fun addRow(row: Row) = apply { this.rows.add(row) } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = apply { - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { - this.additionalQueryParams.put(name, mutableListOf()) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = apply { - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } - - fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - this.additionalBodyProperties.put(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun build(): InferencePipelineDataStreamParams = - InferencePipelineDataStreamParams( - checkNotNull(id) { "`id` is required but was not set" }, - checkNotNull(config) { "`config` is required but was not set" }, - checkNotNull(rows) { "`rows` is required but was not set" }.toUnmodifiable(), - additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalBodyProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(using = Config.Deserializer::class) - @JsonSerialize(using = Config.Serializer::class) - class Config - private constructor( - private val llmData: LlmData? = null, - private val tabularClassificationData: TabularClassificationData? = null, - private val tabularRegressionData: TabularRegressionData? = null, - private val textClassificationData: TextClassificationData? = null, - private val _json: JsonValue? = null, - ) { - - private var validated: Boolean = false - - fun llmData(): Optional = Optional.ofNullable(llmData) - - fun tabularClassificationData(): Optional = - Optional.ofNullable(tabularClassificationData) - - fun tabularRegressionData(): Optional = - Optional.ofNullable(tabularRegressionData) - - fun textClassificationData(): Optional = - Optional.ofNullable(textClassificationData) - - fun isLlmData(): Boolean = llmData != null - - fun isTabularClassificationData(): Boolean = tabularClassificationData != null - - fun isTabularRegressionData(): Boolean = tabularRegressionData != null - - fun isTextClassificationData(): Boolean = textClassificationData != null - - fun asLlmData(): LlmData = llmData.getOrThrow("llmData") - - fun asTabularClassificationData(): TabularClassificationData = - tabularClassificationData.getOrThrow("tabularClassificationData") - - fun asTabularRegressionData(): TabularRegressionData = - tabularRegressionData.getOrThrow("tabularRegressionData") - - fun asTextClassificationData(): TextClassificationData = - textClassificationData.getOrThrow("textClassificationData") - - fun _json(): Optional = Optional.ofNullable(_json) - - fun accept(visitor: Visitor): T { - return when { - llmData != null -> visitor.visitLlmData(llmData) - tabularClassificationData != null -> - visitor.visitTabularClassificationData(tabularClassificationData) - tabularRegressionData != null -> - visitor.visitTabularRegressionData(tabularRegressionData) - textClassificationData != null -> - visitor.visitTextClassificationData(textClassificationData) - else -> visitor.unknown(_json) - } - } - - fun validate(): Config = apply { - if (!validated) { - if ( - llmData == null && - tabularClassificationData == null && - tabularRegressionData == null && - textClassificationData == null - ) { - throw OpenlayerInvalidDataException("Unknown Config: $_json") - } - llmData?.validate() - tabularClassificationData?.validate() - tabularRegressionData?.validate() - textClassificationData?.validate() - validated = true - } - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Config && - this.llmData == other.llmData && - this.tabularClassificationData == other.tabularClassificationData && - this.tabularRegressionData == other.tabularRegressionData && - this.textClassificationData == other.textClassificationData - } - - override fun hashCode(): Int { - return Objects.hash( - llmData, - tabularClassificationData, - tabularRegressionData, - textClassificationData, - ) - } - - override fun toString(): String { - return when { - llmData != null -> "Config{llmData=$llmData}" - tabularClassificationData != null -> - "Config{tabularClassificationData=$tabularClassificationData}" - tabularRegressionData != null -> - "Config{tabularRegressionData=$tabularRegressionData}" - textClassificationData != null -> - "Config{textClassificationData=$textClassificationData}" - _json != null -> "Config{_unknown=$_json}" - else -> throw IllegalStateException("Invalid Config") - } - } - - companion object { - - @JvmStatic fun ofLlmData(llmData: LlmData) = Config(llmData = llmData) - - @JvmStatic - fun ofTabularClassificationData(tabularClassificationData: TabularClassificationData) = - Config(tabularClassificationData = tabularClassificationData) - - @JvmStatic - fun ofTabularRegressionData(tabularRegressionData: TabularRegressionData) = - Config(tabularRegressionData = tabularRegressionData) - - @JvmStatic - fun ofTextClassificationData(textClassificationData: TextClassificationData) = - Config(textClassificationData = textClassificationData) - } - - interface Visitor { - - fun visitLlmData(llmData: LlmData): T - - fun visitTabularClassificationData( - tabularClassificationData: TabularClassificationData - ): T - - fun visitTabularRegressionData(tabularRegressionData: TabularRegressionData): T - - fun visitTextClassificationData(textClassificationData: TextClassificationData): T - - fun unknown(json: JsonValue?): T { - throw OpenlayerInvalidDataException("Unknown Config: $json") - } - } - - class Deserializer : BaseDeserializer(Config::class) { - - override fun ObjectCodec.deserialize(node: JsonNode): Config { - val json = JsonValue.fromJsonNode(node) - tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { - return Config(llmData = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { - return Config(tabularClassificationData = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { - return Config(tabularRegressionData = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { - return Config(textClassificationData = it, _json = json) - } - - return Config(_json = json) - } - } - - class Serializer : BaseSerializer(Config::class) { - - override fun serialize( - value: Config, - generator: JsonGenerator, - provider: SerializerProvider - ) { - when { - value.llmData != null -> generator.writeObject(value.llmData) - value.tabularClassificationData != null -> - generator.writeObject(value.tabularClassificationData) - value.tabularRegressionData != null -> - generator.writeObject(value.tabularRegressionData) - value.textClassificationData != null -> - generator.writeObject(value.textClassificationData) - value._json != null -> generator.writeObject(value._json) - else -> throw IllegalStateException("Invalid Config") - } - } - } - - @JsonDeserialize(builder = LlmData.Builder::class) - @NoAutoDetect - class LlmData - private constructor( - private val numOfTokenColumnName: JsonField, - private val contextColumnName: JsonField, - private val costColumnName: JsonField, - private val groundTruthColumnName: JsonField, - private val inferenceIdColumnName: JsonField, - private val inputVariableNames: JsonField>, - private val latencyColumnName: JsonField, - private val metadata: JsonValue, - private val outputColumnName: JsonField, - private val prompt: JsonField>, - private val questionColumnName: JsonField, - private val timestampColumnName: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** Name of the column with the total number of tokens. */ - fun numOfTokenColumnName(): Optional = - Optional.ofNullable(numOfTokenColumnName.getNullable("numOfTokenColumnName")) - - /** - * Name of the column with the context retrieved. Applies to RAG use cases. Providing - * the context enables RAG-specific metrics. - */ - fun contextColumnName(): Optional = - Optional.ofNullable(contextColumnName.getNullable("contextColumnName")) - - /** Name of the column with the cost associated with each row. */ - fun costColumnName(): Optional = - Optional.ofNullable(costColumnName.getNullable("costColumnName")) - - /** Name of the column with the ground truths. */ - fun groundTruthColumnName(): Optional = - Optional.ofNullable(groundTruthColumnName.getNullable("groundTruthColumnName")) - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - fun inferenceIdColumnName(): Optional = - Optional.ofNullable(inferenceIdColumnName.getNullable("inferenceIdColumnName")) - - /** Array of input variable names. Each input variable should be a dataset column. */ - fun inputVariableNames(): Optional> = - Optional.ofNullable(inputVariableNames.getNullable("inputVariableNames")) - - /** Name of the column with the latencies. */ - fun latencyColumnName(): Optional = - Optional.ofNullable(latencyColumnName.getNullable("latencyColumnName")) - - /** Name of the column with the model outputs. */ - fun outputColumnName(): String = outputColumnName.getRequired("outputColumnName") - - /** Prompt for the LLM. */ - fun prompt(): Optional> = Optional.ofNullable(prompt.getNullable("prompt")) - - /** - * Name of the column with the questions. Applies to RAG use cases. Providing the - * question enables RAG-specific metrics. - */ - fun questionColumnName(): Optional = - Optional.ofNullable(questionColumnName.getNullable("questionColumnName")) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - fun timestampColumnName(): Optional = - Optional.ofNullable(timestampColumnName.getNullable("timestampColumnName")) - - /** Name of the column with the total number of tokens. */ - @JsonProperty("numOfTokenColumnName") - @ExcludeMissing - fun _numOfTokenColumnName() = numOfTokenColumnName - - /** - * Name of the column with the context retrieved. Applies to RAG use cases. Providing - * the context enables RAG-specific metrics. - */ - @JsonProperty("contextColumnName") - @ExcludeMissing - fun _contextColumnName() = contextColumnName - - /** Name of the column with the cost associated with each row. */ - @JsonProperty("costColumnName") @ExcludeMissing fun _costColumnName() = costColumnName - - /** Name of the column with the ground truths. */ - @JsonProperty("groundTruthColumnName") - @ExcludeMissing - fun _groundTruthColumnName() = groundTruthColumnName - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun _inferenceIdColumnName() = inferenceIdColumnName - - /** Array of input variable names. Each input variable should be a dataset column. */ - @JsonProperty("inputVariableNames") - @ExcludeMissing - fun _inputVariableNames() = inputVariableNames - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun _latencyColumnName() = latencyColumnName - - /** Object with metadata. */ - @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - - /** Name of the column with the model outputs. */ - @JsonProperty("outputColumnName") - @ExcludeMissing - fun _outputColumnName() = outputColumnName - - /** Prompt for the LLM. */ - @JsonProperty("prompt") @ExcludeMissing fun _prompt() = prompt - - /** - * Name of the column with the questions. Applies to RAG use cases. Providing the - * question enables RAG-specific metrics. - */ - @JsonProperty("questionColumnName") - @ExcludeMissing - fun _questionColumnName() = questionColumnName - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun _timestampColumnName() = timestampColumnName - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): LlmData = apply { - if (!validated) { - numOfTokenColumnName() - contextColumnName() - costColumnName() - groundTruthColumnName() - inferenceIdColumnName() - inputVariableNames() - latencyColumnName() - outputColumnName() - prompt().map { it.forEach { it.validate() } } - questionColumnName() - timestampColumnName() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is LlmData && - this.numOfTokenColumnName == other.numOfTokenColumnName && - this.contextColumnName == other.contextColumnName && - this.costColumnName == other.costColumnName && - this.groundTruthColumnName == other.groundTruthColumnName && - this.inferenceIdColumnName == other.inferenceIdColumnName && - this.inputVariableNames == other.inputVariableNames && - this.latencyColumnName == other.latencyColumnName && - this.metadata == other.metadata && - this.outputColumnName == other.outputColumnName && - this.prompt == other.prompt && - this.questionColumnName == other.questionColumnName && - this.timestampColumnName == other.timestampColumnName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - numOfTokenColumnName, - contextColumnName, - costColumnName, - groundTruthColumnName, - inferenceIdColumnName, - inputVariableNames, - latencyColumnName, - metadata, - outputColumnName, - prompt, - questionColumnName, - timestampColumnName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "LlmData{numOfTokenColumnName=$numOfTokenColumnName, contextColumnName=$contextColumnName, costColumnName=$costColumnName, groundTruthColumnName=$groundTruthColumnName, inferenceIdColumnName=$inferenceIdColumnName, inputVariableNames=$inputVariableNames, latencyColumnName=$latencyColumnName, metadata=$metadata, outputColumnName=$outputColumnName, prompt=$prompt, questionColumnName=$questionColumnName, timestampColumnName=$timestampColumnName, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var numOfTokenColumnName: JsonField = JsonMissing.of() - private var contextColumnName: JsonField = JsonMissing.of() - private var costColumnName: JsonField = JsonMissing.of() - private var groundTruthColumnName: JsonField = JsonMissing.of() - private var inferenceIdColumnName: JsonField = JsonMissing.of() - private var inputVariableNames: JsonField> = JsonMissing.of() - private var latencyColumnName: JsonField = JsonMissing.of() - private var metadata: JsonValue = JsonMissing.of() - private var outputColumnName: JsonField = JsonMissing.of() - private var prompt: JsonField> = JsonMissing.of() - private var questionColumnName: JsonField = JsonMissing.of() - private var timestampColumnName: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(llmData: LlmData) = apply { - this.numOfTokenColumnName = llmData.numOfTokenColumnName - this.contextColumnName = llmData.contextColumnName - this.costColumnName = llmData.costColumnName - this.groundTruthColumnName = llmData.groundTruthColumnName - this.inferenceIdColumnName = llmData.inferenceIdColumnName - this.inputVariableNames = llmData.inputVariableNames - this.latencyColumnName = llmData.latencyColumnName - this.metadata = llmData.metadata - this.outputColumnName = llmData.outputColumnName - this.prompt = llmData.prompt - this.questionColumnName = llmData.questionColumnName - this.timestampColumnName = llmData.timestampColumnName - additionalProperties(llmData.additionalProperties) - } - - /** Name of the column with the total number of tokens. */ - fun numOfTokenColumnName(numOfTokenColumnName: String) = - numOfTokenColumnName(JsonField.of(numOfTokenColumnName)) - - /** Name of the column with the total number of tokens. */ - @JsonProperty("numOfTokenColumnName") - @ExcludeMissing - fun numOfTokenColumnName(numOfTokenColumnName: JsonField) = apply { - this.numOfTokenColumnName = numOfTokenColumnName - } - - /** - * Name of the column with the context retrieved. Applies to RAG use cases. - * Providing the context enables RAG-specific metrics. - */ - fun contextColumnName(contextColumnName: String) = - contextColumnName(JsonField.of(contextColumnName)) - - /** - * Name of the column with the context retrieved. Applies to RAG use cases. - * Providing the context enables RAG-specific metrics. - */ - @JsonProperty("contextColumnName") - @ExcludeMissing - fun contextColumnName(contextColumnName: JsonField) = apply { - this.contextColumnName = contextColumnName - } - - /** Name of the column with the cost associated with each row. */ - fun costColumnName(costColumnName: String) = - costColumnName(JsonField.of(costColumnName)) - - /** Name of the column with the cost associated with each row. */ - @JsonProperty("costColumnName") - @ExcludeMissing - fun costColumnName(costColumnName: JsonField) = apply { - this.costColumnName = costColumnName - } - - /** Name of the column with the ground truths. */ - fun groundTruthColumnName(groundTruthColumnName: String) = - groundTruthColumnName(JsonField.of(groundTruthColumnName)) - - /** Name of the column with the ground truths. */ - @JsonProperty("groundTruthColumnName") - @ExcludeMissing - fun groundTruthColumnName(groundTruthColumnName: JsonField) = apply { - this.groundTruthColumnName = groundTruthColumnName - } - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - fun inferenceIdColumnName(inferenceIdColumnName: String) = - inferenceIdColumnName(JsonField.of(inferenceIdColumnName)) - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun inferenceIdColumnName(inferenceIdColumnName: JsonField) = apply { - this.inferenceIdColumnName = inferenceIdColumnName - } - - /** - * Array of input variable names. Each input variable should be a dataset column. - */ - fun inputVariableNames(inputVariableNames: List) = - inputVariableNames(JsonField.of(inputVariableNames)) - - /** - * Array of input variable names. Each input variable should be a dataset column. - */ - @JsonProperty("inputVariableNames") - @ExcludeMissing - fun inputVariableNames(inputVariableNames: JsonField>) = apply { - this.inputVariableNames = inputVariableNames - } - - /** Name of the column with the latencies. */ - fun latencyColumnName(latencyColumnName: String) = - latencyColumnName(JsonField.of(latencyColumnName)) - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun latencyColumnName(latencyColumnName: JsonField) = apply { - this.latencyColumnName = latencyColumnName - } - - /** Object with metadata. */ - @JsonProperty("metadata") - @ExcludeMissing - fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - - /** Name of the column with the model outputs. */ - fun outputColumnName(outputColumnName: String) = - outputColumnName(JsonField.of(outputColumnName)) - - /** Name of the column with the model outputs. */ - @JsonProperty("outputColumnName") - @ExcludeMissing - fun outputColumnName(outputColumnName: JsonField) = apply { - this.outputColumnName = outputColumnName - } - - /** Prompt for the LLM. */ - fun prompt(prompt: List) = prompt(JsonField.of(prompt)) - - /** Prompt for the LLM. */ - @JsonProperty("prompt") - @ExcludeMissing - fun prompt(prompt: JsonField>) = apply { this.prompt = prompt } - - /** - * Name of the column with the questions. Applies to RAG use cases. Providing the - * question enables RAG-specific metrics. - */ - fun questionColumnName(questionColumnName: String) = - questionColumnName(JsonField.of(questionColumnName)) - - /** - * Name of the column with the questions. Applies to RAG use cases. Providing the - * question enables RAG-specific metrics. - */ - @JsonProperty("questionColumnName") - @ExcludeMissing - fun questionColumnName(questionColumnName: JsonField) = apply { - this.questionColumnName = questionColumnName - } - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - fun timestampColumnName(timestampColumnName: String) = - timestampColumnName(JsonField.of(timestampColumnName)) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun timestampColumnName(timestampColumnName: JsonField) = apply { - this.timestampColumnName = timestampColumnName - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): LlmData = - LlmData( - numOfTokenColumnName, - contextColumnName, - costColumnName, - groundTruthColumnName, - inferenceIdColumnName, - inputVariableNames.map { it.toUnmodifiable() }, - latencyColumnName, - metadata, - outputColumnName, - prompt.map { it.toUnmodifiable() }, - questionColumnName, - timestampColumnName, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = Prompt.Builder::class) - @NoAutoDetect - class Prompt - private constructor( - private val role: JsonField, - private val content: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** Role of the prompt. */ - fun role(): Optional = Optional.ofNullable(role.getNullable("role")) - - /** Content of the prompt. */ - fun content(): Optional = - Optional.ofNullable(content.getNullable("content")) - - /** Role of the prompt. */ - @JsonProperty("role") @ExcludeMissing fun _role() = role - - /** Content of the prompt. */ - @JsonProperty("content") @ExcludeMissing fun _content() = content - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Prompt = apply { - if (!validated) { - role() - content() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Prompt && - this.role == other.role && - this.content == other.content && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - role, - content, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Prompt{role=$role, content=$content, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var role: JsonField = JsonMissing.of() - private var content: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(prompt: Prompt) = apply { - this.role = prompt.role - this.content = prompt.content - additionalProperties(prompt.additionalProperties) - } - - /** Role of the prompt. */ - fun role(role: String) = role(JsonField.of(role)) - - /** Role of the prompt. */ - @JsonProperty("role") - @ExcludeMissing - fun role(role: JsonField) = apply { this.role = role } - - /** Content of the prompt. */ - fun content(content: String) = content(JsonField.of(content)) - - /** Content of the prompt. */ - @JsonProperty("content") - @ExcludeMissing - fun content(content: JsonField) = apply { this.content = content } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Prompt = - Prompt( - role, - content, - additionalProperties.toUnmodifiable(), - ) - } - } - } - - @JsonDeserialize(builder = TabularClassificationData.Builder::class) - @NoAutoDetect - class TabularClassificationData - private constructor( - private val categoricalFeatureNames: JsonField>, - private val classNames: JsonField>, - private val featureNames: JsonField>, - private val inferenceIdColumnName: JsonField, - private val labelColumnName: JsonField, - private val latencyColumnName: JsonField, - private val metadata: JsonValue, - private val predictionsColumnName: JsonField, - private val predictionScoresColumnName: JsonField, - private val timestampColumnName: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - fun categoricalFeatureNames(): Optional> = - Optional.ofNullable(categoricalFeatureNames.getNullable("categoricalFeatureNames")) - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - fun classNames(): List = classNames.getRequired("classNames") - - /** Array with all input feature names. */ - fun featureNames(): Optional> = - Optional.ofNullable(featureNames.getNullable("featureNames")) - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - fun inferenceIdColumnName(): Optional = - Optional.ofNullable(inferenceIdColumnName.getNullable("inferenceIdColumnName")) - - /** - * Name of the column with the labels. The data in this column must be **zero-indexed - * integers**, matching the list provided in `classNames`. - */ - fun labelColumnName(): Optional = - Optional.ofNullable(labelColumnName.getNullable("labelColumnName")) - - /** Name of the column with the latencies. */ - fun latencyColumnName(): Optional = - Optional.ofNullable(latencyColumnName.getNullable("latencyColumnName")) - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - fun predictionsColumnName(): Optional = - Optional.ofNullable(predictionsColumnName.getNullable("predictionsColumnName")) - - /** - * Name of the column with the model's predictions as **lists of class probabilities**. - */ - fun predictionScoresColumnName(): Optional = - Optional.ofNullable( - predictionScoresColumnName.getNullable("predictionScoresColumnName") - ) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - fun timestampColumnName(): Optional = - Optional.ofNullable(timestampColumnName.getNullable("timestampColumnName")) - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - @JsonProperty("categoricalFeatureNames") - @ExcludeMissing - fun _categoricalFeatureNames() = categoricalFeatureNames - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - @JsonProperty("classNames") @ExcludeMissing fun _classNames() = classNames - - /** Array with all input feature names. */ - @JsonProperty("featureNames") @ExcludeMissing fun _featureNames() = featureNames - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun _inferenceIdColumnName() = inferenceIdColumnName - - /** - * Name of the column with the labels. The data in this column must be **zero-indexed - * integers**, matching the list provided in `classNames`. - */ - @JsonProperty("labelColumnName") - @ExcludeMissing - fun _labelColumnName() = labelColumnName - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun _latencyColumnName() = latencyColumnName - - /** Object with metadata. */ - @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - @JsonProperty("predictionsColumnName") - @ExcludeMissing - fun _predictionsColumnName() = predictionsColumnName - - /** - * Name of the column with the model's predictions as **lists of class probabilities**. - */ - @JsonProperty("predictionScoresColumnName") - @ExcludeMissing - fun _predictionScoresColumnName() = predictionScoresColumnName - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun _timestampColumnName() = timestampColumnName - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): TabularClassificationData = apply { - if (!validated) { - categoricalFeatureNames() - classNames() - featureNames() - inferenceIdColumnName() - labelColumnName() - latencyColumnName() - predictionsColumnName() - predictionScoresColumnName() - timestampColumnName() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is TabularClassificationData && - this.categoricalFeatureNames == other.categoricalFeatureNames && - this.classNames == other.classNames && - this.featureNames == other.featureNames && - this.inferenceIdColumnName == other.inferenceIdColumnName && - this.labelColumnName == other.labelColumnName && - this.latencyColumnName == other.latencyColumnName && - this.metadata == other.metadata && - this.predictionsColumnName == other.predictionsColumnName && - this.predictionScoresColumnName == other.predictionScoresColumnName && - this.timestampColumnName == other.timestampColumnName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - categoricalFeatureNames, - classNames, - featureNames, - inferenceIdColumnName, - labelColumnName, - latencyColumnName, - metadata, - predictionsColumnName, - predictionScoresColumnName, - timestampColumnName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "TabularClassificationData{categoricalFeatureNames=$categoricalFeatureNames, classNames=$classNames, featureNames=$featureNames, inferenceIdColumnName=$inferenceIdColumnName, labelColumnName=$labelColumnName, latencyColumnName=$latencyColumnName, metadata=$metadata, predictionsColumnName=$predictionsColumnName, predictionScoresColumnName=$predictionScoresColumnName, timestampColumnName=$timestampColumnName, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var categoricalFeatureNames: JsonField> = JsonMissing.of() - private var classNames: JsonField> = JsonMissing.of() - private var featureNames: JsonField> = JsonMissing.of() - private var inferenceIdColumnName: JsonField = JsonMissing.of() - private var labelColumnName: JsonField = JsonMissing.of() - private var latencyColumnName: JsonField = JsonMissing.of() - private var metadata: JsonValue = JsonMissing.of() - private var predictionsColumnName: JsonField = JsonMissing.of() - private var predictionScoresColumnName: JsonField = JsonMissing.of() - private var timestampColumnName: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(tabularClassificationData: TabularClassificationData) = apply { - this.categoricalFeatureNames = tabularClassificationData.categoricalFeatureNames - this.classNames = tabularClassificationData.classNames - this.featureNames = tabularClassificationData.featureNames - this.inferenceIdColumnName = tabularClassificationData.inferenceIdColumnName - this.labelColumnName = tabularClassificationData.labelColumnName - this.latencyColumnName = tabularClassificationData.latencyColumnName - this.metadata = tabularClassificationData.metadata - this.predictionsColumnName = tabularClassificationData.predictionsColumnName - this.predictionScoresColumnName = - tabularClassificationData.predictionScoresColumnName - this.timestampColumnName = tabularClassificationData.timestampColumnName - additionalProperties(tabularClassificationData.additionalProperties) - } - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - fun categoricalFeatureNames(categoricalFeatureNames: List) = - categoricalFeatureNames(JsonField.of(categoricalFeatureNames)) - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - @JsonProperty("categoricalFeatureNames") - @ExcludeMissing - fun categoricalFeatureNames(categoricalFeatureNames: JsonField>) = - apply { - this.categoricalFeatureNames = categoricalFeatureNames - } - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - fun classNames(classNames: List) = classNames(JsonField.of(classNames)) - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - @JsonProperty("classNames") - @ExcludeMissing - fun classNames(classNames: JsonField>) = apply { - this.classNames = classNames - } - - /** Array with all input feature names. */ - fun featureNames(featureNames: List) = - featureNames(JsonField.of(featureNames)) - - /** Array with all input feature names. */ - @JsonProperty("featureNames") - @ExcludeMissing - fun featureNames(featureNames: JsonField>) = apply { - this.featureNames = featureNames - } - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - fun inferenceIdColumnName(inferenceIdColumnName: String) = - inferenceIdColumnName(JsonField.of(inferenceIdColumnName)) - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun inferenceIdColumnName(inferenceIdColumnName: JsonField) = apply { - this.inferenceIdColumnName = inferenceIdColumnName - } - - /** - * Name of the column with the labels. The data in this column must be - * **zero-indexed integers**, matching the list provided in `classNames`. - */ - fun labelColumnName(labelColumnName: String) = - labelColumnName(JsonField.of(labelColumnName)) - - /** - * Name of the column with the labels. The data in this column must be - * **zero-indexed integers**, matching the list provided in `classNames`. - */ - @JsonProperty("labelColumnName") - @ExcludeMissing - fun labelColumnName(labelColumnName: JsonField) = apply { - this.labelColumnName = labelColumnName - } - - /** Name of the column with the latencies. */ - fun latencyColumnName(latencyColumnName: String) = - latencyColumnName(JsonField.of(latencyColumnName)) - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun latencyColumnName(latencyColumnName: JsonField) = apply { - this.latencyColumnName = latencyColumnName - } - - /** Object with metadata. */ - @JsonProperty("metadata") - @ExcludeMissing - fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - fun predictionsColumnName(predictionsColumnName: String) = - predictionsColumnName(JsonField.of(predictionsColumnName)) - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - @JsonProperty("predictionsColumnName") - @ExcludeMissing - fun predictionsColumnName(predictionsColumnName: JsonField) = apply { - this.predictionsColumnName = predictionsColumnName - } - - /** - * Name of the column with the model's predictions as **lists of class - * probabilities**. - */ - fun predictionScoresColumnName(predictionScoresColumnName: String) = - predictionScoresColumnName(JsonField.of(predictionScoresColumnName)) - - /** - * Name of the column with the model's predictions as **lists of class - * probabilities**. - */ - @JsonProperty("predictionScoresColumnName") - @ExcludeMissing - fun predictionScoresColumnName(predictionScoresColumnName: JsonField) = - apply { - this.predictionScoresColumnName = predictionScoresColumnName - } - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - fun timestampColumnName(timestampColumnName: String) = - timestampColumnName(JsonField.of(timestampColumnName)) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun timestampColumnName(timestampColumnName: JsonField) = apply { - this.timestampColumnName = timestampColumnName - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): TabularClassificationData = - TabularClassificationData( - categoricalFeatureNames.map { it.toUnmodifiable() }, - classNames.map { it.toUnmodifiable() }, - featureNames.map { it.toUnmodifiable() }, - inferenceIdColumnName, - labelColumnName, - latencyColumnName, - metadata, - predictionsColumnName, - predictionScoresColumnName, - timestampColumnName, - additionalProperties.toUnmodifiable(), - ) - } - } - - @JsonDeserialize(builder = TabularRegressionData.Builder::class) - @NoAutoDetect - class TabularRegressionData - private constructor( - private val categoricalFeatureNames: JsonField>, - private val featureNames: JsonField>, - private val inferenceIdColumnName: JsonField, - private val latencyColumnName: JsonField, - private val metadata: JsonValue, - private val predictionsColumnName: JsonField, - private val targetColumnName: JsonField, - private val timestampColumnName: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - fun categoricalFeatureNames(): Optional> = - Optional.ofNullable(categoricalFeatureNames.getNullable("categoricalFeatureNames")) - - /** Array with all input feature names. */ - fun featureNames(): Optional> = - Optional.ofNullable(featureNames.getNullable("featureNames")) - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - fun inferenceIdColumnName(): Optional = - Optional.ofNullable(inferenceIdColumnName.getNullable("inferenceIdColumnName")) - - /** Name of the column with the latencies. */ - fun latencyColumnName(): Optional = - Optional.ofNullable(latencyColumnName.getNullable("latencyColumnName")) - - /** Name of the column with the model's predictions. */ - fun predictionsColumnName(): Optional = - Optional.ofNullable(predictionsColumnName.getNullable("predictionsColumnName")) - - /** Name of the column with the targets (ground truth values). */ - fun targetColumnName(): Optional = - Optional.ofNullable(targetColumnName.getNullable("targetColumnName")) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - fun timestampColumnName(): Optional = - Optional.ofNullable(timestampColumnName.getNullable("timestampColumnName")) - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - @JsonProperty("categoricalFeatureNames") - @ExcludeMissing - fun _categoricalFeatureNames() = categoricalFeatureNames - - /** Array with all input feature names. */ - @JsonProperty("featureNames") @ExcludeMissing fun _featureNames() = featureNames - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun _inferenceIdColumnName() = inferenceIdColumnName - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun _latencyColumnName() = latencyColumnName - - /** Object with metadata. */ - @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - - /** Name of the column with the model's predictions. */ - @JsonProperty("predictionsColumnName") - @ExcludeMissing - fun _predictionsColumnName() = predictionsColumnName - - /** Name of the column with the targets (ground truth values). */ - @JsonProperty("targetColumnName") - @ExcludeMissing - fun _targetColumnName() = targetColumnName - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun _timestampColumnName() = timestampColumnName - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): TabularRegressionData = apply { - if (!validated) { - categoricalFeatureNames() - featureNames() - inferenceIdColumnName() - latencyColumnName() - predictionsColumnName() - targetColumnName() - timestampColumnName() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is TabularRegressionData && - this.categoricalFeatureNames == other.categoricalFeatureNames && - this.featureNames == other.featureNames && - this.inferenceIdColumnName == other.inferenceIdColumnName && - this.latencyColumnName == other.latencyColumnName && - this.metadata == other.metadata && - this.predictionsColumnName == other.predictionsColumnName && - this.targetColumnName == other.targetColumnName && - this.timestampColumnName == other.timestampColumnName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - categoricalFeatureNames, - featureNames, - inferenceIdColumnName, - latencyColumnName, - metadata, - predictionsColumnName, - targetColumnName, - timestampColumnName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "TabularRegressionData{categoricalFeatureNames=$categoricalFeatureNames, featureNames=$featureNames, inferenceIdColumnName=$inferenceIdColumnName, latencyColumnName=$latencyColumnName, metadata=$metadata, predictionsColumnName=$predictionsColumnName, targetColumnName=$targetColumnName, timestampColumnName=$timestampColumnName, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var categoricalFeatureNames: JsonField> = JsonMissing.of() - private var featureNames: JsonField> = JsonMissing.of() - private var inferenceIdColumnName: JsonField = JsonMissing.of() - private var latencyColumnName: JsonField = JsonMissing.of() - private var metadata: JsonValue = JsonMissing.of() - private var predictionsColumnName: JsonField = JsonMissing.of() - private var targetColumnName: JsonField = JsonMissing.of() - private var timestampColumnName: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(tabularRegressionData: TabularRegressionData) = apply { - this.categoricalFeatureNames = tabularRegressionData.categoricalFeatureNames - this.featureNames = tabularRegressionData.featureNames - this.inferenceIdColumnName = tabularRegressionData.inferenceIdColumnName - this.latencyColumnName = tabularRegressionData.latencyColumnName - this.metadata = tabularRegressionData.metadata - this.predictionsColumnName = tabularRegressionData.predictionsColumnName - this.targetColumnName = tabularRegressionData.targetColumnName - this.timestampColumnName = tabularRegressionData.timestampColumnName - additionalProperties(tabularRegressionData.additionalProperties) - } - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - fun categoricalFeatureNames(categoricalFeatureNames: List) = - categoricalFeatureNames(JsonField.of(categoricalFeatureNames)) - - /** - * Array with the names of all categorical features in the dataset. E.g. - * ["Gender", "Geography"]. - */ - @JsonProperty("categoricalFeatureNames") - @ExcludeMissing - fun categoricalFeatureNames(categoricalFeatureNames: JsonField>) = - apply { - this.categoricalFeatureNames = categoricalFeatureNames - } - - /** Array with all input feature names. */ - fun featureNames(featureNames: List) = - featureNames(JsonField.of(featureNames)) - - /** Array with all input feature names. */ - @JsonProperty("featureNames") - @ExcludeMissing - fun featureNames(featureNames: JsonField>) = apply { - this.featureNames = featureNames - } - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - fun inferenceIdColumnName(inferenceIdColumnName: String) = - inferenceIdColumnName(JsonField.of(inferenceIdColumnName)) - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun inferenceIdColumnName(inferenceIdColumnName: JsonField) = apply { - this.inferenceIdColumnName = inferenceIdColumnName - } - - /** Name of the column with the latencies. */ - fun latencyColumnName(latencyColumnName: String) = - latencyColumnName(JsonField.of(latencyColumnName)) - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun latencyColumnName(latencyColumnName: JsonField) = apply { - this.latencyColumnName = latencyColumnName - } - - /** Object with metadata. */ - @JsonProperty("metadata") - @ExcludeMissing - fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - - /** Name of the column with the model's predictions. */ - fun predictionsColumnName(predictionsColumnName: String) = - predictionsColumnName(JsonField.of(predictionsColumnName)) - - /** Name of the column with the model's predictions. */ - @JsonProperty("predictionsColumnName") - @ExcludeMissing - fun predictionsColumnName(predictionsColumnName: JsonField) = apply { - this.predictionsColumnName = predictionsColumnName - } - - /** Name of the column with the targets (ground truth values). */ - fun targetColumnName(targetColumnName: String) = - targetColumnName(JsonField.of(targetColumnName)) - - /** Name of the column with the targets (ground truth values). */ - @JsonProperty("targetColumnName") - @ExcludeMissing - fun targetColumnName(targetColumnName: JsonField) = apply { - this.targetColumnName = targetColumnName - } - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - fun timestampColumnName(timestampColumnName: String) = - timestampColumnName(JsonField.of(timestampColumnName)) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun timestampColumnName(timestampColumnName: JsonField) = apply { - this.timestampColumnName = timestampColumnName - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): TabularRegressionData = - TabularRegressionData( - categoricalFeatureNames.map { it.toUnmodifiable() }, - featureNames.map { it.toUnmodifiable() }, - inferenceIdColumnName, - latencyColumnName, - metadata, - predictionsColumnName, - targetColumnName, - timestampColumnName, - additionalProperties.toUnmodifiable(), - ) - } - } - - @JsonDeserialize(builder = TextClassificationData.Builder::class) - @NoAutoDetect - class TextClassificationData - private constructor( - private val classNames: JsonField>, - private val inferenceIdColumnName: JsonField, - private val labelColumnName: JsonField, - private val latencyColumnName: JsonField, - private val metadata: JsonValue, - private val predictionsColumnName: JsonField, - private val predictionScoresColumnName: JsonField, - private val textColumnName: JsonField, - private val timestampColumnName: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - fun classNames(): List = classNames.getRequired("classNames") - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - fun inferenceIdColumnName(): Optional = - Optional.ofNullable(inferenceIdColumnName.getNullable("inferenceIdColumnName")) - - /** - * Name of the column with the labels. The data in this column must be **zero-indexed - * integers**, matching the list provided in `classNames`. - */ - fun labelColumnName(): Optional = - Optional.ofNullable(labelColumnName.getNullable("labelColumnName")) - - /** Name of the column with the latencies. */ - fun latencyColumnName(): Optional = - Optional.ofNullable(latencyColumnName.getNullable("latencyColumnName")) - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - fun predictionsColumnName(): Optional = - Optional.ofNullable(predictionsColumnName.getNullable("predictionsColumnName")) - - /** - * Name of the column with the model's predictions as **lists of class probabilities**. - */ - fun predictionScoresColumnName(): Optional = - Optional.ofNullable( - predictionScoresColumnName.getNullable("predictionScoresColumnName") - ) - - /** Name of the column with the text data. */ - fun textColumnName(): Optional = - Optional.ofNullable(textColumnName.getNullable("textColumnName")) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - fun timestampColumnName(): Optional = - Optional.ofNullable(timestampColumnName.getNullable("timestampColumnName")) - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - @JsonProperty("classNames") @ExcludeMissing fun _classNames() = classNames - - /** - * Name of the column with the inference ids. This is useful if you want to update rows - * at a later point in time. If not provided, a unique id is generated by Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun _inferenceIdColumnName() = inferenceIdColumnName - - /** - * Name of the column with the labels. The data in this column must be **zero-indexed - * integers**, matching the list provided in `classNames`. - */ - @JsonProperty("labelColumnName") - @ExcludeMissing - fun _labelColumnName() = labelColumnName - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun _latencyColumnName() = latencyColumnName - - /** Object with metadata. */ - @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - @JsonProperty("predictionsColumnName") - @ExcludeMissing - fun _predictionsColumnName() = predictionsColumnName - - /** - * Name of the column with the model's predictions as **lists of class probabilities**. - */ - @JsonProperty("predictionScoresColumnName") - @ExcludeMissing - fun _predictionScoresColumnName() = predictionScoresColumnName - - /** Name of the column with the text data. */ - @JsonProperty("textColumnName") @ExcludeMissing fun _textColumnName() = textColumnName - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not - * provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun _timestampColumnName() = timestampColumnName - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): TextClassificationData = apply { - if (!validated) { - classNames() - inferenceIdColumnName() - labelColumnName() - latencyColumnName() - predictionsColumnName() - predictionScoresColumnName() - textColumnName() - timestampColumnName() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is TextClassificationData && - this.classNames == other.classNames && - this.inferenceIdColumnName == other.inferenceIdColumnName && - this.labelColumnName == other.labelColumnName && - this.latencyColumnName == other.latencyColumnName && - this.metadata == other.metadata && - this.predictionsColumnName == other.predictionsColumnName && - this.predictionScoresColumnName == other.predictionScoresColumnName && - this.textColumnName == other.textColumnName && - this.timestampColumnName == other.timestampColumnName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - classNames, - inferenceIdColumnName, - labelColumnName, - latencyColumnName, - metadata, - predictionsColumnName, - predictionScoresColumnName, - textColumnName, - timestampColumnName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "TextClassificationData{classNames=$classNames, inferenceIdColumnName=$inferenceIdColumnName, labelColumnName=$labelColumnName, latencyColumnName=$latencyColumnName, metadata=$metadata, predictionsColumnName=$predictionsColumnName, predictionScoresColumnName=$predictionScoresColumnName, textColumnName=$textColumnName, timestampColumnName=$timestampColumnName, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var classNames: JsonField> = JsonMissing.of() - private var inferenceIdColumnName: JsonField = JsonMissing.of() - private var labelColumnName: JsonField = JsonMissing.of() - private var latencyColumnName: JsonField = JsonMissing.of() - private var metadata: JsonValue = JsonMissing.of() - private var predictionsColumnName: JsonField = JsonMissing.of() - private var predictionScoresColumnName: JsonField = JsonMissing.of() - private var textColumnName: JsonField = JsonMissing.of() - private var timestampColumnName: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(textClassificationData: TextClassificationData) = apply { - this.classNames = textClassificationData.classNames - this.inferenceIdColumnName = textClassificationData.inferenceIdColumnName - this.labelColumnName = textClassificationData.labelColumnName - this.latencyColumnName = textClassificationData.latencyColumnName - this.metadata = textClassificationData.metadata - this.predictionsColumnName = textClassificationData.predictionsColumnName - this.predictionScoresColumnName = - textClassificationData.predictionScoresColumnName - this.textColumnName = textClassificationData.textColumnName - this.timestampColumnName = textClassificationData.timestampColumnName - additionalProperties(textClassificationData.additionalProperties) - } - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - fun classNames(classNames: List) = classNames(JsonField.of(classNames)) - - /** - * List of class names indexed by label integer in the dataset. E.g. - * ["Retained", "Exited"] when 0, 1 are in your label column. - */ - @JsonProperty("classNames") - @ExcludeMissing - fun classNames(classNames: JsonField>) = apply { - this.classNames = classNames - } - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - fun inferenceIdColumnName(inferenceIdColumnName: String) = - inferenceIdColumnName(JsonField.of(inferenceIdColumnName)) - - /** - * Name of the column with the inference ids. This is useful if you want to update - * rows at a later point in time. If not provided, a unique id is generated by - * Openlayer. - */ - @JsonProperty("inferenceIdColumnName") - @ExcludeMissing - fun inferenceIdColumnName(inferenceIdColumnName: JsonField) = apply { - this.inferenceIdColumnName = inferenceIdColumnName - } - - /** - * Name of the column with the labels. The data in this column must be - * **zero-indexed integers**, matching the list provided in `classNames`. - */ - fun labelColumnName(labelColumnName: String) = - labelColumnName(JsonField.of(labelColumnName)) - - /** - * Name of the column with the labels. The data in this column must be - * **zero-indexed integers**, matching the list provided in `classNames`. - */ - @JsonProperty("labelColumnName") - @ExcludeMissing - fun labelColumnName(labelColumnName: JsonField) = apply { - this.labelColumnName = labelColumnName - } - - /** Name of the column with the latencies. */ - fun latencyColumnName(latencyColumnName: String) = - latencyColumnName(JsonField.of(latencyColumnName)) - - /** Name of the column with the latencies. */ - @JsonProperty("latencyColumnName") - @ExcludeMissing - fun latencyColumnName(latencyColumnName: JsonField) = apply { - this.latencyColumnName = latencyColumnName - } - - /** Object with metadata. */ - @JsonProperty("metadata") - @ExcludeMissing - fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - fun predictionsColumnName(predictionsColumnName: String) = - predictionsColumnName(JsonField.of(predictionsColumnName)) - - /** Name of the column with the model's predictions as **zero-indexed integers**. */ - @JsonProperty("predictionsColumnName") - @ExcludeMissing - fun predictionsColumnName(predictionsColumnName: JsonField) = apply { - this.predictionsColumnName = predictionsColumnName - } - - /** - * Name of the column with the model's predictions as **lists of class - * probabilities**. - */ - fun predictionScoresColumnName(predictionScoresColumnName: String) = - predictionScoresColumnName(JsonField.of(predictionScoresColumnName)) - - /** - * Name of the column with the model's predictions as **lists of class - * probabilities**. - */ - @JsonProperty("predictionScoresColumnName") - @ExcludeMissing - fun predictionScoresColumnName(predictionScoresColumnName: JsonField) = - apply { - this.predictionScoresColumnName = predictionScoresColumnName - } - - /** Name of the column with the text data. */ - fun textColumnName(textColumnName: String) = - textColumnName(JsonField.of(textColumnName)) - - /** Name of the column with the text data. */ - @JsonProperty("textColumnName") - @ExcludeMissing - fun textColumnName(textColumnName: JsonField) = apply { - this.textColumnName = textColumnName - } - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - fun timestampColumnName(timestampColumnName: String) = - timestampColumnName(JsonField.of(timestampColumnName)) - - /** - * Name of the column with the timestamps. Timestamps must be in UNIX sec format. If - * not provided, the upload timestamp is used. - */ - @JsonProperty("timestampColumnName") - @ExcludeMissing - fun timestampColumnName(timestampColumnName: JsonField) = apply { - this.timestampColumnName = timestampColumnName - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): TextClassificationData = - TextClassificationData( - classNames.map { it.toUnmodifiable() }, - inferenceIdColumnName, - labelColumnName, - latencyColumnName, - metadata, - predictionsColumnName, - predictionScoresColumnName, - textColumnName, - timestampColumnName, - additionalProperties.toUnmodifiable(), - ) - } - } - } - - @JsonDeserialize(builder = Row.Builder::class) - @NoAutoDetect - class Row - private constructor( - private val additionalProperties: Map, - ) { - - private var hashCode: Int = 0 - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Row && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Row{additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(row: Row) = apply { additionalProperties(row.additionalProperties) } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Row = Row(additionalProperties.toUnmodifiable()) - } - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDataStreamResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDataStreamResponse.kt deleted file mode 100644 index 087ceda..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineDataStreamResponse.kt +++ /dev/null @@ -1,161 +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.util.Objects - -@JsonDeserialize(builder = InferencePipelineDataStreamResponse.Builder::class) -@NoAutoDetect -class InferencePipelineDataStreamResponse -private constructor( - private val success: JsonField, - private val additionalProperties: Map, -) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun success(): Success = success.getRequired("success") - - @JsonProperty("success") @ExcludeMissing fun _success() = success - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): InferencePipelineDataStreamResponse = apply { - if (!validated) { - success() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InferencePipelineDataStreamResponse && - this.success == other.success && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(success, additionalProperties) - } - return hashCode - } - - override fun toString() = - "InferencePipelineDataStreamResponse{success=$success, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var success: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from( - inferencePipelineDataStreamResponse: InferencePipelineDataStreamResponse - ) = apply { - this.success = inferencePipelineDataStreamResponse.success - additionalProperties(inferencePipelineDataStreamResponse.additionalProperties) - } - - fun success(success: Success) = success(JsonField.of(success)) - - @JsonProperty("success") - @ExcludeMissing - fun success(success: JsonField) = apply { this.success = success } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): InferencePipelineDataStreamResponse = - InferencePipelineDataStreamResponse(success, additionalProperties.toUnmodifiable()) - } - - class Success - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Success && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val TRUE = Success(JsonField.of(true)) - - @JvmStatic fun of(value: Boolean) = Success(JsonField.of(value)) - } - - enum class Known { - TRUE, - } - - enum class Value { - TRUE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - TRUE -> Value.TRUE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - TRUE -> Known.TRUE - else -> throw OpenlayerInvalidDataException("Unknown Success: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineTestResultListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineTestResultListParams.kt deleted file mode 100644 index cb8fb3c..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineTestResultListParams.kt +++ /dev/null @@ -1,379 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.openlayer.api.models - -import com.fasterxml.jackson.annotation.JsonCreator -import com.openlayer.api.core.Enum -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 InferencePipelineTestResultListParams -constructor( - private val id: String, - private val includeArchived: Boolean?, - private val page: Long?, - private val perPage: Long?, - private val status: Status?, - private val type: Type?, - private val additionalQueryParams: Map>, - private val additionalHeaders: Map>, - private val additionalBodyProperties: Map, -) { - - fun id(): String = id - - fun includeArchived(): Optional = Optional.ofNullable(includeArchived) - - fun page(): Optional = Optional.ofNullable(page) - - fun perPage(): Optional = Optional.ofNullable(perPage) - - fun status(): Optional = Optional.ofNullable(status) - - fun type(): Optional = Optional.ofNullable(type) - - @JvmSynthetic - internal fun getQueryParams(): Map> { - val params = mutableMapOf>() - this.includeArchived?.let { params.put("includeArchived", listOf(it.toString())) } - this.page?.let { params.put("page", listOf(it.toString())) } - this.perPage?.let { params.put("perPage", listOf(it.toString())) } - this.status?.let { params.put("status", listOf(it.toString())) } - this.type?.let { params.put("type", listOf(it.toString())) } - params.putAll(additionalQueryParams) - return params.toUnmodifiable() - } - - @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - - fun getPathParam(index: Int): String { - return when (index) { - 0 -> id - else -> "" - } - } - - fun _additionalQueryParams(): Map> = additionalQueryParams - - fun _additionalHeaders(): Map> = additionalHeaders - - fun _additionalBodyProperties(): Map = additionalBodyProperties - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InferencePipelineTestResultListParams && - this.id == other.id && - this.includeArchived == other.includeArchived && - this.page == other.page && - this.perPage == other.perPage && - this.status == other.status && - this.type == other.type && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties - } - - override fun hashCode(): Int { - return Objects.hash( - id, - includeArchived, - page, - perPage, - status, - type, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) - } - - override fun toString() = - "InferencePipelineTestResultListParams{id=$id, includeArchived=$includeArchived, page=$page, perPage=$perPage, status=$status, type=$type, 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 includeArchived: Boolean? = null - private var page: Long? = null - private var perPage: Long? = null - private var status: Status? = null - private var type: Type? = null - private var additionalQueryParams: MutableMap> = mutableMapOf() - private var additionalHeaders: MutableMap> = mutableMapOf() - private var additionalBodyProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from( - inferencePipelineTestResultListParams: InferencePipelineTestResultListParams - ) = apply { - this.id = inferencePipelineTestResultListParams.id - this.includeArchived = inferencePipelineTestResultListParams.includeArchived - this.page = inferencePipelineTestResultListParams.page - this.perPage = inferencePipelineTestResultListParams.perPage - this.status = inferencePipelineTestResultListParams.status - this.type = inferencePipelineTestResultListParams.type - additionalQueryParams(inferencePipelineTestResultListParams.additionalQueryParams) - additionalHeaders(inferencePipelineTestResultListParams.additionalHeaders) - additionalBodyProperties(inferencePipelineTestResultListParams.additionalBodyProperties) - } - - fun id(id: String) = apply { this.id = id } - - /** Include archived goals. */ - fun includeArchived(includeArchived: Boolean) = apply { - this.includeArchived = includeArchived - } - - /** 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 } - - /** - * Filter list of test results by status. Available statuses are `running`, `passing`, - * `failing`, `skipped`, and `error`. - */ - fun status(status: Status) = apply { this.status = status } - - /** - * Filter objects by test type. Available types are `integrity`, `consistency`, - * `performance`, `fairness`, and `robustness`. - */ - fun type(type: Type) = apply { this.type = type } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = apply { - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { - this.additionalQueryParams.put(name, mutableListOf()) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = apply { - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } - - fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - this.additionalBodyProperties.put(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun build(): InferencePipelineTestResultListParams = - InferencePipelineTestResultListParams( - checkNotNull(id) { "`id` is required but was not set" }, - includeArchived, - page, - perPage, - status, - type, - additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), - additionalBodyProperties.toUnmodifiable(), - ) - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Status && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val RUNNING = Status(JsonField.of("running")) - - @JvmField val PASSING = Status(JsonField.of("passing")) - - @JvmField val FAILING = Status(JsonField.of("failing")) - - @JvmField val SKIPPED = Status(JsonField.of("skipped")) - - @JvmField val ERROR = Status(JsonField.of("error")) - - @JvmStatic fun of(value: String) = Status(JsonField.of(value)) - } - - enum class Known { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - } - - enum class Value { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - RUNNING -> Value.RUNNING - PASSING -> Value.PASSING - FAILING -> Value.FAILING - SKIPPED -> Value.SKIPPED - ERROR -> Value.ERROR - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - RUNNING -> Known.RUNNING - PASSING -> Known.PASSING - FAILING -> Known.FAILING - SKIPPED -> Known.SKIPPED - ERROR -> Known.ERROR - else -> throw OpenlayerInvalidDataException("Unknown Status: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Type && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val INTEGRITY = Type(JsonField.of("integrity")) - - @JvmField val CONSISTENCY = Type(JsonField.of("consistency")) - - @JvmField val PERFORMANCE = Type(JsonField.of("performance")) - - @JvmField val FAIRNESS = Type(JsonField.of("fairness")) - - @JvmField val ROBUSTNESS = Type(JsonField.of("robustness")) - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - enum class Known { - INTEGRITY, - CONSISTENCY, - PERFORMANCE, - FAIRNESS, - ROBUSTNESS, - } - - enum class Value { - INTEGRITY, - CONSISTENCY, - PERFORMANCE, - FAIRNESS, - ROBUSTNESS, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - INTEGRITY -> Value.INTEGRITY - CONSISTENCY -> Value.CONSISTENCY - PERFORMANCE -> Value.PERFORMANCE - FAIRNESS -> Value.FAIRNESS - ROBUSTNESS -> Value.ROBUSTNESS - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - INTEGRITY -> Known.INTEGRITY - CONSISTENCY -> Known.CONSISTENCY - PERFORMANCE -> Known.PERFORMANCE - FAIRNESS -> Known.FAIRNESS - ROBUSTNESS -> Known.ROBUSTNESS - else -> throw OpenlayerInvalidDataException("Unknown Type: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineTestResultListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineTestResultListResponse.kt deleted file mode 100644 index 045ce71..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineTestResultListResponse.kt +++ /dev/null @@ -1,1666 +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.core.JsonGenerator -import com.fasterxml.jackson.core.ObjectCodec -import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.SerializerProvider -import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import com.fasterxml.jackson.databind.annotation.JsonSerialize -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.openlayer.api.core.BaseDeserializer -import com.openlayer.api.core.BaseSerializer -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.getOrThrow -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 = InferencePipelineTestResultListResponse.Builder::class) -@NoAutoDetect -class InferencePipelineTestResultListResponse -private constructor( - private val _meta: JsonField<_Meta>, - private val items: JsonField>, - private val additionalProperties: Map, -) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun _meta(): _Meta = _meta.getRequired("_meta") - - fun items(): List = items.getRequired("items") - - @JsonProperty("_meta") @ExcludeMissing fun __meta() = _meta - - @JsonProperty("items") @ExcludeMissing fun _items() = items - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): InferencePipelineTestResultListResponse = 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 InferencePipelineTestResultListResponse && - 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() = - "InferencePipelineTestResultListResponse{_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> = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from( - inferencePipelineTestResultListResponse: InferencePipelineTestResultListResponse - ) = apply { - this._meta = inferencePipelineTestResultListResponse._meta - this.items = inferencePipelineTestResultListResponse.items - additionalProperties(inferencePipelineTestResultListResponse.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) = items(JsonField.of(items)) - - @JsonProperty("items") - @ExcludeMissing - fun items(items: JsonField>) = apply { this.items = items } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): InferencePipelineTestResultListResponse = - InferencePipelineTestResultListResponse( - _meta, - items.map { it.toUnmodifiable() }, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = _Meta.Builder::class) - @NoAutoDetect - class _Meta - private constructor( - private val page: JsonField, - private val perPage: JsonField, - private val totalItems: JsonField, - private val totalPages: JsonField, - private val additionalProperties: Map, - ) { - - 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 = 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 = JsonMissing.of() - private var perPage: JsonField = JsonMissing.of() - private var totalItems: JsonField = JsonMissing.of() - private var totalPages: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = 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) = 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) = 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) = 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) = apply { this.totalPages = totalPages } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): _Meta = - _Meta( - page, - perPage, - totalItems, - totalPages, - additionalProperties.toUnmodifiable(), - ) - } - } - - @JsonDeserialize(builder = Item.Builder::class) - @NoAutoDetect - class Item - private constructor( - private val id: JsonField, - private val goal: JsonField, - private val goalId: JsonField, - private val projectVersionId: JsonField, - private val inferencePipelineId: JsonField, - private val dateCreated: JsonField, - private val dateUpdated: JsonField, - private val dateDataStarts: JsonField, - private val dateDataEnds: JsonField, - private val status: JsonField, - private val statusMessage: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** Project version (commit) id. */ - fun id(): String = id.getRequired("id") - - fun goal(): Optional = Optional.ofNullable(goal.getNullable("goal")) - - /** The test id. */ - fun goalId(): Optional = Optional.ofNullable(goalId.getNullable("goalId")) - - /** The project version (commit) id. */ - fun projectVersionId(): Optional = - Optional.ofNullable(projectVersionId.getNullable("projectVersionId")) - - /** The inference pipeline id. */ - fun inferencePipelineId(): Optional = - Optional.ofNullable(inferencePipelineId.getNullable("inferencePipelineId")) - - /** The creation date. */ - fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") - - /** The last updated date. */ - fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") - - /** The data start date. */ - fun dateDataStarts(): Optional = - Optional.ofNullable(dateDataStarts.getNullable("dateDataStarts")) - - /** The data end date. */ - fun dateDataEnds(): Optional = - Optional.ofNullable(dateDataEnds.getNullable("dateDataEnds")) - - /** The status of the test. */ - fun status(): Status = status.getRequired("status") - - /** The status message. */ - fun statusMessage(): Optional = - Optional.ofNullable(statusMessage.getNullable("statusMessage")) - - /** Project version (commit) id. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - - @JsonProperty("goal") @ExcludeMissing fun _goal() = goal - - /** The test id. */ - @JsonProperty("goalId") @ExcludeMissing fun _goalId() = goalId - - /** The project version (commit) id. */ - @JsonProperty("projectVersionId") @ExcludeMissing fun _projectVersionId() = projectVersionId - - /** The inference pipeline id. */ - @JsonProperty("inferencePipelineId") - @ExcludeMissing - fun _inferencePipelineId() = inferencePipelineId - - /** The creation date. */ - @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated - - /** The last updated date. */ - @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated - - /** The data start date. */ - @JsonProperty("dateDataStarts") @ExcludeMissing fun _dateDataStarts() = dateDataStarts - - /** The data end date. */ - @JsonProperty("dateDataEnds") @ExcludeMissing fun _dateDataEnds() = dateDataEnds - - /** The status of the test. */ - @JsonProperty("status") @ExcludeMissing fun _status() = status - - /** The status message. */ - @JsonProperty("statusMessage") @ExcludeMissing fun _statusMessage() = statusMessage - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Item = apply { - if (!validated) { - id() - goal().map { it.validate() } - goalId() - projectVersionId() - inferencePipelineId() - dateCreated() - dateUpdated() - dateDataStarts() - dateDataEnds() - status() - statusMessage() - 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.goal == other.goal && - this.goalId == other.goalId && - this.projectVersionId == other.projectVersionId && - this.inferencePipelineId == other.inferencePipelineId && - this.dateCreated == other.dateCreated && - this.dateUpdated == other.dateUpdated && - this.dateDataStarts == other.dateDataStarts && - this.dateDataEnds == other.dateDataEnds && - this.status == other.status && - this.statusMessage == other.statusMessage && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - goal, - goalId, - projectVersionId, - inferencePipelineId, - dateCreated, - dateUpdated, - dateDataStarts, - dateDataEnds, - status, - statusMessage, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Item{id=$id, goal=$goal, goalId=$goalId, projectVersionId=$projectVersionId, inferencePipelineId=$inferencePipelineId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateDataStarts=$dateDataStarts, dateDataEnds=$dateDataEnds, status=$status, statusMessage=$statusMessage, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField = JsonMissing.of() - private var goal: JsonField = JsonMissing.of() - private var goalId: JsonField = JsonMissing.of() - private var projectVersionId: JsonField = JsonMissing.of() - private var inferencePipelineId: JsonField = JsonMissing.of() - private var dateCreated: JsonField = JsonMissing.of() - private var dateUpdated: JsonField = JsonMissing.of() - private var dateDataStarts: JsonField = JsonMissing.of() - private var dateDataEnds: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() - private var statusMessage: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - this.id = item.id - this.goal = item.goal - this.goalId = item.goalId - this.projectVersionId = item.projectVersionId - this.inferencePipelineId = item.inferencePipelineId - this.dateCreated = item.dateCreated - this.dateUpdated = item.dateUpdated - this.dateDataStarts = item.dateDataStarts - this.dateDataEnds = item.dateDataEnds - this.status = item.status - this.statusMessage = item.statusMessage - additionalProperties(item.additionalProperties) - } - - /** Project version (commit) id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** Project version (commit) id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField) = apply { this.id = id } - - fun goal(goal: Goal) = goal(JsonField.of(goal)) - - @JsonProperty("goal") - @ExcludeMissing - fun goal(goal: JsonField) = apply { this.goal = goal } - - /** The test id. */ - fun goalId(goalId: String) = goalId(JsonField.of(goalId)) - - /** The test id. */ - @JsonProperty("goalId") - @ExcludeMissing - fun goalId(goalId: JsonField) = apply { this.goalId = goalId } - - /** The project version (commit) id. */ - fun projectVersionId(projectVersionId: String) = - projectVersionId(JsonField.of(projectVersionId)) - - /** The project version (commit) id. */ - @JsonProperty("projectVersionId") - @ExcludeMissing - fun projectVersionId(projectVersionId: JsonField) = apply { - this.projectVersionId = projectVersionId - } - - /** The inference pipeline id. */ - fun inferencePipelineId(inferencePipelineId: String) = - inferencePipelineId(JsonField.of(inferencePipelineId)) - - /** The inference pipeline id. */ - @JsonProperty("inferencePipelineId") - @ExcludeMissing - fun inferencePipelineId(inferencePipelineId: JsonField) = apply { - this.inferencePipelineId = inferencePipelineId - } - - /** The creation date. */ - fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) - - /** The creation date. */ - @JsonProperty("dateCreated") - @ExcludeMissing - fun dateCreated(dateCreated: JsonField) = apply { - this.dateCreated = dateCreated - } - - /** The last updated date. */ - fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) - - /** The last updated date. */ - @JsonProperty("dateUpdated") - @ExcludeMissing - fun dateUpdated(dateUpdated: JsonField) = apply { - this.dateUpdated = dateUpdated - } - - /** The data start date. */ - fun dateDataStarts(dateDataStarts: OffsetDateTime) = - dateDataStarts(JsonField.of(dateDataStarts)) - - /** The data start date. */ - @JsonProperty("dateDataStarts") - @ExcludeMissing - fun dateDataStarts(dateDataStarts: JsonField) = apply { - this.dateDataStarts = dateDataStarts - } - - /** The data end date. */ - fun dateDataEnds(dateDataEnds: OffsetDateTime) = - dateDataEnds(JsonField.of(dateDataEnds)) - - /** The data end date. */ - @JsonProperty("dateDataEnds") - @ExcludeMissing - fun dateDataEnds(dateDataEnds: JsonField) = apply { - this.dateDataEnds = dateDataEnds - } - - /** The status of the test. */ - fun status(status: Status) = status(JsonField.of(status)) - - /** The status of the test. */ - @JsonProperty("status") - @ExcludeMissing - fun status(status: JsonField) = apply { this.status = status } - - /** The status message. */ - fun statusMessage(statusMessage: String) = statusMessage(JsonField.of(statusMessage)) - - /** The status message. */ - @JsonProperty("statusMessage") - @ExcludeMissing - fun statusMessage(statusMessage: JsonField) = apply { - this.statusMessage = statusMessage - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Item = - Item( - id, - goal, - goalId, - projectVersionId, - inferencePipelineId, - dateCreated, - dateUpdated, - dateDataStarts, - dateDataEnds, - status, - statusMessage, - additionalProperties.toUnmodifiable(), - ) - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Status && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val RUNNING = Status(JsonField.of("running")) - - @JvmField val PASSING = Status(JsonField.of("passing")) - - @JvmField val FAILING = Status(JsonField.of("failing")) - - @JvmField val SKIPPED = Status(JsonField.of("skipped")) - - @JvmField val ERROR = Status(JsonField.of("error")) - - @JvmStatic fun of(value: String) = Status(JsonField.of(value)) - } - - enum class Known { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - } - - enum class Value { - RUNNING, - PASSING, - FAILING, - SKIPPED, - ERROR, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - RUNNING -> Value.RUNNING - PASSING -> Value.PASSING - FAILING -> Value.FAILING - SKIPPED -> Value.SKIPPED - ERROR -> Value.ERROR - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - RUNNING -> Known.RUNNING - PASSING -> Known.PASSING - FAILING -> Known.FAILING - SKIPPED -> Known.SKIPPED - ERROR -> Known.ERROR - else -> throw OpenlayerInvalidDataException("Unknown Status: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } - - @JsonDeserialize(builder = Goal.Builder::class) - @NoAutoDetect - class Goal - private constructor( - private val id: JsonField, - private val number: JsonField, - private val name: JsonField, - private val dateCreated: JsonField, - private val dateUpdated: JsonField, - private val description: JsonValue, - private val evaluationWindow: JsonField, - private val delayWindow: JsonField, - private val type: JsonField, - private val subtype: JsonField, - private val creatorId: JsonField, - private val originProjectVersionId: JsonField, - private val thresholds: JsonField>, - private val archived: JsonField, - private val dateArchived: JsonField, - private val suggested: JsonField, - private val commentCount: JsonField, - private val usesMlModel: JsonField, - private val usesValidationDataset: JsonField, - private val usesTrainingDataset: JsonField, - private val usesReferenceDataset: JsonField, - private val usesProductionData: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The test id. */ - fun id(): String = id.getRequired("id") - - /** The test number. */ - fun number(): Long = number.getRequired("number") - - /** The test 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 evaluation window in seconds. Only applies to tests that use production data. */ - fun evaluationWindow(): Optional = - Optional.ofNullable(evaluationWindow.getNullable("evaluationWindow")) - - /** The delay window in seconds. Only applies to tests that use production data. */ - fun delayWindow(): Optional = - Optional.ofNullable(delayWindow.getNullable("delayWindow")) - - /** The test type. */ - fun type(): String = type.getRequired("type") - - /** The test subtype. */ - fun subtype(): String = subtype.getRequired("subtype") - - /** The test creator id. */ - fun creatorId(): Optional = - Optional.ofNullable(creatorId.getNullable("creatorId")) - - /** The project version (commit) id where the test was created. */ - fun originProjectVersionId(): Optional = - Optional.ofNullable(originProjectVersionId.getNullable("originProjectVersionId")) - - fun thresholds(): List = thresholds.getRequired("thresholds") - - /** Whether the test is archived. */ - fun archived(): Optional = - Optional.ofNullable(archived.getNullable("archived")) - - /** The date the test was archived. */ - fun dateArchived(): Optional = - Optional.ofNullable(dateArchived.getNullable("dateArchived")) - - /** Whether the test is suggested or user-created. */ - fun suggested(): Boolean = suggested.getRequired("suggested") - - /** The number of comments on the test. */ - fun commentCount(): Long = commentCount.getRequired("commentCount") - - /** Whether the test uses an ML model. */ - fun usesMlModel(): Optional = - Optional.ofNullable(usesMlModel.getNullable("usesMlModel")) - - /** Whether the test uses a validation dataset. */ - fun usesValidationDataset(): Optional = - Optional.ofNullable(usesValidationDataset.getNullable("usesValidationDataset")) - - /** Whether the test uses a training dataset. */ - fun usesTrainingDataset(): Optional = - Optional.ofNullable(usesTrainingDataset.getNullable("usesTrainingDataset")) - - /** Whether the test uses a reference dataset (monitoring mode only). */ - fun usesReferenceDataset(): Optional = - Optional.ofNullable(usesReferenceDataset.getNullable("usesReferenceDataset")) - - /** Whether the test uses production data (monitoring mode only). */ - fun usesProductionData(): Optional = - Optional.ofNullable(usesProductionData.getNullable("usesProductionData")) - - /** The test id. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - - /** The test number. */ - @JsonProperty("number") @ExcludeMissing fun _number() = number - - /** The test 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 test description. */ - @JsonProperty("description") @ExcludeMissing fun _description() = description - - /** The evaluation window in seconds. Only applies to tests that use production data. */ - @JsonProperty("evaluationWindow") - @ExcludeMissing - fun _evaluationWindow() = evaluationWindow - - /** The delay window in seconds. Only applies to tests that use production data. */ - @JsonProperty("delayWindow") @ExcludeMissing fun _delayWindow() = delayWindow - - /** The test type. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** The test subtype. */ - @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype - - /** The test creator id. */ - @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId - - /** The project version (commit) id where the test was created. */ - @JsonProperty("originProjectVersionId") - @ExcludeMissing - fun _originProjectVersionId() = originProjectVersionId - - @JsonProperty("thresholds") @ExcludeMissing fun _thresholds() = thresholds - - /** Whether the test is archived. */ - @JsonProperty("archived") @ExcludeMissing fun _archived() = archived - - /** The date the test was archived. */ - @JsonProperty("dateArchived") @ExcludeMissing fun _dateArchived() = dateArchived - - /** Whether the test is suggested or user-created. */ - @JsonProperty("suggested") @ExcludeMissing fun _suggested() = suggested - - /** The number of comments on the test. */ - @JsonProperty("commentCount") @ExcludeMissing fun _commentCount() = commentCount - - /** Whether the test uses an ML model. */ - @JsonProperty("usesMlModel") @ExcludeMissing fun _usesMlModel() = usesMlModel - - /** Whether the test uses a validation dataset. */ - @JsonProperty("usesValidationDataset") - @ExcludeMissing - fun _usesValidationDataset() = usesValidationDataset - - /** Whether the test uses a training dataset. */ - @JsonProperty("usesTrainingDataset") - @ExcludeMissing - fun _usesTrainingDataset() = usesTrainingDataset - - /** Whether the test uses a reference dataset (monitoring mode only). */ - @JsonProperty("usesReferenceDataset") - @ExcludeMissing - fun _usesReferenceDataset() = usesReferenceDataset - - /** Whether the test uses production data (monitoring mode only). */ - @JsonProperty("usesProductionData") - @ExcludeMissing - fun _usesProductionData() = usesProductionData - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Goal = apply { - if (!validated) { - id() - number() - name() - dateCreated() - dateUpdated() - evaluationWindow() - delayWindow() - type() - subtype() - creatorId() - originProjectVersionId() - thresholds().forEach { it.validate() } - archived() - dateArchived() - suggested() - commentCount() - usesMlModel() - usesValidationDataset() - usesTrainingDataset() - usesReferenceDataset() - usesProductionData() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Goal && - this.id == other.id && - this.number == other.number && - this.name == other.name && - this.dateCreated == other.dateCreated && - this.dateUpdated == other.dateUpdated && - this.description == other.description && - this.evaluationWindow == other.evaluationWindow && - this.delayWindow == other.delayWindow && - this.type == other.type && - this.subtype == other.subtype && - this.creatorId == other.creatorId && - this.originProjectVersionId == other.originProjectVersionId && - this.thresholds == other.thresholds && - this.archived == other.archived && - this.dateArchived == other.dateArchived && - this.suggested == other.suggested && - this.commentCount == other.commentCount && - this.usesMlModel == other.usesMlModel && - this.usesValidationDataset == other.usesValidationDataset && - this.usesTrainingDataset == other.usesTrainingDataset && - this.usesReferenceDataset == other.usesReferenceDataset && - this.usesProductionData == other.usesProductionData && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - number, - name, - dateCreated, - dateUpdated, - description, - evaluationWindow, - delayWindow, - type, - subtype, - creatorId, - originProjectVersionId, - thresholds, - archived, - dateArchived, - suggested, - commentCount, - usesMlModel, - usesValidationDataset, - usesTrainingDataset, - usesReferenceDataset, - usesProductionData, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Goal{id=$id, number=$number, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, evaluationWindow=$evaluationWindow, delayWindow=$delayWindow, type=$type, subtype=$subtype, creatorId=$creatorId, originProjectVersionId=$originProjectVersionId, thresholds=$thresholds, archived=$archived, dateArchived=$dateArchived, suggested=$suggested, commentCount=$commentCount, usesMlModel=$usesMlModel, usesValidationDataset=$usesValidationDataset, usesTrainingDataset=$usesTrainingDataset, usesReferenceDataset=$usesReferenceDataset, usesProductionData=$usesProductionData, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField = JsonMissing.of() - private var number: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var dateCreated: JsonField = JsonMissing.of() - private var dateUpdated: JsonField = JsonMissing.of() - private var description: JsonValue = JsonMissing.of() - private var evaluationWindow: JsonField = JsonMissing.of() - private var delayWindow: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var subtype: JsonField = JsonMissing.of() - private var creatorId: JsonField = JsonMissing.of() - private var originProjectVersionId: JsonField = JsonMissing.of() - private var thresholds: JsonField> = JsonMissing.of() - private var archived: JsonField = JsonMissing.of() - private var dateArchived: JsonField = JsonMissing.of() - private var suggested: JsonField = JsonMissing.of() - private var commentCount: JsonField = JsonMissing.of() - private var usesMlModel: JsonField = JsonMissing.of() - private var usesValidationDataset: JsonField = JsonMissing.of() - private var usesTrainingDataset: JsonField = JsonMissing.of() - private var usesReferenceDataset: JsonField = JsonMissing.of() - private var usesProductionData: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(goal: Goal) = apply { - this.id = goal.id - this.number = goal.number - this.name = goal.name - this.dateCreated = goal.dateCreated - this.dateUpdated = goal.dateUpdated - this.description = goal.description - this.evaluationWindow = goal.evaluationWindow - this.delayWindow = goal.delayWindow - this.type = goal.type - this.subtype = goal.subtype - this.creatorId = goal.creatorId - this.originProjectVersionId = goal.originProjectVersionId - this.thresholds = goal.thresholds - this.archived = goal.archived - this.dateArchived = goal.dateArchived - this.suggested = goal.suggested - this.commentCount = goal.commentCount - this.usesMlModel = goal.usesMlModel - this.usesValidationDataset = goal.usesValidationDataset - this.usesTrainingDataset = goal.usesTrainingDataset - this.usesReferenceDataset = goal.usesReferenceDataset - this.usesProductionData = goal.usesProductionData - additionalProperties(goal.additionalProperties) - } - - /** The test id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** The test id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField) = apply { this.id = id } - - /** The test number. */ - fun number(number: Long) = number(JsonField.of(number)) - - /** The test number. */ - @JsonProperty("number") - @ExcludeMissing - fun number(number: JsonField) = apply { this.number = number } - - /** The test name. */ - fun name(name: String) = name(JsonField.of(name)) - - /** The test name. */ - @JsonProperty("name") - @ExcludeMissing - fun name(name: JsonField) = apply { this.name = name } - - /** The creation date. */ - fun dateCreated(dateCreated: OffsetDateTime) = - dateCreated(JsonField.of(dateCreated)) - - /** The creation date. */ - @JsonProperty("dateCreated") - @ExcludeMissing - fun dateCreated(dateCreated: JsonField) = apply { - this.dateCreated = dateCreated - } - - /** The last updated date. */ - fun dateUpdated(dateUpdated: OffsetDateTime) = - dateUpdated(JsonField.of(dateUpdated)) - - /** The last updated date. */ - @JsonProperty("dateUpdated") - @ExcludeMissing - fun dateUpdated(dateUpdated: JsonField) = apply { - this.dateUpdated = dateUpdated - } - - /** The test description. */ - @JsonProperty("description") - @ExcludeMissing - fun description(description: JsonValue) = apply { this.description = description } - - /** - * The evaluation window in seconds. Only applies to tests that use production data. - */ - fun evaluationWindow(evaluationWindow: Double) = - evaluationWindow(JsonField.of(evaluationWindow)) - - /** - * The evaluation window in seconds. Only applies to tests that use production data. - */ - @JsonProperty("evaluationWindow") - @ExcludeMissing - fun evaluationWindow(evaluationWindow: JsonField) = apply { - this.evaluationWindow = evaluationWindow - } - - /** The delay window in seconds. Only applies to tests that use production data. */ - fun delayWindow(delayWindow: Double) = delayWindow(JsonField.of(delayWindow)) - - /** The delay window in seconds. Only applies to tests that use production data. */ - @JsonProperty("delayWindow") - @ExcludeMissing - fun delayWindow(delayWindow: JsonField) = apply { - this.delayWindow = delayWindow - } - - /** The test type. */ - fun type(type: String) = type(JsonField.of(type)) - - /** The test type. */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** The test subtype. */ - fun subtype(subtype: String) = subtype(JsonField.of(subtype)) - - /** The test subtype. */ - @JsonProperty("subtype") - @ExcludeMissing - fun subtype(subtype: JsonField) = apply { this.subtype = subtype } - - /** The test creator id. */ - fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) - - /** The test creator id. */ - @JsonProperty("creatorId") - @ExcludeMissing - fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } - - /** The project version (commit) id where the test was created. */ - fun originProjectVersionId(originProjectVersionId: String) = - originProjectVersionId(JsonField.of(originProjectVersionId)) - - /** The project version (commit) id where the test was created. */ - @JsonProperty("originProjectVersionId") - @ExcludeMissing - fun originProjectVersionId(originProjectVersionId: JsonField) = apply { - this.originProjectVersionId = originProjectVersionId - } - - fun thresholds(thresholds: List) = thresholds(JsonField.of(thresholds)) - - @JsonProperty("thresholds") - @ExcludeMissing - fun thresholds(thresholds: JsonField>) = apply { - this.thresholds = thresholds - } - - /** Whether the test is archived. */ - fun archived(archived: Boolean) = archived(JsonField.of(archived)) - - /** Whether the test is archived. */ - @JsonProperty("archived") - @ExcludeMissing - fun archived(archived: JsonField) = apply { this.archived = archived } - - /** The date the test was archived. */ - fun dateArchived(dateArchived: OffsetDateTime) = - dateArchived(JsonField.of(dateArchived)) - - /** The date the test was archived. */ - @JsonProperty("dateArchived") - @ExcludeMissing - fun dateArchived(dateArchived: JsonField) = apply { - this.dateArchived = dateArchived - } - - /** Whether the test is suggested or user-created. */ - fun suggested(suggested: Boolean) = suggested(JsonField.of(suggested)) - - /** Whether the test is suggested or user-created. */ - @JsonProperty("suggested") - @ExcludeMissing - fun suggested(suggested: JsonField) = apply { this.suggested = suggested } - - /** The number of comments on the test. */ - fun commentCount(commentCount: Long) = commentCount(JsonField.of(commentCount)) - - /** The number of comments on the test. */ - @JsonProperty("commentCount") - @ExcludeMissing - fun commentCount(commentCount: JsonField) = apply { - this.commentCount = commentCount - } - - /** Whether the test uses an ML model. */ - fun usesMlModel(usesMlModel: Boolean) = usesMlModel(JsonField.of(usesMlModel)) - - /** Whether the test uses an ML model. */ - @JsonProperty("usesMlModel") - @ExcludeMissing - fun usesMlModel(usesMlModel: JsonField) = apply { - this.usesMlModel = usesMlModel - } - - /** Whether the test uses a validation dataset. */ - fun usesValidationDataset(usesValidationDataset: Boolean) = - usesValidationDataset(JsonField.of(usesValidationDataset)) - - /** Whether the test uses a validation dataset. */ - @JsonProperty("usesValidationDataset") - @ExcludeMissing - fun usesValidationDataset(usesValidationDataset: JsonField) = apply { - this.usesValidationDataset = usesValidationDataset - } - - /** Whether the test uses a training dataset. */ - fun usesTrainingDataset(usesTrainingDataset: Boolean) = - usesTrainingDataset(JsonField.of(usesTrainingDataset)) - - /** Whether the test uses a training dataset. */ - @JsonProperty("usesTrainingDataset") - @ExcludeMissing - fun usesTrainingDataset(usesTrainingDataset: JsonField) = apply { - this.usesTrainingDataset = usesTrainingDataset - } - - /** Whether the test uses a reference dataset (monitoring mode only). */ - fun usesReferenceDataset(usesReferenceDataset: Boolean) = - usesReferenceDataset(JsonField.of(usesReferenceDataset)) - - /** Whether the test uses a reference dataset (monitoring mode only). */ - @JsonProperty("usesReferenceDataset") - @ExcludeMissing - fun usesReferenceDataset(usesReferenceDataset: JsonField) = apply { - this.usesReferenceDataset = usesReferenceDataset - } - - /** Whether the test uses production data (monitoring mode only). */ - fun usesProductionData(usesProductionData: Boolean) = - usesProductionData(JsonField.of(usesProductionData)) - - /** Whether the test uses production data (monitoring mode only). */ - @JsonProperty("usesProductionData") - @ExcludeMissing - fun usesProductionData(usesProductionData: JsonField) = apply { - this.usesProductionData = usesProductionData - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Goal = - Goal( - id, - number, - name, - dateCreated, - dateUpdated, - description, - evaluationWindow, - delayWindow, - type, - subtype, - creatorId, - originProjectVersionId, - thresholds.map { it.toUnmodifiable() }, - archived, - dateArchived, - suggested, - commentCount, - usesMlModel, - usesValidationDataset, - usesTrainingDataset, - usesReferenceDataset, - usesProductionData, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = Threshold.Builder::class) - @NoAutoDetect - class Threshold - private constructor( - private val measurement: JsonField, - private val insightName: JsonField, - private val insightParameters: JsonField>, - private val operator: JsonField, - private val value: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The measurement to be evaluated. */ - fun measurement(): Optional = - Optional.ofNullable(measurement.getNullable("measurement")) - - /** The insight name to be evaluated. */ - fun insightName(): Optional = - Optional.ofNullable(insightName.getNullable("insightName")) - - fun insightParameters(): Optional> = - Optional.ofNullable(insightParameters.getNullable("insightParameters")) - - /** The operator to be used for the evaluation. */ - fun operator(): Optional = - Optional.ofNullable(operator.getNullable("operator")) - - /** The value to be compared. */ - fun value(): Optional = Optional.ofNullable(value.getNullable("value")) - - /** The measurement to be evaluated. */ - @JsonProperty("measurement") @ExcludeMissing fun _measurement() = measurement - - /** The insight name to be evaluated. */ - @JsonProperty("insightName") @ExcludeMissing fun _insightName() = insightName - - @JsonProperty("insightParameters") - @ExcludeMissing - fun _insightParameters() = insightParameters - - /** The operator to be used for the evaluation. */ - @JsonProperty("operator") @ExcludeMissing fun _operator() = operator - - /** The value to be compared. */ - @JsonProperty("value") @ExcludeMissing fun _value() = value - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Threshold = apply { - if (!validated) { - measurement() - insightName() - insightParameters() - operator() - value() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Threshold && - this.measurement == other.measurement && - this.insightName == other.insightName && - this.insightParameters == other.insightParameters && - this.operator == other.operator && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - measurement, - insightName, - insightParameters, - operator, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Threshold{measurement=$measurement, insightName=$insightName, insightParameters=$insightParameters, operator=$operator, value=$value, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var measurement: JsonField = JsonMissing.of() - private var insightName: JsonField = JsonMissing.of() - private var insightParameters: JsonField> = JsonMissing.of() - private var operator: JsonField = JsonMissing.of() - private var value: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(threshold: Threshold) = apply { - this.measurement = threshold.measurement - this.insightName = threshold.insightName - this.insightParameters = threshold.insightParameters - this.operator = threshold.operator - this.value = threshold.value - additionalProperties(threshold.additionalProperties) - } - - /** The measurement to be evaluated. */ - fun measurement(measurement: String) = measurement(JsonField.of(measurement)) - - /** The measurement to be evaluated. */ - @JsonProperty("measurement") - @ExcludeMissing - fun measurement(measurement: JsonField) = apply { - this.measurement = measurement - } - - /** The insight name to be evaluated. */ - fun insightName(insightName: String) = insightName(JsonField.of(insightName)) - - /** The insight name to be evaluated. */ - @JsonProperty("insightName") - @ExcludeMissing - fun insightName(insightName: JsonField) = apply { - this.insightName = insightName - } - - fun insightParameters(insightParameters: List) = - insightParameters(JsonField.of(insightParameters)) - - @JsonProperty("insightParameters") - @ExcludeMissing - fun insightParameters(insightParameters: JsonField>) = apply { - this.insightParameters = insightParameters - } - - /** The operator to be used for the evaluation. */ - fun operator(operator: String) = operator(JsonField.of(operator)) - - /** The operator to be used for the evaluation. */ - @JsonProperty("operator") - @ExcludeMissing - fun operator(operator: JsonField) = apply { this.operator = operator } - - /** The value to be compared. */ - fun value(value: Value) = value(JsonField.of(value)) - - /** The value to be compared. */ - @JsonProperty("value") - @ExcludeMissing - fun value(value: JsonField) = apply { this.value = value } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Threshold = - Threshold( - measurement, - insightName, - insightParameters.map { it.toUnmodifiable() }, - operator, - value, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(using = Value.Deserializer::class) - @JsonSerialize(using = Value.Serializer::class) - class Value - private constructor( - private val double: Double? = null, - private val boolean: Boolean? = null, - private val string: String? = null, - private val strings: List? = null, - private val _json: JsonValue? = null, - ) { - - private var validated: Boolean = false - - fun double(): Optional = Optional.ofNullable(double) - - fun boolean(): Optional = Optional.ofNullable(boolean) - - fun string(): Optional = Optional.ofNullable(string) - - fun strings(): Optional> = Optional.ofNullable(strings) - - fun isDouble(): Boolean = double != null - - fun isBoolean(): Boolean = boolean != null - - fun isString(): Boolean = string != null - - fun isStrings(): Boolean = strings != null - - fun asDouble(): Double = double.getOrThrow("double") - - fun asBoolean(): Boolean = boolean.getOrThrow("boolean") - - fun asString(): String = string.getOrThrow("string") - - fun asStrings(): List = strings.getOrThrow("strings") - - fun _json(): Optional = Optional.ofNullable(_json) - - fun accept(visitor: Visitor): T { - return when { - double != null -> visitor.visitDouble(double) - boolean != null -> visitor.visitBoolean(boolean) - string != null -> visitor.visitString(string) - strings != null -> visitor.visitStrings(strings) - else -> visitor.unknown(_json) - } - } - - fun validate(): Value = apply { - if (!validated) { - if ( - double == null && - boolean == null && - string == null && - strings == null - ) { - throw OpenlayerInvalidDataException("Unknown Value: $_json") - } - validated = true - } - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Value && - this.double == other.double && - this.boolean == other.boolean && - this.string == other.string && - this.strings == other.strings - } - - override fun hashCode(): Int { - return Objects.hash( - double, - boolean, - string, - strings, - ) - } - - override fun toString(): String { - return when { - double != null -> "Value{double=$double}" - boolean != null -> "Value{boolean=$boolean}" - string != null -> "Value{string=$string}" - strings != null -> "Value{strings=$strings}" - _json != null -> "Value{_unknown=$_json}" - else -> throw IllegalStateException("Invalid Value") - } - } - - companion object { - - @JvmStatic fun ofDouble(double: Double) = Value(double = double) - - @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - - @JvmStatic fun ofString(string: String) = Value(string = string) - - @JvmStatic fun ofStrings(strings: List) = Value(strings = strings) - } - - interface Visitor { - - fun visitDouble(double: Double): T - - fun visitBoolean(boolean: Boolean): T - - fun visitString(string: String): T - - fun visitStrings(strings: List): T - - fun unknown(json: JsonValue?): T { - throw OpenlayerInvalidDataException("Unknown Value: $json") - } - } - - class Deserializer : BaseDeserializer(Value::class) { - - override fun ObjectCodec.deserialize(node: JsonNode): Value { - val json = JsonValue.fromJsonNode(node) - tryDeserialize(node, jacksonTypeRef())?.let { - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef())?.let { - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef>())?.let { - return Value(strings = it, _json = json) - } - - return Value(_json = json) - } - } - - class Serializer : BaseSerializer(Value::class) { - - override fun serialize( - value: Value, - generator: JsonGenerator, - provider: SerializerProvider - ) { - when { - value.double != null -> generator.writeObject(value.double) - value.boolean != null -> generator.writeObject(value.boolean) - value.string != null -> generator.writeObject(value.string) - value.strings != null -> generator.writeObject(value.strings) - value._json != null -> generator.writeObject(value._json) - else -> throw IllegalStateException("Invalid Value") - } - } - } - } - } - } - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCommitListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCommitListParams.kt deleted file mode 100644 index 6951d52..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCommitListParams.kt +++ /dev/null @@ -1,179 +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 ProjectCommitListParams -constructor( - private val id: String, - private val page: Long?, - private val perPage: Long?, - private val additionalQueryParams: Map>, - private val additionalHeaders: Map>, - private val additionalBodyProperties: Map, -) { - - fun id(): String = id - - fun page(): Optional = Optional.ofNullable(page) - - fun perPage(): Optional = Optional.ofNullable(perPage) - - @JvmSynthetic - internal fun getQueryParams(): Map> { - val params = mutableMapOf>() - 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> = additionalHeaders - - fun getPathParam(index: Int): String { - return when (index) { - 0 -> id - else -> "" - } - } - - fun _additionalQueryParams(): Map> = additionalQueryParams - - fun _additionalHeaders(): Map> = additionalHeaders - - fun _additionalBodyProperties(): Map = additionalBodyProperties - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectCommitListParams && - this.id == other.id && - 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, - page, - perPage, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) - } - - override fun toString() = - "ProjectCommitListParams{id=$id, 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 page: Long? = null - private var perPage: Long? = null - private var additionalQueryParams: MutableMap> = mutableMapOf() - private var additionalHeaders: MutableMap> = mutableMapOf() - private var additionalBodyProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(projectCommitListParams: ProjectCommitListParams) = apply { - this.id = projectCommitListParams.id - this.page = projectCommitListParams.page - this.perPage = projectCommitListParams.perPage - additionalQueryParams(projectCommitListParams.additionalQueryParams) - additionalHeaders(projectCommitListParams.additionalHeaders) - additionalBodyProperties(projectCommitListParams.additionalBodyProperties) - } - - fun id(id: String) = apply { this.id = id } - - /** 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>) = apply { - this.additionalQueryParams.clear() - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = apply { - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = apply { - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { - this.additionalQueryParams.put(name, mutableListOf()) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = apply { - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = apply { - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } - - fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - this.additionalBodyProperties.clear() - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - this.additionalBodyProperties.put(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { - this.additionalBodyProperties.putAll(additionalBodyProperties) - } - - fun build(): ProjectCommitListParams = - ProjectCommitListParams( - checkNotNull(id) { "`id` is required but was not set" }, - 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/ProjectCommitListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCommitListResponse.kt deleted file mode 100644 index da9d1fd..0000000 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCommitListResponse.kt +++ /dev/null @@ -1,1308 +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 = ProjectCommitListResponse.Builder::class) -@NoAutoDetect -class ProjectCommitListResponse -private constructor( - private val _meta: JsonField<_Meta>, - private val items: JsonField>, - private val additionalProperties: Map, -) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun _meta(): _Meta = _meta.getRequired("_meta") - - fun items(): List = items.getRequired("items") - - @JsonProperty("_meta") @ExcludeMissing fun __meta() = _meta - - @JsonProperty("items") @ExcludeMissing fun _items() = items - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): ProjectCommitListResponse = 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 ProjectCommitListResponse && - 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() = - "ProjectCommitListResponse{_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> = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(projectCommitListResponse: ProjectCommitListResponse) = apply { - this._meta = projectCommitListResponse._meta - this.items = projectCommitListResponse.items - additionalProperties(projectCommitListResponse.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) = items(JsonField.of(items)) - - @JsonProperty("items") - @ExcludeMissing - fun items(items: JsonField>) = apply { this.items = items } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): ProjectCommitListResponse = - ProjectCommitListResponse( - _meta, - items.map { it.toUnmodifiable() }, - additionalProperties.toUnmodifiable(), - ) - } - - @JsonDeserialize(builder = _Meta.Builder::class) - @NoAutoDetect - class _Meta - private constructor( - private val page: JsonField, - private val perPage: JsonField, - private val totalItems: JsonField, - private val totalPages: JsonField, - private val additionalProperties: Map, - ) { - - 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 = 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 = JsonMissing.of() - private var perPage: JsonField = JsonMissing.of() - private var totalItems: JsonField = JsonMissing.of() - private var totalPages: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = 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) = 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) = 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) = 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) = apply { this.totalPages = totalPages } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): _Meta = - _Meta( - page, - perPage, - totalItems, - totalPages, - additionalProperties.toUnmodifiable(), - ) - } - } - - @JsonDeserialize(builder = Item.Builder::class) - @NoAutoDetect - class Item - private constructor( - private val id: JsonField, - private val dateCreated: JsonField, - private val status: JsonField, - private val statusMessage: JsonField, - private val projectId: JsonField, - private val storageUri: JsonField, - private val commit: JsonField, - private val deploymentStatus: JsonField, - private val mlModelId: JsonField, - private val validationDatasetId: JsonField, - private val trainingDatasetId: JsonField, - private val archived: JsonField, - private val dateArchived: JsonField, - private val passingGoalCount: JsonField, - private val failingGoalCount: JsonField, - private val totalGoalCount: JsonField, - private val links: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The project version (commit) id. */ - fun id(): String = id.getRequired("id") - - /** The project version (commit) creation date. */ - fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") - - /** - * The commit status. Initially, the commit is `queued`, then, it switches to `running`. - * Finally, it can be `paused`, `failed`, or `completed`. - */ - fun status(): Status = status.getRequired("status") - - /** The commit status message. */ - fun statusMessage(): Optional = - Optional.ofNullable(statusMessage.getNullable("statusMessage")) - - /** The project id. */ - fun projectId(): String = projectId.getRequired("projectId") - - /** The storage URI where the commit bundle is stored. */ - fun storageUri(): String = storageUri.getRequired("storageUri") - - /** The details of a commit (project version). */ - fun commit(): Commit = commit.getRequired("commit") - - /** The deployment status associated with the commit's model. */ - fun deploymentStatus(): Optional = - Optional.ofNullable(deploymentStatus.getNullable("deploymentStatus")) - - /** The model id. */ - fun mlModelId(): Optional = Optional.ofNullable(mlModelId.getNullable("mlModelId")) - - /** The validation dataset id. */ - fun validationDatasetId(): Optional = - Optional.ofNullable(validationDatasetId.getNullable("validationDatasetId")) - - /** The training dataset id. */ - fun trainingDatasetId(): Optional = - Optional.ofNullable(trainingDatasetId.getNullable("trainingDatasetId")) - - /** Whether the commit is archived. */ - fun archived(): Optional = Optional.ofNullable(archived.getNullable("archived")) - - /** The commit archive date. */ - fun dateArchived(): Optional = - Optional.ofNullable(dateArchived.getNullable("dateArchived")) - - /** The number of tests that are passing for the commit. */ - fun passingGoalCount(): Long = passingGoalCount.getRequired("passingGoalCount") - - /** The number of tests that are failing for the commit. */ - fun failingGoalCount(): Long = failingGoalCount.getRequired("failingGoalCount") - - /** The total number of tests for the commit. */ - fun totalGoalCount(): Long = totalGoalCount.getRequired("totalGoalCount") - - fun links(): Optional = Optional.ofNullable(links.getNullable("links")) - - /** The project version (commit) id. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - - /** The project version (commit) creation date. */ - @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated - - /** - * The commit status. Initially, the commit is `queued`, then, it switches to `running`. - * Finally, it can be `paused`, `failed`, or `completed`. - */ - @JsonProperty("status") @ExcludeMissing fun _status() = status - - /** The commit status message. */ - @JsonProperty("statusMessage") @ExcludeMissing fun _statusMessage() = statusMessage - - /** The project id. */ - @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId - - /** The storage URI where the commit bundle is stored. */ - @JsonProperty("storageUri") @ExcludeMissing fun _storageUri() = storageUri - - /** The details of a commit (project version). */ - @JsonProperty("commit") @ExcludeMissing fun _commit() = commit - - /** The deployment status associated with the commit's model. */ - @JsonProperty("deploymentStatus") @ExcludeMissing fun _deploymentStatus() = deploymentStatus - - /** The model id. */ - @JsonProperty("mlModelId") @ExcludeMissing fun _mlModelId() = mlModelId - - /** The validation dataset id. */ - @JsonProperty("validationDatasetId") - @ExcludeMissing - fun _validationDatasetId() = validationDatasetId - - /** The training dataset id. */ - @JsonProperty("trainingDatasetId") - @ExcludeMissing - fun _trainingDatasetId() = trainingDatasetId - - /** Whether the commit is archived. */ - @JsonProperty("archived") @ExcludeMissing fun _archived() = archived - - /** The commit archive date. */ - @JsonProperty("dateArchived") @ExcludeMissing fun _dateArchived() = dateArchived - - /** The number of tests that are passing for the commit. */ - @JsonProperty("passingGoalCount") @ExcludeMissing fun _passingGoalCount() = passingGoalCount - - /** The number of tests that are failing for the commit. */ - @JsonProperty("failingGoalCount") @ExcludeMissing fun _failingGoalCount() = failingGoalCount - - /** The total number of tests for the commit. */ - @JsonProperty("totalGoalCount") @ExcludeMissing fun _totalGoalCount() = totalGoalCount - - @JsonProperty("links") @ExcludeMissing fun _links() = links - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Item = apply { - if (!validated) { - id() - dateCreated() - status() - statusMessage() - projectId() - storageUri() - commit().validate() - deploymentStatus() - mlModelId() - validationDatasetId() - trainingDatasetId() - archived() - dateArchived() - passingGoalCount() - failingGoalCount() - totalGoalCount() - links().map { it.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.dateCreated == other.dateCreated && - this.status == other.status && - this.statusMessage == other.statusMessage && - this.projectId == other.projectId && - this.storageUri == other.storageUri && - this.commit == other.commit && - this.deploymentStatus == other.deploymentStatus && - this.mlModelId == other.mlModelId && - this.validationDatasetId == other.validationDatasetId && - this.trainingDatasetId == other.trainingDatasetId && - this.archived == other.archived && - this.dateArchived == other.dateArchived && - this.passingGoalCount == other.passingGoalCount && - this.failingGoalCount == other.failingGoalCount && - this.totalGoalCount == other.totalGoalCount && - this.links == other.links && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - dateCreated, - status, - statusMessage, - projectId, - storageUri, - commit, - deploymentStatus, - mlModelId, - validationDatasetId, - trainingDatasetId, - archived, - dateArchived, - passingGoalCount, - failingGoalCount, - totalGoalCount, - links, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Item{id=$id, dateCreated=$dateCreated, status=$status, statusMessage=$statusMessage, projectId=$projectId, storageUri=$storageUri, commit=$commit, deploymentStatus=$deploymentStatus, mlModelId=$mlModelId, validationDatasetId=$validationDatasetId, trainingDatasetId=$trainingDatasetId, archived=$archived, dateArchived=$dateArchived, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, links=$links, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField = JsonMissing.of() - private var dateCreated: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() - private var statusMessage: JsonField = JsonMissing.of() - private var projectId: JsonField = JsonMissing.of() - private var storageUri: JsonField = JsonMissing.of() - private var commit: JsonField = JsonMissing.of() - private var deploymentStatus: JsonField = JsonMissing.of() - private var mlModelId: JsonField = JsonMissing.of() - private var validationDatasetId: JsonField = JsonMissing.of() - private var trainingDatasetId: JsonField = JsonMissing.of() - private var archived: JsonField = JsonMissing.of() - private var dateArchived: JsonField = JsonMissing.of() - private var passingGoalCount: JsonField = JsonMissing.of() - private var failingGoalCount: JsonField = JsonMissing.of() - private var totalGoalCount: JsonField = JsonMissing.of() - private var links: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - this.id = item.id - this.dateCreated = item.dateCreated - this.status = item.status - this.statusMessage = item.statusMessage - this.projectId = item.projectId - this.storageUri = item.storageUri - this.commit = item.commit - this.deploymentStatus = item.deploymentStatus - this.mlModelId = item.mlModelId - this.validationDatasetId = item.validationDatasetId - this.trainingDatasetId = item.trainingDatasetId - this.archived = item.archived - this.dateArchived = item.dateArchived - this.passingGoalCount = item.passingGoalCount - this.failingGoalCount = item.failingGoalCount - this.totalGoalCount = item.totalGoalCount - this.links = item.links - additionalProperties(item.additionalProperties) - } - - /** The project version (commit) id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** The project version (commit) id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField) = apply { this.id = id } - - /** The project version (commit) creation date. */ - fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) - - /** The project version (commit) creation date. */ - @JsonProperty("dateCreated") - @ExcludeMissing - fun dateCreated(dateCreated: JsonField) = apply { - this.dateCreated = dateCreated - } - - /** - * The commit status. Initially, the commit is `queued`, then, it switches to `running`. - * Finally, it can be `paused`, `failed`, or `completed`. - */ - fun status(status: Status) = status(JsonField.of(status)) - - /** - * The commit status. Initially, the commit is `queued`, then, it switches to `running`. - * Finally, it can be `paused`, `failed`, or `completed`. - */ - @JsonProperty("status") - @ExcludeMissing - fun status(status: JsonField) = apply { this.status = status } - - /** The commit status message. */ - fun statusMessage(statusMessage: String) = statusMessage(JsonField.of(statusMessage)) - - /** The commit status message. */ - @JsonProperty("statusMessage") - @ExcludeMissing - fun statusMessage(statusMessage: JsonField) = apply { - this.statusMessage = statusMessage - } - - /** The project id. */ - fun projectId(projectId: String) = projectId(JsonField.of(projectId)) - - /** The project id. */ - @JsonProperty("projectId") - @ExcludeMissing - fun projectId(projectId: JsonField) = apply { this.projectId = projectId } - - /** The storage URI where the commit bundle is stored. */ - fun storageUri(storageUri: String) = storageUri(JsonField.of(storageUri)) - - /** The storage URI where the commit bundle is stored. */ - @JsonProperty("storageUri") - @ExcludeMissing - fun storageUri(storageUri: JsonField) = apply { this.storageUri = storageUri } - - /** The details of a commit (project version). */ - fun commit(commit: Commit) = commit(JsonField.of(commit)) - - /** The details of a commit (project version). */ - @JsonProperty("commit") - @ExcludeMissing - fun commit(commit: JsonField) = apply { this.commit = commit } - - /** The deployment status associated with the commit's model. */ - fun deploymentStatus(deploymentStatus: String) = - deploymentStatus(JsonField.of(deploymentStatus)) - - /** The deployment status associated with the commit's model. */ - @JsonProperty("deploymentStatus") - @ExcludeMissing - fun deploymentStatus(deploymentStatus: JsonField) = apply { - this.deploymentStatus = deploymentStatus - } - - /** The model id. */ - fun mlModelId(mlModelId: String) = mlModelId(JsonField.of(mlModelId)) - - /** The model id. */ - @JsonProperty("mlModelId") - @ExcludeMissing - fun mlModelId(mlModelId: JsonField) = apply { this.mlModelId = mlModelId } - - /** The validation dataset id. */ - fun validationDatasetId(validationDatasetId: String) = - validationDatasetId(JsonField.of(validationDatasetId)) - - /** The validation dataset id. */ - @JsonProperty("validationDatasetId") - @ExcludeMissing - fun validationDatasetId(validationDatasetId: JsonField) = apply { - this.validationDatasetId = validationDatasetId - } - - /** The training dataset id. */ - fun trainingDatasetId(trainingDatasetId: String) = - trainingDatasetId(JsonField.of(trainingDatasetId)) - - /** The training dataset id. */ - @JsonProperty("trainingDatasetId") - @ExcludeMissing - fun trainingDatasetId(trainingDatasetId: JsonField) = apply { - this.trainingDatasetId = trainingDatasetId - } - - /** Whether the commit is archived. */ - fun archived(archived: Boolean) = archived(JsonField.of(archived)) - - /** Whether the commit is archived. */ - @JsonProperty("archived") - @ExcludeMissing - fun archived(archived: JsonField) = apply { this.archived = archived } - - /** The commit archive date. */ - fun dateArchived(dateArchived: OffsetDateTime) = - dateArchived(JsonField.of(dateArchived)) - - /** The commit archive date. */ - @JsonProperty("dateArchived") - @ExcludeMissing - fun dateArchived(dateArchived: JsonField) = apply { - this.dateArchived = dateArchived - } - - /** The number of tests that are passing for the commit. */ - fun passingGoalCount(passingGoalCount: Long) = - passingGoalCount(JsonField.of(passingGoalCount)) - - /** The number of tests that are passing for the commit. */ - @JsonProperty("passingGoalCount") - @ExcludeMissing - fun passingGoalCount(passingGoalCount: JsonField) = apply { - this.passingGoalCount = passingGoalCount - } - - /** The number of tests that are failing for the commit. */ - fun failingGoalCount(failingGoalCount: Long) = - failingGoalCount(JsonField.of(failingGoalCount)) - - /** The number of tests that are failing for the commit. */ - @JsonProperty("failingGoalCount") - @ExcludeMissing - fun failingGoalCount(failingGoalCount: JsonField) = apply { - this.failingGoalCount = failingGoalCount - } - - /** The total number of tests for the commit. */ - fun totalGoalCount(totalGoalCount: Long) = totalGoalCount(JsonField.of(totalGoalCount)) - - /** The total number of tests for the commit. */ - @JsonProperty("totalGoalCount") - @ExcludeMissing - fun totalGoalCount(totalGoalCount: JsonField) = apply { - this.totalGoalCount = totalGoalCount - } - - fun links(links: Links) = links(JsonField.of(links)) - - @JsonProperty("links") - @ExcludeMissing - fun links(links: JsonField) = apply { this.links = links } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Item = - Item( - id, - dateCreated, - status, - statusMessage, - projectId, - storageUri, - commit, - deploymentStatus, - mlModelId, - validationDatasetId, - trainingDatasetId, - archived, - dateArchived, - passingGoalCount, - failingGoalCount, - totalGoalCount, - links, - additionalProperties.toUnmodifiable(), - ) - } - - /** The details of a commit (project version). */ - @JsonDeserialize(builder = Commit.Builder::class) - @NoAutoDetect - class Commit - private constructor( - private val id: JsonField, - private val authorId: JsonField, - private val dateCreated: JsonField, - private val fileSize: JsonField, - private val message: JsonField, - private val mlModelId: JsonField, - private val validationDatasetId: JsonField, - private val trainingDatasetId: JsonField, - private val storageUri: JsonField, - private val gitCommitSha: JsonField, - private val gitCommitRef: JsonField, - private val gitCommitUrl: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - /** The commit id. */ - fun id(): String = id.getRequired("id") - - /** The author id of the commit. */ - fun authorId(): String = authorId.getRequired("authorId") - - /** The commit creation date. */ - fun dateCreated(): Optional = - Optional.ofNullable(dateCreated.getNullable("dateCreated")) - - /** The size of the commit bundle in bytes. */ - fun fileSize(): Optional = Optional.ofNullable(fileSize.getNullable("fileSize")) - - /** The commit message. */ - fun message(): String = message.getRequired("message") - - /** The model id. */ - fun mlModelId(): Optional = - Optional.ofNullable(mlModelId.getNullable("mlModelId")) - - /** The validation dataset id. */ - fun validationDatasetId(): Optional = - Optional.ofNullable(validationDatasetId.getNullable("validationDatasetId")) - - /** The training dataset id. */ - fun trainingDatasetId(): Optional = - Optional.ofNullable(trainingDatasetId.getNullable("trainingDatasetId")) - - /** The storage URI where the commit bundle is stored. */ - fun storageUri(): String = storageUri.getRequired("storageUri") - - /** The SHA of the corresponding git commit. */ - fun gitCommitSha(): Optional = - Optional.ofNullable(gitCommitSha.getNullable("gitCommitSha")) - - /** The ref of the corresponding git commit. */ - fun gitCommitRef(): Optional = - Optional.ofNullable(gitCommitRef.getNullable("gitCommitRef")) - - /** The URL of the corresponding git commit. */ - fun gitCommitUrl(): Optional = - Optional.ofNullable(gitCommitUrl.getNullable("gitCommitUrl")) - - /** The commit id. */ - @JsonProperty("id") @ExcludeMissing fun _id() = id - - /** The author id of the commit. */ - @JsonProperty("authorId") @ExcludeMissing fun _authorId() = authorId - - /** The commit creation date. */ - @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated - - /** The size of the commit bundle in bytes. */ - @JsonProperty("fileSize") @ExcludeMissing fun _fileSize() = fileSize - - /** The commit message. */ - @JsonProperty("message") @ExcludeMissing fun _message() = message - - /** The model id. */ - @JsonProperty("mlModelId") @ExcludeMissing fun _mlModelId() = mlModelId - - /** The validation dataset id. */ - @JsonProperty("validationDatasetId") - @ExcludeMissing - fun _validationDatasetId() = validationDatasetId - - /** The training dataset id. */ - @JsonProperty("trainingDatasetId") - @ExcludeMissing - fun _trainingDatasetId() = trainingDatasetId - - /** The storage URI where the commit bundle is stored. */ - @JsonProperty("storageUri") @ExcludeMissing fun _storageUri() = storageUri - - /** The SHA of the corresponding git commit. */ - @JsonProperty("gitCommitSha") @ExcludeMissing fun _gitCommitSha() = gitCommitSha - - /** The ref of the corresponding git commit. */ - @JsonProperty("gitCommitRef") @ExcludeMissing fun _gitCommitRef() = gitCommitRef - - /** The URL of the corresponding git commit. */ - @JsonProperty("gitCommitUrl") @ExcludeMissing fun _gitCommitUrl() = gitCommitUrl - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Commit = apply { - if (!validated) { - id() - authorId() - dateCreated() - fileSize() - message() - mlModelId() - validationDatasetId() - trainingDatasetId() - storageUri() - gitCommitSha() - gitCommitRef() - gitCommitUrl() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Commit && - this.id == other.id && - this.authorId == other.authorId && - this.dateCreated == other.dateCreated && - this.fileSize == other.fileSize && - this.message == other.message && - this.mlModelId == other.mlModelId && - this.validationDatasetId == other.validationDatasetId && - this.trainingDatasetId == other.trainingDatasetId && - this.storageUri == other.storageUri && - this.gitCommitSha == other.gitCommitSha && - this.gitCommitRef == other.gitCommitRef && - this.gitCommitUrl == other.gitCommitUrl && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - authorId, - dateCreated, - fileSize, - message, - mlModelId, - validationDatasetId, - trainingDatasetId, - storageUri, - gitCommitSha, - gitCommitRef, - gitCommitUrl, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Commit{id=$id, authorId=$authorId, dateCreated=$dateCreated, fileSize=$fileSize, message=$message, mlModelId=$mlModelId, validationDatasetId=$validationDatasetId, trainingDatasetId=$trainingDatasetId, storageUri=$storageUri, gitCommitSha=$gitCommitSha, gitCommitRef=$gitCommitRef, gitCommitUrl=$gitCommitUrl, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField = JsonMissing.of() - private var authorId: JsonField = JsonMissing.of() - private var dateCreated: JsonField = JsonMissing.of() - private var fileSize: JsonField = JsonMissing.of() - private var message: JsonField = JsonMissing.of() - private var mlModelId: JsonField = JsonMissing.of() - private var validationDatasetId: JsonField = JsonMissing.of() - private var trainingDatasetId: JsonField = JsonMissing.of() - private var storageUri: JsonField = JsonMissing.of() - private var gitCommitSha: JsonField = JsonMissing.of() - private var gitCommitRef: JsonField = JsonMissing.of() - private var gitCommitUrl: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(commit: Commit) = apply { - this.id = commit.id - this.authorId = commit.authorId - this.dateCreated = commit.dateCreated - this.fileSize = commit.fileSize - this.message = commit.message - this.mlModelId = commit.mlModelId - this.validationDatasetId = commit.validationDatasetId - this.trainingDatasetId = commit.trainingDatasetId - this.storageUri = commit.storageUri - this.gitCommitSha = commit.gitCommitSha - this.gitCommitRef = commit.gitCommitRef - this.gitCommitUrl = commit.gitCommitUrl - additionalProperties(commit.additionalProperties) - } - - /** The commit id. */ - fun id(id: String) = id(JsonField.of(id)) - - /** The commit id. */ - @JsonProperty("id") - @ExcludeMissing - fun id(id: JsonField) = apply { this.id = id } - - /** The author id of the commit. */ - fun authorId(authorId: String) = authorId(JsonField.of(authorId)) - - /** The author id of the commit. */ - @JsonProperty("authorId") - @ExcludeMissing - fun authorId(authorId: JsonField) = apply { this.authorId = authorId } - - /** The commit creation date. */ - fun dateCreated(dateCreated: OffsetDateTime) = - dateCreated(JsonField.of(dateCreated)) - - /** The commit creation date. */ - @JsonProperty("dateCreated") - @ExcludeMissing - fun dateCreated(dateCreated: JsonField) = apply { - this.dateCreated = dateCreated - } - - /** The size of the commit bundle in bytes. */ - fun fileSize(fileSize: Long) = fileSize(JsonField.of(fileSize)) - - /** The size of the commit bundle in bytes. */ - @JsonProperty("fileSize") - @ExcludeMissing - fun fileSize(fileSize: JsonField) = apply { this.fileSize = fileSize } - - /** The commit message. */ - fun message(message: String) = message(JsonField.of(message)) - - /** The commit message. */ - @JsonProperty("message") - @ExcludeMissing - fun message(message: JsonField) = apply { this.message = message } - - /** The model id. */ - fun mlModelId(mlModelId: String) = mlModelId(JsonField.of(mlModelId)) - - /** The model id. */ - @JsonProperty("mlModelId") - @ExcludeMissing - fun mlModelId(mlModelId: JsonField) = apply { this.mlModelId = mlModelId } - - /** The validation dataset id. */ - fun validationDatasetId(validationDatasetId: String) = - validationDatasetId(JsonField.of(validationDatasetId)) - - /** The validation dataset id. */ - @JsonProperty("validationDatasetId") - @ExcludeMissing - fun validationDatasetId(validationDatasetId: JsonField) = apply { - this.validationDatasetId = validationDatasetId - } - - /** The training dataset id. */ - fun trainingDatasetId(trainingDatasetId: String) = - trainingDatasetId(JsonField.of(trainingDatasetId)) - - /** The training dataset id. */ - @JsonProperty("trainingDatasetId") - @ExcludeMissing - fun trainingDatasetId(trainingDatasetId: JsonField) = apply { - this.trainingDatasetId = trainingDatasetId - } - - /** The storage URI where the commit bundle is stored. */ - fun storageUri(storageUri: String) = storageUri(JsonField.of(storageUri)) - - /** The storage URI where the commit bundle is stored. */ - @JsonProperty("storageUri") - @ExcludeMissing - fun storageUri(storageUri: JsonField) = apply { - this.storageUri = storageUri - } - - /** The SHA of the corresponding git commit. */ - fun gitCommitSha(gitCommitSha: Long) = gitCommitSha(JsonField.of(gitCommitSha)) - - /** The SHA of the corresponding git commit. */ - @JsonProperty("gitCommitSha") - @ExcludeMissing - fun gitCommitSha(gitCommitSha: JsonField) = apply { - this.gitCommitSha = gitCommitSha - } - - /** The ref of the corresponding git commit. */ - fun gitCommitRef(gitCommitRef: String) = gitCommitRef(JsonField.of(gitCommitRef)) - - /** The ref of the corresponding git commit. */ - @JsonProperty("gitCommitRef") - @ExcludeMissing - fun gitCommitRef(gitCommitRef: JsonField) = apply { - this.gitCommitRef = gitCommitRef - } - - /** The URL of the corresponding git commit. */ - fun gitCommitUrl(gitCommitUrl: String) = gitCommitUrl(JsonField.of(gitCommitUrl)) - - /** The URL of the corresponding git commit. */ - @JsonProperty("gitCommitUrl") - @ExcludeMissing - fun gitCommitUrl(gitCommitUrl: JsonField) = apply { - this.gitCommitUrl = gitCommitUrl - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Commit = - Commit( - id, - authorId, - dateCreated, - fileSize, - message, - mlModelId, - validationDatasetId, - trainingDatasetId, - storageUri, - gitCommitSha, - gitCommitRef, - gitCommitUrl, - additionalProperties.toUnmodifiable(), - ) - } - } - - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Status && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val QUEUED = Status(JsonField.of("queued")) - - @JvmField val RUNNING = Status(JsonField.of("running")) - - @JvmField val PAUSED = Status(JsonField.of("paused")) - - @JvmField val FAILED = Status(JsonField.of("failed")) - - @JvmField val COMPLETED = Status(JsonField.of("completed")) - - @JvmField val UNKNOWN = Status(JsonField.of("unknown")) - - @JvmStatic fun of(value: String) = Status(JsonField.of(value)) - } - - enum class Known { - QUEUED, - RUNNING, - PAUSED, - FAILED, - COMPLETED, - UNKNOWN, - } - - enum class Value { - QUEUED, - RUNNING, - PAUSED, - FAILED, - COMPLETED, - UNKNOWN, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - QUEUED -> Value.QUEUED - RUNNING -> Value.RUNNING - PAUSED -> Value.PAUSED - FAILED -> Value.FAILED - COMPLETED -> Value.COMPLETED - UNKNOWN -> Value.UNKNOWN - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - QUEUED -> Known.QUEUED - RUNNING -> Known.RUNNING - PAUSED -> Known.PAUSED - FAILED -> Known.FAILED - COMPLETED -> Known.COMPLETED - UNKNOWN -> Known.UNKNOWN - else -> throw OpenlayerInvalidDataException("Unknown Status: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } - - @JsonDeserialize(builder = Links.Builder::class) - @NoAutoDetect - class Links - private constructor( - private val app: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun app(): String = app.getRequired("app") - - @JsonProperty("app") @ExcludeMissing fun _app() = app - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): Links = apply { - if (!validated) { - app() - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Links && - this.app == other.app && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(app, additionalProperties) - } - return hashCode - } - - override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var app: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(links: Links) = apply { - this.app = links.app - additionalProperties(links.additionalProperties) - } - - fun app(app: String) = app(JsonField.of(app)) - - @JsonProperty("app") - @ExcludeMissing - fun app(app: JsonField) = apply { this.app = app } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun build(): Links = Links(app, additionalProperties.toUnmodifiable()) - } - } - } -} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateParams.kt index 7feaef8..dab084a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateParams.kt @@ -25,9 +25,6 @@ constructor( private val taskType: TaskType, private val description: String?, private val gitRepo: GitRepo?, - private val slackChannelId: String?, - private val slackChannelName: String?, - private val slackChannelNotificationsEnabled: Boolean?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, @@ -41,13 +38,6 @@ constructor( fun gitRepo(): Optional = Optional.ofNullable(gitRepo) - fun slackChannelId(): Optional = Optional.ofNullable(slackChannelId) - - fun slackChannelName(): Optional = Optional.ofNullable(slackChannelName) - - fun slackChannelNotificationsEnabled(): Optional = - Optional.ofNullable(slackChannelNotificationsEnabled) - @JvmSynthetic internal fun getBody(): ProjectCreateBody { return ProjectCreateBody( @@ -55,9 +45,6 @@ constructor( taskType, description, gitRepo, - slackChannelId, - slackChannelName, - slackChannelNotificationsEnabled, additionalBodyProperties, ) } @@ -74,9 +61,6 @@ constructor( private val taskType: TaskType?, private val description: String?, private val gitRepo: GitRepo?, - private val slackChannelId: String?, - private val slackChannelName: String?, - private val slackChannelNotificationsEnabled: Boolean?, private val additionalProperties: Map, ) { @@ -93,16 +77,6 @@ constructor( @JsonProperty("gitRepo") fun gitRepo(): GitRepo? = gitRepo - /** The slack channel id connected to the project. */ - @JsonProperty("slackChannelId") fun slackChannelId(): String? = slackChannelId - - /** The slack channel connected to the project. */ - @JsonProperty("slackChannelName") fun slackChannelName(): String? = slackChannelName - - /** Whether slack channel notifications are enabled for the project. */ - @JsonProperty("slackChannelNotificationsEnabled") - fun slackChannelNotificationsEnabled(): Boolean? = slackChannelNotificationsEnabled - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -119,9 +93,6 @@ constructor( this.taskType == other.taskType && this.description == other.description && this.gitRepo == other.gitRepo && - this.slackChannelId == other.slackChannelId && - this.slackChannelName == other.slackChannelName && - this.slackChannelNotificationsEnabled == other.slackChannelNotificationsEnabled && this.additionalProperties == other.additionalProperties } @@ -133,9 +104,6 @@ constructor( taskType, description, gitRepo, - slackChannelId, - slackChannelName, - slackChannelNotificationsEnabled, additionalProperties, ) } @@ -143,7 +111,7 @@ constructor( } override fun toString() = - "ProjectCreateBody{name=$name, taskType=$taskType, description=$description, gitRepo=$gitRepo, slackChannelId=$slackChannelId, slackChannelName=$slackChannelName, slackChannelNotificationsEnabled=$slackChannelNotificationsEnabled, additionalProperties=$additionalProperties}" + "ProjectCreateBody{name=$name, taskType=$taskType, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" companion object { @@ -156,9 +124,6 @@ constructor( private var taskType: TaskType? = null private var description: String? = null private var gitRepo: GitRepo? = null - private var slackChannelId: String? = null - private var slackChannelName: String? = null - private var slackChannelNotificationsEnabled: Boolean? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -167,10 +132,6 @@ constructor( this.taskType = projectCreateBody.taskType this.description = projectCreateBody.description this.gitRepo = projectCreateBody.gitRepo - this.slackChannelId = projectCreateBody.slackChannelId - this.slackChannelName = projectCreateBody.slackChannelName - this.slackChannelNotificationsEnabled = - projectCreateBody.slackChannelNotificationsEnabled additionalProperties(projectCreateBody.additionalProperties) } @@ -188,25 +149,6 @@ constructor( @JsonProperty("gitRepo") fun gitRepo(gitRepo: GitRepo) = apply { this.gitRepo = gitRepo } - /** The slack channel id connected to the project. */ - @JsonProperty("slackChannelId") - fun slackChannelId(slackChannelId: String) = apply { - this.slackChannelId = slackChannelId - } - - /** The slack channel connected to the project. */ - @JsonProperty("slackChannelName") - fun slackChannelName(slackChannelName: String) = apply { - this.slackChannelName = slackChannelName - } - - /** Whether slack channel notifications are enabled for the project. */ - @JsonProperty("slackChannelNotificationsEnabled") - fun slackChannelNotificationsEnabled(slackChannelNotificationsEnabled: Boolean) = - apply { - this.slackChannelNotificationsEnabled = slackChannelNotificationsEnabled - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -227,9 +169,6 @@ constructor( checkNotNull(taskType) { "`taskType` is required but was not set" }, description, gitRepo, - slackChannelId, - slackChannelName, - slackChannelNotificationsEnabled, additionalProperties.toUnmodifiable(), ) } @@ -251,9 +190,6 @@ constructor( this.taskType == other.taskType && this.description == other.description && this.gitRepo == other.gitRepo && - this.slackChannelId == other.slackChannelId && - this.slackChannelName == other.slackChannelName && - this.slackChannelNotificationsEnabled == other.slackChannelNotificationsEnabled && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties @@ -265,9 +201,6 @@ constructor( taskType, description, gitRepo, - slackChannelId, - slackChannelName, - slackChannelNotificationsEnabled, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -275,7 +208,7 @@ constructor( } override fun toString() = - "ProjectCreateParams{name=$name, taskType=$taskType, description=$description, gitRepo=$gitRepo, slackChannelId=$slackChannelId, slackChannelName=$slackChannelName, slackChannelNotificationsEnabled=$slackChannelNotificationsEnabled, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + "ProjectCreateParams{name=$name, taskType=$taskType, description=$description, gitRepo=$gitRepo, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" fun toBuilder() = Builder().from(this) @@ -291,9 +224,6 @@ constructor( private var taskType: TaskType? = null private var description: String? = null private var gitRepo: GitRepo? = null - private var slackChannelId: String? = null - private var slackChannelName: String? = null - private var slackChannelNotificationsEnabled: Boolean? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -304,10 +234,6 @@ constructor( this.taskType = projectCreateParams.taskType this.description = projectCreateParams.description this.gitRepo = projectCreateParams.gitRepo - this.slackChannelId = projectCreateParams.slackChannelId - this.slackChannelName = projectCreateParams.slackChannelName - this.slackChannelNotificationsEnabled = - projectCreateParams.slackChannelNotificationsEnabled additionalQueryParams(projectCreateParams.additionalQueryParams) additionalHeaders(projectCreateParams.additionalHeaders) additionalBodyProperties(projectCreateParams.additionalBodyProperties) @@ -324,19 +250,6 @@ constructor( fun gitRepo(gitRepo: GitRepo) = apply { this.gitRepo = gitRepo } - /** The slack channel id connected to the project. */ - fun slackChannelId(slackChannelId: String) = apply { this.slackChannelId = slackChannelId } - - /** The slack channel connected to the project. */ - fun slackChannelName(slackChannelName: String) = apply { - this.slackChannelName = slackChannelName - } - - /** Whether slack channel notifications are enabled for the project. */ - fun slackChannelNotificationsEnabled(slackChannelNotificationsEnabled: Boolean) = apply { - this.slackChannelNotificationsEnabled = slackChannelNotificationsEnabled - } - fun additionalQueryParams(additionalQueryParams: Map>) = apply { this.additionalQueryParams.clear() putAllQueryParams(additionalQueryParams) @@ -397,9 +310,6 @@ constructor( checkNotNull(taskType) { "`taskType` is required but was not set" }, description, gitRepo, - slackChannelId, - slackChannelName, - slackChannelNotificationsEnabled, 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/ProjectCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateResponse.kt index fdbee3e..eb6afee 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectCreateResponse.kt @@ -30,7 +30,6 @@ private constructor( private val dateCreated: JsonField, private val dateUpdated: JsonField, private val description: JsonField, - private val sample: JsonField, private val source: JsonField, private val taskType: JsonField, private val versionCount: JsonField, @@ -38,11 +37,7 @@ private constructor( private val goalCount: JsonField, private val developmentGoalCount: JsonField, private val monitoringGoalCount: JsonField, - private val unreadNotificationCount: JsonField, private val links: JsonField, - private val slackChannelNotificationsEnabled: JsonField, - private val slackChannelName: JsonField, - private val slackChannelId: JsonField, private val gitRepo: JsonField, private val additionalProperties: Map, ) { @@ -74,9 +69,6 @@ private constructor( fun description(): Optional = Optional.ofNullable(description.getNullable("description")) - /** Whether the project is a sample project or a user-created project. */ - fun sample(): Boolean = sample.getRequired("sample") - /** The source of the project. */ fun source(): Optional = Optional.ofNullable(source.getNullable("source")) @@ -99,27 +91,9 @@ private constructor( /** The number of tests in the monitoring mode of the project. */ fun monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") - /** The number of unread notifications in the project. */ - fun unreadNotificationCount(): Optional = - Optional.ofNullable(unreadNotificationCount.getNullable("unreadNotificationCount")) - /** Links to the project. */ fun links(): Links = links.getRequired("links") - /** Whether slack channel notifications are enabled for the project. */ - fun slackChannelNotificationsEnabled(): Optional = - Optional.ofNullable( - slackChannelNotificationsEnabled.getNullable("slackChannelNotificationsEnabled") - ) - - /** The slack channel connected to the project. */ - fun slackChannelName(): Optional = - Optional.ofNullable(slackChannelName.getNullable("slackChannelName")) - - /** The slack channel id connected to the project. */ - fun slackChannelId(): Optional = - Optional.ofNullable(slackChannelId.getNullable("slackChannelId")) - fun gitRepo(): Optional = Optional.ofNullable(gitRepo.getNullable("gitRepo")) /** The project id. */ @@ -143,9 +117,6 @@ private constructor( /** The project description. */ @JsonProperty("description") @ExcludeMissing fun _description() = description - /** Whether the project is a sample project or a user-created project. */ - @JsonProperty("sample") @ExcludeMissing fun _sample() = sample - /** The source of the project. */ @JsonProperty("source") @ExcludeMissing fun _source() = source @@ -173,25 +144,9 @@ private constructor( @ExcludeMissing fun _monitoringGoalCount() = monitoringGoalCount - /** The number of unread notifications in the project. */ - @JsonProperty("unreadNotificationCount") - @ExcludeMissing - fun _unreadNotificationCount() = unreadNotificationCount - /** Links to the project. */ @JsonProperty("links") @ExcludeMissing fun _links() = links - /** Whether slack channel notifications are enabled for the project. */ - @JsonProperty("slackChannelNotificationsEnabled") - @ExcludeMissing - fun _slackChannelNotificationsEnabled() = slackChannelNotificationsEnabled - - /** The slack channel connected to the project. */ - @JsonProperty("slackChannelName") @ExcludeMissing fun _slackChannelName() = slackChannelName - - /** The slack channel id connected to the project. */ - @JsonProperty("slackChannelId") @ExcludeMissing fun _slackChannelId() = slackChannelId - @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo() = gitRepo @JsonAnyGetter @@ -207,7 +162,6 @@ private constructor( dateCreated() dateUpdated() description() - sample() source() taskType() versionCount() @@ -215,11 +169,7 @@ private constructor( goalCount() developmentGoalCount() monitoringGoalCount() - unreadNotificationCount() links().validate() - slackChannelNotificationsEnabled() - slackChannelName() - slackChannelId() gitRepo().map { it.validate() } validated = true } @@ -240,7 +190,6 @@ private constructor( this.dateCreated == other.dateCreated && this.dateUpdated == other.dateUpdated && this.description == other.description && - this.sample == other.sample && this.source == other.source && this.taskType == other.taskType && this.versionCount == other.versionCount && @@ -248,11 +197,7 @@ private constructor( this.goalCount == other.goalCount && this.developmentGoalCount == other.developmentGoalCount && this.monitoringGoalCount == other.monitoringGoalCount && - this.unreadNotificationCount == other.unreadNotificationCount && this.links == other.links && - this.slackChannelNotificationsEnabled == other.slackChannelNotificationsEnabled && - this.slackChannelName == other.slackChannelName && - this.slackChannelId == other.slackChannelId && this.gitRepo == other.gitRepo && this.additionalProperties == other.additionalProperties } @@ -268,7 +213,6 @@ private constructor( dateCreated, dateUpdated, description, - sample, source, taskType, versionCount, @@ -276,11 +220,7 @@ private constructor( goalCount, developmentGoalCount, monitoringGoalCount, - unreadNotificationCount, links, - slackChannelNotificationsEnabled, - slackChannelName, - slackChannelId, gitRepo, additionalProperties, ) @@ -289,7 +229,7 @@ private constructor( } override fun toString() = - "ProjectCreateResponse{id=$id, workspaceId=$workspaceId, creatorId=$creatorId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, sample=$sample, source=$source, taskType=$taskType, versionCount=$versionCount, inferencePipelineCount=$inferencePipelineCount, goalCount=$goalCount, developmentGoalCount=$developmentGoalCount, monitoringGoalCount=$monitoringGoalCount, unreadNotificationCount=$unreadNotificationCount, links=$links, slackChannelNotificationsEnabled=$slackChannelNotificationsEnabled, slackChannelName=$slackChannelName, slackChannelId=$slackChannelId, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "ProjectCreateResponse{id=$id, workspaceId=$workspaceId, creatorId=$creatorId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, source=$source, taskType=$taskType, versionCount=$versionCount, inferencePipelineCount=$inferencePipelineCount, goalCount=$goalCount, developmentGoalCount=$developmentGoalCount, monitoringGoalCount=$monitoringGoalCount, links=$links, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" companion object { @@ -305,7 +245,6 @@ private constructor( private var dateCreated: JsonField = JsonMissing.of() private var dateUpdated: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() - private var sample: JsonField = JsonMissing.of() private var source: JsonField = JsonMissing.of() private var taskType: JsonField = JsonMissing.of() private var versionCount: JsonField = JsonMissing.of() @@ -313,11 +252,7 @@ private constructor( private var goalCount: JsonField = JsonMissing.of() private var developmentGoalCount: JsonField = JsonMissing.of() private var monitoringGoalCount: JsonField = JsonMissing.of() - private var unreadNotificationCount: JsonField = JsonMissing.of() private var links: JsonField = JsonMissing.of() - private var slackChannelNotificationsEnabled: JsonField = JsonMissing.of() - private var slackChannelName: JsonField = JsonMissing.of() - private var slackChannelId: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -330,7 +265,6 @@ private constructor( this.dateCreated = projectCreateResponse.dateCreated this.dateUpdated = projectCreateResponse.dateUpdated this.description = projectCreateResponse.description - this.sample = projectCreateResponse.sample this.source = projectCreateResponse.source this.taskType = projectCreateResponse.taskType this.versionCount = projectCreateResponse.versionCount @@ -338,12 +272,7 @@ private constructor( this.goalCount = projectCreateResponse.goalCount this.developmentGoalCount = projectCreateResponse.developmentGoalCount this.monitoringGoalCount = projectCreateResponse.monitoringGoalCount - this.unreadNotificationCount = projectCreateResponse.unreadNotificationCount this.links = projectCreateResponse.links - this.slackChannelNotificationsEnabled = - projectCreateResponse.slackChannelNotificationsEnabled - this.slackChannelName = projectCreateResponse.slackChannelName - this.slackChannelId = projectCreateResponse.slackChannelId this.gitRepo = projectCreateResponse.gitRepo additionalProperties(projectCreateResponse.additionalProperties) } @@ -406,14 +335,6 @@ private constructor( @ExcludeMissing fun description(description: JsonField) = apply { this.description = description } - /** Whether the project is a sample project or a user-created project. */ - fun sample(sample: Boolean) = sample(JsonField.of(sample)) - - /** Whether the project is a sample project or a user-created project. */ - @JsonProperty("sample") - @ExcludeMissing - fun sample(sample: JsonField) = apply { this.sample = sample } - /** The source of the project. */ fun source(source: Source) = source(JsonField.of(source)) @@ -479,17 +400,6 @@ private constructor( this.monitoringGoalCount = monitoringGoalCount } - /** The number of unread notifications in the project. */ - fun unreadNotificationCount(unreadNotificationCount: Long) = - unreadNotificationCount(JsonField.of(unreadNotificationCount)) - - /** The number of unread notifications in the project. */ - @JsonProperty("unreadNotificationCount") - @ExcludeMissing - fun unreadNotificationCount(unreadNotificationCount: JsonField) = apply { - this.unreadNotificationCount = unreadNotificationCount - } - /** Links to the project. */ fun links(links: Links) = links(JsonField.of(links)) @@ -498,39 +408,6 @@ private constructor( @ExcludeMissing fun links(links: JsonField) = apply { this.links = links } - /** Whether slack channel notifications are enabled for the project. */ - fun slackChannelNotificationsEnabled(slackChannelNotificationsEnabled: Boolean) = - slackChannelNotificationsEnabled(JsonField.of(slackChannelNotificationsEnabled)) - - /** Whether slack channel notifications are enabled for the project. */ - @JsonProperty("slackChannelNotificationsEnabled") - @ExcludeMissing - fun slackChannelNotificationsEnabled(slackChannelNotificationsEnabled: JsonField) = - apply { - this.slackChannelNotificationsEnabled = slackChannelNotificationsEnabled - } - - /** The slack channel connected to the project. */ - fun slackChannelName(slackChannelName: String) = - slackChannelName(JsonField.of(slackChannelName)) - - /** The slack channel connected to the project. */ - @JsonProperty("slackChannelName") - @ExcludeMissing - fun slackChannelName(slackChannelName: JsonField) = apply { - this.slackChannelName = slackChannelName - } - - /** The slack channel id connected to the project. */ - fun slackChannelId(slackChannelId: String) = slackChannelId(JsonField.of(slackChannelId)) - - /** The slack channel id connected to the project. */ - @JsonProperty("slackChannelId") - @ExcludeMissing - fun slackChannelId(slackChannelId: JsonField) = apply { - this.slackChannelId = slackChannelId - } - fun gitRepo(gitRepo: GitRepo) = gitRepo(JsonField.of(gitRepo)) @JsonProperty("gitRepo") @@ -560,7 +437,6 @@ private constructor( dateCreated, dateUpdated, description, - sample, source, taskType, versionCount, @@ -568,11 +444,7 @@ private constructor( goalCount, developmentGoalCount, monitoringGoalCount, - unreadNotificationCount, links, - slackChannelNotificationsEnabled, - slackChannelName, - slackChannelId, gitRepo, additionalProperties.toUnmodifiable(), ) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectListResponse.kt index 025b285..69c6387 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectListResponse.kt @@ -307,7 +307,6 @@ private constructor( private val dateCreated: JsonField, private val dateUpdated: JsonField, private val description: JsonField, - private val sample: JsonField, private val source: JsonField, private val taskType: JsonField, private val versionCount: JsonField, @@ -315,11 +314,7 @@ private constructor( private val goalCount: JsonField, private val developmentGoalCount: JsonField, private val monitoringGoalCount: JsonField, - private val unreadNotificationCount: JsonField, private val links: JsonField, - private val slackChannelNotificationsEnabled: JsonField, - private val slackChannelName: JsonField, - private val slackChannelId: JsonField, private val gitRepo: JsonField, private val additionalProperties: Map, ) { @@ -351,9 +346,6 @@ private constructor( fun description(): Optional = Optional.ofNullable(description.getNullable("description")) - /** Whether the project is a sample project or a user-created project. */ - fun sample(): Boolean = sample.getRequired("sample") - /** The source of the project. */ fun source(): Optional = Optional.ofNullable(source.getNullable("source")) @@ -376,27 +368,9 @@ private constructor( /** The number of tests in the monitoring mode of the project. */ fun monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") - /** The number of unread notifications in the project. */ - fun unreadNotificationCount(): Optional = - Optional.ofNullable(unreadNotificationCount.getNullable("unreadNotificationCount")) - /** Links to the project. */ fun links(): Links = links.getRequired("links") - /** Whether slack channel notifications are enabled for the project. */ - fun slackChannelNotificationsEnabled(): Optional = - Optional.ofNullable( - slackChannelNotificationsEnabled.getNullable("slackChannelNotificationsEnabled") - ) - - /** The slack channel connected to the project. */ - fun slackChannelName(): Optional = - Optional.ofNullable(slackChannelName.getNullable("slackChannelName")) - - /** The slack channel id connected to the project. */ - fun slackChannelId(): Optional = - Optional.ofNullable(slackChannelId.getNullable("slackChannelId")) - fun gitRepo(): Optional = Optional.ofNullable(gitRepo.getNullable("gitRepo")) /** The project id. */ @@ -420,9 +394,6 @@ private constructor( /** The project description. */ @JsonProperty("description") @ExcludeMissing fun _description() = description - /** Whether the project is a sample project or a user-created project. */ - @JsonProperty("sample") @ExcludeMissing fun _sample() = sample - /** The source of the project. */ @JsonProperty("source") @ExcludeMissing fun _source() = source @@ -450,25 +421,9 @@ private constructor( @ExcludeMissing fun _monitoringGoalCount() = monitoringGoalCount - /** The number of unread notifications in the project. */ - @JsonProperty("unreadNotificationCount") - @ExcludeMissing - fun _unreadNotificationCount() = unreadNotificationCount - /** Links to the project. */ @JsonProperty("links") @ExcludeMissing fun _links() = links - /** Whether slack channel notifications are enabled for the project. */ - @JsonProperty("slackChannelNotificationsEnabled") - @ExcludeMissing - fun _slackChannelNotificationsEnabled() = slackChannelNotificationsEnabled - - /** The slack channel connected to the project. */ - @JsonProperty("slackChannelName") @ExcludeMissing fun _slackChannelName() = slackChannelName - - /** The slack channel id connected to the project. */ - @JsonProperty("slackChannelId") @ExcludeMissing fun _slackChannelId() = slackChannelId - @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo() = gitRepo @JsonAnyGetter @@ -484,7 +439,6 @@ private constructor( dateCreated() dateUpdated() description() - sample() source() taskType() versionCount() @@ -492,11 +446,7 @@ private constructor( goalCount() developmentGoalCount() monitoringGoalCount() - unreadNotificationCount() links().validate() - slackChannelNotificationsEnabled() - slackChannelName() - slackChannelId() gitRepo().map { it.validate() } validated = true } @@ -517,7 +467,6 @@ private constructor( this.dateCreated == other.dateCreated && this.dateUpdated == other.dateUpdated && this.description == other.description && - this.sample == other.sample && this.source == other.source && this.taskType == other.taskType && this.versionCount == other.versionCount && @@ -525,11 +474,7 @@ private constructor( this.goalCount == other.goalCount && this.developmentGoalCount == other.developmentGoalCount && this.monitoringGoalCount == other.monitoringGoalCount && - this.unreadNotificationCount == other.unreadNotificationCount && this.links == other.links && - this.slackChannelNotificationsEnabled == other.slackChannelNotificationsEnabled && - this.slackChannelName == other.slackChannelName && - this.slackChannelId == other.slackChannelId && this.gitRepo == other.gitRepo && this.additionalProperties == other.additionalProperties } @@ -545,7 +490,6 @@ private constructor( dateCreated, dateUpdated, description, - sample, source, taskType, versionCount, @@ -553,11 +497,7 @@ private constructor( goalCount, developmentGoalCount, monitoringGoalCount, - unreadNotificationCount, links, - slackChannelNotificationsEnabled, - slackChannelName, - slackChannelId, gitRepo, additionalProperties, ) @@ -566,7 +506,7 @@ private constructor( } override fun toString() = - "Item{id=$id, workspaceId=$workspaceId, creatorId=$creatorId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, sample=$sample, source=$source, taskType=$taskType, versionCount=$versionCount, inferencePipelineCount=$inferencePipelineCount, goalCount=$goalCount, developmentGoalCount=$developmentGoalCount, monitoringGoalCount=$monitoringGoalCount, unreadNotificationCount=$unreadNotificationCount, links=$links, slackChannelNotificationsEnabled=$slackChannelNotificationsEnabled, slackChannelName=$slackChannelName, slackChannelId=$slackChannelId, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Item{id=$id, workspaceId=$workspaceId, creatorId=$creatorId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, source=$source, taskType=$taskType, versionCount=$versionCount, inferencePipelineCount=$inferencePipelineCount, goalCount=$goalCount, developmentGoalCount=$developmentGoalCount, monitoringGoalCount=$monitoringGoalCount, links=$links, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" companion object { @@ -582,7 +522,6 @@ private constructor( private var dateCreated: JsonField = JsonMissing.of() private var dateUpdated: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() - private var sample: JsonField = JsonMissing.of() private var source: JsonField = JsonMissing.of() private var taskType: JsonField = JsonMissing.of() private var versionCount: JsonField = JsonMissing.of() @@ -590,11 +529,7 @@ private constructor( private var goalCount: JsonField = JsonMissing.of() private var developmentGoalCount: JsonField = JsonMissing.of() private var monitoringGoalCount: JsonField = JsonMissing.of() - private var unreadNotificationCount: JsonField = JsonMissing.of() private var links: JsonField = JsonMissing.of() - private var slackChannelNotificationsEnabled: JsonField = JsonMissing.of() - private var slackChannelName: JsonField = JsonMissing.of() - private var slackChannelId: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -607,7 +542,6 @@ private constructor( this.dateCreated = item.dateCreated this.dateUpdated = item.dateUpdated this.description = item.description - this.sample = item.sample this.source = item.source this.taskType = item.taskType this.versionCount = item.versionCount @@ -615,11 +549,7 @@ private constructor( this.goalCount = item.goalCount this.developmentGoalCount = item.developmentGoalCount this.monitoringGoalCount = item.monitoringGoalCount - this.unreadNotificationCount = item.unreadNotificationCount this.links = item.links - this.slackChannelNotificationsEnabled = item.slackChannelNotificationsEnabled - this.slackChannelName = item.slackChannelName - this.slackChannelId = item.slackChannelId this.gitRepo = item.gitRepo additionalProperties(item.additionalProperties) } @@ -688,14 +618,6 @@ private constructor( this.description = description } - /** Whether the project is a sample project or a user-created project. */ - fun sample(sample: Boolean) = sample(JsonField.of(sample)) - - /** Whether the project is a sample project or a user-created project. */ - @JsonProperty("sample") - @ExcludeMissing - fun sample(sample: JsonField) = apply { this.sample = sample } - /** The source of the project. */ fun source(source: Source) = source(JsonField.of(source)) @@ -763,17 +685,6 @@ private constructor( this.monitoringGoalCount = monitoringGoalCount } - /** The number of unread notifications in the project. */ - fun unreadNotificationCount(unreadNotificationCount: Long) = - unreadNotificationCount(JsonField.of(unreadNotificationCount)) - - /** The number of unread notifications in the project. */ - @JsonProperty("unreadNotificationCount") - @ExcludeMissing - fun unreadNotificationCount(unreadNotificationCount: JsonField) = apply { - this.unreadNotificationCount = unreadNotificationCount - } - /** Links to the project. */ fun links(links: Links) = links(JsonField.of(links)) @@ -782,39 +693,6 @@ private constructor( @ExcludeMissing fun links(links: JsonField) = apply { this.links = links } - /** Whether slack channel notifications are enabled for the project. */ - fun slackChannelNotificationsEnabled(slackChannelNotificationsEnabled: Boolean) = - slackChannelNotificationsEnabled(JsonField.of(slackChannelNotificationsEnabled)) - - /** Whether slack channel notifications are enabled for the project. */ - @JsonProperty("slackChannelNotificationsEnabled") - @ExcludeMissing - fun slackChannelNotificationsEnabled( - slackChannelNotificationsEnabled: JsonField - ) = apply { this.slackChannelNotificationsEnabled = slackChannelNotificationsEnabled } - - /** The slack channel connected to the project. */ - fun slackChannelName(slackChannelName: String) = - slackChannelName(JsonField.of(slackChannelName)) - - /** The slack channel connected to the project. */ - @JsonProperty("slackChannelName") - @ExcludeMissing - fun slackChannelName(slackChannelName: JsonField) = apply { - this.slackChannelName = slackChannelName - } - - /** The slack channel id connected to the project. */ - fun slackChannelId(slackChannelId: String) = - slackChannelId(JsonField.of(slackChannelId)) - - /** The slack channel id connected to the project. */ - @JsonProperty("slackChannelId") - @ExcludeMissing - fun slackChannelId(slackChannelId: JsonField) = apply { - this.slackChannelId = slackChannelId - } - fun gitRepo(gitRepo: GitRepo) = gitRepo(JsonField.of(gitRepo)) @JsonProperty("gitRepo") @@ -844,7 +722,6 @@ private constructor( dateCreated, dateUpdated, description, - sample, source, taskType, versionCount, @@ -852,11 +729,7 @@ private constructor( goalCount, developmentGoalCount, monitoringGoalCount, - unreadNotificationCount, links, - slackChannelNotificationsEnabled, - slackChannelName, - slackChannelId, gitRepo, additionalProperties.toUnmodifiable(), ) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsync.kt index cbf79aa..1eaf12d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsync.kt @@ -4,17 +4,4 @@ package com.openlayer.api.services.async.commits -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.CommitTestResultListParams -import com.openlayer.api.models.CommitTestResultListResponse -import java.util.concurrent.CompletableFuture - -interface TestResultServiceAsync { - - /** List the test results for a commit (project version). */ - @JvmOverloads - fun list( - params: CommitTestResultListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} +interface TestResultServiceAsync diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsyncImpl.kt index 7429781..49a793d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/commits/TestResultServiceAsyncImpl.kt @@ -3,17 +3,9 @@ package com.openlayer.api.services.async.commits 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.CommitTestResultListParams -import com.openlayer.api.models.CommitTestResultListResponse import com.openlayer.api.services.errorHandler -import com.openlayer.api.services.jsonHandler -import com.openlayer.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture class TestResultServiceAsyncImpl constructor( @@ -21,34 +13,4 @@ constructor( ) : TestResultServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the test results for a commit (project version). */ - override fun list( - params: CommitTestResultListParams, - requestOptions: RequestOptions - ): CompletableFuture { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("versions", params.getPathParam(0), "results") - .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/async/inferencePipelines/DataServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsync.kt index f7fb4cd..2e301ea 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsync.kt @@ -4,17 +4,4 @@ package com.openlayer.api.services.async.inferencePipelines -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.InferencePipelineDataStreamParams -import com.openlayer.api.models.InferencePipelineDataStreamResponse -import java.util.concurrent.CompletableFuture - -interface DataServiceAsync { - - /** Stream production data to an inference pipeline in Openlayer. */ - @JvmOverloads - fun stream( - params: InferencePipelineDataStreamParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} +interface DataServiceAsync diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsyncImpl.kt index 4a155d3..331f7d8 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/DataServiceAsyncImpl.kt @@ -3,18 +3,9 @@ package com.openlayer.api.services.async.inferencePipelines import com.openlayer.api.core.ClientOptions -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.core.http.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.InferencePipelineDataStreamParams -import com.openlayer.api.models.InferencePipelineDataStreamResponse 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 DataServiceAsyncImpl constructor( @@ -22,35 +13,4 @@ constructor( ) : DataServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val streamHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Stream production data to an inference pipeline in Openlayer. */ - override fun stream( - params: InferencePipelineDataStreamParams, - requestOptions: RequestOptions - ): CompletableFuture { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .addPathSegments("inference-pipelines", params.getPathParam(0), "data-stream") - .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 { streamHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } - } - } - } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsync.kt index 3ef1da7..94500d8 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsync.kt @@ -4,17 +4,4 @@ package com.openlayer.api.services.async.inferencePipelines -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.InferencePipelineTestResultListParams -import com.openlayer.api.models.InferencePipelineTestResultListResponse -import java.util.concurrent.CompletableFuture - -interface TestResultServiceAsync { - - /** List the test results under an inference pipeline. */ - @JvmOverloads - fun list( - params: InferencePipelineTestResultListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} +interface TestResultServiceAsync diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsyncImpl.kt index 568e64f..b167dc4 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/inferencePipelines/TestResultServiceAsyncImpl.kt @@ -3,17 +3,9 @@ package com.openlayer.api.services.async.inferencePipelines import com.openlayer.api.core.ClientOptions -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.core.http.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.InferencePipelineTestResultListParams -import com.openlayer.api.models.InferencePipelineTestResultListResponse import com.openlayer.api.services.errorHandler -import com.openlayer.api.services.jsonHandler -import com.openlayer.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture class TestResultServiceAsyncImpl constructor( @@ -21,34 +13,4 @@ constructor( ) : TestResultServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the test results under an inference pipeline. */ - override fun list( - params: InferencePipelineTestResultListParams, - requestOptions: RequestOptions - ): CompletableFuture { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("inference-pipelines", params.getPathParam(0), "results") - .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/async/projects/CommitServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsync.kt index ee9833d..7a39f1f 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsync.kt @@ -4,17 +4,4 @@ package com.openlayer.api.services.async.projects -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.ProjectCommitListParams -import com.openlayer.api.models.ProjectCommitListResponse -import java.util.concurrent.CompletableFuture - -interface CommitServiceAsync { - - /** List the commits (project versions) under a project. */ - @JvmOverloads - fun list( - params: ProjectCommitListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} +interface CommitServiceAsync diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsyncImpl.kt index 41174a6..8963663 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/projects/CommitServiceAsyncImpl.kt @@ -3,17 +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.ProjectCommitListParams -import com.openlayer.api.models.ProjectCommitListResponse import com.openlayer.api.services.errorHandler -import com.openlayer.api.services.jsonHandler -import com.openlayer.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture class CommitServiceAsyncImpl constructor( @@ -21,34 +13,4 @@ constructor( ) : CommitServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the commits (project versions) under a project. */ - override fun list( - params: ProjectCommitListParams, - requestOptions: RequestOptions - ): CompletableFuture { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("projects", params.getPathParam(0), "versions") - .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/commits/TestResultService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultService.kt index 68db234..6f22d7a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultService.kt @@ -4,16 +4,4 @@ package com.openlayer.api.services.blocking.commits -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.CommitTestResultListParams -import com.openlayer.api.models.CommitTestResultListResponse - -interface TestResultService { - - /** List the test results for a commit (project version). */ - @JvmOverloads - fun list( - params: CommitTestResultListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CommitTestResultListResponse -} +interface TestResultService diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceImpl.kt index 0992990..fa049ad 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceImpl.kt @@ -3,16 +3,9 @@ package com.openlayer.api.services.blocking.commits 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.CommitTestResultListParams -import com.openlayer.api.models.CommitTestResultListResponse import com.openlayer.api.services.errorHandler -import com.openlayer.api.services.jsonHandler -import com.openlayer.api.services.withErrorHandler class TestResultServiceImpl constructor( @@ -20,33 +13,4 @@ constructor( ) : TestResultService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the test results for a commit (project version). */ - override fun list( - params: CommitTestResultListParams, - requestOptions: RequestOptions - ): CommitTestResultListResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("versions", params.getPathParam(0), "results") - .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/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataService.kt index ecfe2e5..be45c79 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataService.kt @@ -4,16 +4,4 @@ package com.openlayer.api.services.blocking.inferencePipelines -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.InferencePipelineDataStreamParams -import com.openlayer.api.models.InferencePipelineDataStreamResponse - -interface DataService { - - /** Stream production data to an inference pipeline in Openlayer. */ - @JvmOverloads - fun stream( - params: InferencePipelineDataStreamParams, - requestOptions: RequestOptions = RequestOptions.none() - ): InferencePipelineDataStreamResponse -} +interface DataService diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceImpl.kt index 31e69fe..0729faa 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceImpl.kt @@ -3,17 +3,9 @@ package com.openlayer.api.services.blocking.inferencePipelines 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.InferencePipelineDataStreamParams -import com.openlayer.api.models.InferencePipelineDataStreamResponse 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 DataServiceImpl constructor( @@ -21,34 +13,4 @@ constructor( ) : DataService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val streamHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Stream production data to an inference pipeline in Openlayer. */ - override fun stream( - params: InferencePipelineDataStreamParams, - requestOptions: RequestOptions - ): InferencePipelineDataStreamResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .addPathSegments("inference-pipelines", params.getPathParam(0), "data-stream") - .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 { streamHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() - } - } - } - } } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultService.kt index 37774ae..909a068 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultService.kt @@ -4,16 +4,4 @@ package com.openlayer.api.services.blocking.inferencePipelines -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.InferencePipelineTestResultListParams -import com.openlayer.api.models.InferencePipelineTestResultListResponse - -interface TestResultService { - - /** List the test results under an inference pipeline. */ - @JvmOverloads - fun list( - params: InferencePipelineTestResultListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): InferencePipelineTestResultListResponse -} +interface TestResultService diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceImpl.kt index edb9021..7deba57 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceImpl.kt @@ -3,16 +3,9 @@ package com.openlayer.api.services.blocking.inferencePipelines 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.InferencePipelineTestResultListParams -import com.openlayer.api.models.InferencePipelineTestResultListResponse import com.openlayer.api.services.errorHandler -import com.openlayer.api.services.jsonHandler -import com.openlayer.api.services.withErrorHandler class TestResultServiceImpl constructor( @@ -20,33 +13,4 @@ constructor( ) : TestResultService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the test results under an inference pipeline. */ - override fun list( - params: InferencePipelineTestResultListParams, - requestOptions: RequestOptions - ): InferencePipelineTestResultListResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("inference-pipelines", params.getPathParam(0), "results") - .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/main/kotlin/com/openlayer/api/services/blocking/projects/CommitService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitService.kt index b942ebd..c16b4ca 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitService.kt @@ -4,16 +4,4 @@ package com.openlayer.api.services.blocking.projects -import com.openlayer.api.core.RequestOptions -import com.openlayer.api.models.ProjectCommitListParams -import com.openlayer.api.models.ProjectCommitListResponse - -interface CommitService { - - /** List the commits (project versions) under a project. */ - @JvmOverloads - fun list( - params: ProjectCommitListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): ProjectCommitListResponse -} +interface CommitService diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceImpl.kt index 0e91983..0a54d59 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceImpl.kt @@ -3,16 +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.ProjectCommitListParams -import com.openlayer.api.models.ProjectCommitListResponse import com.openlayer.api.services.errorHandler -import com.openlayer.api.services.jsonHandler -import com.openlayer.api.services.withErrorHandler class CommitServiceImpl constructor( @@ -20,33 +13,4 @@ constructor( ) : CommitService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** List the commits (project versions) under a project. */ - override fun list( - params: ProjectCommitListParams, - requestOptions: RequestOptions - ): ProjectCommitListResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .addPathSegments("projects", params.getPathParam(0), "versions") - .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/CommitTestResultListParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/CommitTestResultListParamsTest.kt deleted file mode 100644 index 01924b0..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/CommitTestResultListParamsTest.kt +++ /dev/null @@ -1,61 +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 CommitTestResultListParamsTest { - - @Test - fun createCommitTestResultListParams() { - CommitTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .includeArchived(true) - .page(123L) - .perPage(100L) - .status(CommitTestResultListParams.Status.RUNNING) - .type(CommitTestResultListParams.Type.INTEGRITY) - .build() - } - - @Test - fun getQueryParams() { - val params = - CommitTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .includeArchived(true) - .page(123L) - .perPage(100L) - .status(CommitTestResultListParams.Status.RUNNING) - .type(CommitTestResultListParams.Type.INTEGRITY) - .build() - val expected = mutableMapOf>() - expected.put("includeArchived", listOf("true")) - expected.put("page", listOf("123")) - expected.put("perPage", listOf("100")) - expected.put("status", listOf(CommitTestResultListParams.Status.RUNNING.toString())) - expected.put("type", listOf(CommitTestResultListParams.Type.INTEGRITY.toString())) - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getQueryParamsWithoutOptionalFields() { - val params = - CommitTestResultListParams.builder().id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() - val expected = mutableMapOf>() - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getPathParam() { - val params = - CommitTestResultListParams.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/CommitTestResultListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/CommitTestResultListResponseTest.kt deleted file mode 100644 index 05c6717..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/CommitTestResultListResponseTest.kt +++ /dev/null @@ -1,161 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.openlayer.api.models - -import com.openlayer.api.core.JsonValue -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -class CommitTestResultListResponseTest { - - @Test - fun createCommitTestResultListResponse() { - val commitTestResultListResponse = - CommitTestResultListResponse.builder() - ._meta( - CommitTestResultListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - .items( - listOf( - CommitTestResultListResponse.Item.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataEnds(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataStarts(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .inferencePipelineId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .projectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .status(CommitTestResultListResponse.Item.Status.RUNNING) - .statusMessage("Test successfully processed.") - .goal( - CommitTestResultListResponse.Item.Goal.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .commentCount(123L) - .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") - .dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .description( - JsonValue.from( - "This test checks for duplicate rows in the dataset." - ) - ) - .name("No duplicate rows") - .number(123L) - .originProjectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .subtype("duplicateRowCount") - .suggested(true) - .thresholds( - listOf( - CommitTestResultListResponse.Item.Goal.Threshold - .builder() - .insightName("duplicateRowCount") - .insightParameters( - listOf(JsonValue.from(mapOf())) - ) - .measurement("duplicateRowCount") - .operator("<=") - .value( - CommitTestResultListResponse.Item.Goal.Threshold - .Value - .ofDouble(42.23) - ) - .build() - ) - ) - .type("integrity") - .archived(true) - .delayWindow(42.23) - .evaluationWindow(42.23) - .usesMlModel(true) - .usesProductionData(true) - .usesReferenceDataset(true) - .usesTrainingDataset(true) - .usesValidationDataset(true) - .build() - ) - .goalId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .build() - ) - ) - .build() - assertThat(commitTestResultListResponse).isNotNull - assertThat(commitTestResultListResponse._meta()) - .isEqualTo( - CommitTestResultListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - assertThat(commitTestResultListResponse.items()) - .containsExactly( - CommitTestResultListResponse.Item.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataEnds(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataStarts(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .inferencePipelineId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .projectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .status(CommitTestResultListResponse.Item.Status.RUNNING) - .statusMessage("Test successfully processed.") - .goal( - CommitTestResultListResponse.Item.Goal.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .commentCount(123L) - .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") - .dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .description( - JsonValue.from( - "This test checks for duplicate rows in the dataset." - ) - ) - .name("No duplicate rows") - .number(123L) - .originProjectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .subtype("duplicateRowCount") - .suggested(true) - .thresholds( - listOf( - CommitTestResultListResponse.Item.Goal.Threshold.builder() - .insightName("duplicateRowCount") - .insightParameters( - listOf(JsonValue.from(mapOf())) - ) - .measurement("duplicateRowCount") - .operator("<=") - .value( - CommitTestResultListResponse.Item.Goal.Threshold.Value - .ofDouble(42.23) - ) - .build() - ) - ) - .type("integrity") - .archived(true) - .delayWindow(42.23) - .evaluationWindow(42.23) - .usesMlModel(true) - .usesProductionData(true) - .usesReferenceDataset(true) - .usesTrainingDataset(true) - .usesValidationDataset(true) - .build() - ) - .goalId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .build() - ) - } -} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDataStreamParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDataStreamParamsTest.kt deleted file mode 100644 index 37203d8..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDataStreamParamsTest.kt +++ /dev/null @@ -1,158 +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.models.* -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -class InferencePipelineDataStreamParamsTest { - - @Test - fun createInferencePipelineDataStreamParams() { - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt.builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) - ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - .build() - } - - @Test - fun getBody() { - val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) - ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - .build() - val body = params.getBody() - assertThat(body).isNotNull - assertThat(body.config()) - .isEqualTo( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt.builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) - ) - assertThat(body.rows()) - .isEqualTo(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - } - - @Test - fun getBodyWithoutOptionalFields() { - val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .build() - ) - ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - .build() - val body = params.getBody() - assertThat(body).isNotNull - assertThat(body.config()) - .isEqualTo( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .build() - ) - ) - assertThat(body.rows()) - .isEqualTo(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - } - - @Test - fun getPathParam() { - val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .build() - ) - ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - .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/InferencePipelineDataStreamResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDataStreamResponseTest.kt deleted file mode 100644 index 5d5c07f..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineDataStreamResponseTest.kt +++ /dev/null @@ -1,20 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.openlayer.api.models - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -class InferencePipelineDataStreamResponseTest { - - @Test - fun createInferencePipelineDataStreamResponse() { - val inferencePipelineDataStreamResponse = - InferencePipelineDataStreamResponse.builder() - .success(InferencePipelineDataStreamResponse.Success.TRUE) - .build() - assertThat(inferencePipelineDataStreamResponse).isNotNull - assertThat(inferencePipelineDataStreamResponse.success()) - .isEqualTo(InferencePipelineDataStreamResponse.Success.TRUE) - } -} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineTestResultListParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineTestResultListParamsTest.kt deleted file mode 100644 index 0e1b9ea..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineTestResultListParamsTest.kt +++ /dev/null @@ -1,71 +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 InferencePipelineTestResultListParamsTest { - - @Test - fun createInferencePipelineTestResultListParams() { - InferencePipelineTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .includeArchived(true) - .page(123L) - .perPage(100L) - .status(InferencePipelineTestResultListParams.Status.RUNNING) - .type(InferencePipelineTestResultListParams.Type.INTEGRITY) - .build() - } - - @Test - fun getQueryParams() { - val params = - InferencePipelineTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .includeArchived(true) - .page(123L) - .perPage(100L) - .status(InferencePipelineTestResultListParams.Status.RUNNING) - .type(InferencePipelineTestResultListParams.Type.INTEGRITY) - .build() - val expected = mutableMapOf>() - expected.put("includeArchived", listOf("true")) - expected.put("page", listOf("123")) - expected.put("perPage", listOf("100")) - expected.put( - "status", - listOf(InferencePipelineTestResultListParams.Status.RUNNING.toString()) - ) - expected.put( - "type", - listOf(InferencePipelineTestResultListParams.Type.INTEGRITY.toString()) - ) - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getQueryParamsWithoutOptionalFields() { - val params = - InferencePipelineTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - val expected = mutableMapOf>() - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getPathParam() { - val params = - InferencePipelineTestResultListParams.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/InferencePipelineTestResultListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineTestResultListResponseTest.kt deleted file mode 100644 index d9eadbb..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineTestResultListResponseTest.kt +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.openlayer.api.models - -import com.openlayer.api.core.JsonValue -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -class InferencePipelineTestResultListResponseTest { - - @Test - fun createInferencePipelineTestResultListResponse() { - val inferencePipelineTestResultListResponse = - InferencePipelineTestResultListResponse.builder() - ._meta( - InferencePipelineTestResultListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - .items( - listOf( - InferencePipelineTestResultListResponse.Item.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataEnds(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataStarts(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .inferencePipelineId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .projectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .status(InferencePipelineTestResultListResponse.Item.Status.RUNNING) - .statusMessage("Test successfully processed.") - .goal( - InferencePipelineTestResultListResponse.Item.Goal.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .commentCount(123L) - .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") - .dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .description( - JsonValue.from( - "This test checks for duplicate rows in the dataset." - ) - ) - .name("No duplicate rows") - .number(123L) - .originProjectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .subtype("duplicateRowCount") - .suggested(true) - .thresholds( - listOf( - InferencePipelineTestResultListResponse.Item.Goal - .Threshold - .builder() - .insightName("duplicateRowCount") - .insightParameters( - listOf(JsonValue.from(mapOf())) - ) - .measurement("duplicateRowCount") - .operator("<=") - .value( - InferencePipelineTestResultListResponse.Item - .Goal - .Threshold - .Value - .ofDouble(42.23) - ) - .build() - ) - ) - .type("integrity") - .archived(true) - .delayWindow(42.23) - .evaluationWindow(42.23) - .usesMlModel(true) - .usesProductionData(true) - .usesReferenceDataset(true) - .usesTrainingDataset(true) - .usesValidationDataset(true) - .build() - ) - .goalId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .build() - ) - ) - .build() - assertThat(inferencePipelineTestResultListResponse).isNotNull - assertThat(inferencePipelineTestResultListResponse._meta()) - .isEqualTo( - InferencePipelineTestResultListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - assertThat(inferencePipelineTestResultListResponse.items()) - .containsExactly( - InferencePipelineTestResultListResponse.Item.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataEnds(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateDataStarts(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .inferencePipelineId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .projectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .status(InferencePipelineTestResultListResponse.Item.Status.RUNNING) - .statusMessage("Test successfully processed.") - .goal( - InferencePipelineTestResultListResponse.Item.Goal.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .commentCount(123L) - .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") - .dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .description( - JsonValue.from( - "This test checks for duplicate rows in the dataset." - ) - ) - .name("No duplicate rows") - .number(123L) - .originProjectVersionId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .subtype("duplicateRowCount") - .suggested(true) - .thresholds( - listOf( - InferencePipelineTestResultListResponse.Item.Goal.Threshold - .builder() - .insightName("duplicateRowCount") - .insightParameters( - listOf(JsonValue.from(mapOf())) - ) - .measurement("duplicateRowCount") - .operator("<=") - .value( - InferencePipelineTestResultListResponse.Item.Goal - .Threshold - .Value - .ofDouble(42.23) - ) - .build() - ) - ) - .type("integrity") - .archived(true) - .delayWindow(42.23) - .evaluationWindow(42.23) - .usesMlModel(true) - .usesProductionData(true) - .usesReferenceDataset(true) - .usesTrainingDataset(true) - .usesValidationDataset(true) - .build() - ) - .goalId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .build() - ) - } -} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCommitListParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCommitListParamsTest.kt deleted file mode 100644 index 83e994e..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCommitListParamsTest.kt +++ /dev/null @@ -1,52 +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 ProjectCommitListParamsTest { - - @Test - fun createProjectCommitListParams() { - ProjectCommitListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .page(123L) - .perPage(100L) - .build() - } - - @Test - fun getQueryParams() { - val params = - ProjectCommitListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .page(123L) - .perPage(100L) - .build() - val expected = mutableMapOf>() - expected.put("page", listOf("123")) - expected.put("perPage", listOf("100")) - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getQueryParamsWithoutOptionalFields() { - val params = - ProjectCommitListParams.builder().id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() - val expected = mutableMapOf>() - assertThat(params.getQueryParams()).isEqualTo(expected) - } - - @Test - fun getPathParam() { - val params = - ProjectCommitListParams.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/ProjectCommitListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCommitListResponseTest.kt deleted file mode 100644 index 72defbb..0000000 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCommitListResponseTest.kt +++ /dev/null @@ -1,124 +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 ProjectCommitListResponseTest { - - @Test - fun createProjectCommitListResponse() { - val projectCommitListResponse = - ProjectCommitListResponse.builder() - ._meta( - ProjectCommitListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - .items( - listOf( - ProjectCommitListResponse.Item.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .commit( - ProjectCommitListResponse.Item.Commit.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .authorId("589ece63-49a2-41b4-98e1-10547761d4b0") - .fileSize(123L) - .message("Updated the prompt.") - .mlModelId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .storageUri("s3://...") - .trainingDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .validationDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .gitCommitRef("main") - .gitCommitSha(123L) - .gitCommitUrl("string") - .build() - ) - .dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .failingGoalCount(123L) - .mlModelId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .passingGoalCount(123L) - .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .status(ProjectCommitListResponse.Item.Status.QUEUED) - .statusMessage("Commit successfully processed.") - .storageUri("s3://...") - .totalGoalCount(123L) - .trainingDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .validationDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .archived(true) - .deploymentStatus("Deployed") - .links( - ProjectCommitListResponse.Item.Links.builder() - .app( - "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" - ) - .build() - ) - .build() - ) - ) - .build() - assertThat(projectCommitListResponse).isNotNull - assertThat(projectCommitListResponse._meta()) - .isEqualTo( - ProjectCommitListResponse._Meta - .builder() - .page(123L) - .perPage(100L) - .totalItems(123L) - .totalPages(123L) - .build() - ) - assertThat(projectCommitListResponse.items()) - .containsExactly( - ProjectCommitListResponse.Item.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .commit( - ProjectCommitListResponse.Item.Commit.builder() - .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .authorId("589ece63-49a2-41b4-98e1-10547761d4b0") - .fileSize(123L) - .message("Updated the prompt.") - .mlModelId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .storageUri("s3://...") - .trainingDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .validationDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .gitCommitRef("main") - .gitCommitSha(123L) - .gitCommitUrl("string") - .build() - ) - .dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) - .failingGoalCount(123L) - .mlModelId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .passingGoalCount(123L) - .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .status(ProjectCommitListResponse.Item.Status.QUEUED) - .statusMessage("Commit successfully processed.") - .storageUri("s3://...") - .totalGoalCount(123L) - .trainingDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .validationDatasetId("3fa85f64-5717-4562-b3fc-2c963f66afa6") - .archived(true) - .deploymentStatus("Deployed") - .links( - ProjectCommitListResponse.Item.Links.builder() - .app( - "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" - ) - .build() - ) - .build() - ) - } -} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateParamsTest.kt index 5d691bf..ff17e65 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateParamsTest.kt @@ -31,9 +31,6 @@ class ProjectCreateParamsTest { .rootDir("string") .build() ) - .slackChannelId("C01B2PZQX1Z") - .slackChannelName("#my-project") - .slackChannelNotificationsEnabled(true) .build() } @@ -60,9 +57,6 @@ class ProjectCreateParamsTest { .rootDir("string") .build() ) - .slackChannelId("C01B2PZQX1Z") - .slackChannelName("#my-project") - .slackChannelNotificationsEnabled(true) .build() val body = params.getBody() assertThat(body).isNotNull @@ -86,9 +80,6 @@ class ProjectCreateParamsTest { .rootDir("string") .build() ) - assertThat(body.slackChannelId()).isEqualTo("C01B2PZQX1Z") - assertThat(body.slackChannelName()).isEqualTo("#my-project") - assertThat(body.slackChannelNotificationsEnabled()).isEqualTo(true) } @Test diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateResponseTest.kt index 3fca2c5..1adc950 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectCreateResponseTest.kt @@ -28,7 +28,6 @@ class ProjectCreateResponseTest { ) .monitoringGoalCount(123L) .name("My Project") - .sample(true) .source(ProjectCreateResponse.Source.WEB) .taskType(ProjectCreateResponse.TaskType.LLM_BASE) .versionCount(123L) @@ -50,10 +49,6 @@ class ProjectCreateResponseTest { .rootDir("string") .build() ) - .slackChannelId("C01B2PZQX1Z") - .slackChannelName("#my-project") - .slackChannelNotificationsEnabled(true) - .unreadNotificationCount(123L) .build() assertThat(projectCreateResponse).isNotNull assertThat(projectCreateResponse.id()).isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") @@ -76,7 +71,6 @@ class ProjectCreateResponseTest { ) assertThat(projectCreateResponse.monitoringGoalCount()).isEqualTo(123L) assertThat(projectCreateResponse.name()).isEqualTo("My Project") - assertThat(projectCreateResponse.sample()).isEqualTo(true) assertThat(projectCreateResponse.source()).contains(ProjectCreateResponse.Source.WEB) assertThat(projectCreateResponse.taskType()) .isEqualTo(ProjectCreateResponse.TaskType.LLM_BASE) @@ -101,9 +95,5 @@ class ProjectCreateResponseTest { .rootDir("string") .build() ) - assertThat(projectCreateResponse.slackChannelId()).contains("C01B2PZQX1Z") - assertThat(projectCreateResponse.slackChannelName()).contains("#my-project") - assertThat(projectCreateResponse.slackChannelNotificationsEnabled()).contains(true) - assertThat(projectCreateResponse.unreadNotificationCount()).contains(123L) } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectListResponseTest.kt index afb6ebb..949d211 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectListResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectListResponseTest.kt @@ -40,7 +40,6 @@ class ProjectListResponseTest { ) .monitoringGoalCount(123L) .name("My Project") - .sample(true) .source(ProjectListResponse.Item.Source.WEB) .taskType(ProjectListResponse.Item.TaskType.LLM_BASE) .versionCount(123L) @@ -62,10 +61,6 @@ class ProjectListResponseTest { .rootDir("string") .build() ) - .slackChannelId("C01B2PZQX1Z") - .slackChannelName("#my-project") - .slackChannelNotificationsEnabled(true) - .unreadNotificationCount(123L) .build() ) ) @@ -100,7 +95,6 @@ class ProjectListResponseTest { ) .monitoringGoalCount(123L) .name("My Project") - .sample(true) .source(ProjectListResponse.Item.Source.WEB) .taskType(ProjectListResponse.Item.TaskType.LLM_BASE) .versionCount(123L) @@ -122,10 +116,6 @@ class ProjectListResponseTest { .rootDir("string") .build() ) - .slackChannelId("C01B2PZQX1Z") - .slackChannelName("#my-project") - .slackChannelNotificationsEnabled(true) - .unreadNotificationCount(123L) .build() ) } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ErrorHandlingTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ErrorHandlingTest.kt index fc8198c..9b8edf9 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ErrorHandlingTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ErrorHandlingTest.kt @@ -16,7 +16,6 @@ import com.google.common.collect.ListMultimap import com.openlayer.api.client.OpenlayerClient import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient import com.openlayer.api.core.JsonString -import com.openlayer.api.core.JsonValue import com.openlayer.api.core.jsonMapper import com.openlayer.api.errors.BadRequestException import com.openlayer.api.errors.InternalServerException @@ -29,6 +28,7 @@ import com.openlayer.api.errors.UnauthorizedException import com.openlayer.api.errors.UnexpectedStatusCodeException import com.openlayer.api.errors.UnprocessableEntityException import com.openlayer.api.models.* +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.assertj.core.api.InstanceOfAssertFactories @@ -56,81 +56,99 @@ class ErrorHandlingTest { } @Test - fun dataStream200() { + fun projectsCreate200() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() val expected = - InferencePipelineDataStreamResponse.builder() - .success(InferencePipelineDataStreamResponse.Success.TRUE) + ProjectCreateResponse.builder() + .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") + .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .developmentGoalCount(123L) + .goalCount(123L) + .inferencePipelineCount(123L) + .links( + ProjectCreateResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(123L) + .name("My Project") + .source(ProjectCreateResponse.Source.WEB) + .taskType(ProjectCreateResponse.TaskType.LLM_BASE) + .versionCount(123L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectCreateResponse.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() + ) .build() stubFor(post(anyUrl()).willReturn(ok().withBody(toJson(expected)))) - assertThat(client.inferencePipelines().data().stream(params)).isEqualTo(expected) + assertThat(client.projects().create(params)).isEqualTo(expected) } @Test - fun dataStream400() { + fun projectsCreate400() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -138,44 +156,35 @@ class ErrorHandlingTest { .willReturn(status(400).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertBadRequest(e, ImmutableListMultimap.of("Foo", "Bar"), OPENLAYER_ERROR) }) } @Test - fun dataStream401() { + fun projectsCreate401() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -183,44 +192,35 @@ class ErrorHandlingTest { .willReturn(status(401).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertUnauthorized(e, ImmutableListMultimap.of("Foo", "Bar"), OPENLAYER_ERROR) }) } @Test - fun dataStream403() { + fun projectsCreate403() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -228,44 +228,35 @@ class ErrorHandlingTest { .willReturn(status(403).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertPermissionDenied(e, ImmutableListMultimap.of("Foo", "Bar"), OPENLAYER_ERROR) }) } @Test - fun dataStream404() { + fun projectsCreate404() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -273,44 +264,35 @@ class ErrorHandlingTest { .willReturn(status(404).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertNotFound(e, ImmutableListMultimap.of("Foo", "Bar"), OPENLAYER_ERROR) }) } @Test - fun dataStream422() { + fun projectsCreate422() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -318,7 +300,7 @@ class ErrorHandlingTest { .willReturn(status(422).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertUnprocessableEntity( e, @@ -329,37 +311,28 @@ class ErrorHandlingTest { } @Test - fun dataStream429() { + fun projectsCreate429() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -367,44 +340,35 @@ class ErrorHandlingTest { .willReturn(status(429).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertRateLimit(e, ImmutableListMultimap.of("Foo", "Bar"), OPENLAYER_ERROR) }) } @Test - fun dataStream500() { + fun projectsCreate500() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -412,7 +376,7 @@ class ErrorHandlingTest { .willReturn(status(500).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertInternalServer(e, ImmutableListMultimap.of("Foo", "Bar"), OPENLAYER_ERROR) }) @@ -421,35 +385,26 @@ class ErrorHandlingTest { @Test fun unexpectedStatusCode() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor( @@ -457,7 +412,7 @@ class ErrorHandlingTest { .willReturn(status(999).withHeader("Foo", "Bar").withBody(toJson(OPENLAYER_ERROR))) ) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertUnexpectedStatusCodeException( e, @@ -471,40 +426,31 @@ class ErrorHandlingTest { @Test fun invalidBody() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor(post(anyUrl()).willReturn(status(200).withBody("Not JSON"))) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertThat(e) .isInstanceOf(OpenlayerException::class.java) @@ -515,40 +461,31 @@ class ErrorHandlingTest { @Test fun invalidErrorBody() { val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .build() stubFor(post(anyUrl()).willReturn(status(400).withBody("Not JSON"))) - assertThatThrownBy({ client.inferencePipelines().data().stream(params) }) + assertThatThrownBy({ client.projects().create(params) }) .satisfies({ e -> assertBadRequest(e, ImmutableListMultimap.of(), OpenlayerError.builder().build()) }) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ServiceParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ServiceParamsTest.kt index 15b11a5..170e43e 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ServiceParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/ServiceParamsTest.kt @@ -21,6 +21,7 @@ import com.openlayer.api.core.JsonString import com.openlayer.api.core.JsonValue import com.openlayer.api.core.jsonMapper import com.openlayer.api.models.* +import java.time.OffsetDateTime import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -41,7 +42,7 @@ class ServiceParamsTest { } @Test - fun dataStreamWithAdditionalParams() { + fun projectsCreateWithAdditionalParams() { val additionalHeaders = mutableMapOf>() additionalHeaders.put("x-test-header", listOf("abc1234")) @@ -55,43 +56,70 @@ class ServiceParamsTest { additionalBodyProperties.put("testBodyProperty", JsonString.of("ghi890")) val params = - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) + ProjectCreateParams.builder() + .name("My Project") + .taskType(ProjectCreateParams.TaskType.LLM_BASE) + .description("My project description.") + .gitRepo( + ProjectCreateParams.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) .additionalHeaders(additionalHeaders) .additionalBodyProperties(additionalBodyProperties) .additionalQueryParams(additionalQueryParams) .build() val apiResponse = - InferencePipelineDataStreamResponse.builder() - .success(InferencePipelineDataStreamResponse.Success.TRUE) + ProjectCreateResponse.builder() + .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") + .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .developmentGoalCount(123L) + .goalCount(123L) + .inferencePipelineCount(123L) + .links( + ProjectCreateResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(123L) + .name("My Project") + .source(ProjectCreateResponse.Source.WEB) + .taskType(ProjectCreateResponse.TaskType.LLM_BASE) + .versionCount(123L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectCreateResponse.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(123L) + .name("string") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("string") + .url("string") + .branch("string") + .rootDir("string") + .build() + ) .build() stubFor( @@ -102,7 +130,7 @@ class ServiceParamsTest { .willReturn(ok(JSON_MAPPER.writeValueAsString(apiResponse))) ) - client.inferencePipelines().data().stream(params) + client.projects().create(params) verify(postRequestedFor(anyUrl())) } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt index e7e4e02..95cc0e1 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt @@ -42,9 +42,6 @@ class ProjectServiceTest { .rootDir("string") .build() ) - .slackChannelId("C01B2PZQX1Z") - .slackChannelName("#my-project") - .slackChannelNotificationsEnabled(true) .build() ) println(projectCreateResponse) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceTest.kt index 171aa44..752695d 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/commits/TestResultServiceTest.kt @@ -3,34 +3,7 @@ package com.openlayer.api.services.blocking.commits 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 TestResultServiceTest { - - @Test - fun callList() { - val client = - OpenlayerOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val testResultService = client.commits().testResults() - val commitTestResultListResponse = - testResultService.list( - CommitTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .includeArchived(true) - .page(123L) - .perPage(100L) - .status(CommitTestResultListParams.Status.RUNNING) - .type(CommitTestResultListParams.Type.INTEGRITY) - .build() - ) - println(commitTestResultListResponse) - commitTestResultListResponse.validate() - } -} +@ExtendWith(TestServerExtension::class) class TestResultServiceTest diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceTest.kt index d004505..b8c0866 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/DataServiceTest.kt @@ -3,57 +3,7 @@ package com.openlayer.api.services.blocking.inferencePipelines import com.openlayer.api.TestServerExtension -import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient -import com.openlayer.api.core.JsonValue import com.openlayer.api.models.* -import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith(TestServerExtension::class) -class DataServiceTest { - - @Test - fun callStream() { - val client = - OpenlayerOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val dataService = client.inferencePipelines().data() - val inferencePipelineDataStreamResponse = - dataService.stream( - InferencePipelineDataStreamParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .config( - InferencePipelineDataStreamParams.Config.ofLlmData( - InferencePipelineDataStreamParams.Config.LlmData.builder() - .outputColumnName("output") - .contextColumnName("context") - .costColumnName("cost") - .groundTruthColumnName("ground_truth") - .inferenceIdColumnName("id") - .inputVariableNames(listOf("string")) - .latencyColumnName("latency") - .metadata(JsonValue.from(mapOf())) - .numOfTokenColumnName("num_tokens") - .prompt( - listOf( - InferencePipelineDataStreamParams.Config.LlmData.Prompt - .builder() - .content("{{ user_query }}") - .role("user") - .build() - ) - ) - .questionColumnName("question") - .timestampColumnName("timestamp") - .build() - ) - ) - .rows(listOf(InferencePipelineDataStreamParams.Row.builder().build())) - .build() - ) - println(inferencePipelineDataStreamResponse) - inferencePipelineDataStreamResponse.validate() - } -} +@ExtendWith(TestServerExtension::class) class DataServiceTest diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceTest.kt index c100166..f9bdd02 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/TestResultServiceTest.kt @@ -3,34 +3,7 @@ package com.openlayer.api.services.blocking.inferencePipelines 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 TestResultServiceTest { - - @Test - fun callList() { - val client = - OpenlayerOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val testResultService = client.inferencePipelines().testResults() - val inferencePipelineTestResultListResponse = - testResultService.list( - InferencePipelineTestResultListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .includeArchived(true) - .page(123L) - .perPage(100L) - .status(InferencePipelineTestResultListParams.Status.RUNNING) - .type(InferencePipelineTestResultListParams.Type.INTEGRITY) - .build() - ) - println(inferencePipelineTestResultListResponse) - inferencePipelineTestResultListResponse.validate() - } -} +@ExtendWith(TestServerExtension::class) class TestResultServiceTest diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceTest.kt index de43f45..231f03f 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/CommitServiceTest.kt @@ -3,31 +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 CommitServiceTest { - - @Test - fun callList() { - val client = - OpenlayerOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val commitService = client.projects().commits() - val projectCommitListResponse = - commitService.list( - ProjectCommitListParams.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .page(123L) - .perPage(100L) - .build() - ) - println(projectCommitListResponse) - projectCommitListResponse.validate() - } -} +@ExtendWith(TestServerExtension::class) class CommitServiceTest