diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3b005e5..ee49ac2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.10" + ".": "0.1.0-alpha.11" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b65d6ab..ab2c993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.1.0-alpha.11 (2024-12-20) + +Full Changelog: [v0.1.0-alpha.10...v0.1.0-alpha.11](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.0-alpha.10...v0.1.0-alpha.11) + +### Features + +* **api:** api update ([#68](https://github.com/openlayer-ai/openlayer-java/issues/68)) ([679ff1c](https://github.com/openlayer-ai/openlayer-java/commit/679ff1c2cd70530e6429d31766e1cad6165a7f6d)) + + +### Chores + +* **docs:** add example project ([#71](https://github.com/openlayer-ai/openlayer-java/issues/71)) ([7efeda9](https://github.com/openlayer-ai/openlayer-java/commit/7efeda9e63ec09ca07ec18e1647f4353ada3d218)) +* **docs:** add example project ([#75](https://github.com/openlayer-ai/openlayer-java/issues/75)) ([3c48537](https://github.com/openlayer-ai/openlayer-java/commit/3c485375542ec9c8f8daf996bf436c0e50773149)) +* **docs:** update readme ([#70](https://github.com/openlayer-ai/openlayer-java/issues/70)) ([91e2007](https://github.com/openlayer-ai/openlayer-java/commit/91e2007f4938d80ce30cc54651612e7d00ceda78)) +* **docs:** update readme ([#73](https://github.com/openlayer-ai/openlayer-java/issues/73)) ([1f3da27](https://github.com/openlayer-ai/openlayer-java/commit/1f3da279ac393c8d077d21b1605cb28e398fff8e)) +* **internal:** codegen related update ([#72](https://github.com/openlayer-ai/openlayer-java/issues/72)) ([029360f](https://github.com/openlayer-ai/openlayer-java/commit/029360f548e14f460168b7a0fe79e8914d7bfa48)) +* **internal:** codegen related update ([#74](https://github.com/openlayer-ai/openlayer-java/issues/74)) ([2561984](https://github.com/openlayer-ai/openlayer-java/commit/2561984b26c0b220318ef21c2201cb1b96702e29)) + ## 0.1.0-alpha.10 (2024-12-13) Full Changelog: [v0.1.0-alpha.9...v0.1.0-alpha.10](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.0-alpha.9...v0.1.0-alpha.10) diff --git a/README.md b/README.md index 600fab6..ed0596e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.10) +[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.11) @@ -27,7 +27,7 @@ The REST API documentation can be foundĀ on [openlayer.com](https://openlayer.co ```kotlin -implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.10") +implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.11") ``` #### Maven @@ -36,7 +36,7 @@ implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.10") com.openlayer.api openlayer-java - 0.1.0-alpha.10 + 0.1.0-alpha.11 ``` @@ -49,6 +49,9 @@ Use `OpenlayerOkHttpClient.builder()` to configure the client. Alternately, set the environment with `OPENLAYER_API_KEY`, and use `OpenlayerOkHttpClient.fromEnv()` to read from the environment. ```java +import com.openlayer.api.client.OpenlayerClient; +import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient; + OpenlayerClient client = OpenlayerOkHttpClient.fromEnv(); // Note: you can also call fromEnv() from the client builder, for example if you need to set additional properties @@ -68,10 +71,10 @@ 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 inference pipeline data, first use the `InferencePipelineDataStreamParams` builder to specify attributes, then pass that to the `stream` method of the `data` service. ```java +import com.openlayer.api.core.JsonValue; import com.openlayer.api.models.InferencePipelineDataStreamParams; import com.openlayer.api.models.InferencePipelineDataStreamResponse; import java.util.List; @@ -85,7 +88,7 @@ InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.bui .costColumnName("cost") .timestampColumnName("timestamp") .build())) - .row(List.of(InferencePipelineDataStreamParams.Row.builder() + .rows(List.of(InferencePipelineDataStreamParams.Row.builder() .putAdditionalProperty("user_query", JsonValue.from("what is the meaning of life?")) .putAdditionalProperty("output", JsonValue.from("42")) .putAdditionalProperty("tokens", JsonValue.from(7)) @@ -104,14 +107,14 @@ InferencePipelineDataStreamResponse response = client.inferencePipelines().data( 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 `InferencePipelineDataStreamParams.builder()` to pass to the `stream` method of the `data` 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. +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 -import com.openlayer.api.models.core.JsonValue; +import com.openlayer.api.core.JsonValue; +import com.openlayer.api.models.InferencePipelineDataStreamParams; + InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder() // ... normal properties .putAdditionalProperty("secret_param", JsonValue.from("4242")) @@ -125,15 +128,19 @@ 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 +import com.openlayer.api.models.InferencePipelineDataStreamResponse; + InferencePipelineDataStreamResponse response = client.inferencePipelines().data().stream().validate(); ``` ### Response properties as JSON -In rare cases, you may want to access the underlying JSON value for a response property rather than using the typed version provided by -this SDK. Each model property has a corresponding JSON version, with an underscore before the method name, which returns a `JsonField` value. +In rare cases, you may want to access the underlying JSON value for a response property rather than using the typed version provided by this SDK. Each model property has a corresponding JSON version, with an underscore before the method name, which returns a `JsonField` value. ```java +import com.openlayer.api.core.JsonField; +import java.util.Optional; + JsonField field = responseObj._field(); if (field.isMissing()) { @@ -155,6 +162,8 @@ 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 +import com.openlayer.api.core.JsonValue; + JsonValue secret = projectCreateResponse._additionalProperties().get("secret_field"); ``` @@ -168,31 +177,33 @@ This library throws exceptions in a single hierarchy for easy handling: - **`OpenlayerException`** - Base exception for all exceptions - - **`OpenlayerServiceException`** - HTTP errors with a well-formed response body we were able to parse. The exception message and the `.debuggingRequestId()` will be set by the server. +- **`OpenlayerServiceException`** - HTTP errors with a well-formed response body we were able to parse. The exception message and the `.debuggingRequestId()` will be set by the server. - | 400 | BadRequestException | - | ------ | ----------------------------- | - | 401 | AuthenticationException | - | 403 | PermissionDeniedException | - | 404 | NotFoundException | - | 422 | UnprocessableEntityException | - | 429 | RateLimitException | - | 5xx | InternalServerException | - | others | UnexpectedStatusCodeException | + | 400 | BadRequestException | + | ------ | ----------------------------- | + | 401 | AuthenticationException | + | 403 | PermissionDeniedException | + | 404 | NotFoundException | + | 422 | UnprocessableEntityException | + | 429 | RateLimitException | + | 5xx | InternalServerException | + | others | UnexpectedStatusCodeException | - - **`OpenlayerIoException`** - I/O networking errors - - **`OpenlayerInvalidDataException`** - any other exceptions on the client side, e.g.: - - We failed to serialize the request body - - We failed to parse the response body (has access to response code and body) +- **`OpenlayerIoException`** - I/O networking errors +- **`OpenlayerInvalidDataException`** - any other exceptions on the client side, e.g.: + - We failed to serialize the request body + - We failed to parse the response body (has access to response code and body) ## Network options ### Retries -Requests that experience certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default. -You can provide a `maxRetries` on the client builder to configure this: +Requests that experience certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default. You can provide a `maxRetries` on the client builder to configure this: ```java +import com.openlayer.api.client.OpenlayerClient; +import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient; + OpenlayerClient client = OpenlayerOkHttpClient.builder() .fromEnv() .maxRetries(4) @@ -204,6 +215,10 @@ OpenlayerClient client = OpenlayerOkHttpClient.builder() Requests time out after 1 minute by default. You can configure this on the client builder: ```java +import com.openlayer.api.client.OpenlayerClient; +import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient; +import java.time.Duration; + OpenlayerClient client = OpenlayerOkHttpClient.builder() .fromEnv() .timeout(Duration.ofSeconds(30)) @@ -215,24 +230,24 @@ OpenlayerClient client = OpenlayerOkHttpClient.builder() Requests can be routed through a proxy. You can configure this on the client builder: ```java +import com.openlayer.api.client.OpenlayerClient; +import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient; +import java.net.InetSocketAddress; +import java.net.Proxy; + OpenlayerClient client = OpenlayerOkHttpClient.builder() .fromEnv() - .proxy(new Proxy( - Type.HTTP, - new InetSocketAddress("proxy.com", 8080) - )) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("example.com", 8080))) .build(); ``` ## Making custom/undocumented requests -This library is typed for convenient access to the documented API. If you need to access undocumented -params or response properties, the library can still be used. +This library is typed for convenient access to the documented API. If you need to access undocumented params or response properties, the library can still be used. ### Undocumented request params -To make requests using undocumented parameters, you can provide or override parameters on the params object -while building it. +To make requests using undocumented parameters, you can provide or override parameters on the params object while building it. ```kotlin FooCreateParams address = FooCreateParams.builder() @@ -243,10 +258,7 @@ FooCreateParams address = FooCreateParams.builder() ### Undocumented response properties -To access undocumented response properties, you can use `res._additionalProperties()` on a response object to -get a map of untyped fields of type `Map`. You can then access fields like -`._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class -to extract it to a desired type. +To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type. ## Logging diff --git a/build.gradle.kts b/build.gradle.kts index f485855..6466dce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { allprojects { group = "com.openlayer.api" - version = "0.1.0-alpha.10" // x-release-please-version + version = "0.1.0-alpha.11" // x-release-please-version } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt index 2dfa188..b5e6d1c 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParams.kt @@ -2,27 +2,42 @@ 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.NoAutoDetect import com.openlayer.api.core.http.Headers import com.openlayer.api.core.http.QueryParams +import com.openlayer.api.core.toImmutable +import com.openlayer.api.errors.OpenlayerInvalidDataException import java.util.Objects +import java.util.Optional class InferencePipelineRetrieveParams constructor( private val inferencePipelineId: String, + private val expand: List?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) { fun inferencePipelineId(): String = inferencePipelineId + fun expand(): Optional> = Optional.ofNullable(expand) + fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + @JvmSynthetic + internal fun getQueryParams(): QueryParams { + val queryParams = QueryParams.builder() + this.expand?.let { queryParams.put("expand", listOf(it.joinToString(separator = ","))) } + queryParams.putAll(additionalQueryParams) + return queryParams.build() + } fun getPathParam(index: Int): String { return when (index) { @@ -42,6 +57,7 @@ constructor( class Builder { private var inferencePipelineId: String? = null + private var expand: MutableList = mutableListOf() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -49,6 +65,7 @@ constructor( internal fun from(inferencePipelineRetrieveParams: InferencePipelineRetrieveParams) = apply { inferencePipelineId = inferencePipelineRetrieveParams.inferencePipelineId + expand = inferencePipelineRetrieveParams.expand?.toMutableList() ?: mutableListOf() additionalHeaders = inferencePipelineRetrieveParams.additionalHeaders.toBuilder() additionalQueryParams = inferencePipelineRetrieveParams.additionalQueryParams.toBuilder() @@ -58,6 +75,15 @@ constructor( this.inferencePipelineId = inferencePipelineId } + /** Expand specific nested objects. */ + fun expand(expand: List) = apply { + this.expand.clear() + this.expand.addAll(expand) + } + + /** Expand specific nested objects. */ + fun addExpand(expand: Expand) = apply { this.expand.add(expand) } + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -161,21 +187,79 @@ constructor( checkNotNull(inferencePipelineId) { "`inferencePipelineId` is required but was not set" }, + expand.toImmutable().ifEmpty { null }, additionalHeaders.build(), additionalQueryParams.build(), ) } + class Expand + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PROJECT = of("project") + + @JvmField val WORKSPACE = of("workspace") + + @JvmStatic fun of(value: String) = Expand(JsonField.of(value)) + } + + enum class Known { + PROJECT, + WORKSPACE, + } + + enum class Value { + PROJECT, + WORKSPACE, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + PROJECT -> Value.PROJECT + WORKSPACE -> Value.WORKSPACE + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + PROJECT -> Known.PROJECT + WORKSPACE -> Known.WORKSPACE + else -> throw OpenlayerInvalidDataException("Unknown Expand: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Expand && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is InferencePipelineRetrieveParams && inferencePipelineId == other.inferencePipelineId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is InferencePipelineRetrieveParams && inferencePipelineId == other.inferencePipelineId && expand == other.expand && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(inferencePipelineId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(inferencePipelineId, expand, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "InferencePipelineRetrieveParams{inferencePipelineId=$inferencePipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InferencePipelineRetrieveParams{inferencePipelineId=$inferencePipelineId, expand=$expand, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt index bfd6a1e..3dd305e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponse.kt @@ -15,6 +15,7 @@ import com.openlayer.api.core.JsonValue import com.openlayer.api.core.NoAutoDetect import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.LocalDate import java.time.OffsetDateTime import java.util.Objects import java.util.Optional @@ -25,6 +26,9 @@ class InferencePipelineRetrieveResponse private constructor( private val id: JsonField, private val projectId: JsonField, + private val workspaceId: JsonField, + private val project: JsonField, + private val workspace: JsonField, private val name: JsonField, private val dateCreated: JsonField, private val dateUpdated: JsonField, @@ -49,6 +53,14 @@ private constructor( /** The project id. */ fun projectId(): String = projectId.getRequired("projectId") + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + fun project(): Optional = Optional.ofNullable(project.getNullable("project")) + + fun workspace(): Optional = Optional.ofNullable(workspace.getNullable("workspace")) + /** The inference pipeline name. */ fun name(): String = name.getRequired("name") @@ -98,6 +110,13 @@ private constructor( /** The project id. */ @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + @JsonProperty("project") @ExcludeMissing fun _project() = project + + @JsonProperty("workspace") @ExcludeMissing fun _workspace() = workspace + /** The inference pipeline name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -148,6 +167,9 @@ private constructor( if (!validated) { id() projectId() + workspaceId() + project().map { it.validate() } + workspace().map { it.validate() } name() dateCreated() dateUpdated() @@ -176,6 +198,9 @@ private constructor( private var id: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var project: JsonField = JsonMissing.of() + private var workspace: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var dateCreated: JsonField = JsonMissing.of() private var dateUpdated: JsonField = JsonMissing.of() @@ -196,6 +221,9 @@ private constructor( apply { this.id = inferencePipelineRetrieveResponse.id this.projectId = inferencePipelineRetrieveResponse.projectId + this.workspaceId = inferencePipelineRetrieveResponse.workspaceId + this.project = inferencePipelineRetrieveResponse.project + this.workspace = inferencePipelineRetrieveResponse.workspace this.name = inferencePipelineRetrieveResponse.name this.dateCreated = inferencePipelineRetrieveResponse.dateCreated this.dateUpdated = inferencePipelineRetrieveResponse.dateUpdated @@ -227,6 +255,26 @@ private constructor( @ExcludeMissing fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId } + + fun project(project: Project) = project(JsonField.of(project)) + + @JsonProperty("project") + @ExcludeMissing + fun project(project: JsonField) = apply { this.project = project } + + fun workspace(workspace: Workspace) = workspace(JsonField.of(workspace)) + + @JsonProperty("workspace") + @ExcludeMissing + fun workspace(workspace: JsonField) = apply { this.workspace = workspace } + /** The inference pipeline name. */ fun name(name: String) = name(JsonField.of(name)) @@ -370,6 +418,9 @@ private constructor( InferencePipelineRetrieveResponse( id, projectId, + workspaceId, + project, + workspace, name, dateCreated, dateUpdated, @@ -551,20 +602,1467 @@ private constructor( override fun toString() = value.toString() } + @JsonDeserialize(builder = Project.Builder::class) + @NoAutoDetect + class Project + private constructor( + private val id: JsonField, + private val workspaceId: JsonField, + private val creatorId: JsonField, + private val name: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val description: JsonField, + private val source: JsonField, + private val taskType: JsonField, + private val versionCount: JsonField, + private val inferencePipelineCount: JsonField, + private val goalCount: JsonField, + private val developmentGoalCount: JsonField, + private val monitoringGoalCount: JsonField, + private val links: JsonField, + private val gitRepo: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The project id. */ + fun id(): String = id.getRequired("id") + + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + /** The project creator id. */ + fun creatorId(): Optional = Optional.ofNullable(creatorId.getNullable("creatorId")) + + /** The project name. */ + fun name(): String = name.getRequired("name") + + /** The project creation date. */ + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + /** The project last updated date. */ + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** The project description. */ + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) + + /** The source of the project. */ + fun source(): Optional = Optional.ofNullable(source.getNullable("source")) + + /** The task type of the project. */ + fun taskType(): TaskType = taskType.getRequired("taskType") + + /** The number of versions (commits) in the project. */ + fun versionCount(): Long = versionCount.getRequired("versionCount") + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(): Long = + inferencePipelineCount.getRequired("inferencePipelineCount") + + /** The total number of tests in the project. */ + fun goalCount(): Long = goalCount.getRequired("goalCount") + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(): Long = developmentGoalCount.getRequired("developmentGoalCount") + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") + + /** Links to the project. */ + fun links(): Links = links.getRequired("links") + + fun gitRepo(): Optional = Optional.ofNullable(gitRepo.getNullable("gitRepo")) + + /** The project id. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + /** The project creator id. */ + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + /** The project name. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The project creation date. */ + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + /** The project last updated date. */ + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + /** The project description. */ + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** The source of the project. */ + @JsonProperty("source") @ExcludeMissing fun _source() = source + + /** The task type of the project. */ + @JsonProperty("taskType") @ExcludeMissing fun _taskType() = taskType + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") @ExcludeMissing fun _versionCount() = versionCount + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun _inferencePipelineCount() = inferencePipelineCount + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") @ExcludeMissing fun _goalCount() = goalCount + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun _developmentGoalCount() = developmentGoalCount + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun _monitoringGoalCount() = monitoringGoalCount + + /** Links to the project. */ + @JsonProperty("links") @ExcludeMissing fun _links() = links + + @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo() = gitRepo + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Project = apply { + if (!validated) { + id() + workspaceId() + creatorId() + name() + dateCreated() + dateUpdated() + description() + source() + taskType() + versionCount() + inferencePipelineCount() + goalCount() + developmentGoalCount() + monitoringGoalCount() + links().validate() + gitRepo().map { it.validate() } + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() + private var taskType: JsonField = JsonMissing.of() + private var versionCount: JsonField = JsonMissing.of() + private var inferencePipelineCount: JsonField = JsonMissing.of() + private var goalCount: JsonField = JsonMissing.of() + private var developmentGoalCount: JsonField = JsonMissing.of() + private var monitoringGoalCount: JsonField = JsonMissing.of() + private var links: JsonField = JsonMissing.of() + private var gitRepo: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(project: Project) = apply { + this.id = project.id + this.workspaceId = project.workspaceId + this.creatorId = project.creatorId + this.name = project.name + this.dateCreated = project.dateCreated + this.dateUpdated = project.dateUpdated + this.description = project.description + this.source = project.source + this.taskType = project.taskType + this.versionCount = project.versionCount + this.inferencePipelineCount = project.inferencePipelineCount + this.goalCount = project.goalCount + this.developmentGoalCount = project.developmentGoalCount + this.monitoringGoalCount = project.monitoringGoalCount + this.links = project.links + this.gitRepo = project.gitRepo + additionalProperties(project.additionalProperties) + } + + /** The project id. */ + fun id(id: String) = id(JsonField.of(id)) + + /** The project id. */ + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { + this.workspaceId = workspaceId + } + + /** The project creator id. */ + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + /** The project creator id. */ + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + /** The project name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The project name. */ + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + /** The project creation date. */ + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + /** The project creation date. */ + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + /** The project last updated date. */ + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + /** The project last updated date. */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + /** The project description. */ + fun description(description: String) = description(JsonField.of(description)) + + /** The project description. */ + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { + this.description = description + } + + /** The source of the project. */ + fun source(source: Source) = source(JsonField.of(source)) + + /** The source of the project. */ + @JsonProperty("source") + @ExcludeMissing + fun source(source: JsonField) = apply { this.source = source } + + /** The task type of the project. */ + fun taskType(taskType: TaskType) = taskType(JsonField.of(taskType)) + + /** The task type of the project. */ + @JsonProperty("taskType") + @ExcludeMissing + fun taskType(taskType: JsonField) = apply { this.taskType = taskType } + + /** The number of versions (commits) in the project. */ + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") + @ExcludeMissing + fun versionCount(versionCount: JsonField) = apply { + this.versionCount = versionCount + } + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(inferencePipelineCount: Long) = + inferencePipelineCount(JsonField.of(inferencePipelineCount)) + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun inferencePipelineCount(inferencePipelineCount: JsonField) = apply { + this.inferencePipelineCount = inferencePipelineCount + } + + /** The total number of tests in the project. */ + fun goalCount(goalCount: Long) = goalCount(JsonField.of(goalCount)) + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") + @ExcludeMissing + fun goalCount(goalCount: JsonField) = apply { this.goalCount = goalCount } + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(developmentGoalCount: Long) = + developmentGoalCount(JsonField.of(developmentGoalCount)) + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun developmentGoalCount(developmentGoalCount: JsonField) = apply { + this.developmentGoalCount = developmentGoalCount + } + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(monitoringGoalCount: Long) = + monitoringGoalCount(JsonField.of(monitoringGoalCount)) + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun monitoringGoalCount(monitoringGoalCount: JsonField) = apply { + this.monitoringGoalCount = monitoringGoalCount + } + + /** Links to the project. */ + fun links(links: Links) = links(JsonField.of(links)) + + /** Links to the project. */ + @JsonProperty("links") + @ExcludeMissing + fun links(links: JsonField) = apply { this.links = links } + + fun gitRepo(gitRepo: GitRepo) = gitRepo(JsonField.of(gitRepo)) + + @JsonProperty("gitRepo") + @ExcludeMissing + fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + + 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(): Project = + Project( + id, + workspaceId, + creatorId, + name, + dateCreated, + dateUpdated, + description, + source, + taskType, + versionCount, + inferencePipelineCount, + goalCount, + developmentGoalCount, + monitoringGoalCount, + links, + gitRepo, + additionalProperties.toImmutable(), + ) + } + + /** Links to the project. */ + @JsonDeserialize(builder = Links.Builder::class) + @NoAutoDetect + class Links + private constructor( + private val app: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + 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) + + 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.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Links && app == other.app && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(app, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" + } + + class Source + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val WEB = of("web") + + @JvmField val API = of("api") + + @JvmField val NULL = of("null") + + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) + } + + enum class Known { + WEB, + API, + NULL, + } + + enum class Value { + WEB, + API, + NULL, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + WEB -> Value.WEB + API -> Value.API + NULL -> Value.NULL + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + WEB -> Known.WEB + API -> Known.API + NULL -> Known.NULL + else -> throw OpenlayerInvalidDataException("Unknown Source: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Source && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class TaskType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LLM_BASE = of("llm-base") + + @JvmField val TABULAR_CLASSIFICATION = of("tabular-classification") + + @JvmField val TABULAR_REGRESSION = of("tabular-regression") + + @JvmField val TEXT_CLASSIFICATION = of("text-classification") + + @JvmStatic fun of(value: String) = TaskType(JsonField.of(value)) + } + + enum class Known { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + } + + enum class Value { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + LLM_BASE -> Value.LLM_BASE + TABULAR_CLASSIFICATION -> Value.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Value.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Value.TEXT_CLASSIFICATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + LLM_BASE -> Known.LLM_BASE + TABULAR_CLASSIFICATION -> Known.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Known.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Known.TEXT_CLASSIFICATION + else -> throw OpenlayerInvalidDataException("Unknown TaskType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is TaskType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = GitRepo.Builder::class) + @NoAutoDetect + class GitRepo + private constructor( + private val id: JsonField, + private val gitId: JsonField, + private val dateConnected: JsonField, + private val dateUpdated: JsonField, + private val branch: JsonField, + private val name: JsonField, + private val private_: JsonField, + private val slug: JsonField, + private val url: JsonField, + private val rootDir: JsonField, + private val projectId: JsonField, + private val gitAccountId: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun gitId(): Long = gitId.getRequired("gitId") + + fun dateConnected(): OffsetDateTime = dateConnected.getRequired("dateConnected") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun branch(): Optional = Optional.ofNullable(branch.getNullable("branch")) + + fun name(): String = name.getRequired("name") + + fun private_(): Boolean = private_.getRequired("private") + + fun slug(): String = slug.getRequired("slug") + + fun url(): String = url.getRequired("url") + + fun rootDir(): Optional = Optional.ofNullable(rootDir.getNullable("rootDir")) + + fun projectId(): String = projectId.getRequired("projectId") + + fun gitAccountId(): String = gitAccountId.getRequired("gitAccountId") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("gitId") @ExcludeMissing fun _gitId() = gitId + + @JsonProperty("dateConnected") @ExcludeMissing fun _dateConnected() = dateConnected + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("branch") @ExcludeMissing fun _branch() = branch + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("private") @ExcludeMissing fun _private_() = private_ + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("url") @ExcludeMissing fun _url() = url + + @JsonProperty("rootDir") @ExcludeMissing fun _rootDir() = rootDir + + @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + + @JsonProperty("gitAccountId") @ExcludeMissing fun _gitAccountId() = gitAccountId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): GitRepo = apply { + if (!validated) { + id() + gitId() + dateConnected() + dateUpdated() + branch() + name() + private_() + slug() + url() + rootDir() + projectId() + gitAccountId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var gitId: JsonField = JsonMissing.of() + private var dateConnected: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var branch: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var private_: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var url: JsonField = JsonMissing.of() + private var rootDir: JsonField = JsonMissing.of() + private var projectId: JsonField = JsonMissing.of() + private var gitAccountId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(gitRepo: GitRepo) = apply { + this.id = gitRepo.id + this.gitId = gitRepo.gitId + this.dateConnected = gitRepo.dateConnected + this.dateUpdated = gitRepo.dateUpdated + this.branch = gitRepo.branch + this.name = gitRepo.name + this.private_ = gitRepo.private_ + this.slug = gitRepo.slug + this.url = gitRepo.url + this.rootDir = gitRepo.rootDir + this.projectId = gitRepo.projectId + this.gitAccountId = gitRepo.gitAccountId + additionalProperties(gitRepo.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun gitId(gitId: Long) = gitId(JsonField.of(gitId)) + + @JsonProperty("gitId") + @ExcludeMissing + fun gitId(gitId: JsonField) = apply { this.gitId = gitId } + + fun dateConnected(dateConnected: OffsetDateTime) = + dateConnected(JsonField.of(dateConnected)) + + @JsonProperty("dateConnected") + @ExcludeMissing + fun dateConnected(dateConnected: JsonField) = apply { + this.dateConnected = dateConnected + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = + dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun branch(branch: String) = branch(JsonField.of(branch)) + + @JsonProperty("branch") + @ExcludeMissing + fun branch(branch: JsonField) = apply { this.branch = branch } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun private_(private_: Boolean) = private_(JsonField.of(private_)) + + @JsonProperty("private") + @ExcludeMissing + fun private_(private_: JsonField) = apply { this.private_ = private_ } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun url(url: String) = url(JsonField.of(url)) + + @JsonProperty("url") + @ExcludeMissing + fun url(url: JsonField) = apply { this.url = url } + + fun rootDir(rootDir: String) = rootDir(JsonField.of(rootDir)) + + @JsonProperty("rootDir") + @ExcludeMissing + fun rootDir(rootDir: JsonField) = apply { this.rootDir = rootDir } + + fun projectId(projectId: String) = projectId(JsonField.of(projectId)) + + @JsonProperty("projectId") + @ExcludeMissing + fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + + fun gitAccountId(gitAccountId: String) = gitAccountId(JsonField.of(gitAccountId)) + + @JsonProperty("gitAccountId") + @ExcludeMissing + fun gitAccountId(gitAccountId: JsonField) = apply { + this.gitAccountId = gitAccountId + } + + 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(): GitRepo = + GitRepo( + id, + gitId, + dateConnected, + dateUpdated, + branch, + name, + private_, + slug, + url, + rootDir, + projectId, + gitAccountId, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GitRepo && id == other.id && gitId == other.gitId && dateConnected == other.dateConnected && dateUpdated == other.dateUpdated && branch == other.branch && name == other.name && private_ == other.private_ && slug == other.slug && url == other.url && rootDir == other.rootDir && projectId == other.projectId && gitAccountId == other.gitAccountId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, gitId, dateConnected, dateUpdated, branch, name, private_, slug, url, rootDir, projectId, gitAccountId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GitRepo{id=$id, gitId=$gitId, dateConnected=$dateConnected, dateUpdated=$dateUpdated, branch=$branch, name=$name, private_=$private_, slug=$slug, url=$url, rootDir=$rootDir, projectId=$projectId, gitAccountId=$gitAccountId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Project && id == other.id && workspaceId == other.workspaceId && creatorId == other.creatorId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && description == other.description && source == other.source && taskType == other.taskType && versionCount == other.versionCount && inferencePipelineCount == other.inferencePipelineCount && goalCount == other.goalCount && developmentGoalCount == other.developmentGoalCount && monitoringGoalCount == other.monitoringGoalCount && links == other.links && gitRepo == other.gitRepo && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, workspaceId, creatorId, name, dateCreated, dateUpdated, description, source, taskType, versionCount, inferencePipelineCount, goalCount, developmentGoalCount, monitoringGoalCount, links, gitRepo, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Project{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}" + } + + @JsonDeserialize(builder = Workspace.Builder::class) + @NoAutoDetect + class Workspace + private constructor( + private val id: JsonField, + private val name: JsonField, + private val slug: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val creatorId: JsonField, + private val inviteCode: JsonField, + private val wildcardDomains: JsonField>, + private val projectCount: JsonField, + private val memberCount: JsonField, + private val monthlyUsage: JsonField>, + private val inviteCount: JsonField, + private val periodStartDate: JsonField, + private val periodEndDate: JsonField, + private val samlOnlyAccess: JsonField, + private val status: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun name(): String = name.getRequired("name") + + fun slug(): String = slug.getRequired("slug") + + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun creatorId(): Optional = Optional.ofNullable(creatorId.getNullable("creatorId")) + + fun inviteCode(): Optional = + Optional.ofNullable(inviteCode.getNullable("inviteCode")) + + fun wildcardDomains(): Optional> = + Optional.ofNullable(wildcardDomains.getNullable("wildcardDomains")) + + fun projectCount(): Long = projectCount.getRequired("projectCount") + + fun memberCount(): Long = memberCount.getRequired("memberCount") + + fun monthlyUsage(): Optional> = + Optional.ofNullable(monthlyUsage.getNullable("monthlyUsage")) + + fun inviteCount(): Long = inviteCount.getRequired("inviteCount") + + fun periodStartDate(): Optional = + Optional.ofNullable(periodStartDate.getNullable("periodStartDate")) + + fun periodEndDate(): Optional = + Optional.ofNullable(periodEndDate.getNullable("periodEndDate")) + + fun samlOnlyAccess(): Optional = + Optional.ofNullable(samlOnlyAccess.getNullable("samlOnlyAccess")) + + fun status(): Status = status.getRequired("status") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + @JsonProperty("inviteCode") @ExcludeMissing fun _inviteCode() = inviteCode + + @JsonProperty("wildcardDomains") @ExcludeMissing fun _wildcardDomains() = wildcardDomains + + @JsonProperty("projectCount") @ExcludeMissing fun _projectCount() = projectCount + + @JsonProperty("memberCount") @ExcludeMissing fun _memberCount() = memberCount + + @JsonProperty("monthlyUsage") @ExcludeMissing fun _monthlyUsage() = monthlyUsage + + @JsonProperty("inviteCount") @ExcludeMissing fun _inviteCount() = inviteCount + + @JsonProperty("periodStartDate") @ExcludeMissing fun _periodStartDate() = periodStartDate + + @JsonProperty("periodEndDate") @ExcludeMissing fun _periodEndDate() = periodEndDate + + @JsonProperty("samlOnlyAccess") @ExcludeMissing fun _samlOnlyAccess() = samlOnlyAccess + + @JsonProperty("status") @ExcludeMissing fun _status() = status + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Workspace = apply { + if (!validated) { + id() + name() + slug() + dateCreated() + dateUpdated() + creatorId() + inviteCode() + wildcardDomains() + projectCount() + memberCount() + monthlyUsage().map { it.forEach { it.validate() } } + inviteCount() + periodStartDate() + periodEndDate() + samlOnlyAccess() + status() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var inviteCode: JsonField = JsonMissing.of() + private var wildcardDomains: JsonField> = JsonMissing.of() + private var projectCount: JsonField = JsonMissing.of() + private var memberCount: JsonField = JsonMissing.of() + private var monthlyUsage: JsonField> = JsonMissing.of() + private var inviteCount: JsonField = JsonMissing.of() + private var periodStartDate: JsonField = JsonMissing.of() + private var periodEndDate: JsonField = JsonMissing.of() + private var samlOnlyAccess: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(workspace: Workspace) = apply { + this.id = workspace.id + this.name = workspace.name + this.slug = workspace.slug + this.dateCreated = workspace.dateCreated + this.dateUpdated = workspace.dateUpdated + this.creatorId = workspace.creatorId + this.inviteCode = workspace.inviteCode + this.wildcardDomains = workspace.wildcardDomains + this.projectCount = workspace.projectCount + this.memberCount = workspace.memberCount + this.monthlyUsage = workspace.monthlyUsage + this.inviteCount = workspace.inviteCount + this.periodStartDate = workspace.periodStartDate + this.periodEndDate = workspace.periodEndDate + this.samlOnlyAccess = workspace.samlOnlyAccess + this.status = workspace.status + additionalProperties(workspace.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + fun inviteCode(inviteCode: String) = inviteCode(JsonField.of(inviteCode)) + + @JsonProperty("inviteCode") + @ExcludeMissing + fun inviteCode(inviteCode: JsonField) = apply { this.inviteCode = inviteCode } + + fun wildcardDomains(wildcardDomains: List) = + wildcardDomains(JsonField.of(wildcardDomains)) + + @JsonProperty("wildcardDomains") + @ExcludeMissing + fun wildcardDomains(wildcardDomains: JsonField>) = apply { + this.wildcardDomains = wildcardDomains + } + + fun projectCount(projectCount: Long) = projectCount(JsonField.of(projectCount)) + + @JsonProperty("projectCount") + @ExcludeMissing + fun projectCount(projectCount: JsonField) = apply { + this.projectCount = projectCount + } + + fun memberCount(memberCount: Long) = memberCount(JsonField.of(memberCount)) + + @JsonProperty("memberCount") + @ExcludeMissing + fun memberCount(memberCount: JsonField) = apply { this.memberCount = memberCount } + + fun monthlyUsage(monthlyUsage: List) = + monthlyUsage(JsonField.of(monthlyUsage)) + + @JsonProperty("monthlyUsage") + @ExcludeMissing + fun monthlyUsage(monthlyUsage: JsonField>) = apply { + this.monthlyUsage = monthlyUsage + } + + fun inviteCount(inviteCount: Long) = inviteCount(JsonField.of(inviteCount)) + + @JsonProperty("inviteCount") + @ExcludeMissing + fun inviteCount(inviteCount: JsonField) = apply { this.inviteCount = inviteCount } + + fun periodStartDate(periodStartDate: OffsetDateTime) = + periodStartDate(JsonField.of(periodStartDate)) + + @JsonProperty("periodStartDate") + @ExcludeMissing + fun periodStartDate(periodStartDate: JsonField) = apply { + this.periodStartDate = periodStartDate + } + + fun periodEndDate(periodEndDate: OffsetDateTime) = + periodEndDate(JsonField.of(periodEndDate)) + + @JsonProperty("periodEndDate") + @ExcludeMissing + fun periodEndDate(periodEndDate: JsonField) = apply { + this.periodEndDate = periodEndDate + } + + fun samlOnlyAccess(samlOnlyAccess: Boolean) = + samlOnlyAccess(JsonField.of(samlOnlyAccess)) + + @JsonProperty("samlOnlyAccess") + @ExcludeMissing + fun samlOnlyAccess(samlOnlyAccess: JsonField) = apply { + this.samlOnlyAccess = samlOnlyAccess + } + + fun status(status: Status) = status(JsonField.of(status)) + + @JsonProperty("status") + @ExcludeMissing + fun status(status: JsonField) = apply { this.status = status } + + 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(): Workspace = + Workspace( + id, + name, + slug, + dateCreated, + dateUpdated, + creatorId, + inviteCode, + wildcardDomains.map { it.toImmutable() }, + projectCount, + memberCount, + monthlyUsage.map { it.toImmutable() }, + inviteCount, + periodStartDate, + periodEndDate, + samlOnlyAccess, + status, + additionalProperties.toImmutable(), + ) + } + + class Status + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val PAST_DUE = of("past_due") + + @JvmField val UNPAID = of("unpaid") + + @JvmField val CANCELED = of("canceled") + + @JvmField val INCOMPLETE = of("incomplete") + + @JvmField val INCOMPLETE_EXPIRED = of("incomplete_expired") + + @JvmField val TRIALING = of("trialing") + + @JvmField val PAUSED = of("paused") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + } + + enum class Value { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + PAST_DUE -> Value.PAST_DUE + UNPAID -> Value.UNPAID + CANCELED -> Value.CANCELED + INCOMPLETE -> Value.INCOMPLETE + INCOMPLETE_EXPIRED -> Value.INCOMPLETE_EXPIRED + TRIALING -> Value.TRIALING + PAUSED -> Value.PAUSED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + PAST_DUE -> Known.PAST_DUE + UNPAID -> Known.UNPAID + CANCELED -> Known.CANCELED + INCOMPLETE -> Known.INCOMPLETE + INCOMPLETE_EXPIRED -> Known.INCOMPLETE_EXPIRED + TRIALING -> Known.TRIALING + PAUSED -> Known.PAUSED + else -> throw OpenlayerInvalidDataException("Unknown Status: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = MonthlyUsage.Builder::class) + @NoAutoDetect + class MonthlyUsage + private constructor( + private val monthYear: JsonField, + private val predictionCount: JsonField, + private val executionTimeMs: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun monthYear(): Optional = + Optional.ofNullable(monthYear.getNullable("monthYear")) + + fun predictionCount(): Optional = + Optional.ofNullable(predictionCount.getNullable("predictionCount")) + + fun executionTimeMs(): Optional = + Optional.ofNullable(executionTimeMs.getNullable("executionTimeMs")) + + @JsonProperty("monthYear") @ExcludeMissing fun _monthYear() = monthYear + + @JsonProperty("predictionCount") + @ExcludeMissing + fun _predictionCount() = predictionCount + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun _executionTimeMs() = executionTimeMs + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): MonthlyUsage = apply { + if (!validated) { + monthYear() + predictionCount() + executionTimeMs() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var monthYear: JsonField = JsonMissing.of() + private var predictionCount: JsonField = JsonMissing.of() + private var executionTimeMs: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(monthlyUsage: MonthlyUsage) = apply { + this.monthYear = monthlyUsage.monthYear + this.predictionCount = monthlyUsage.predictionCount + this.executionTimeMs = monthlyUsage.executionTimeMs + additionalProperties(monthlyUsage.additionalProperties) + } + + fun monthYear(monthYear: LocalDate) = monthYear(JsonField.of(monthYear)) + + @JsonProperty("monthYear") + @ExcludeMissing + fun monthYear(monthYear: JsonField) = apply { + this.monthYear = monthYear + } + + fun predictionCount(predictionCount: Long) = + predictionCount(JsonField.of(predictionCount)) + + @JsonProperty("predictionCount") + @ExcludeMissing + fun predictionCount(predictionCount: JsonField) = apply { + this.predictionCount = predictionCount + } + + fun executionTimeMs(executionTimeMs: Long) = + executionTimeMs(JsonField.of(executionTimeMs)) + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun executionTimeMs(executionTimeMs: JsonField) = apply { + this.executionTimeMs = executionTimeMs + } + + 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(): MonthlyUsage = + MonthlyUsage( + monthYear, + predictionCount, + executionTimeMs, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MonthlyUsage && monthYear == other.monthYear && predictionCount == other.predictionCount && executionTimeMs == other.executionTimeMs && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(monthYear, predictionCount, executionTimeMs, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MonthlyUsage{monthYear=$monthYear, predictionCount=$predictionCount, executionTimeMs=$executionTimeMs, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Workspace && id == other.id && name == other.name && slug == other.slug && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && creatorId == other.creatorId && inviteCode == other.inviteCode && wildcardDomains == other.wildcardDomains && projectCount == other.projectCount && memberCount == other.memberCount && monthlyUsage == other.monthlyUsage && inviteCount == other.inviteCount && periodStartDate == other.periodStartDate && periodEndDate == other.periodEndDate && samlOnlyAccess == other.samlOnlyAccess && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, name, slug, dateCreated, dateUpdated, creatorId, inviteCode, wildcardDomains, projectCount, memberCount, monthlyUsage, inviteCount, periodStartDate, periodEndDate, samlOnlyAccess, status, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Workspace{id=$id, name=$name, slug=$slug, dateCreated=$dateCreated, dateUpdated=$dateUpdated, creatorId=$creatorId, inviteCode=$inviteCode, wildcardDomains=$wildcardDomains, projectCount=$projectCount, memberCount=$memberCount, monthlyUsage=$monthlyUsage, inviteCount=$inviteCount, periodStartDate=$periodStartDate, periodEndDate=$periodEndDate, samlOnlyAccess=$samlOnlyAccess, status=$status, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is InferencePipelineRetrieveResponse && id == other.id && projectId == other.projectId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is InferencePipelineRetrieveResponse && id == other.id && projectId == other.projectId && workspaceId == other.workspaceId && project == other.project && workspace == other.workspace && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, projectId, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, projectId, workspaceId, project, workspace, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "InferencePipelineRetrieveResponse{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" + "InferencePipelineRetrieveResponse{id=$id, projectId=$projectId, workspaceId=$workspaceId, project=$project, workspace=$workspace, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponse.kt index 3c952f1..b570b22 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponse.kt @@ -15,6 +15,7 @@ import com.openlayer.api.core.JsonValue import com.openlayer.api.core.NoAutoDetect import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.LocalDate import java.time.OffsetDateTime import java.util.Objects import java.util.Optional @@ -25,6 +26,9 @@ class InferencePipelineUpdateResponse private constructor( private val id: JsonField, private val projectId: JsonField, + private val workspaceId: JsonField, + private val project: JsonField, + private val workspace: JsonField, private val name: JsonField, private val dateCreated: JsonField, private val dateUpdated: JsonField, @@ -49,6 +53,14 @@ private constructor( /** The project id. */ fun projectId(): String = projectId.getRequired("projectId") + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + fun project(): Optional = Optional.ofNullable(project.getNullable("project")) + + fun workspace(): Optional = Optional.ofNullable(workspace.getNullable("workspace")) + /** The inference pipeline name. */ fun name(): String = name.getRequired("name") @@ -98,6 +110,13 @@ private constructor( /** The project id. */ @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + @JsonProperty("project") @ExcludeMissing fun _project() = project + + @JsonProperty("workspace") @ExcludeMissing fun _workspace() = workspace + /** The inference pipeline name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -148,6 +167,9 @@ private constructor( if (!validated) { id() projectId() + workspaceId() + project().map { it.validate() } + workspace().map { it.validate() } name() dateCreated() dateUpdated() @@ -176,6 +198,9 @@ private constructor( private var id: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var project: JsonField = JsonMissing.of() + private var workspace: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var dateCreated: JsonField = JsonMissing.of() private var dateUpdated: JsonField = JsonMissing.of() @@ -196,6 +221,9 @@ private constructor( apply { this.id = inferencePipelineUpdateResponse.id this.projectId = inferencePipelineUpdateResponse.projectId + this.workspaceId = inferencePipelineUpdateResponse.workspaceId + this.project = inferencePipelineUpdateResponse.project + this.workspace = inferencePipelineUpdateResponse.workspace this.name = inferencePipelineUpdateResponse.name this.dateCreated = inferencePipelineUpdateResponse.dateCreated this.dateUpdated = inferencePipelineUpdateResponse.dateUpdated @@ -226,6 +254,26 @@ private constructor( @ExcludeMissing fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId } + + fun project(project: Project) = project(JsonField.of(project)) + + @JsonProperty("project") + @ExcludeMissing + fun project(project: JsonField) = apply { this.project = project } + + fun workspace(workspace: Workspace) = workspace(JsonField.of(workspace)) + + @JsonProperty("workspace") + @ExcludeMissing + fun workspace(workspace: JsonField) = apply { this.workspace = workspace } + /** The inference pipeline name. */ fun name(name: String) = name(JsonField.of(name)) @@ -369,6 +417,9 @@ private constructor( InferencePipelineUpdateResponse( id, projectId, + workspaceId, + project, + workspace, name, dateCreated, dateUpdated, @@ -550,20 +601,1467 @@ private constructor( override fun toString() = value.toString() } + @JsonDeserialize(builder = Project.Builder::class) + @NoAutoDetect + class Project + private constructor( + private val id: JsonField, + private val workspaceId: JsonField, + private val creatorId: JsonField, + private val name: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val description: JsonField, + private val source: JsonField, + private val taskType: JsonField, + private val versionCount: JsonField, + private val inferencePipelineCount: JsonField, + private val goalCount: JsonField, + private val developmentGoalCount: JsonField, + private val monitoringGoalCount: JsonField, + private val links: JsonField, + private val gitRepo: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The project id. */ + fun id(): String = id.getRequired("id") + + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + /** The project creator id. */ + fun creatorId(): Optional = Optional.ofNullable(creatorId.getNullable("creatorId")) + + /** The project name. */ + fun name(): String = name.getRequired("name") + + /** The project creation date. */ + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + /** The project last updated date. */ + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** The project description. */ + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) + + /** The source of the project. */ + fun source(): Optional = Optional.ofNullable(source.getNullable("source")) + + /** The task type of the project. */ + fun taskType(): TaskType = taskType.getRequired("taskType") + + /** The number of versions (commits) in the project. */ + fun versionCount(): Long = versionCount.getRequired("versionCount") + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(): Long = + inferencePipelineCount.getRequired("inferencePipelineCount") + + /** The total number of tests in the project. */ + fun goalCount(): Long = goalCount.getRequired("goalCount") + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(): Long = developmentGoalCount.getRequired("developmentGoalCount") + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") + + /** Links to the project. */ + fun links(): Links = links.getRequired("links") + + fun gitRepo(): Optional = Optional.ofNullable(gitRepo.getNullable("gitRepo")) + + /** The project id. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + /** The project creator id. */ + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + /** The project name. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The project creation date. */ + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + /** The project last updated date. */ + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + /** The project description. */ + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** The source of the project. */ + @JsonProperty("source") @ExcludeMissing fun _source() = source + + /** The task type of the project. */ + @JsonProperty("taskType") @ExcludeMissing fun _taskType() = taskType + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") @ExcludeMissing fun _versionCount() = versionCount + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun _inferencePipelineCount() = inferencePipelineCount + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") @ExcludeMissing fun _goalCount() = goalCount + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun _developmentGoalCount() = developmentGoalCount + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun _monitoringGoalCount() = monitoringGoalCount + + /** Links to the project. */ + @JsonProperty("links") @ExcludeMissing fun _links() = links + + @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo() = gitRepo + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Project = apply { + if (!validated) { + id() + workspaceId() + creatorId() + name() + dateCreated() + dateUpdated() + description() + source() + taskType() + versionCount() + inferencePipelineCount() + goalCount() + developmentGoalCount() + monitoringGoalCount() + links().validate() + gitRepo().map { it.validate() } + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() + private var taskType: JsonField = JsonMissing.of() + private var versionCount: JsonField = JsonMissing.of() + private var inferencePipelineCount: JsonField = JsonMissing.of() + private var goalCount: JsonField = JsonMissing.of() + private var developmentGoalCount: JsonField = JsonMissing.of() + private var monitoringGoalCount: JsonField = JsonMissing.of() + private var links: JsonField = JsonMissing.of() + private var gitRepo: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(project: Project) = apply { + this.id = project.id + this.workspaceId = project.workspaceId + this.creatorId = project.creatorId + this.name = project.name + this.dateCreated = project.dateCreated + this.dateUpdated = project.dateUpdated + this.description = project.description + this.source = project.source + this.taskType = project.taskType + this.versionCount = project.versionCount + this.inferencePipelineCount = project.inferencePipelineCount + this.goalCount = project.goalCount + this.developmentGoalCount = project.developmentGoalCount + this.monitoringGoalCount = project.monitoringGoalCount + this.links = project.links + this.gitRepo = project.gitRepo + additionalProperties(project.additionalProperties) + } + + /** The project id. */ + fun id(id: String) = id(JsonField.of(id)) + + /** The project id. */ + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { + this.workspaceId = workspaceId + } + + /** The project creator id. */ + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + /** The project creator id. */ + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + /** The project name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The project name. */ + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + /** The project creation date. */ + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + /** The project creation date. */ + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + /** The project last updated date. */ + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + /** The project last updated date. */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + /** The project description. */ + fun description(description: String) = description(JsonField.of(description)) + + /** The project description. */ + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { + this.description = description + } + + /** The source of the project. */ + fun source(source: Source) = source(JsonField.of(source)) + + /** The source of the project. */ + @JsonProperty("source") + @ExcludeMissing + fun source(source: JsonField) = apply { this.source = source } + + /** The task type of the project. */ + fun taskType(taskType: TaskType) = taskType(JsonField.of(taskType)) + + /** The task type of the project. */ + @JsonProperty("taskType") + @ExcludeMissing + fun taskType(taskType: JsonField) = apply { this.taskType = taskType } + + /** The number of versions (commits) in the project. */ + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") + @ExcludeMissing + fun versionCount(versionCount: JsonField) = apply { + this.versionCount = versionCount + } + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(inferencePipelineCount: Long) = + inferencePipelineCount(JsonField.of(inferencePipelineCount)) + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun inferencePipelineCount(inferencePipelineCount: JsonField) = apply { + this.inferencePipelineCount = inferencePipelineCount + } + + /** The total number of tests in the project. */ + fun goalCount(goalCount: Long) = goalCount(JsonField.of(goalCount)) + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") + @ExcludeMissing + fun goalCount(goalCount: JsonField) = apply { this.goalCount = goalCount } + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(developmentGoalCount: Long) = + developmentGoalCount(JsonField.of(developmentGoalCount)) + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun developmentGoalCount(developmentGoalCount: JsonField) = apply { + this.developmentGoalCount = developmentGoalCount + } + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(monitoringGoalCount: Long) = + monitoringGoalCount(JsonField.of(monitoringGoalCount)) + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun monitoringGoalCount(monitoringGoalCount: JsonField) = apply { + this.monitoringGoalCount = monitoringGoalCount + } + + /** Links to the project. */ + fun links(links: Links) = links(JsonField.of(links)) + + /** Links to the project. */ + @JsonProperty("links") + @ExcludeMissing + fun links(links: JsonField) = apply { this.links = links } + + fun gitRepo(gitRepo: GitRepo) = gitRepo(JsonField.of(gitRepo)) + + @JsonProperty("gitRepo") + @ExcludeMissing + fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + + 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(): Project = + Project( + id, + workspaceId, + creatorId, + name, + dateCreated, + dateUpdated, + description, + source, + taskType, + versionCount, + inferencePipelineCount, + goalCount, + developmentGoalCount, + monitoringGoalCount, + links, + gitRepo, + additionalProperties.toImmutable(), + ) + } + + /** Links to the project. */ + @JsonDeserialize(builder = Links.Builder::class) + @NoAutoDetect + class Links + private constructor( + private val app: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + 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) + + 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.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Links && app == other.app && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(app, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" + } + + class Source + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val WEB = of("web") + + @JvmField val API = of("api") + + @JvmField val NULL = of("null") + + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) + } + + enum class Known { + WEB, + API, + NULL, + } + + enum class Value { + WEB, + API, + NULL, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + WEB -> Value.WEB + API -> Value.API + NULL -> Value.NULL + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + WEB -> Known.WEB + API -> Known.API + NULL -> Known.NULL + else -> throw OpenlayerInvalidDataException("Unknown Source: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Source && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class TaskType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LLM_BASE = of("llm-base") + + @JvmField val TABULAR_CLASSIFICATION = of("tabular-classification") + + @JvmField val TABULAR_REGRESSION = of("tabular-regression") + + @JvmField val TEXT_CLASSIFICATION = of("text-classification") + + @JvmStatic fun of(value: String) = TaskType(JsonField.of(value)) + } + + enum class Known { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + } + + enum class Value { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + LLM_BASE -> Value.LLM_BASE + TABULAR_CLASSIFICATION -> Value.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Value.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Value.TEXT_CLASSIFICATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + LLM_BASE -> Known.LLM_BASE + TABULAR_CLASSIFICATION -> Known.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Known.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Known.TEXT_CLASSIFICATION + else -> throw OpenlayerInvalidDataException("Unknown TaskType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is TaskType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = GitRepo.Builder::class) + @NoAutoDetect + class GitRepo + private constructor( + private val id: JsonField, + private val gitId: JsonField, + private val dateConnected: JsonField, + private val dateUpdated: JsonField, + private val branch: JsonField, + private val name: JsonField, + private val private_: JsonField, + private val slug: JsonField, + private val url: JsonField, + private val rootDir: JsonField, + private val projectId: JsonField, + private val gitAccountId: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun gitId(): Long = gitId.getRequired("gitId") + + fun dateConnected(): OffsetDateTime = dateConnected.getRequired("dateConnected") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun branch(): Optional = Optional.ofNullable(branch.getNullable("branch")) + + fun name(): String = name.getRequired("name") + + fun private_(): Boolean = private_.getRequired("private") + + fun slug(): String = slug.getRequired("slug") + + fun url(): String = url.getRequired("url") + + fun rootDir(): Optional = Optional.ofNullable(rootDir.getNullable("rootDir")) + + fun projectId(): String = projectId.getRequired("projectId") + + fun gitAccountId(): String = gitAccountId.getRequired("gitAccountId") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("gitId") @ExcludeMissing fun _gitId() = gitId + + @JsonProperty("dateConnected") @ExcludeMissing fun _dateConnected() = dateConnected + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("branch") @ExcludeMissing fun _branch() = branch + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("private") @ExcludeMissing fun _private_() = private_ + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("url") @ExcludeMissing fun _url() = url + + @JsonProperty("rootDir") @ExcludeMissing fun _rootDir() = rootDir + + @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + + @JsonProperty("gitAccountId") @ExcludeMissing fun _gitAccountId() = gitAccountId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): GitRepo = apply { + if (!validated) { + id() + gitId() + dateConnected() + dateUpdated() + branch() + name() + private_() + slug() + url() + rootDir() + projectId() + gitAccountId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var gitId: JsonField = JsonMissing.of() + private var dateConnected: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var branch: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var private_: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var url: JsonField = JsonMissing.of() + private var rootDir: JsonField = JsonMissing.of() + private var projectId: JsonField = JsonMissing.of() + private var gitAccountId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(gitRepo: GitRepo) = apply { + this.id = gitRepo.id + this.gitId = gitRepo.gitId + this.dateConnected = gitRepo.dateConnected + this.dateUpdated = gitRepo.dateUpdated + this.branch = gitRepo.branch + this.name = gitRepo.name + this.private_ = gitRepo.private_ + this.slug = gitRepo.slug + this.url = gitRepo.url + this.rootDir = gitRepo.rootDir + this.projectId = gitRepo.projectId + this.gitAccountId = gitRepo.gitAccountId + additionalProperties(gitRepo.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun gitId(gitId: Long) = gitId(JsonField.of(gitId)) + + @JsonProperty("gitId") + @ExcludeMissing + fun gitId(gitId: JsonField) = apply { this.gitId = gitId } + + fun dateConnected(dateConnected: OffsetDateTime) = + dateConnected(JsonField.of(dateConnected)) + + @JsonProperty("dateConnected") + @ExcludeMissing + fun dateConnected(dateConnected: JsonField) = apply { + this.dateConnected = dateConnected + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = + dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun branch(branch: String) = branch(JsonField.of(branch)) + + @JsonProperty("branch") + @ExcludeMissing + fun branch(branch: JsonField) = apply { this.branch = branch } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun private_(private_: Boolean) = private_(JsonField.of(private_)) + + @JsonProperty("private") + @ExcludeMissing + fun private_(private_: JsonField) = apply { this.private_ = private_ } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun url(url: String) = url(JsonField.of(url)) + + @JsonProperty("url") + @ExcludeMissing + fun url(url: JsonField) = apply { this.url = url } + + fun rootDir(rootDir: String) = rootDir(JsonField.of(rootDir)) + + @JsonProperty("rootDir") + @ExcludeMissing + fun rootDir(rootDir: JsonField) = apply { this.rootDir = rootDir } + + fun projectId(projectId: String) = projectId(JsonField.of(projectId)) + + @JsonProperty("projectId") + @ExcludeMissing + fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + + fun gitAccountId(gitAccountId: String) = gitAccountId(JsonField.of(gitAccountId)) + + @JsonProperty("gitAccountId") + @ExcludeMissing + fun gitAccountId(gitAccountId: JsonField) = apply { + this.gitAccountId = gitAccountId + } + + 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(): GitRepo = + GitRepo( + id, + gitId, + dateConnected, + dateUpdated, + branch, + name, + private_, + slug, + url, + rootDir, + projectId, + gitAccountId, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GitRepo && id == other.id && gitId == other.gitId && dateConnected == other.dateConnected && dateUpdated == other.dateUpdated && branch == other.branch && name == other.name && private_ == other.private_ && slug == other.slug && url == other.url && rootDir == other.rootDir && projectId == other.projectId && gitAccountId == other.gitAccountId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, gitId, dateConnected, dateUpdated, branch, name, private_, slug, url, rootDir, projectId, gitAccountId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GitRepo{id=$id, gitId=$gitId, dateConnected=$dateConnected, dateUpdated=$dateUpdated, branch=$branch, name=$name, private_=$private_, slug=$slug, url=$url, rootDir=$rootDir, projectId=$projectId, gitAccountId=$gitAccountId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Project && id == other.id && workspaceId == other.workspaceId && creatorId == other.creatorId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && description == other.description && source == other.source && taskType == other.taskType && versionCount == other.versionCount && inferencePipelineCount == other.inferencePipelineCount && goalCount == other.goalCount && developmentGoalCount == other.developmentGoalCount && monitoringGoalCount == other.monitoringGoalCount && links == other.links && gitRepo == other.gitRepo && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, workspaceId, creatorId, name, dateCreated, dateUpdated, description, source, taskType, versionCount, inferencePipelineCount, goalCount, developmentGoalCount, monitoringGoalCount, links, gitRepo, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Project{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}" + } + + @JsonDeserialize(builder = Workspace.Builder::class) + @NoAutoDetect + class Workspace + private constructor( + private val id: JsonField, + private val name: JsonField, + private val slug: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val creatorId: JsonField, + private val inviteCode: JsonField, + private val wildcardDomains: JsonField>, + private val projectCount: JsonField, + private val memberCount: JsonField, + private val monthlyUsage: JsonField>, + private val inviteCount: JsonField, + private val periodStartDate: JsonField, + private val periodEndDate: JsonField, + private val samlOnlyAccess: JsonField, + private val status: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun name(): String = name.getRequired("name") + + fun slug(): String = slug.getRequired("slug") + + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun creatorId(): Optional = Optional.ofNullable(creatorId.getNullable("creatorId")) + + fun inviteCode(): Optional = + Optional.ofNullable(inviteCode.getNullable("inviteCode")) + + fun wildcardDomains(): Optional> = + Optional.ofNullable(wildcardDomains.getNullable("wildcardDomains")) + + fun projectCount(): Long = projectCount.getRequired("projectCount") + + fun memberCount(): Long = memberCount.getRequired("memberCount") + + fun monthlyUsage(): Optional> = + Optional.ofNullable(monthlyUsage.getNullable("monthlyUsage")) + + fun inviteCount(): Long = inviteCount.getRequired("inviteCount") + + fun periodStartDate(): Optional = + Optional.ofNullable(periodStartDate.getNullable("periodStartDate")) + + fun periodEndDate(): Optional = + Optional.ofNullable(periodEndDate.getNullable("periodEndDate")) + + fun samlOnlyAccess(): Optional = + Optional.ofNullable(samlOnlyAccess.getNullable("samlOnlyAccess")) + + fun status(): Status = status.getRequired("status") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + @JsonProperty("inviteCode") @ExcludeMissing fun _inviteCode() = inviteCode + + @JsonProperty("wildcardDomains") @ExcludeMissing fun _wildcardDomains() = wildcardDomains + + @JsonProperty("projectCount") @ExcludeMissing fun _projectCount() = projectCount + + @JsonProperty("memberCount") @ExcludeMissing fun _memberCount() = memberCount + + @JsonProperty("monthlyUsage") @ExcludeMissing fun _monthlyUsage() = monthlyUsage + + @JsonProperty("inviteCount") @ExcludeMissing fun _inviteCount() = inviteCount + + @JsonProperty("periodStartDate") @ExcludeMissing fun _periodStartDate() = periodStartDate + + @JsonProperty("periodEndDate") @ExcludeMissing fun _periodEndDate() = periodEndDate + + @JsonProperty("samlOnlyAccess") @ExcludeMissing fun _samlOnlyAccess() = samlOnlyAccess + + @JsonProperty("status") @ExcludeMissing fun _status() = status + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Workspace = apply { + if (!validated) { + id() + name() + slug() + dateCreated() + dateUpdated() + creatorId() + inviteCode() + wildcardDomains() + projectCount() + memberCount() + monthlyUsage().map { it.forEach { it.validate() } } + inviteCount() + periodStartDate() + periodEndDate() + samlOnlyAccess() + status() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var inviteCode: JsonField = JsonMissing.of() + private var wildcardDomains: JsonField> = JsonMissing.of() + private var projectCount: JsonField = JsonMissing.of() + private var memberCount: JsonField = JsonMissing.of() + private var monthlyUsage: JsonField> = JsonMissing.of() + private var inviteCount: JsonField = JsonMissing.of() + private var periodStartDate: JsonField = JsonMissing.of() + private var periodEndDate: JsonField = JsonMissing.of() + private var samlOnlyAccess: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(workspace: Workspace) = apply { + this.id = workspace.id + this.name = workspace.name + this.slug = workspace.slug + this.dateCreated = workspace.dateCreated + this.dateUpdated = workspace.dateUpdated + this.creatorId = workspace.creatorId + this.inviteCode = workspace.inviteCode + this.wildcardDomains = workspace.wildcardDomains + this.projectCount = workspace.projectCount + this.memberCount = workspace.memberCount + this.monthlyUsage = workspace.monthlyUsage + this.inviteCount = workspace.inviteCount + this.periodStartDate = workspace.periodStartDate + this.periodEndDate = workspace.periodEndDate + this.samlOnlyAccess = workspace.samlOnlyAccess + this.status = workspace.status + additionalProperties(workspace.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + fun inviteCode(inviteCode: String) = inviteCode(JsonField.of(inviteCode)) + + @JsonProperty("inviteCode") + @ExcludeMissing + fun inviteCode(inviteCode: JsonField) = apply { this.inviteCode = inviteCode } + + fun wildcardDomains(wildcardDomains: List) = + wildcardDomains(JsonField.of(wildcardDomains)) + + @JsonProperty("wildcardDomains") + @ExcludeMissing + fun wildcardDomains(wildcardDomains: JsonField>) = apply { + this.wildcardDomains = wildcardDomains + } + + fun projectCount(projectCount: Long) = projectCount(JsonField.of(projectCount)) + + @JsonProperty("projectCount") + @ExcludeMissing + fun projectCount(projectCount: JsonField) = apply { + this.projectCount = projectCount + } + + fun memberCount(memberCount: Long) = memberCount(JsonField.of(memberCount)) + + @JsonProperty("memberCount") + @ExcludeMissing + fun memberCount(memberCount: JsonField) = apply { this.memberCount = memberCount } + + fun monthlyUsage(monthlyUsage: List) = + monthlyUsage(JsonField.of(monthlyUsage)) + + @JsonProperty("monthlyUsage") + @ExcludeMissing + fun monthlyUsage(monthlyUsage: JsonField>) = apply { + this.monthlyUsage = monthlyUsage + } + + fun inviteCount(inviteCount: Long) = inviteCount(JsonField.of(inviteCount)) + + @JsonProperty("inviteCount") + @ExcludeMissing + fun inviteCount(inviteCount: JsonField) = apply { this.inviteCount = inviteCount } + + fun periodStartDate(periodStartDate: OffsetDateTime) = + periodStartDate(JsonField.of(periodStartDate)) + + @JsonProperty("periodStartDate") + @ExcludeMissing + fun periodStartDate(periodStartDate: JsonField) = apply { + this.periodStartDate = periodStartDate + } + + fun periodEndDate(periodEndDate: OffsetDateTime) = + periodEndDate(JsonField.of(periodEndDate)) + + @JsonProperty("periodEndDate") + @ExcludeMissing + fun periodEndDate(periodEndDate: JsonField) = apply { + this.periodEndDate = periodEndDate + } + + fun samlOnlyAccess(samlOnlyAccess: Boolean) = + samlOnlyAccess(JsonField.of(samlOnlyAccess)) + + @JsonProperty("samlOnlyAccess") + @ExcludeMissing + fun samlOnlyAccess(samlOnlyAccess: JsonField) = apply { + this.samlOnlyAccess = samlOnlyAccess + } + + fun status(status: Status) = status(JsonField.of(status)) + + @JsonProperty("status") + @ExcludeMissing + fun status(status: JsonField) = apply { this.status = status } + + 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(): Workspace = + Workspace( + id, + name, + slug, + dateCreated, + dateUpdated, + creatorId, + inviteCode, + wildcardDomains.map { it.toImmutable() }, + projectCount, + memberCount, + monthlyUsage.map { it.toImmutable() }, + inviteCount, + periodStartDate, + periodEndDate, + samlOnlyAccess, + status, + additionalProperties.toImmutable(), + ) + } + + class Status + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val PAST_DUE = of("past_due") + + @JvmField val UNPAID = of("unpaid") + + @JvmField val CANCELED = of("canceled") + + @JvmField val INCOMPLETE = of("incomplete") + + @JvmField val INCOMPLETE_EXPIRED = of("incomplete_expired") + + @JvmField val TRIALING = of("trialing") + + @JvmField val PAUSED = of("paused") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + } + + enum class Value { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + PAST_DUE -> Value.PAST_DUE + UNPAID -> Value.UNPAID + CANCELED -> Value.CANCELED + INCOMPLETE -> Value.INCOMPLETE + INCOMPLETE_EXPIRED -> Value.INCOMPLETE_EXPIRED + TRIALING -> Value.TRIALING + PAUSED -> Value.PAUSED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + PAST_DUE -> Known.PAST_DUE + UNPAID -> Known.UNPAID + CANCELED -> Known.CANCELED + INCOMPLETE -> Known.INCOMPLETE + INCOMPLETE_EXPIRED -> Known.INCOMPLETE_EXPIRED + TRIALING -> Known.TRIALING + PAUSED -> Known.PAUSED + else -> throw OpenlayerInvalidDataException("Unknown Status: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = MonthlyUsage.Builder::class) + @NoAutoDetect + class MonthlyUsage + private constructor( + private val monthYear: JsonField, + private val predictionCount: JsonField, + private val executionTimeMs: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun monthYear(): Optional = + Optional.ofNullable(monthYear.getNullable("monthYear")) + + fun predictionCount(): Optional = + Optional.ofNullable(predictionCount.getNullable("predictionCount")) + + fun executionTimeMs(): Optional = + Optional.ofNullable(executionTimeMs.getNullable("executionTimeMs")) + + @JsonProperty("monthYear") @ExcludeMissing fun _monthYear() = monthYear + + @JsonProperty("predictionCount") + @ExcludeMissing + fun _predictionCount() = predictionCount + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun _executionTimeMs() = executionTimeMs + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): MonthlyUsage = apply { + if (!validated) { + monthYear() + predictionCount() + executionTimeMs() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var monthYear: JsonField = JsonMissing.of() + private var predictionCount: JsonField = JsonMissing.of() + private var executionTimeMs: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(monthlyUsage: MonthlyUsage) = apply { + this.monthYear = monthlyUsage.monthYear + this.predictionCount = monthlyUsage.predictionCount + this.executionTimeMs = monthlyUsage.executionTimeMs + additionalProperties(monthlyUsage.additionalProperties) + } + + fun monthYear(monthYear: LocalDate) = monthYear(JsonField.of(monthYear)) + + @JsonProperty("monthYear") + @ExcludeMissing + fun monthYear(monthYear: JsonField) = apply { + this.monthYear = monthYear + } + + fun predictionCount(predictionCount: Long) = + predictionCount(JsonField.of(predictionCount)) + + @JsonProperty("predictionCount") + @ExcludeMissing + fun predictionCount(predictionCount: JsonField) = apply { + this.predictionCount = predictionCount + } + + fun executionTimeMs(executionTimeMs: Long) = + executionTimeMs(JsonField.of(executionTimeMs)) + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun executionTimeMs(executionTimeMs: JsonField) = apply { + this.executionTimeMs = executionTimeMs + } + + 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(): MonthlyUsage = + MonthlyUsage( + monthYear, + predictionCount, + executionTimeMs, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MonthlyUsage && monthYear == other.monthYear && predictionCount == other.predictionCount && executionTimeMs == other.executionTimeMs && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(monthYear, predictionCount, executionTimeMs, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MonthlyUsage{monthYear=$monthYear, predictionCount=$predictionCount, executionTimeMs=$executionTimeMs, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Workspace && id == other.id && name == other.name && slug == other.slug && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && creatorId == other.creatorId && inviteCode == other.inviteCode && wildcardDomains == other.wildcardDomains && projectCount == other.projectCount && memberCount == other.memberCount && monthlyUsage == other.monthlyUsage && inviteCount == other.inviteCount && periodStartDate == other.periodStartDate && periodEndDate == other.periodEndDate && samlOnlyAccess == other.samlOnlyAccess && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, name, slug, dateCreated, dateUpdated, creatorId, inviteCode, wildcardDomains, projectCount, memberCount, monthlyUsage, inviteCount, periodStartDate, periodEndDate, samlOnlyAccess, status, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Workspace{id=$id, name=$name, slug=$slug, dateCreated=$dateCreated, dateUpdated=$dateUpdated, creatorId=$creatorId, inviteCode=$inviteCode, wildcardDomains=$wildcardDomains, projectCount=$projectCount, memberCount=$memberCount, monthlyUsage=$monthlyUsage, inviteCount=$inviteCount, periodStartDate=$periodStartDate, periodEndDate=$periodEndDate, samlOnlyAccess=$samlOnlyAccess, status=$status, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is InferencePipelineUpdateResponse && id == other.id && projectId == other.projectId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is InferencePipelineUpdateResponse && id == other.id && projectId == other.projectId && workspaceId == other.workspaceId && project == other.project && workspace == other.workspace && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, projectId, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, projectId, workspaceId, project, workspace, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "InferencePipelineUpdateResponse{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" + "InferencePipelineUpdateResponse{id=$id, projectId=$projectId, workspaceId=$workspaceId, project=$project, workspace=$workspace, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt index 90e35ca..39cf115 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParams.kt @@ -16,6 +16,8 @@ import com.openlayer.api.core.http.Headers import com.openlayer.api.core.http.QueryParams import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.LocalDate +import java.time.OffsetDateTime import java.util.Objects import java.util.Optional @@ -24,6 +26,8 @@ constructor( private val projectId: String, private val description: String?, private val name: String, + private val project: Project?, + private val workspace: Workspace?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -35,6 +39,10 @@ constructor( fun name(): String = name + fun project(): Optional = Optional.ofNullable(project) + + fun workspace(): Optional = Optional.ofNullable(workspace) + fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams @@ -46,6 +54,8 @@ constructor( return ProjectInferencePipelineCreateBody( description, name, + project, + workspace, additionalBodyProperties, ) } @@ -67,6 +77,8 @@ constructor( internal constructor( private val description: String?, private val name: String?, + private val project: Project?, + private val workspace: Workspace?, private val additionalProperties: Map, ) { @@ -76,6 +88,10 @@ constructor( /** The inference pipeline name. */ @JsonProperty("name") fun name(): String? = name + @JsonProperty("project") fun project(): Project? = project + + @JsonProperty("workspace") fun workspace(): Workspace? = workspace + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -91,6 +107,8 @@ constructor( private var description: String? = null private var name: String? = null + private var project: Project? = null + private var workspace: Workspace? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -99,6 +117,8 @@ constructor( ) = apply { this.description = projectInferencePipelineCreateBody.description this.name = projectInferencePipelineCreateBody.name + this.project = projectInferencePipelineCreateBody.project + this.workspace = projectInferencePipelineCreateBody.workspace additionalProperties(projectInferencePipelineCreateBody.additionalProperties) } @@ -109,6 +129,12 @@ constructor( /** The inference pipeline name. */ @JsonProperty("name") fun name(name: String) = apply { this.name = name } + @JsonProperty("project") + fun project(project: Project) = apply { this.project = project } + + @JsonProperty("workspace") + fun workspace(workspace: Workspace) = apply { this.workspace = workspace } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -127,6 +153,8 @@ constructor( ProjectInferencePipelineCreateBody( description, checkNotNull(name) { "`name` is required but was not set" }, + project, + workspace, additionalProperties.toImmutable(), ) } @@ -136,17 +164,17 @@ constructor( return true } - return /* spotless:off */ other is ProjectInferencePipelineCreateBody && description == other.description && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ProjectInferencePipelineCreateBody && description == other.description && name == other.name && project == other.project && workspace == other.workspace && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(description, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(description, name, project, workspace, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ProjectInferencePipelineCreateBody{description=$description, name=$name, additionalProperties=$additionalProperties}" + "ProjectInferencePipelineCreateBody{description=$description, name=$name, project=$project, workspace=$workspace, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -162,6 +190,8 @@ constructor( private var projectId: String? = null private var description: String? = null private var name: String? = null + private var project: Project? = null + private var workspace: Workspace? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -173,6 +203,8 @@ constructor( projectId = projectInferencePipelineCreateParams.projectId description = projectInferencePipelineCreateParams.description name = projectInferencePipelineCreateParams.name + project = projectInferencePipelineCreateParams.project + workspace = projectInferencePipelineCreateParams.workspace additionalHeaders = projectInferencePipelineCreateParams.additionalHeaders.toBuilder() additionalQueryParams = projectInferencePipelineCreateParams.additionalQueryParams.toBuilder() @@ -188,6 +220,10 @@ constructor( /** The inference pipeline name. */ fun name(name: String) = apply { this.name = name } + fun project(project: Project) = apply { this.project = project } + + fun workspace(workspace: Workspace) = apply { this.workspace = workspace } + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -313,6 +349,8 @@ constructor( checkNotNull(projectId) { "`projectId` is required but was not set" }, description, checkNotNull(name) { "`name` is required but was not set" }, + project, + workspace, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -472,16 +510,1050 @@ constructor( override fun toString() = value.toString() } + @JsonDeserialize(builder = Project.Builder::class) + @NoAutoDetect + class Project + private constructor( + private val id: String?, + private val workspaceId: String?, + private val creatorId: String?, + private val name: String?, + private val dateCreated: OffsetDateTime?, + private val dateUpdated: OffsetDateTime?, + private val description: String?, + private val source: Source?, + private val taskType: TaskType?, + private val versionCount: Long?, + private val inferencePipelineCount: Long?, + private val goalCount: Long?, + private val developmentGoalCount: Long?, + private val monitoringGoalCount: Long?, + private val links: Links?, + private val gitRepo: GitRepo?, + private val additionalProperties: Map, + ) { + + /** The project id. */ + @JsonProperty("id") fun id(): String? = id + + /** The workspace id. */ + @JsonProperty("workspaceId") fun workspaceId(): String? = workspaceId + + /** The project creator id. */ + @JsonProperty("creatorId") fun creatorId(): String? = creatorId + + /** The project name. */ + @JsonProperty("name") fun name(): String? = name + + /** The project creation date. */ + @JsonProperty("dateCreated") fun dateCreated(): OffsetDateTime? = dateCreated + + /** The project last updated date. */ + @JsonProperty("dateUpdated") fun dateUpdated(): OffsetDateTime? = dateUpdated + + /** The project description. */ + @JsonProperty("description") fun description(): String? = description + + /** The source of the project. */ + @JsonProperty("source") fun source(): Source? = source + + /** The task type of the project. */ + @JsonProperty("taskType") fun taskType(): TaskType? = taskType + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") fun versionCount(): Long? = versionCount + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + fun inferencePipelineCount(): Long? = inferencePipelineCount + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") fun goalCount(): Long? = goalCount + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + fun developmentGoalCount(): Long? = developmentGoalCount + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") fun monitoringGoalCount(): Long? = monitoringGoalCount + + /** Links to the project. */ + @JsonProperty("links") fun links(): Links? = links + + @JsonProperty("gitRepo") fun gitRepo(): GitRepo? = gitRepo + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: String? = null + private var workspaceId: String? = null + private var creatorId: String? = null + private var name: String? = null + private var dateCreated: OffsetDateTime? = null + private var dateUpdated: OffsetDateTime? = null + private var description: String? = null + private var source: Source? = null + private var taskType: TaskType? = null + private var versionCount: Long? = null + private var inferencePipelineCount: Long? = null + private var goalCount: Long? = null + private var developmentGoalCount: Long? = null + private var monitoringGoalCount: Long? = null + private var links: Links? = null + private var gitRepo: GitRepo? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(project: Project) = apply { + this.id = project.id + this.workspaceId = project.workspaceId + this.creatorId = project.creatorId + this.name = project.name + this.dateCreated = project.dateCreated + this.dateUpdated = project.dateUpdated + this.description = project.description + this.source = project.source + this.taskType = project.taskType + this.versionCount = project.versionCount + this.inferencePipelineCount = project.inferencePipelineCount + this.goalCount = project.goalCount + this.developmentGoalCount = project.developmentGoalCount + this.monitoringGoalCount = project.monitoringGoalCount + this.links = project.links + this.gitRepo = project.gitRepo + additionalProperties(project.additionalProperties) + } + + /** The project id. */ + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + /** The workspace id. */ + @JsonProperty("workspaceId") + fun workspaceId(workspaceId: String) = apply { this.workspaceId = workspaceId } + + /** The project creator id. */ + @JsonProperty("creatorId") + fun creatorId(creatorId: String) = apply { this.creatorId = creatorId } + + /** The project name. */ + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + /** The project creation date. */ + @JsonProperty("dateCreated") + fun dateCreated(dateCreated: OffsetDateTime) = apply { this.dateCreated = dateCreated } + + /** The project last updated date. */ + @JsonProperty("dateUpdated") + fun dateUpdated(dateUpdated: OffsetDateTime) = apply { this.dateUpdated = dateUpdated } + + /** The project description. */ + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } + + /** The source of the project. */ + @JsonProperty("source") fun source(source: Source) = apply { this.source = source } + + /** The task type of the project. */ + @JsonProperty("taskType") + fun taskType(taskType: TaskType) = apply { this.taskType = taskType } + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") + fun versionCount(versionCount: Long) = apply { this.versionCount = versionCount } + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + fun inferencePipelineCount(inferencePipelineCount: Long) = apply { + this.inferencePipelineCount = inferencePipelineCount + } + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") + fun goalCount(goalCount: Long) = apply { this.goalCount = goalCount } + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + fun developmentGoalCount(developmentGoalCount: Long) = apply { + this.developmentGoalCount = developmentGoalCount + } + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + fun monitoringGoalCount(monitoringGoalCount: Long) = apply { + this.monitoringGoalCount = monitoringGoalCount + } + + /** Links to the project. */ + @JsonProperty("links") fun links(links: Links) = apply { this.links = links } + + @JsonProperty("gitRepo") + fun gitRepo(gitRepo: GitRepo) = apply { this.gitRepo = gitRepo } + + 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(): Project = + Project( + checkNotNull(id) { "`id` is required but was not set" }, + workspaceId, + creatorId, + checkNotNull(name) { "`name` is required but was not set" }, + checkNotNull(dateCreated) { "`dateCreated` is required but was not set" }, + checkNotNull(dateUpdated) { "`dateUpdated` is required but was not set" }, + description, + source, + checkNotNull(taskType) { "`taskType` is required but was not set" }, + checkNotNull(versionCount) { "`versionCount` is required but was not set" }, + checkNotNull(inferencePipelineCount) { + "`inferencePipelineCount` is required but was not set" + }, + checkNotNull(goalCount) { "`goalCount` is required but was not set" }, + checkNotNull(developmentGoalCount) { + "`developmentGoalCount` is required but was not set" + }, + checkNotNull(monitoringGoalCount) { + "`monitoringGoalCount` is required but was not set" + }, + checkNotNull(links) { "`links` is required but was not set" }, + gitRepo, + additionalProperties.toImmutable(), + ) + } + + /** Links to the project. */ + @JsonDeserialize(builder = Links.Builder::class) + @NoAutoDetect + class Links + private constructor( + private val app: String?, + private val additionalProperties: Map, + ) { + + @JsonProperty("app") fun app(): String? = app + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var app: String? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(links: Links) = apply { + this.app = links.app + additionalProperties(links.additionalProperties) + } + + @JsonProperty("app") fun app(app: String) = apply { this.app = app } + + fun additionalProperties(additionalProperties: Map) = 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( + checkNotNull(app) { "`app` is required but was not set" }, + additionalProperties.toImmutable() + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Links && app == other.app && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(app, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" + } + + class Source + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val WEB = of("web") + + @JvmField val API = of("api") + + @JvmField val NULL = of("null") + + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) + } + + enum class Known { + WEB, + API, + NULL, + } + + enum class Value { + WEB, + API, + NULL, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + WEB -> Value.WEB + API -> Value.API + NULL -> Value.NULL + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + WEB -> Known.WEB + API -> Known.API + NULL -> Known.NULL + else -> throw OpenlayerInvalidDataException("Unknown Source: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Source && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class TaskType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LLM_BASE = of("llm-base") + + @JvmField val TABULAR_CLASSIFICATION = of("tabular-classification") + + @JvmField val TABULAR_REGRESSION = of("tabular-regression") + + @JvmField val TEXT_CLASSIFICATION = of("text-classification") + + @JvmStatic fun of(value: String) = TaskType(JsonField.of(value)) + } + + enum class Known { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + } + + enum class Value { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + LLM_BASE -> Value.LLM_BASE + TABULAR_CLASSIFICATION -> Value.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Value.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Value.TEXT_CLASSIFICATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + LLM_BASE -> Known.LLM_BASE + TABULAR_CLASSIFICATION -> Known.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Known.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Known.TEXT_CLASSIFICATION + else -> throw OpenlayerInvalidDataException("Unknown TaskType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is TaskType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = GitRepo.Builder::class) + @NoAutoDetect + class GitRepo + private constructor( + private val id: String?, + private val gitId: Long?, + private val dateConnected: OffsetDateTime?, + private val dateUpdated: OffsetDateTime?, + private val branch: String?, + private val name: String?, + private val private_: Boolean?, + private val slug: String?, + private val url: String?, + private val rootDir: String?, + private val projectId: String?, + private val gitAccountId: String?, + private val additionalProperties: Map, + ) { + + @JsonProperty("id") fun id(): String? = id + + @JsonProperty("gitId") fun gitId(): Long? = gitId + + @JsonProperty("dateConnected") fun dateConnected(): OffsetDateTime? = dateConnected + + @JsonProperty("dateUpdated") fun dateUpdated(): OffsetDateTime? = dateUpdated + + @JsonProperty("branch") fun branch(): String? = branch + + @JsonProperty("name") fun name(): String? = name + + @JsonProperty("private") fun private_(): Boolean? = private_ + + @JsonProperty("slug") fun slug(): String? = slug + + @JsonProperty("url") fun url(): String? = url + + @JsonProperty("rootDir") fun rootDir(): String? = rootDir + + @JsonProperty("projectId") fun projectId(): String? = projectId + + @JsonProperty("gitAccountId") fun gitAccountId(): String? = gitAccountId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: String? = null + private var gitId: Long? = null + private var dateConnected: OffsetDateTime? = null + private var dateUpdated: OffsetDateTime? = null + private var branch: String? = null + private var name: String? = null + private var private_: Boolean? = null + private var slug: String? = null + private var url: String? = null + private var rootDir: String? = null + private var projectId: String? = null + private var gitAccountId: String? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(gitRepo: GitRepo) = apply { + this.id = gitRepo.id + this.gitId = gitRepo.gitId + this.dateConnected = gitRepo.dateConnected + this.dateUpdated = gitRepo.dateUpdated + this.branch = gitRepo.branch + this.name = gitRepo.name + this.private_ = gitRepo.private_ + this.slug = gitRepo.slug + this.url = gitRepo.url + this.rootDir = gitRepo.rootDir + this.projectId = gitRepo.projectId + this.gitAccountId = gitRepo.gitAccountId + additionalProperties(gitRepo.additionalProperties) + } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("gitId") fun gitId(gitId: Long) = apply { this.gitId = gitId } + + @JsonProperty("dateConnected") + fun dateConnected(dateConnected: OffsetDateTime) = apply { + this.dateConnected = dateConnected + } + + @JsonProperty("dateUpdated") + fun dateUpdated(dateUpdated: OffsetDateTime) = apply { + this.dateUpdated = dateUpdated + } + + @JsonProperty("branch") fun branch(branch: String) = apply { this.branch = branch } + + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + @JsonProperty("private") + fun private_(private_: Boolean) = apply { this.private_ = private_ } + + @JsonProperty("slug") fun slug(slug: String) = apply { this.slug = slug } + + @JsonProperty("url") fun url(url: String) = apply { this.url = url } + + @JsonProperty("rootDir") + fun rootDir(rootDir: String) = apply { this.rootDir = rootDir } + + @JsonProperty("projectId") + fun projectId(projectId: String) = apply { this.projectId = projectId } + + @JsonProperty("gitAccountId") + fun gitAccountId(gitAccountId: String) = apply { this.gitAccountId = gitAccountId } + + 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(): GitRepo = + GitRepo( + checkNotNull(id) { "`id` is required but was not set" }, + checkNotNull(gitId) { "`gitId` is required but was not set" }, + checkNotNull(dateConnected) { + "`dateConnected` is required but was not set" + }, + checkNotNull(dateUpdated) { "`dateUpdated` is required but was not set" }, + branch, + checkNotNull(name) { "`name` is required but was not set" }, + checkNotNull(private_) { "`private_` is required but was not set" }, + checkNotNull(slug) { "`slug` is required but was not set" }, + checkNotNull(url) { "`url` is required but was not set" }, + rootDir, + checkNotNull(projectId) { "`projectId` is required but was not set" }, + checkNotNull(gitAccountId) { "`gitAccountId` is required but was not set" }, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GitRepo && id == other.id && gitId == other.gitId && dateConnected == other.dateConnected && dateUpdated == other.dateUpdated && branch == other.branch && name == other.name && private_ == other.private_ && slug == other.slug && url == other.url && rootDir == other.rootDir && projectId == other.projectId && gitAccountId == other.gitAccountId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, gitId, dateConnected, dateUpdated, branch, name, private_, slug, url, rootDir, projectId, gitAccountId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GitRepo{id=$id, gitId=$gitId, dateConnected=$dateConnected, dateUpdated=$dateUpdated, branch=$branch, name=$name, private_=$private_, slug=$slug, url=$url, rootDir=$rootDir, projectId=$projectId, gitAccountId=$gitAccountId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Project && id == other.id && workspaceId == other.workspaceId && creatorId == other.creatorId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && description == other.description && source == other.source && taskType == other.taskType && versionCount == other.versionCount && inferencePipelineCount == other.inferencePipelineCount && goalCount == other.goalCount && developmentGoalCount == other.developmentGoalCount && monitoringGoalCount == other.monitoringGoalCount && links == other.links && gitRepo == other.gitRepo && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, workspaceId, creatorId, name, dateCreated, dateUpdated, description, source, taskType, versionCount, inferencePipelineCount, goalCount, developmentGoalCount, monitoringGoalCount, links, gitRepo, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Project{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}" + } + + @JsonDeserialize(builder = Workspace.Builder::class) + @NoAutoDetect + class Workspace + private constructor( + private val id: String?, + private val name: String?, + private val slug: String?, + private val dateCreated: OffsetDateTime?, + private val dateUpdated: OffsetDateTime?, + private val creatorId: String?, + private val inviteCode: String?, + private val wildcardDomains: List?, + private val projectCount: Long?, + private val memberCount: Long?, + private val monthlyUsage: List?, + private val inviteCount: Long?, + private val periodStartDate: OffsetDateTime?, + private val periodEndDate: OffsetDateTime?, + private val samlOnlyAccess: Boolean?, + private val status: Status?, + private val additionalProperties: Map, + ) { + + @JsonProperty("id") fun id(): String? = id + + @JsonProperty("name") fun name(): String? = name + + @JsonProperty("slug") fun slug(): String? = slug + + @JsonProperty("dateCreated") fun dateCreated(): OffsetDateTime? = dateCreated + + @JsonProperty("dateUpdated") fun dateUpdated(): OffsetDateTime? = dateUpdated + + @JsonProperty("creatorId") fun creatorId(): String? = creatorId + + @JsonProperty("inviteCode") fun inviteCode(): String? = inviteCode + + @JsonProperty("wildcardDomains") fun wildcardDomains(): List? = wildcardDomains + + @JsonProperty("projectCount") fun projectCount(): Long? = projectCount + + @JsonProperty("memberCount") fun memberCount(): Long? = memberCount + + @JsonProperty("monthlyUsage") fun monthlyUsage(): List? = monthlyUsage + + @JsonProperty("inviteCount") fun inviteCount(): Long? = inviteCount + + @JsonProperty("periodStartDate") fun periodStartDate(): OffsetDateTime? = periodStartDate + + @JsonProperty("periodEndDate") fun periodEndDate(): OffsetDateTime? = periodEndDate + + @JsonProperty("samlOnlyAccess") fun samlOnlyAccess(): Boolean? = samlOnlyAccess + + @JsonProperty("status") fun status(): Status? = status + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: String? = null + private var name: String? = null + private var slug: String? = null + private var dateCreated: OffsetDateTime? = null + private var dateUpdated: OffsetDateTime? = null + private var creatorId: String? = null + private var inviteCode: String? = null + private var wildcardDomains: List? = null + private var projectCount: Long? = null + private var memberCount: Long? = null + private var monthlyUsage: List? = null + private var inviteCount: Long? = null + private var periodStartDate: OffsetDateTime? = null + private var periodEndDate: OffsetDateTime? = null + private var samlOnlyAccess: Boolean? = null + private var status: Status? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(workspace: Workspace) = apply { + this.id = workspace.id + this.name = workspace.name + this.slug = workspace.slug + this.dateCreated = workspace.dateCreated + this.dateUpdated = workspace.dateUpdated + this.creatorId = workspace.creatorId + this.inviteCode = workspace.inviteCode + this.wildcardDomains = workspace.wildcardDomains + this.projectCount = workspace.projectCount + this.memberCount = workspace.memberCount + this.monthlyUsage = workspace.monthlyUsage + this.inviteCount = workspace.inviteCount + this.periodStartDate = workspace.periodStartDate + this.periodEndDate = workspace.periodEndDate + this.samlOnlyAccess = workspace.samlOnlyAccess + this.status = workspace.status + additionalProperties(workspace.additionalProperties) + } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + @JsonProperty("slug") fun slug(slug: String) = apply { this.slug = slug } + + @JsonProperty("dateCreated") + fun dateCreated(dateCreated: OffsetDateTime) = apply { this.dateCreated = dateCreated } + + @JsonProperty("dateUpdated") + fun dateUpdated(dateUpdated: OffsetDateTime) = apply { this.dateUpdated = dateUpdated } + + @JsonProperty("creatorId") + fun creatorId(creatorId: String) = apply { this.creatorId = creatorId } + + @JsonProperty("inviteCode") + fun inviteCode(inviteCode: String) = apply { this.inviteCode = inviteCode } + + @JsonProperty("wildcardDomains") + fun wildcardDomains(wildcardDomains: List) = apply { + this.wildcardDomains = wildcardDomains + } + + @JsonProperty("projectCount") + fun projectCount(projectCount: Long) = apply { this.projectCount = projectCount } + + @JsonProperty("memberCount") + fun memberCount(memberCount: Long) = apply { this.memberCount = memberCount } + + @JsonProperty("monthlyUsage") + fun monthlyUsage(monthlyUsage: List) = apply { + this.monthlyUsage = monthlyUsage + } + + @JsonProperty("inviteCount") + fun inviteCount(inviteCount: Long) = apply { this.inviteCount = inviteCount } + + @JsonProperty("periodStartDate") + fun periodStartDate(periodStartDate: OffsetDateTime) = apply { + this.periodStartDate = periodStartDate + } + + @JsonProperty("periodEndDate") + fun periodEndDate(periodEndDate: OffsetDateTime) = apply { + this.periodEndDate = periodEndDate + } + + @JsonProperty("samlOnlyAccess") + fun samlOnlyAccess(samlOnlyAccess: Boolean) = apply { + this.samlOnlyAccess = samlOnlyAccess + } + + @JsonProperty("status") fun status(status: Status) = apply { this.status = status } + + 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(): Workspace = + Workspace( + checkNotNull(id) { "`id` is required but was not set" }, + checkNotNull(name) { "`name` is required but was not set" }, + checkNotNull(slug) { "`slug` is required but was not set" }, + checkNotNull(dateCreated) { "`dateCreated` is required but was not set" }, + checkNotNull(dateUpdated) { "`dateUpdated` is required but was not set" }, + creatorId, + inviteCode, + wildcardDomains?.toImmutable(), + checkNotNull(projectCount) { "`projectCount` is required but was not set" }, + checkNotNull(memberCount) { "`memberCount` is required but was not set" }, + monthlyUsage?.toImmutable(), + checkNotNull(inviteCount) { "`inviteCount` is required but was not set" }, + periodStartDate, + periodEndDate, + samlOnlyAccess, + checkNotNull(status) { "`status` is required but was not set" }, + additionalProperties.toImmutable(), + ) + } + + class Status + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val PAST_DUE = of("past_due") + + @JvmField val UNPAID = of("unpaid") + + @JvmField val CANCELED = of("canceled") + + @JvmField val INCOMPLETE = of("incomplete") + + @JvmField val INCOMPLETE_EXPIRED = of("incomplete_expired") + + @JvmField val TRIALING = of("trialing") + + @JvmField val PAUSED = of("paused") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + } + + enum class Value { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + PAST_DUE -> Value.PAST_DUE + UNPAID -> Value.UNPAID + CANCELED -> Value.CANCELED + INCOMPLETE -> Value.INCOMPLETE + INCOMPLETE_EXPIRED -> Value.INCOMPLETE_EXPIRED + TRIALING -> Value.TRIALING + PAUSED -> Value.PAUSED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + PAST_DUE -> Known.PAST_DUE + UNPAID -> Known.UNPAID + CANCELED -> Known.CANCELED + INCOMPLETE -> Known.INCOMPLETE + INCOMPLETE_EXPIRED -> Known.INCOMPLETE_EXPIRED + TRIALING -> Known.TRIALING + PAUSED -> Known.PAUSED + else -> throw OpenlayerInvalidDataException("Unknown Status: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = MonthlyUsage.Builder::class) + @NoAutoDetect + class MonthlyUsage + private constructor( + private val monthYear: LocalDate?, + private val predictionCount: Long?, + private val executionTimeMs: Long?, + private val additionalProperties: Map, + ) { + + @JsonProperty("monthYear") fun monthYear(): LocalDate? = monthYear + + @JsonProperty("predictionCount") fun predictionCount(): Long? = predictionCount + + @JsonProperty("executionTimeMs") fun executionTimeMs(): Long? = executionTimeMs + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var monthYear: LocalDate? = null + private var predictionCount: Long? = null + private var executionTimeMs: Long? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(monthlyUsage: MonthlyUsage) = apply { + this.monthYear = monthlyUsage.monthYear + this.predictionCount = monthlyUsage.predictionCount + this.executionTimeMs = monthlyUsage.executionTimeMs + additionalProperties(monthlyUsage.additionalProperties) + } + + @JsonProperty("monthYear") + fun monthYear(monthYear: LocalDate) = apply { this.monthYear = monthYear } + + @JsonProperty("predictionCount") + fun predictionCount(predictionCount: Long) = apply { + this.predictionCount = predictionCount + } + + @JsonProperty("executionTimeMs") + fun executionTimeMs(executionTimeMs: Long) = apply { + this.executionTimeMs = executionTimeMs + } + + 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(): MonthlyUsage = + MonthlyUsage( + monthYear, + predictionCount, + executionTimeMs, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MonthlyUsage && monthYear == other.monthYear && predictionCount == other.predictionCount && executionTimeMs == other.executionTimeMs && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(monthYear, predictionCount, executionTimeMs, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MonthlyUsage{monthYear=$monthYear, predictionCount=$predictionCount, executionTimeMs=$executionTimeMs, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Workspace && id == other.id && name == other.name && slug == other.slug && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && creatorId == other.creatorId && inviteCode == other.inviteCode && wildcardDomains == other.wildcardDomains && projectCount == other.projectCount && memberCount == other.memberCount && monthlyUsage == other.monthlyUsage && inviteCount == other.inviteCount && periodStartDate == other.periodStartDate && periodEndDate == other.periodEndDate && samlOnlyAccess == other.samlOnlyAccess && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, name, slug, dateCreated, dateUpdated, creatorId, inviteCode, wildcardDomains, projectCount, memberCount, monthlyUsage, inviteCount, periodStartDate, periodEndDate, samlOnlyAccess, status, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Workspace{id=$id, name=$name, slug=$slug, dateCreated=$dateCreated, dateUpdated=$dateUpdated, creatorId=$creatorId, inviteCode=$inviteCode, wildcardDomains=$wildcardDomains, projectCount=$projectCount, memberCount=$memberCount, monthlyUsage=$monthlyUsage, inviteCount=$inviteCount, periodStartDate=$periodStartDate, periodEndDate=$periodEndDate, samlOnlyAccess=$samlOnlyAccess, status=$status, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is ProjectInferencePipelineCreateParams && projectId == other.projectId && description == other.description && name == other.name && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ProjectInferencePipelineCreateParams && projectId == other.projectId && description == other.description && name == other.name && project == other.project && workspace == other.workspace && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(projectId, description, name, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(projectId, description, name, project, workspace, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = - "ProjectInferencePipelineCreateParams{projectId=$projectId, description=$description, name=$name, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "ProjectInferencePipelineCreateParams{projectId=$projectId, description=$description, name=$name, project=$project, workspace=$workspace, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt index e7d3a0e..44828f1 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponse.kt @@ -15,6 +15,7 @@ import com.openlayer.api.core.JsonValue import com.openlayer.api.core.NoAutoDetect import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.LocalDate import java.time.OffsetDateTime import java.util.Objects import java.util.Optional @@ -25,6 +26,9 @@ class ProjectInferencePipelineCreateResponse private constructor( private val id: JsonField, private val projectId: JsonField, + private val workspaceId: JsonField, + private val project: JsonField, + private val workspace: JsonField, private val name: JsonField, private val dateCreated: JsonField, private val dateUpdated: JsonField, @@ -49,6 +53,14 @@ private constructor( /** The project id. */ fun projectId(): String = projectId.getRequired("projectId") + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + fun project(): Optional = Optional.ofNullable(project.getNullable("project")) + + fun workspace(): Optional = Optional.ofNullable(workspace.getNullable("workspace")) + /** The inference pipeline name. */ fun name(): String = name.getRequired("name") @@ -98,6 +110,13 @@ private constructor( /** The project id. */ @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + @JsonProperty("project") @ExcludeMissing fun _project() = project + + @JsonProperty("workspace") @ExcludeMissing fun _workspace() = workspace + /** The inference pipeline name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -148,6 +167,9 @@ private constructor( if (!validated) { id() projectId() + workspaceId() + project().map { it.validate() } + workspace().map { it.validate() } name() dateCreated() dateUpdated() @@ -176,6 +198,9 @@ private constructor( private var id: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var project: JsonField = JsonMissing.of() + private var workspace: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var dateCreated: JsonField = JsonMissing.of() private var dateUpdated: JsonField = JsonMissing.of() @@ -197,6 +222,9 @@ private constructor( ) = apply { this.id = projectInferencePipelineCreateResponse.id this.projectId = projectInferencePipelineCreateResponse.projectId + this.workspaceId = projectInferencePipelineCreateResponse.workspaceId + this.project = projectInferencePipelineCreateResponse.project + this.workspace = projectInferencePipelineCreateResponse.workspace this.name = projectInferencePipelineCreateResponse.name this.dateCreated = projectInferencePipelineCreateResponse.dateCreated this.dateUpdated = projectInferencePipelineCreateResponse.dateUpdated @@ -228,6 +256,26 @@ private constructor( @ExcludeMissing fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId } + + fun project(project: Project) = project(JsonField.of(project)) + + @JsonProperty("project") + @ExcludeMissing + fun project(project: JsonField) = apply { this.project = project } + + fun workspace(workspace: Workspace) = workspace(JsonField.of(workspace)) + + @JsonProperty("workspace") + @ExcludeMissing + fun workspace(workspace: JsonField) = apply { this.workspace = workspace } + /** The inference pipeline name. */ fun name(name: String) = name(JsonField.of(name)) @@ -371,6 +419,9 @@ private constructor( ProjectInferencePipelineCreateResponse( id, projectId, + workspaceId, + project, + workspace, name, dateCreated, dateUpdated, @@ -552,20 +603,1467 @@ private constructor( override fun toString() = value.toString() } + @JsonDeserialize(builder = Project.Builder::class) + @NoAutoDetect + class Project + private constructor( + private val id: JsonField, + private val workspaceId: JsonField, + private val creatorId: JsonField, + private val name: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val description: JsonField, + private val source: JsonField, + private val taskType: JsonField, + private val versionCount: JsonField, + private val inferencePipelineCount: JsonField, + private val goalCount: JsonField, + private val developmentGoalCount: JsonField, + private val monitoringGoalCount: JsonField, + private val links: JsonField, + private val gitRepo: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The project id. */ + fun id(): String = id.getRequired("id") + + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + /** The project creator id. */ + fun creatorId(): Optional = Optional.ofNullable(creatorId.getNullable("creatorId")) + + /** The project name. */ + fun name(): String = name.getRequired("name") + + /** The project creation date. */ + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + /** The project last updated date. */ + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** The project description. */ + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) + + /** The source of the project. */ + fun source(): Optional = Optional.ofNullable(source.getNullable("source")) + + /** The task type of the project. */ + fun taskType(): TaskType = taskType.getRequired("taskType") + + /** The number of versions (commits) in the project. */ + fun versionCount(): Long = versionCount.getRequired("versionCount") + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(): Long = + inferencePipelineCount.getRequired("inferencePipelineCount") + + /** The total number of tests in the project. */ + fun goalCount(): Long = goalCount.getRequired("goalCount") + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(): Long = developmentGoalCount.getRequired("developmentGoalCount") + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") + + /** Links to the project. */ + fun links(): Links = links.getRequired("links") + + fun gitRepo(): Optional = Optional.ofNullable(gitRepo.getNullable("gitRepo")) + + /** The project id. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + /** The project creator id. */ + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + /** The project name. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The project creation date. */ + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + /** The project last updated date. */ + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + /** The project description. */ + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** The source of the project. */ + @JsonProperty("source") @ExcludeMissing fun _source() = source + + /** The task type of the project. */ + @JsonProperty("taskType") @ExcludeMissing fun _taskType() = taskType + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") @ExcludeMissing fun _versionCount() = versionCount + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun _inferencePipelineCount() = inferencePipelineCount + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") @ExcludeMissing fun _goalCount() = goalCount + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun _developmentGoalCount() = developmentGoalCount + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun _monitoringGoalCount() = monitoringGoalCount + + /** Links to the project. */ + @JsonProperty("links") @ExcludeMissing fun _links() = links + + @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo() = gitRepo + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Project = apply { + if (!validated) { + id() + workspaceId() + creatorId() + name() + dateCreated() + dateUpdated() + description() + source() + taskType() + versionCount() + inferencePipelineCount() + goalCount() + developmentGoalCount() + monitoringGoalCount() + links().validate() + gitRepo().map { it.validate() } + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() + private var taskType: JsonField = JsonMissing.of() + private var versionCount: JsonField = JsonMissing.of() + private var inferencePipelineCount: JsonField = JsonMissing.of() + private var goalCount: JsonField = JsonMissing.of() + private var developmentGoalCount: JsonField = JsonMissing.of() + private var monitoringGoalCount: JsonField = JsonMissing.of() + private var links: JsonField = JsonMissing.of() + private var gitRepo: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(project: Project) = apply { + this.id = project.id + this.workspaceId = project.workspaceId + this.creatorId = project.creatorId + this.name = project.name + this.dateCreated = project.dateCreated + this.dateUpdated = project.dateUpdated + this.description = project.description + this.source = project.source + this.taskType = project.taskType + this.versionCount = project.versionCount + this.inferencePipelineCount = project.inferencePipelineCount + this.goalCount = project.goalCount + this.developmentGoalCount = project.developmentGoalCount + this.monitoringGoalCount = project.monitoringGoalCount + this.links = project.links + this.gitRepo = project.gitRepo + additionalProperties(project.additionalProperties) + } + + /** The project id. */ + fun id(id: String) = id(JsonField.of(id)) + + /** The project id. */ + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { + this.workspaceId = workspaceId + } + + /** The project creator id. */ + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + /** The project creator id. */ + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + /** The project name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The project name. */ + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + /** The project creation date. */ + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + /** The project creation date. */ + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + /** The project last updated date. */ + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + /** The project last updated date. */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + /** The project description. */ + fun description(description: String) = description(JsonField.of(description)) + + /** The project description. */ + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { + this.description = description + } + + /** The source of the project. */ + fun source(source: Source) = source(JsonField.of(source)) + + /** The source of the project. */ + @JsonProperty("source") + @ExcludeMissing + fun source(source: JsonField) = apply { this.source = source } + + /** The task type of the project. */ + fun taskType(taskType: TaskType) = taskType(JsonField.of(taskType)) + + /** The task type of the project. */ + @JsonProperty("taskType") + @ExcludeMissing + fun taskType(taskType: JsonField) = apply { this.taskType = taskType } + + /** The number of versions (commits) in the project. */ + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") + @ExcludeMissing + fun versionCount(versionCount: JsonField) = apply { + this.versionCount = versionCount + } + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(inferencePipelineCount: Long) = + inferencePipelineCount(JsonField.of(inferencePipelineCount)) + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun inferencePipelineCount(inferencePipelineCount: JsonField) = apply { + this.inferencePipelineCount = inferencePipelineCount + } + + /** The total number of tests in the project. */ + fun goalCount(goalCount: Long) = goalCount(JsonField.of(goalCount)) + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") + @ExcludeMissing + fun goalCount(goalCount: JsonField) = apply { this.goalCount = goalCount } + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(developmentGoalCount: Long) = + developmentGoalCount(JsonField.of(developmentGoalCount)) + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun developmentGoalCount(developmentGoalCount: JsonField) = apply { + this.developmentGoalCount = developmentGoalCount + } + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(monitoringGoalCount: Long) = + monitoringGoalCount(JsonField.of(monitoringGoalCount)) + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun monitoringGoalCount(monitoringGoalCount: JsonField) = apply { + this.monitoringGoalCount = monitoringGoalCount + } + + /** Links to the project. */ + fun links(links: Links) = links(JsonField.of(links)) + + /** Links to the project. */ + @JsonProperty("links") + @ExcludeMissing + fun links(links: JsonField) = apply { this.links = links } + + fun gitRepo(gitRepo: GitRepo) = gitRepo(JsonField.of(gitRepo)) + + @JsonProperty("gitRepo") + @ExcludeMissing + fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + + 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(): Project = + Project( + id, + workspaceId, + creatorId, + name, + dateCreated, + dateUpdated, + description, + source, + taskType, + versionCount, + inferencePipelineCount, + goalCount, + developmentGoalCount, + monitoringGoalCount, + links, + gitRepo, + additionalProperties.toImmutable(), + ) + } + + /** Links to the project. */ + @JsonDeserialize(builder = Links.Builder::class) + @NoAutoDetect + class Links + private constructor( + private val app: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + 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) + + 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.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Links && app == other.app && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(app, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" + } + + class Source + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val WEB = of("web") + + @JvmField val API = of("api") + + @JvmField val NULL = of("null") + + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) + } + + enum class Known { + WEB, + API, + NULL, + } + + enum class Value { + WEB, + API, + NULL, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + WEB -> Value.WEB + API -> Value.API + NULL -> Value.NULL + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + WEB -> Known.WEB + API -> Known.API + NULL -> Known.NULL + else -> throw OpenlayerInvalidDataException("Unknown Source: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Source && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class TaskType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LLM_BASE = of("llm-base") + + @JvmField val TABULAR_CLASSIFICATION = of("tabular-classification") + + @JvmField val TABULAR_REGRESSION = of("tabular-regression") + + @JvmField val TEXT_CLASSIFICATION = of("text-classification") + + @JvmStatic fun of(value: String) = TaskType(JsonField.of(value)) + } + + enum class Known { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + } + + enum class Value { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + LLM_BASE -> Value.LLM_BASE + TABULAR_CLASSIFICATION -> Value.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Value.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Value.TEXT_CLASSIFICATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + LLM_BASE -> Known.LLM_BASE + TABULAR_CLASSIFICATION -> Known.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Known.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Known.TEXT_CLASSIFICATION + else -> throw OpenlayerInvalidDataException("Unknown TaskType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is TaskType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = GitRepo.Builder::class) + @NoAutoDetect + class GitRepo + private constructor( + private val id: JsonField, + private val gitId: JsonField, + private val dateConnected: JsonField, + private val dateUpdated: JsonField, + private val branch: JsonField, + private val name: JsonField, + private val private_: JsonField, + private val slug: JsonField, + private val url: JsonField, + private val rootDir: JsonField, + private val projectId: JsonField, + private val gitAccountId: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun gitId(): Long = gitId.getRequired("gitId") + + fun dateConnected(): OffsetDateTime = dateConnected.getRequired("dateConnected") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun branch(): Optional = Optional.ofNullable(branch.getNullable("branch")) + + fun name(): String = name.getRequired("name") + + fun private_(): Boolean = private_.getRequired("private") + + fun slug(): String = slug.getRequired("slug") + + fun url(): String = url.getRequired("url") + + fun rootDir(): Optional = Optional.ofNullable(rootDir.getNullable("rootDir")) + + fun projectId(): String = projectId.getRequired("projectId") + + fun gitAccountId(): String = gitAccountId.getRequired("gitAccountId") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("gitId") @ExcludeMissing fun _gitId() = gitId + + @JsonProperty("dateConnected") @ExcludeMissing fun _dateConnected() = dateConnected + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("branch") @ExcludeMissing fun _branch() = branch + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("private") @ExcludeMissing fun _private_() = private_ + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("url") @ExcludeMissing fun _url() = url + + @JsonProperty("rootDir") @ExcludeMissing fun _rootDir() = rootDir + + @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + + @JsonProperty("gitAccountId") @ExcludeMissing fun _gitAccountId() = gitAccountId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): GitRepo = apply { + if (!validated) { + id() + gitId() + dateConnected() + dateUpdated() + branch() + name() + private_() + slug() + url() + rootDir() + projectId() + gitAccountId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var gitId: JsonField = JsonMissing.of() + private var dateConnected: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var branch: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var private_: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var url: JsonField = JsonMissing.of() + private var rootDir: JsonField = JsonMissing.of() + private var projectId: JsonField = JsonMissing.of() + private var gitAccountId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(gitRepo: GitRepo) = apply { + this.id = gitRepo.id + this.gitId = gitRepo.gitId + this.dateConnected = gitRepo.dateConnected + this.dateUpdated = gitRepo.dateUpdated + this.branch = gitRepo.branch + this.name = gitRepo.name + this.private_ = gitRepo.private_ + this.slug = gitRepo.slug + this.url = gitRepo.url + this.rootDir = gitRepo.rootDir + this.projectId = gitRepo.projectId + this.gitAccountId = gitRepo.gitAccountId + additionalProperties(gitRepo.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun gitId(gitId: Long) = gitId(JsonField.of(gitId)) + + @JsonProperty("gitId") + @ExcludeMissing + fun gitId(gitId: JsonField) = apply { this.gitId = gitId } + + fun dateConnected(dateConnected: OffsetDateTime) = + dateConnected(JsonField.of(dateConnected)) + + @JsonProperty("dateConnected") + @ExcludeMissing + fun dateConnected(dateConnected: JsonField) = apply { + this.dateConnected = dateConnected + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = + dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun branch(branch: String) = branch(JsonField.of(branch)) + + @JsonProperty("branch") + @ExcludeMissing + fun branch(branch: JsonField) = apply { this.branch = branch } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun private_(private_: Boolean) = private_(JsonField.of(private_)) + + @JsonProperty("private") + @ExcludeMissing + fun private_(private_: JsonField) = apply { this.private_ = private_ } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun url(url: String) = url(JsonField.of(url)) + + @JsonProperty("url") + @ExcludeMissing + fun url(url: JsonField) = apply { this.url = url } + + fun rootDir(rootDir: String) = rootDir(JsonField.of(rootDir)) + + @JsonProperty("rootDir") + @ExcludeMissing + fun rootDir(rootDir: JsonField) = apply { this.rootDir = rootDir } + + fun projectId(projectId: String) = projectId(JsonField.of(projectId)) + + @JsonProperty("projectId") + @ExcludeMissing + fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + + fun gitAccountId(gitAccountId: String) = gitAccountId(JsonField.of(gitAccountId)) + + @JsonProperty("gitAccountId") + @ExcludeMissing + fun gitAccountId(gitAccountId: JsonField) = apply { + this.gitAccountId = gitAccountId + } + + 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(): GitRepo = + GitRepo( + id, + gitId, + dateConnected, + dateUpdated, + branch, + name, + private_, + slug, + url, + rootDir, + projectId, + gitAccountId, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GitRepo && id == other.id && gitId == other.gitId && dateConnected == other.dateConnected && dateUpdated == other.dateUpdated && branch == other.branch && name == other.name && private_ == other.private_ && slug == other.slug && url == other.url && rootDir == other.rootDir && projectId == other.projectId && gitAccountId == other.gitAccountId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, gitId, dateConnected, dateUpdated, branch, name, private_, slug, url, rootDir, projectId, gitAccountId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GitRepo{id=$id, gitId=$gitId, dateConnected=$dateConnected, dateUpdated=$dateUpdated, branch=$branch, name=$name, private_=$private_, slug=$slug, url=$url, rootDir=$rootDir, projectId=$projectId, gitAccountId=$gitAccountId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Project && id == other.id && workspaceId == other.workspaceId && creatorId == other.creatorId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && description == other.description && source == other.source && taskType == other.taskType && versionCount == other.versionCount && inferencePipelineCount == other.inferencePipelineCount && goalCount == other.goalCount && developmentGoalCount == other.developmentGoalCount && monitoringGoalCount == other.monitoringGoalCount && links == other.links && gitRepo == other.gitRepo && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, workspaceId, creatorId, name, dateCreated, dateUpdated, description, source, taskType, versionCount, inferencePipelineCount, goalCount, developmentGoalCount, monitoringGoalCount, links, gitRepo, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Project{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}" + } + + @JsonDeserialize(builder = Workspace.Builder::class) + @NoAutoDetect + class Workspace + private constructor( + private val id: JsonField, + private val name: JsonField, + private val slug: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val creatorId: JsonField, + private val inviteCode: JsonField, + private val wildcardDomains: JsonField>, + private val projectCount: JsonField, + private val memberCount: JsonField, + private val monthlyUsage: JsonField>, + private val inviteCount: JsonField, + private val periodStartDate: JsonField, + private val periodEndDate: JsonField, + private val samlOnlyAccess: JsonField, + private val status: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun name(): String = name.getRequired("name") + + fun slug(): String = slug.getRequired("slug") + + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun creatorId(): Optional = Optional.ofNullable(creatorId.getNullable("creatorId")) + + fun inviteCode(): Optional = + Optional.ofNullable(inviteCode.getNullable("inviteCode")) + + fun wildcardDomains(): Optional> = + Optional.ofNullable(wildcardDomains.getNullable("wildcardDomains")) + + fun projectCount(): Long = projectCount.getRequired("projectCount") + + fun memberCount(): Long = memberCount.getRequired("memberCount") + + fun monthlyUsage(): Optional> = + Optional.ofNullable(monthlyUsage.getNullable("monthlyUsage")) + + fun inviteCount(): Long = inviteCount.getRequired("inviteCount") + + fun periodStartDate(): Optional = + Optional.ofNullable(periodStartDate.getNullable("periodStartDate")) + + fun periodEndDate(): Optional = + Optional.ofNullable(periodEndDate.getNullable("periodEndDate")) + + fun samlOnlyAccess(): Optional = + Optional.ofNullable(samlOnlyAccess.getNullable("samlOnlyAccess")) + + fun status(): Status = status.getRequired("status") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + @JsonProperty("inviteCode") @ExcludeMissing fun _inviteCode() = inviteCode + + @JsonProperty("wildcardDomains") @ExcludeMissing fun _wildcardDomains() = wildcardDomains + + @JsonProperty("projectCount") @ExcludeMissing fun _projectCount() = projectCount + + @JsonProperty("memberCount") @ExcludeMissing fun _memberCount() = memberCount + + @JsonProperty("monthlyUsage") @ExcludeMissing fun _monthlyUsage() = monthlyUsage + + @JsonProperty("inviteCount") @ExcludeMissing fun _inviteCount() = inviteCount + + @JsonProperty("periodStartDate") @ExcludeMissing fun _periodStartDate() = periodStartDate + + @JsonProperty("periodEndDate") @ExcludeMissing fun _periodEndDate() = periodEndDate + + @JsonProperty("samlOnlyAccess") @ExcludeMissing fun _samlOnlyAccess() = samlOnlyAccess + + @JsonProperty("status") @ExcludeMissing fun _status() = status + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Workspace = apply { + if (!validated) { + id() + name() + slug() + dateCreated() + dateUpdated() + creatorId() + inviteCode() + wildcardDomains() + projectCount() + memberCount() + monthlyUsage().map { it.forEach { it.validate() } } + inviteCount() + periodStartDate() + periodEndDate() + samlOnlyAccess() + status() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var inviteCode: JsonField = JsonMissing.of() + private var wildcardDomains: JsonField> = JsonMissing.of() + private var projectCount: JsonField = JsonMissing.of() + private var memberCount: JsonField = JsonMissing.of() + private var monthlyUsage: JsonField> = JsonMissing.of() + private var inviteCount: JsonField = JsonMissing.of() + private var periodStartDate: JsonField = JsonMissing.of() + private var periodEndDate: JsonField = JsonMissing.of() + private var samlOnlyAccess: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(workspace: Workspace) = apply { + this.id = workspace.id + this.name = workspace.name + this.slug = workspace.slug + this.dateCreated = workspace.dateCreated + this.dateUpdated = workspace.dateUpdated + this.creatorId = workspace.creatorId + this.inviteCode = workspace.inviteCode + this.wildcardDomains = workspace.wildcardDomains + this.projectCount = workspace.projectCount + this.memberCount = workspace.memberCount + this.monthlyUsage = workspace.monthlyUsage + this.inviteCount = workspace.inviteCount + this.periodStartDate = workspace.periodStartDate + this.periodEndDate = workspace.periodEndDate + this.samlOnlyAccess = workspace.samlOnlyAccess + this.status = workspace.status + additionalProperties(workspace.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + fun inviteCode(inviteCode: String) = inviteCode(JsonField.of(inviteCode)) + + @JsonProperty("inviteCode") + @ExcludeMissing + fun inviteCode(inviteCode: JsonField) = apply { this.inviteCode = inviteCode } + + fun wildcardDomains(wildcardDomains: List) = + wildcardDomains(JsonField.of(wildcardDomains)) + + @JsonProperty("wildcardDomains") + @ExcludeMissing + fun wildcardDomains(wildcardDomains: JsonField>) = apply { + this.wildcardDomains = wildcardDomains + } + + fun projectCount(projectCount: Long) = projectCount(JsonField.of(projectCount)) + + @JsonProperty("projectCount") + @ExcludeMissing + fun projectCount(projectCount: JsonField) = apply { + this.projectCount = projectCount + } + + fun memberCount(memberCount: Long) = memberCount(JsonField.of(memberCount)) + + @JsonProperty("memberCount") + @ExcludeMissing + fun memberCount(memberCount: JsonField) = apply { this.memberCount = memberCount } + + fun monthlyUsage(monthlyUsage: List) = + monthlyUsage(JsonField.of(monthlyUsage)) + + @JsonProperty("monthlyUsage") + @ExcludeMissing + fun monthlyUsage(monthlyUsage: JsonField>) = apply { + this.monthlyUsage = monthlyUsage + } + + fun inviteCount(inviteCount: Long) = inviteCount(JsonField.of(inviteCount)) + + @JsonProperty("inviteCount") + @ExcludeMissing + fun inviteCount(inviteCount: JsonField) = apply { this.inviteCount = inviteCount } + + fun periodStartDate(periodStartDate: OffsetDateTime) = + periodStartDate(JsonField.of(periodStartDate)) + + @JsonProperty("periodStartDate") + @ExcludeMissing + fun periodStartDate(periodStartDate: JsonField) = apply { + this.periodStartDate = periodStartDate + } + + fun periodEndDate(periodEndDate: OffsetDateTime) = + periodEndDate(JsonField.of(periodEndDate)) + + @JsonProperty("periodEndDate") + @ExcludeMissing + fun periodEndDate(periodEndDate: JsonField) = apply { + this.periodEndDate = periodEndDate + } + + fun samlOnlyAccess(samlOnlyAccess: Boolean) = + samlOnlyAccess(JsonField.of(samlOnlyAccess)) + + @JsonProperty("samlOnlyAccess") + @ExcludeMissing + fun samlOnlyAccess(samlOnlyAccess: JsonField) = apply { + this.samlOnlyAccess = samlOnlyAccess + } + + fun status(status: Status) = status(JsonField.of(status)) + + @JsonProperty("status") + @ExcludeMissing + fun status(status: JsonField) = apply { this.status = status } + + 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(): Workspace = + Workspace( + id, + name, + slug, + dateCreated, + dateUpdated, + creatorId, + inviteCode, + wildcardDomains.map { it.toImmutable() }, + projectCount, + memberCount, + monthlyUsage.map { it.toImmutable() }, + inviteCount, + periodStartDate, + periodEndDate, + samlOnlyAccess, + status, + additionalProperties.toImmutable(), + ) + } + + class Status + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val PAST_DUE = of("past_due") + + @JvmField val UNPAID = of("unpaid") + + @JvmField val CANCELED = of("canceled") + + @JvmField val INCOMPLETE = of("incomplete") + + @JvmField val INCOMPLETE_EXPIRED = of("incomplete_expired") + + @JvmField val TRIALING = of("trialing") + + @JvmField val PAUSED = of("paused") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + } + + enum class Value { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + PAST_DUE -> Value.PAST_DUE + UNPAID -> Value.UNPAID + CANCELED -> Value.CANCELED + INCOMPLETE -> Value.INCOMPLETE + INCOMPLETE_EXPIRED -> Value.INCOMPLETE_EXPIRED + TRIALING -> Value.TRIALING + PAUSED -> Value.PAUSED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + PAST_DUE -> Known.PAST_DUE + UNPAID -> Known.UNPAID + CANCELED -> Known.CANCELED + INCOMPLETE -> Known.INCOMPLETE + INCOMPLETE_EXPIRED -> Known.INCOMPLETE_EXPIRED + TRIALING -> Known.TRIALING + PAUSED -> Known.PAUSED + else -> throw OpenlayerInvalidDataException("Unknown Status: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = MonthlyUsage.Builder::class) + @NoAutoDetect + class MonthlyUsage + private constructor( + private val monthYear: JsonField, + private val predictionCount: JsonField, + private val executionTimeMs: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun monthYear(): Optional = + Optional.ofNullable(monthYear.getNullable("monthYear")) + + fun predictionCount(): Optional = + Optional.ofNullable(predictionCount.getNullable("predictionCount")) + + fun executionTimeMs(): Optional = + Optional.ofNullable(executionTimeMs.getNullable("executionTimeMs")) + + @JsonProperty("monthYear") @ExcludeMissing fun _monthYear() = monthYear + + @JsonProperty("predictionCount") + @ExcludeMissing + fun _predictionCount() = predictionCount + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun _executionTimeMs() = executionTimeMs + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): MonthlyUsage = apply { + if (!validated) { + monthYear() + predictionCount() + executionTimeMs() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var monthYear: JsonField = JsonMissing.of() + private var predictionCount: JsonField = JsonMissing.of() + private var executionTimeMs: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(monthlyUsage: MonthlyUsage) = apply { + this.monthYear = monthlyUsage.monthYear + this.predictionCount = monthlyUsage.predictionCount + this.executionTimeMs = monthlyUsage.executionTimeMs + additionalProperties(monthlyUsage.additionalProperties) + } + + fun monthYear(monthYear: LocalDate) = monthYear(JsonField.of(monthYear)) + + @JsonProperty("monthYear") + @ExcludeMissing + fun monthYear(monthYear: JsonField) = apply { + this.monthYear = monthYear + } + + fun predictionCount(predictionCount: Long) = + predictionCount(JsonField.of(predictionCount)) + + @JsonProperty("predictionCount") + @ExcludeMissing + fun predictionCount(predictionCount: JsonField) = apply { + this.predictionCount = predictionCount + } + + fun executionTimeMs(executionTimeMs: Long) = + executionTimeMs(JsonField.of(executionTimeMs)) + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun executionTimeMs(executionTimeMs: JsonField) = apply { + this.executionTimeMs = executionTimeMs + } + + 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(): MonthlyUsage = + MonthlyUsage( + monthYear, + predictionCount, + executionTimeMs, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MonthlyUsage && monthYear == other.monthYear && predictionCount == other.predictionCount && executionTimeMs == other.executionTimeMs && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(monthYear, predictionCount, executionTimeMs, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MonthlyUsage{monthYear=$monthYear, predictionCount=$predictionCount, executionTimeMs=$executionTimeMs, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Workspace && id == other.id && name == other.name && slug == other.slug && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && creatorId == other.creatorId && inviteCode == other.inviteCode && wildcardDomains == other.wildcardDomains && projectCount == other.projectCount && memberCount == other.memberCount && monthlyUsage == other.monthlyUsage && inviteCount == other.inviteCount && periodStartDate == other.periodStartDate && periodEndDate == other.periodEndDate && samlOnlyAccess == other.samlOnlyAccess && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, name, slug, dateCreated, dateUpdated, creatorId, inviteCode, wildcardDomains, projectCount, memberCount, monthlyUsage, inviteCount, periodStartDate, periodEndDate, samlOnlyAccess, status, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Workspace{id=$id, name=$name, slug=$slug, dateCreated=$dateCreated, dateUpdated=$dateUpdated, creatorId=$creatorId, inviteCode=$inviteCode, wildcardDomains=$wildcardDomains, projectCount=$projectCount, memberCount=$memberCount, monthlyUsage=$monthlyUsage, inviteCount=$inviteCount, periodStartDate=$periodStartDate, periodEndDate=$periodEndDate, samlOnlyAccess=$samlOnlyAccess, status=$status, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is ProjectInferencePipelineCreateResponse && id == other.id && projectId == other.projectId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ProjectInferencePipelineCreateResponse && id == other.id && projectId == other.projectId && workspaceId == other.workspaceId && project == other.project && workspace == other.workspace && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, projectId, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, projectId, workspaceId, project, workspace, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ProjectInferencePipelineCreateResponse{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" + "ProjectInferencePipelineCreateResponse{id=$id, projectId=$projectId, workspaceId=$workspaceId, project=$project, workspace=$workspace, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt index 4cb5983..5ee1acf 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponse.kt @@ -15,6 +15,7 @@ import com.openlayer.api.core.JsonValue import com.openlayer.api.core.NoAutoDetect import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.LocalDate import java.time.OffsetDateTime import java.util.Objects import java.util.Optional @@ -97,6 +98,9 @@ private constructor( private constructor( private val id: JsonField, private val projectId: JsonField, + private val workspaceId: JsonField, + private val project: JsonField, + private val workspace: JsonField, private val name: JsonField, private val dateCreated: JsonField, private val dateUpdated: JsonField, @@ -121,6 +125,15 @@ private constructor( /** The project id. */ fun projectId(): String = projectId.getRequired("projectId") + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + fun project(): Optional = Optional.ofNullable(project.getNullable("project")) + + fun workspace(): Optional = + Optional.ofNullable(workspace.getNullable("workspace")) + /** The inference pipeline name. */ fun name(): String = name.getRequired("name") @@ -170,6 +183,13 @@ private constructor( /** The project id. */ @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + @JsonProperty("project") @ExcludeMissing fun _project() = project + + @JsonProperty("workspace") @ExcludeMissing fun _workspace() = workspace + /** The inference pipeline name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -222,6 +242,9 @@ private constructor( if (!validated) { id() projectId() + workspaceId() + project().map { it.validate() } + workspace().map { it.validate() } name() dateCreated() dateUpdated() @@ -250,6 +273,9 @@ private constructor( private var id: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var project: JsonField = JsonMissing.of() + private var workspace: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var dateCreated: JsonField = JsonMissing.of() private var dateUpdated: JsonField = JsonMissing.of() @@ -269,6 +295,9 @@ private constructor( internal fun from(item: Item) = apply { this.id = item.id this.projectId = item.projectId + this.workspaceId = item.workspaceId + this.project = item.project + this.workspace = item.workspace this.name = item.name this.dateCreated = item.dateCreated this.dateUpdated = item.dateUpdated @@ -301,6 +330,28 @@ private constructor( @ExcludeMissing fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { + this.workspaceId = workspaceId + } + + fun project(project: Project) = project(JsonField.of(project)) + + @JsonProperty("project") + @ExcludeMissing + fun project(project: JsonField) = apply { this.project = project } + + fun workspace(workspace: Workspace) = workspace(JsonField.of(workspace)) + + @JsonProperty("workspace") + @ExcludeMissing + fun workspace(workspace: JsonField) = apply { this.workspace = workspace } + /** The inference pipeline name. */ fun name(name: String) = name(JsonField.of(name)) @@ -446,6 +497,9 @@ private constructor( Item( id, projectId, + workspaceId, + project, + workspace, name, dateCreated, dateUpdated, @@ -628,22 +682,1493 @@ private constructor( override fun toString() = value.toString() } + @JsonDeserialize(builder = Project.Builder::class) + @NoAutoDetect + class Project + private constructor( + private val id: JsonField, + private val workspaceId: JsonField, + private val creatorId: JsonField, + private val name: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val description: JsonField, + private val source: JsonField, + private val taskType: JsonField, + private val versionCount: JsonField, + private val inferencePipelineCount: JsonField, + private val goalCount: JsonField, + private val developmentGoalCount: JsonField, + private val monitoringGoalCount: JsonField, + private val links: JsonField, + private val gitRepo: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The project id. */ + fun id(): String = id.getRequired("id") + + /** The workspace id. */ + fun workspaceId(): Optional = + Optional.ofNullable(workspaceId.getNullable("workspaceId")) + + /** The project creator id. */ + fun creatorId(): Optional = + Optional.ofNullable(creatorId.getNullable("creatorId")) + + /** The project name. */ + fun name(): String = name.getRequired("name") + + /** The project creation date. */ + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + /** The project last updated date. */ + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** The project description. */ + fun description(): Optional = + Optional.ofNullable(description.getNullable("description")) + + /** The source of the project. */ + fun source(): Optional = Optional.ofNullable(source.getNullable("source")) + + /** The task type of the project. */ + fun taskType(): TaskType = taskType.getRequired("taskType") + + /** The number of versions (commits) in the project. */ + fun versionCount(): Long = versionCount.getRequired("versionCount") + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(): Long = + inferencePipelineCount.getRequired("inferencePipelineCount") + + /** The total number of tests in the project. */ + fun goalCount(): Long = goalCount.getRequired("goalCount") + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(): Long = + developmentGoalCount.getRequired("developmentGoalCount") + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") + + /** Links to the project. */ + fun links(): Links = links.getRequired("links") + + fun gitRepo(): Optional = Optional.ofNullable(gitRepo.getNullable("gitRepo")) + + /** The project id. */ + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** The workspace id. */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId() = workspaceId + + /** The project creator id. */ + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + /** The project name. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + + /** The project creation date. */ + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + /** The project last updated date. */ + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + /** The project description. */ + @JsonProperty("description") @ExcludeMissing fun _description() = description + + /** The source of the project. */ + @JsonProperty("source") @ExcludeMissing fun _source() = source + + /** The task type of the project. */ + @JsonProperty("taskType") @ExcludeMissing fun _taskType() = taskType + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") @ExcludeMissing fun _versionCount() = versionCount + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun _inferencePipelineCount() = inferencePipelineCount + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") @ExcludeMissing fun _goalCount() = goalCount + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun _developmentGoalCount() = developmentGoalCount + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun _monitoringGoalCount() = monitoringGoalCount + + /** Links to the project. */ + @JsonProperty("links") @ExcludeMissing fun _links() = links + + @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo() = gitRepo + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Project = apply { + if (!validated) { + id() + workspaceId() + creatorId() + name() + dateCreated() + dateUpdated() + description() + source() + taskType() + versionCount() + inferencePipelineCount() + goalCount() + developmentGoalCount() + monitoringGoalCount() + links().validate() + gitRepo().map { it.validate() } + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var workspaceId: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() + private var taskType: JsonField = JsonMissing.of() + private var versionCount: JsonField = JsonMissing.of() + private var inferencePipelineCount: JsonField = JsonMissing.of() + private var goalCount: JsonField = JsonMissing.of() + private var developmentGoalCount: JsonField = JsonMissing.of() + private var monitoringGoalCount: JsonField = JsonMissing.of() + private var links: JsonField = JsonMissing.of() + private var gitRepo: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(project: Project) = apply { + this.id = project.id + this.workspaceId = project.workspaceId + this.creatorId = project.creatorId + this.name = project.name + this.dateCreated = project.dateCreated + this.dateUpdated = project.dateUpdated + this.description = project.description + this.source = project.source + this.taskType = project.taskType + this.versionCount = project.versionCount + this.inferencePipelineCount = project.inferencePipelineCount + this.goalCount = project.goalCount + this.developmentGoalCount = project.developmentGoalCount + this.monitoringGoalCount = project.monitoringGoalCount + this.links = project.links + this.gitRepo = project.gitRepo + additionalProperties(project.additionalProperties) + } + + /** The project id. */ + fun id(id: String) = id(JsonField.of(id)) + + /** The project id. */ + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** The workspace id. */ + fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId)) + + /** The workspace id. */ + @JsonProperty("workspaceId") + @ExcludeMissing + fun workspaceId(workspaceId: JsonField) = apply { + this.workspaceId = workspaceId + } + + /** The project creator id. */ + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + /** The project creator id. */ + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + /** The project name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** The project name. */ + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + /** The project creation date. */ + fun dateCreated(dateCreated: OffsetDateTime) = + dateCreated(JsonField.of(dateCreated)) + + /** The project creation date. */ + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + /** The project last updated date. */ + fun dateUpdated(dateUpdated: OffsetDateTime) = + dateUpdated(JsonField.of(dateUpdated)) + + /** The project last updated date. */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + /** The project description. */ + fun description(description: String) = description(JsonField.of(description)) + + /** The project description. */ + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { + this.description = description + } + + /** The source of the project. */ + fun source(source: Source) = source(JsonField.of(source)) + + /** The source of the project. */ + @JsonProperty("source") + @ExcludeMissing + fun source(source: JsonField) = apply { this.source = source } + + /** The task type of the project. */ + fun taskType(taskType: TaskType) = taskType(JsonField.of(taskType)) + + /** The task type of the project. */ + @JsonProperty("taskType") + @ExcludeMissing + fun taskType(taskType: JsonField) = apply { this.taskType = taskType } + + /** The number of versions (commits) in the project. */ + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + /** The number of versions (commits) in the project. */ + @JsonProperty("versionCount") + @ExcludeMissing + fun versionCount(versionCount: JsonField) = apply { + this.versionCount = versionCount + } + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(inferencePipelineCount: Long) = + inferencePipelineCount(JsonField.of(inferencePipelineCount)) + + /** The number of inference pipelines in the project. */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun inferencePipelineCount(inferencePipelineCount: JsonField) = apply { + this.inferencePipelineCount = inferencePipelineCount + } + + /** The total number of tests in the project. */ + fun goalCount(goalCount: Long) = goalCount(JsonField.of(goalCount)) + + /** The total number of tests in the project. */ + @JsonProperty("goalCount") + @ExcludeMissing + fun goalCount(goalCount: JsonField) = apply { this.goalCount = goalCount } + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(developmentGoalCount: Long) = + developmentGoalCount(JsonField.of(developmentGoalCount)) + + /** The number of tests in the development mode of the project. */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun developmentGoalCount(developmentGoalCount: JsonField) = apply { + this.developmentGoalCount = developmentGoalCount + } + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(monitoringGoalCount: Long) = + monitoringGoalCount(JsonField.of(monitoringGoalCount)) + + /** The number of tests in the monitoring mode of the project. */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun monitoringGoalCount(monitoringGoalCount: JsonField) = apply { + this.monitoringGoalCount = monitoringGoalCount + } + + /** Links to the project. */ + fun links(links: Links) = links(JsonField.of(links)) + + /** Links to the project. */ + @JsonProperty("links") + @ExcludeMissing + fun links(links: JsonField) = apply { this.links = links } + + fun gitRepo(gitRepo: GitRepo) = gitRepo(JsonField.of(gitRepo)) + + @JsonProperty("gitRepo") + @ExcludeMissing + fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + + 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(): Project = + Project( + id, + workspaceId, + creatorId, + name, + dateCreated, + dateUpdated, + description, + source, + taskType, + versionCount, + inferencePipelineCount, + goalCount, + developmentGoalCount, + monitoringGoalCount, + links, + gitRepo, + additionalProperties.toImmutable(), + ) + } + + /** Links to the project. */ + @JsonDeserialize(builder = Links.Builder::class) + @NoAutoDetect + class Links + private constructor( + private val app: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + 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) + + 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.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Links && app == other.app && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(app, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Links{app=$app, additionalProperties=$additionalProperties}" + } + + class Source + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val WEB = of("web") + + @JvmField val API = of("api") + + @JvmField val NULL = of("null") + + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) + } + + enum class Known { + WEB, + API, + NULL, + } + + enum class Value { + WEB, + API, + NULL, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + WEB -> Value.WEB + API -> Value.API + NULL -> Value.NULL + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + WEB -> Known.WEB + API -> Known.API + NULL -> Known.NULL + else -> throw OpenlayerInvalidDataException("Unknown Source: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Source && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class TaskType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LLM_BASE = of("llm-base") + + @JvmField val TABULAR_CLASSIFICATION = of("tabular-classification") + + @JvmField val TABULAR_REGRESSION = of("tabular-regression") + + @JvmField val TEXT_CLASSIFICATION = of("text-classification") + + @JvmStatic fun of(value: String) = TaskType(JsonField.of(value)) + } + + enum class Known { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + } + + enum class Value { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + LLM_BASE -> Value.LLM_BASE + TABULAR_CLASSIFICATION -> Value.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Value.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Value.TEXT_CLASSIFICATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + LLM_BASE -> Known.LLM_BASE + TABULAR_CLASSIFICATION -> Known.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Known.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Known.TEXT_CLASSIFICATION + else -> throw OpenlayerInvalidDataException("Unknown TaskType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is TaskType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = GitRepo.Builder::class) + @NoAutoDetect + class GitRepo + private constructor( + private val id: JsonField, + private val gitId: JsonField, + private val dateConnected: JsonField, + private val dateUpdated: JsonField, + private val branch: JsonField, + private val name: JsonField, + private val private_: JsonField, + private val slug: JsonField, + private val url: JsonField, + private val rootDir: JsonField, + private val projectId: JsonField, + private val gitAccountId: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun gitId(): Long = gitId.getRequired("gitId") + + fun dateConnected(): OffsetDateTime = dateConnected.getRequired("dateConnected") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun branch(): Optional = Optional.ofNullable(branch.getNullable("branch")) + + fun name(): String = name.getRequired("name") + + fun private_(): Boolean = private_.getRequired("private") + + fun slug(): String = slug.getRequired("slug") + + fun url(): String = url.getRequired("url") + + fun rootDir(): Optional = + Optional.ofNullable(rootDir.getNullable("rootDir")) + + fun projectId(): String = projectId.getRequired("projectId") + + fun gitAccountId(): String = gitAccountId.getRequired("gitAccountId") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("gitId") @ExcludeMissing fun _gitId() = gitId + + @JsonProperty("dateConnected") @ExcludeMissing fun _dateConnected() = dateConnected + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("branch") @ExcludeMissing fun _branch() = branch + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("private") @ExcludeMissing fun _private_() = private_ + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("url") @ExcludeMissing fun _url() = url + + @JsonProperty("rootDir") @ExcludeMissing fun _rootDir() = rootDir + + @JsonProperty("projectId") @ExcludeMissing fun _projectId() = projectId + + @JsonProperty("gitAccountId") @ExcludeMissing fun _gitAccountId() = gitAccountId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): GitRepo = apply { + if (!validated) { + id() + gitId() + dateConnected() + dateUpdated() + branch() + name() + private_() + slug() + url() + rootDir() + projectId() + gitAccountId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var gitId: JsonField = JsonMissing.of() + private var dateConnected: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var branch: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var private_: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var url: JsonField = JsonMissing.of() + private var rootDir: JsonField = JsonMissing.of() + private var projectId: JsonField = JsonMissing.of() + private var gitAccountId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(gitRepo: GitRepo) = apply { + this.id = gitRepo.id + this.gitId = gitRepo.gitId + this.dateConnected = gitRepo.dateConnected + this.dateUpdated = gitRepo.dateUpdated + this.branch = gitRepo.branch + this.name = gitRepo.name + this.private_ = gitRepo.private_ + this.slug = gitRepo.slug + this.url = gitRepo.url + this.rootDir = gitRepo.rootDir + this.projectId = gitRepo.projectId + this.gitAccountId = gitRepo.gitAccountId + additionalProperties(gitRepo.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun gitId(gitId: Long) = gitId(JsonField.of(gitId)) + + @JsonProperty("gitId") + @ExcludeMissing + fun gitId(gitId: JsonField) = apply { this.gitId = gitId } + + fun dateConnected(dateConnected: OffsetDateTime) = + dateConnected(JsonField.of(dateConnected)) + + @JsonProperty("dateConnected") + @ExcludeMissing + fun dateConnected(dateConnected: JsonField) = apply { + this.dateConnected = dateConnected + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = + dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun branch(branch: String) = branch(JsonField.of(branch)) + + @JsonProperty("branch") + @ExcludeMissing + fun branch(branch: JsonField) = apply { this.branch = branch } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun private_(private_: Boolean) = private_(JsonField.of(private_)) + + @JsonProperty("private") + @ExcludeMissing + fun private_(private_: JsonField) = apply { this.private_ = private_ } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun url(url: String) = url(JsonField.of(url)) + + @JsonProperty("url") + @ExcludeMissing + fun url(url: JsonField) = apply { this.url = url } + + fun rootDir(rootDir: String) = rootDir(JsonField.of(rootDir)) + + @JsonProperty("rootDir") + @ExcludeMissing + fun rootDir(rootDir: JsonField) = apply { this.rootDir = rootDir } + + fun projectId(projectId: String) = projectId(JsonField.of(projectId)) + + @JsonProperty("projectId") + @ExcludeMissing + fun projectId(projectId: JsonField) = apply { + this.projectId = projectId + } + + fun gitAccountId(gitAccountId: String) = + gitAccountId(JsonField.of(gitAccountId)) + + @JsonProperty("gitAccountId") + @ExcludeMissing + fun gitAccountId(gitAccountId: JsonField) = apply { + this.gitAccountId = gitAccountId + } + + 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(): GitRepo = + GitRepo( + id, + gitId, + dateConnected, + dateUpdated, + branch, + name, + private_, + slug, + url, + rootDir, + projectId, + gitAccountId, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GitRepo && id == other.id && gitId == other.gitId && dateConnected == other.dateConnected && dateUpdated == other.dateUpdated && branch == other.branch && name == other.name && private_ == other.private_ && slug == other.slug && url == other.url && rootDir == other.rootDir && projectId == other.projectId && gitAccountId == other.gitAccountId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, gitId, dateConnected, dateUpdated, branch, name, private_, slug, url, rootDir, projectId, gitAccountId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GitRepo{id=$id, gitId=$gitId, dateConnected=$dateConnected, dateUpdated=$dateUpdated, branch=$branch, name=$name, private_=$private_, slug=$slug, url=$url, rootDir=$rootDir, projectId=$projectId, gitAccountId=$gitAccountId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Project && id == other.id && workspaceId == other.workspaceId && creatorId == other.creatorId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && description == other.description && source == other.source && taskType == other.taskType && versionCount == other.versionCount && inferencePipelineCount == other.inferencePipelineCount && goalCount == other.goalCount && developmentGoalCount == other.developmentGoalCount && monitoringGoalCount == other.monitoringGoalCount && links == other.links && gitRepo == other.gitRepo && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, workspaceId, creatorId, name, dateCreated, dateUpdated, description, source, taskType, versionCount, inferencePipelineCount, goalCount, developmentGoalCount, monitoringGoalCount, links, gitRepo, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Project{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}" + } + + @JsonDeserialize(builder = Workspace.Builder::class) + @NoAutoDetect + class Workspace + private constructor( + private val id: JsonField, + private val name: JsonField, + private val slug: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val creatorId: JsonField, + private val inviteCode: JsonField, + private val wildcardDomains: JsonField>, + private val projectCount: JsonField, + private val memberCount: JsonField, + private val monthlyUsage: JsonField>, + private val inviteCount: JsonField, + private val periodStartDate: JsonField, + private val periodEndDate: JsonField, + private val samlOnlyAccess: JsonField, + private val status: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + fun name(): String = name.getRequired("name") + + fun slug(): String = slug.getRequired("slug") + + fun dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + fun dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + fun creatorId(): Optional = + Optional.ofNullable(creatorId.getNullable("creatorId")) + + fun inviteCode(): Optional = + Optional.ofNullable(inviteCode.getNullable("inviteCode")) + + fun wildcardDomains(): Optional> = + Optional.ofNullable(wildcardDomains.getNullable("wildcardDomains")) + + fun projectCount(): Long = projectCount.getRequired("projectCount") + + fun memberCount(): Long = memberCount.getRequired("memberCount") + + fun monthlyUsage(): Optional> = + Optional.ofNullable(monthlyUsage.getNullable("monthlyUsage")) + + fun inviteCount(): Long = inviteCount.getRequired("inviteCount") + + fun periodStartDate(): Optional = + Optional.ofNullable(periodStartDate.getNullable("periodStartDate")) + + fun periodEndDate(): Optional = + Optional.ofNullable(periodEndDate.getNullable("periodEndDate")) + + fun samlOnlyAccess(): Optional = + Optional.ofNullable(samlOnlyAccess.getNullable("samlOnlyAccess")) + + fun status(): Status = status.getRequired("status") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + @JsonProperty("name") @ExcludeMissing fun _name() = name + + @JsonProperty("slug") @ExcludeMissing fun _slug() = slug + + @JsonProperty("dateCreated") @ExcludeMissing fun _dateCreated() = dateCreated + + @JsonProperty("dateUpdated") @ExcludeMissing fun _dateUpdated() = dateUpdated + + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId() = creatorId + + @JsonProperty("inviteCode") @ExcludeMissing fun _inviteCode() = inviteCode + + @JsonProperty("wildcardDomains") + @ExcludeMissing + fun _wildcardDomains() = wildcardDomains + + @JsonProperty("projectCount") @ExcludeMissing fun _projectCount() = projectCount + + @JsonProperty("memberCount") @ExcludeMissing fun _memberCount() = memberCount + + @JsonProperty("monthlyUsage") @ExcludeMissing fun _monthlyUsage() = monthlyUsage + + @JsonProperty("inviteCount") @ExcludeMissing fun _inviteCount() = inviteCount + + @JsonProperty("periodStartDate") + @ExcludeMissing + fun _periodStartDate() = periodStartDate + + @JsonProperty("periodEndDate") @ExcludeMissing fun _periodEndDate() = periodEndDate + + @JsonProperty("samlOnlyAccess") @ExcludeMissing fun _samlOnlyAccess() = samlOnlyAccess + + @JsonProperty("status") @ExcludeMissing fun _status() = status + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): Workspace = apply { + if (!validated) { + id() + name() + slug() + dateCreated() + dateUpdated() + creatorId() + inviteCode() + wildcardDomains() + projectCount() + memberCount() + monthlyUsage().map { it.forEach { it.validate() } } + inviteCount() + periodStartDate() + periodEndDate() + samlOnlyAccess() + status() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var slug: JsonField = JsonMissing.of() + private var dateCreated: JsonField = JsonMissing.of() + private var dateUpdated: JsonField = JsonMissing.of() + private var creatorId: JsonField = JsonMissing.of() + private var inviteCode: JsonField = JsonMissing.of() + private var wildcardDomains: JsonField> = JsonMissing.of() + private var projectCount: JsonField = JsonMissing.of() + private var memberCount: JsonField = JsonMissing.of() + private var monthlyUsage: JsonField> = JsonMissing.of() + private var inviteCount: JsonField = JsonMissing.of() + private var periodStartDate: JsonField = JsonMissing.of() + private var periodEndDate: JsonField = JsonMissing.of() + private var samlOnlyAccess: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(workspace: Workspace) = apply { + this.id = workspace.id + this.name = workspace.name + this.slug = workspace.slug + this.dateCreated = workspace.dateCreated + this.dateUpdated = workspace.dateUpdated + this.creatorId = workspace.creatorId + this.inviteCode = workspace.inviteCode + this.wildcardDomains = workspace.wildcardDomains + this.projectCount = workspace.projectCount + this.memberCount = workspace.memberCount + this.monthlyUsage = workspace.monthlyUsage + this.inviteCount = workspace.inviteCount + this.periodStartDate = workspace.periodStartDate + this.periodEndDate = workspace.periodEndDate + this.samlOnlyAccess = workspace.samlOnlyAccess + this.status = workspace.status + additionalProperties(workspace.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + @JsonProperty("slug") + @ExcludeMissing + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun dateCreated(dateCreated: OffsetDateTime) = + dateCreated(JsonField.of(dateCreated)) + + @JsonProperty("dateCreated") + @ExcludeMissing + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = + dateUpdated(JsonField.of(dateUpdated)) + + @JsonProperty("dateUpdated") + @ExcludeMissing + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun creatorId(creatorId: String) = creatorId(JsonField.of(creatorId)) + + @JsonProperty("creatorId") + @ExcludeMissing + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + fun inviteCode(inviteCode: String) = inviteCode(JsonField.of(inviteCode)) + + @JsonProperty("inviteCode") + @ExcludeMissing + fun inviteCode(inviteCode: JsonField) = apply { + this.inviteCode = inviteCode + } + + fun wildcardDomains(wildcardDomains: List) = + wildcardDomains(JsonField.of(wildcardDomains)) + + @JsonProperty("wildcardDomains") + @ExcludeMissing + fun wildcardDomains(wildcardDomains: JsonField>) = apply { + this.wildcardDomains = wildcardDomains + } + + fun projectCount(projectCount: Long) = projectCount(JsonField.of(projectCount)) + + @JsonProperty("projectCount") + @ExcludeMissing + fun projectCount(projectCount: JsonField) = apply { + this.projectCount = projectCount + } + + fun memberCount(memberCount: Long) = memberCount(JsonField.of(memberCount)) + + @JsonProperty("memberCount") + @ExcludeMissing + fun memberCount(memberCount: JsonField) = apply { + this.memberCount = memberCount + } + + fun monthlyUsage(monthlyUsage: List) = + monthlyUsage(JsonField.of(monthlyUsage)) + + @JsonProperty("monthlyUsage") + @ExcludeMissing + fun monthlyUsage(monthlyUsage: JsonField>) = apply { + this.monthlyUsage = monthlyUsage + } + + fun inviteCount(inviteCount: Long) = inviteCount(JsonField.of(inviteCount)) + + @JsonProperty("inviteCount") + @ExcludeMissing + fun inviteCount(inviteCount: JsonField) = apply { + this.inviteCount = inviteCount + } + + fun periodStartDate(periodStartDate: OffsetDateTime) = + periodStartDate(JsonField.of(periodStartDate)) + + @JsonProperty("periodStartDate") + @ExcludeMissing + fun periodStartDate(periodStartDate: JsonField) = apply { + this.periodStartDate = periodStartDate + } + + fun periodEndDate(periodEndDate: OffsetDateTime) = + periodEndDate(JsonField.of(periodEndDate)) + + @JsonProperty("periodEndDate") + @ExcludeMissing + fun periodEndDate(periodEndDate: JsonField) = apply { + this.periodEndDate = periodEndDate + } + + fun samlOnlyAccess(samlOnlyAccess: Boolean) = + samlOnlyAccess(JsonField.of(samlOnlyAccess)) + + @JsonProperty("samlOnlyAccess") + @ExcludeMissing + fun samlOnlyAccess(samlOnlyAccess: JsonField) = apply { + this.samlOnlyAccess = samlOnlyAccess + } + + fun status(status: Status) = status(JsonField.of(status)) + + @JsonProperty("status") + @ExcludeMissing + fun status(status: JsonField) = apply { this.status = status } + + 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(): Workspace = + Workspace( + id, + name, + slug, + dateCreated, + dateUpdated, + creatorId, + inviteCode, + wildcardDomains.map { it.toImmutable() }, + projectCount, + memberCount, + monthlyUsage.map { it.toImmutable() }, + inviteCount, + periodStartDate, + periodEndDate, + samlOnlyAccess, + status, + additionalProperties.toImmutable(), + ) + } + + class Status + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val PAST_DUE = of("past_due") + + @JvmField val UNPAID = of("unpaid") + + @JvmField val CANCELED = of("canceled") + + @JvmField val INCOMPLETE = of("incomplete") + + @JvmField val INCOMPLETE_EXPIRED = of("incomplete_expired") + + @JvmField val TRIALING = of("trialing") + + @JvmField val PAUSED = of("paused") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + } + + enum class Value { + ACTIVE, + PAST_DUE, + UNPAID, + CANCELED, + INCOMPLETE, + INCOMPLETE_EXPIRED, + TRIALING, + PAUSED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + PAST_DUE -> Value.PAST_DUE + UNPAID -> Value.UNPAID + CANCELED -> Value.CANCELED + INCOMPLETE -> Value.INCOMPLETE + INCOMPLETE_EXPIRED -> Value.INCOMPLETE_EXPIRED + TRIALING -> Value.TRIALING + PAUSED -> Value.PAUSED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + PAST_DUE -> Known.PAST_DUE + UNPAID -> Known.UNPAID + CANCELED -> Known.CANCELED + INCOMPLETE -> Known.INCOMPLETE + INCOMPLETE_EXPIRED -> Known.INCOMPLETE_EXPIRED + TRIALING -> Known.TRIALING + PAUSED -> Known.PAUSED + else -> throw OpenlayerInvalidDataException("Unknown Status: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + @JsonDeserialize(builder = MonthlyUsage.Builder::class) + @NoAutoDetect + class MonthlyUsage + private constructor( + private val monthYear: JsonField, + private val predictionCount: JsonField, + private val executionTimeMs: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun monthYear(): Optional = + Optional.ofNullable(monthYear.getNullable("monthYear")) + + fun predictionCount(): Optional = + Optional.ofNullable(predictionCount.getNullable("predictionCount")) + + fun executionTimeMs(): Optional = + Optional.ofNullable(executionTimeMs.getNullable("executionTimeMs")) + + @JsonProperty("monthYear") @ExcludeMissing fun _monthYear() = monthYear + + @JsonProperty("predictionCount") + @ExcludeMissing + fun _predictionCount() = predictionCount + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun _executionTimeMs() = executionTimeMs + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): MonthlyUsage = apply { + if (!validated) { + monthYear() + predictionCount() + executionTimeMs() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var monthYear: JsonField = JsonMissing.of() + private var predictionCount: JsonField = JsonMissing.of() + private var executionTimeMs: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(monthlyUsage: MonthlyUsage) = apply { + this.monthYear = monthlyUsage.monthYear + this.predictionCount = monthlyUsage.predictionCount + this.executionTimeMs = monthlyUsage.executionTimeMs + additionalProperties(monthlyUsage.additionalProperties) + } + + fun monthYear(monthYear: LocalDate) = monthYear(JsonField.of(monthYear)) + + @JsonProperty("monthYear") + @ExcludeMissing + fun monthYear(monthYear: JsonField) = apply { + this.monthYear = monthYear + } + + fun predictionCount(predictionCount: Long) = + predictionCount(JsonField.of(predictionCount)) + + @JsonProperty("predictionCount") + @ExcludeMissing + fun predictionCount(predictionCount: JsonField) = apply { + this.predictionCount = predictionCount + } + + fun executionTimeMs(executionTimeMs: Long) = + executionTimeMs(JsonField.of(executionTimeMs)) + + @JsonProperty("executionTimeMs") + @ExcludeMissing + fun executionTimeMs(executionTimeMs: JsonField) = apply { + this.executionTimeMs = executionTimeMs + } + + 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(): MonthlyUsage = + MonthlyUsage( + monthYear, + predictionCount, + executionTimeMs, + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MonthlyUsage && monthYear == other.monthYear && predictionCount == other.predictionCount && executionTimeMs == other.executionTimeMs && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(monthYear, predictionCount, executionTimeMs, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MonthlyUsage{monthYear=$monthYear, predictionCount=$predictionCount, executionTimeMs=$executionTimeMs, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Workspace && id == other.id && name == other.name && slug == other.slug && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && creatorId == other.creatorId && inviteCode == other.inviteCode && wildcardDomains == other.wildcardDomains && projectCount == other.projectCount && memberCount == other.memberCount && monthlyUsage == other.monthlyUsage && inviteCount == other.inviteCount && periodStartDate == other.periodStartDate && periodEndDate == other.periodEndDate && samlOnlyAccess == other.samlOnlyAccess && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, name, slug, dateCreated, dateUpdated, creatorId, inviteCode, wildcardDomains, projectCount, memberCount, monthlyUsage, inviteCount, periodStartDate, periodEndDate, samlOnlyAccess, status, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Workspace{id=$id, name=$name, slug=$slug, dateCreated=$dateCreated, dateUpdated=$dateUpdated, creatorId=$creatorId, inviteCode=$inviteCode, wildcardDomains=$wildcardDomains, projectCount=$projectCount, memberCount=$memberCount, monthlyUsage=$monthlyUsage, inviteCount=$inviteCount, periodStartDate=$periodStartDate, periodEndDate=$periodEndDate, samlOnlyAccess=$samlOnlyAccess, status=$status, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Item && id == other.id && projectId == other.projectId && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Item && id == other.id && projectId == other.projectId && workspaceId == other.workspaceId && project == other.project && workspace == other.workspace && name == other.name && dateCreated == other.dateCreated && dateUpdated == other.dateUpdated && dateLastSampleReceived == other.dateLastSampleReceived && description == other.description && dateLastEvaluated == other.dateLastEvaluated && dateOfNextEvaluation == other.dateOfNextEvaluation && passingGoalCount == other.passingGoalCount && failingGoalCount == other.failingGoalCount && totalGoalCount == other.totalGoalCount && status == other.status && statusMessage == other.statusMessage && links == other.links && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, projectId, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, projectId, workspaceId, project, workspace, name, dateCreated, dateUpdated, dateLastSampleReceived, description, dateLastEvaluated, dateOfNextEvaluation, passingGoalCount, failingGoalCount, totalGoalCount, status, statusMessage, links, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Item{id=$id, projectId=$projectId, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" + "Item{id=$id, projectId=$projectId, workspaceId=$workspaceId, project=$project, workspace=$workspace, name=$name, dateCreated=$dateCreated, dateUpdated=$dateUpdated, dateLastSampleReceived=$dateLastSampleReceived, description=$description, dateLastEvaluated=$dateLastEvaluated, dateOfNextEvaluation=$dateOfNextEvaluation, passingGoalCount=$passingGoalCount, failingGoalCount=$failingGoalCount, totalGoalCount=$totalGoalCount, status=$status, statusMessage=$statusMessage, links=$links, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt index 9becd92..cb3cfc6 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveParamsTest.kt @@ -2,6 +2,7 @@ package com.openlayer.api.models +import com.openlayer.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -11,9 +12,32 @@ class InferencePipelineRetrieveParamsTest { fun createInferencePipelineRetrieveParams() { InferencePipelineRetrieveParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .expand(listOf(InferencePipelineRetrieveParams.Expand.PROJECT)) .build() } + @Test + fun getQueryParams() { + val params = + InferencePipelineRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .expand(listOf(InferencePipelineRetrieveParams.Expand.PROJECT)) + .build() + val expected = QueryParams.builder() + expected.put("expand", InferencePipelineRetrieveParams.Expand.PROJECT.toString()) + assertThat(params.getQueryParams()).isEqualTo(expected.build()) + } + + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = + InferencePipelineRetrieveParams.builder() + .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + val expected = QueryParams.builder() + assertThat(params.getQueryParams()).isEqualTo(expected.build()) + } + @Test fun getPathParam() { val params = diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt index bdbcbe6..9b516de 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRetrieveResponseTest.kt @@ -2,6 +2,7 @@ package com.openlayer.api.models +import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -33,6 +34,76 @@ class InferencePipelineRetrieveResponseTest { .status(InferencePipelineRetrieveResponse.Status.QUEUED) .statusMessage("Tests successfully evaluated") .totalGoalCount(6L) + .project( + InferencePipelineRetrieveResponse.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + InferencePipelineRetrieveResponse.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(InferencePipelineRetrieveResponse.Project.Source.WEB) + .taskType(InferencePipelineRetrieveResponse.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + InferencePipelineRetrieveResponse.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + InferencePipelineRetrieveResponse.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(InferencePipelineRetrieveResponse.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + InferencePipelineRetrieveResponse.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") .build() assertThat(inferencePipelineRetrieveResponse).isNotNull assertThat(inferencePipelineRetrieveResponse.id()) @@ -67,5 +138,78 @@ class InferencePipelineRetrieveResponseTest { assertThat(inferencePipelineRetrieveResponse.statusMessage()) .contains("Tests successfully evaluated") assertThat(inferencePipelineRetrieveResponse.totalGoalCount()).isEqualTo(6L) + assertThat(inferencePipelineRetrieveResponse.project()) + .contains( + InferencePipelineRetrieveResponse.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + InferencePipelineRetrieveResponse.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(InferencePipelineRetrieveResponse.Project.Source.WEB) + .taskType(InferencePipelineRetrieveResponse.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + InferencePipelineRetrieveResponse.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + assertThat(inferencePipelineRetrieveResponse.workspace()) + .contains( + InferencePipelineRetrieveResponse.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(InferencePipelineRetrieveResponse.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + InferencePipelineRetrieveResponse.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + assertThat(inferencePipelineRetrieveResponse.workspaceId()) + .contains("055fddb1-261f-4654-8598-f6347ee46a09") } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRowUpdateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRowUpdateParamsTest.kt index 83221bf..8eb0ac3 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRowUpdateParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineRowUpdateParamsTest.kt @@ -13,6 +13,7 @@ class InferencePipelineRowUpdateParamsTest { fun createInferencePipelineRowUpdateParams() { InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") .row(JsonValue.from(mapOf())) .config( InferencePipelineRowUpdateParams.Config.builder() @@ -23,7 +24,6 @@ class InferencePipelineRowUpdateParamsTest { .timestampColumnName("timestamp") .build() ) - .inferenceId("inferenceId") .build() } @@ -32,6 +32,7 @@ class InferencePipelineRowUpdateParamsTest { val params = InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") .row(JsonValue.from(mapOf())) .config( InferencePipelineRowUpdateParams.Config.builder() @@ -42,7 +43,6 @@ class InferencePipelineRowUpdateParamsTest { .timestampColumnName("timestamp") .build() ) - .inferenceId("inferenceId") .build() val expected = QueryParams.builder() expected.put("inferenceId", "inferenceId") @@ -54,8 +54,8 @@ class InferencePipelineRowUpdateParamsTest { val params = InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .row(JsonValue.from(mapOf())) .inferenceId("inferenceId") + .row(JsonValue.from(mapOf())) .build() val expected = QueryParams.builder() expected.put("inferenceId", "inferenceId") @@ -67,6 +67,7 @@ class InferencePipelineRowUpdateParamsTest { val params = InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") .row(JsonValue.from(mapOf())) .config( InferencePipelineRowUpdateParams.Config.builder() @@ -77,7 +78,6 @@ class InferencePipelineRowUpdateParamsTest { .timestampColumnName("timestamp") .build() ) - .inferenceId("inferenceId") .build() val body = params.getBody() assertThat(body).isNotNull @@ -99,8 +99,8 @@ class InferencePipelineRowUpdateParamsTest { val params = InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .row(JsonValue.from(mapOf())) .inferenceId("inferenceId") + .row(JsonValue.from(mapOf())) .build() val body = params.getBody() assertThat(body).isNotNull @@ -112,8 +112,8 @@ class InferencePipelineRowUpdateParamsTest { val params = InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .row(JsonValue.from(mapOf())) .inferenceId("inferenceId") + .row(JsonValue.from(mapOf())) .build() assertThat(params).isNotNull // path param "inferencePipelineId" diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponseTest.kt index 838b046..22921ec 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/InferencePipelineUpdateResponseTest.kt @@ -2,6 +2,7 @@ package com.openlayer.api.models +import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -33,6 +34,76 @@ class InferencePipelineUpdateResponseTest { .status(InferencePipelineUpdateResponse.Status.QUEUED) .statusMessage("Tests successfully evaluated") .totalGoalCount(6L) + .project( + InferencePipelineUpdateResponse.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + InferencePipelineUpdateResponse.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(InferencePipelineUpdateResponse.Project.Source.WEB) + .taskType(InferencePipelineUpdateResponse.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + InferencePipelineUpdateResponse.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + InferencePipelineUpdateResponse.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(InferencePipelineUpdateResponse.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + InferencePipelineUpdateResponse.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") .build() assertThat(inferencePipelineUpdateResponse).isNotNull assertThat(inferencePipelineUpdateResponse.id()) @@ -67,5 +138,78 @@ class InferencePipelineUpdateResponseTest { assertThat(inferencePipelineUpdateResponse.statusMessage()) .contains("Tests successfully evaluated") assertThat(inferencePipelineUpdateResponse.totalGoalCount()).isEqualTo(6L) + assertThat(inferencePipelineUpdateResponse.project()) + .contains( + InferencePipelineUpdateResponse.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + InferencePipelineUpdateResponse.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(InferencePipelineUpdateResponse.Project.Source.WEB) + .taskType(InferencePipelineUpdateResponse.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + InferencePipelineUpdateResponse.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + assertThat(inferencePipelineUpdateResponse.workspace()) + .contains( + InferencePipelineUpdateResponse.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(InferencePipelineUpdateResponse.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + InferencePipelineUpdateResponse.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + assertThat(inferencePipelineUpdateResponse.workspaceId()) + .contains("055fddb1-261f-4654-8598-f6347ee46a09") } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt index d9484ee..fac797b 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateParamsTest.kt @@ -2,6 +2,8 @@ package com.openlayer.api.models +import java.time.LocalDate +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -13,6 +15,75 @@ class ProjectInferencePipelineCreateParamsTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("This pipeline is used for production.") .name("production") + .project( + ProjectInferencePipelineCreateParams.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineCreateParams.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineCreateParams.Project.Source.WEB) + .taskType(ProjectInferencePipelineCreateParams.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineCreateParams.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + ProjectInferencePipelineCreateParams.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(ProjectInferencePipelineCreateParams.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineCreateParams.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) .build() } @@ -23,11 +94,152 @@ class ProjectInferencePipelineCreateParamsTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("This pipeline is used for production.") .name("production") + .project( + ProjectInferencePipelineCreateParams.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineCreateParams.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineCreateParams.Project.Source.WEB) + .taskType(ProjectInferencePipelineCreateParams.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineCreateParams.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + ProjectInferencePipelineCreateParams.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(ProjectInferencePipelineCreateParams.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineCreateParams.Workspace.MonthlyUsage + .builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) .build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.description()).isEqualTo("This pipeline is used for production.") assertThat(body.name()).isEqualTo("production") + assertThat(body.project()) + .isEqualTo( + ProjectInferencePipelineCreateParams.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineCreateParams.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineCreateParams.Project.Source.WEB) + .taskType(ProjectInferencePipelineCreateParams.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineCreateParams.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + assertThat(body.workspace()) + .isEqualTo( + ProjectInferencePipelineCreateParams.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(ProjectInferencePipelineCreateParams.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineCreateParams.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) } @Test diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt index 7159c5d..646bc7e 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineCreateResponseTest.kt @@ -2,6 +2,7 @@ package com.openlayer.api.models +import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -33,6 +34,77 @@ class ProjectInferencePipelineCreateResponseTest { .status(ProjectInferencePipelineCreateResponse.Status.QUEUED) .statusMessage("Tests successfully evaluated") .totalGoalCount(6L) + .project( + ProjectInferencePipelineCreateResponse.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineCreateResponse.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineCreateResponse.Project.Source.WEB) + .taskType(ProjectInferencePipelineCreateResponse.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineCreateResponse.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + ProjectInferencePipelineCreateResponse.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(ProjectInferencePipelineCreateResponse.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineCreateResponse.Workspace.MonthlyUsage + .builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") .build() assertThat(projectInferencePipelineCreateResponse).isNotNull assertThat(projectInferencePipelineCreateResponse.id()) @@ -67,5 +139,78 @@ class ProjectInferencePipelineCreateResponseTest { assertThat(projectInferencePipelineCreateResponse.statusMessage()) .contains("Tests successfully evaluated") assertThat(projectInferencePipelineCreateResponse.totalGoalCount()).isEqualTo(6L) + assertThat(projectInferencePipelineCreateResponse.project()) + .contains( + ProjectInferencePipelineCreateResponse.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineCreateResponse.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineCreateResponse.Project.Source.WEB) + .taskType(ProjectInferencePipelineCreateResponse.Project.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineCreateResponse.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + assertThat(projectInferencePipelineCreateResponse.workspace()) + .contains( + ProjectInferencePipelineCreateResponse.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(ProjectInferencePipelineCreateResponse.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineCreateResponse.Workspace.MonthlyUsage.builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + assertThat(projectInferencePipelineCreateResponse.workspaceId()) + .contains("055fddb1-261f-4654-8598-f6347ee46a09") } } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt index 2dc728b..ec8ea79 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/ProjectInferencePipelineListResponseTest.kt @@ -2,6 +2,7 @@ package com.openlayer.api.models +import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -38,6 +39,94 @@ class ProjectInferencePipelineListResponseTest { .status(ProjectInferencePipelineListResponse.Item.Status.QUEUED) .statusMessage("Tests successfully evaluated") .totalGoalCount(6L) + .project( + ProjectInferencePipelineListResponse.Item.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineListResponse.Item.Project.Links + .builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source( + ProjectInferencePipelineListResponse.Item.Project.Source.WEB + ) + .taskType( + ProjectInferencePipelineListResponse.Item.Project.TaskType + .LLM_BASE + ) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineListResponse.Item.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + ProjectInferencePipelineListResponse.Item.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .projectCount(0L) + .slug("openlayer") + .status( + ProjectInferencePipelineListResponse.Item.Workspace.Status + .ACTIVE + ) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineListResponse.Item.Workspace + .MonthlyUsage + .builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") .build() ) ) @@ -67,6 +156,81 @@ class ProjectInferencePipelineListResponseTest { .status(ProjectInferencePipelineListResponse.Item.Status.QUEUED) .statusMessage("Tests successfully evaluated") .totalGoalCount(6L) + .project( + ProjectInferencePipelineListResponse.Item.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineListResponse.Item.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineListResponse.Item.Project.Source.WEB) + .taskType( + ProjectInferencePipelineListResponse.Item.Project.TaskType.LLM_BASE + ) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineListResponse.Item.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + ProjectInferencePipelineListResponse.Item.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status( + ProjectInferencePipelineListResponse.Item.Workspace.Status.ACTIVE + ) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineListResponse.Item.Workspace.MonthlyUsage + .builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") .build() ) } diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt index ec3ccf3..4fd1110 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/InferencePipelineServiceTest.kt @@ -25,6 +25,7 @@ class InferencePipelineServiceTest { inferencePipelineService.retrieve( InferencePipelineRetrieveParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .expand(listOf(InferencePipelineRetrieveParams.Expand.PROJECT)) .build() ) println(inferencePipelineRetrieveResponse) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/RowServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/RowServiceTest.kt index eeee656..dacce1d 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/RowServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/inferencePipelines/RowServiceTest.kt @@ -24,6 +24,7 @@ class RowServiceTest { rowService.update( InferencePipelineRowUpdateParams.builder() .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .inferenceId("inferenceId") .row(JsonValue.from(mapOf())) .config( InferencePipelineRowUpdateParams.Config.builder() @@ -34,7 +35,6 @@ class RowServiceTest { .timestampColumnName("timestamp") .build() ) - .inferenceId("inferenceId") .build() ) println(inferencePipelineRowUpdateResponse) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt index c145f4f..c7a80a4 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt @@ -6,6 +6,8 @@ import com.openlayer.api.TestServerExtension import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient import com.openlayer.api.models.ProjectInferencePipelineCreateParams import com.openlayer.api.models.ProjectInferencePipelineListParams +import java.time.LocalDate +import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -26,6 +28,78 @@ class InferencePipelineServiceTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("This pipeline is used for production.") .name("production") + .project( + ProjectInferencePipelineCreateParams.Project.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(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectInferencePipelineCreateParams.Project.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectInferencePipelineCreateParams.Project.Source.WEB) + .taskType( + ProjectInferencePipelineCreateParams.Project.TaskType.LLM_BASE + ) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .description("My project description.") + .gitRepo( + ProjectInferencePipelineCreateParams.Project.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(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .build() + ) + .workspace( + ProjectInferencePipelineCreateParams.Workspace.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .creatorId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .inviteCount(0L) + .memberCount(0L) + .name("Openlayer") + .periodEndDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .periodStartDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .projectCount(0L) + .slug("openlayer") + .status(ProjectInferencePipelineCreateParams.Workspace.Status.ACTIVE) + .inviteCode("inviteCode") + .monthlyUsage( + listOf( + ProjectInferencePipelineCreateParams.Workspace.MonthlyUsage + .builder() + .executionTimeMs(0L) + .monthYear(LocalDate.parse("2019-12-27")) + .predictionCount(0L) + .build() + ) + ) + .samlOnlyAccess(true) + .wildcardDomains(listOf("string")) + .build() + ) .build() ) println(projectInferencePipelineCreateResponse) diff --git a/openlayer-java-example/build.gradle.kts b/openlayer-java-example/build.gradle.kts new file mode 100644 index 0000000..9973e51 --- /dev/null +++ b/openlayer-java-example/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("openlayer.kotlin") + id("java") + application +} + +dependencies { + implementation(project(":openlayer-java")) +} + +tasks.withType().configureEach { + // Allow using more modern APIs, like `List.of` and `Map.of`, in examples. + options.release.set(9) +} + +application { + mainClass = "com.openlayer.api.example.Main" +}