diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2b28d6ec..6d78745c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.1" + ".": "0.9.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index df395195..40c511ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## 0.9.0 (2026-05-06) + +Full Changelog: [v0.8.1...v0.9.0](https://github.com/openlayer-ai/openlayer-java/compare/v0.8.1...v0.9.0) + +### Features + +* **client:** more robust error parsing ([28aef40](https://github.com/openlayer-ai/openlayer-java/commit/28aef408ee0ba8b68b4e5c3b7f8674f9538fb12c)) +* **client:** support proxy authentication ([d34e16d](https://github.com/openlayer-ai/openlayer-java/commit/d34e16d3662aafa7a814b5756838333b077095f9)) +* support setting headers via env ([b045b8e](https://github.com/openlayer-ai/openlayer-java/commit/b045b8ee4cbc7099734674e06706d0334e70a4fe)) + + +### Performance Improvements + +* **client:** create one json mapper ([74b6403](https://github.com/openlayer-ai/openlayer-java/commit/74b6403db4f6798234a9b98c73a8b59d0a88bf5b)) + + +### Chores + +* remove duplicated dokka setup ([dde1361](https://github.com/openlayer-ai/openlayer-java/commit/dde1361a5a6b2415c21f97a75b953beac1f173ad)) +* **tests:** bump steady to v0.22.1 ([277c809](https://github.com/openlayer-ai/openlayer-java/commit/277c809aa93a31be85ff7b70b5e2d801244e1c69)) + + +### Documentation + +* clarify forwards compat behavior ([d8035d8](https://github.com/openlayer-ai/openlayer-java/commit/d8035d8f9ef26a29e80d6d0399f42591c1d33414)) + ## 0.8.1 (2026-04-10) Full Changelog: [v0.8.0...v0.8.1](https://github.com/openlayer-ai/openlayer-java/compare/v0.8.0...v0.8.1) diff --git a/README.md b/README.md index dc71ceaf..55e74196 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.8.1) -[![javadoc](https://javadoc.io/badge2/com.openlayer.api/openlayer-java/0.8.1/javadoc.svg)](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.8.1) +[![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.9.0) +[![javadoc](https://javadoc.io/badge2/com.openlayer.api/openlayer-java/0.9.0/javadoc.svg)](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.9.0) @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.8.1). +The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.9.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [openlayer.com](https://openlayer.com ### Gradle ```kotlin -implementation("com.openlayer.api:openlayer-java:0.8.1") +implementation("com.openlayer.api:openlayer-java:0.9.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.openlayer.api:openlayer-java:0.8.1") com.openlayer.api openlayer-java - 0.8.1 + 0.9.0 ``` @@ -407,6 +407,21 @@ OpenlayerClient client = OpenlayerOkHttpClient.builder() .build(); ``` +If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`: + +```java +import com.openlayer.api.client.OpenlayerClient; +import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient; +import com.openlayer.api.core.http.ProxyAuthenticator; + +OpenlayerClient client = OpenlayerOkHttpClient.builder() + .fromEnv() + .proxy(...) + // Or a custom implementation of `ProxyAuthenticator`. + .proxyAuthenticator(ProxyAuthenticator.basic("username", "password")) + .build(); +``` + ### Connection pooling To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods: @@ -661,7 +676,9 @@ In rare cases, the API may return a response that doesn't match the expected typ By default, the SDK will not throw an exception in this case. It will throw [`OpenlayerInvalidDataException`](openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/OpenlayerInvalidDataException.kt) only if you directly access the property. -If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: +Validating the response is _not_ forwards compatible with new types from the API for existing fields. + +If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`: ```java import com.openlayer.api.models.inferencepipelines.data.DataStreamResponse; diff --git a/build.gradle.kts b/build.gradle.kts index 317b1c2b..f52c9a56 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.openlayer.api" - version = "0.8.1" // x-release-please-version + version = "0.9.0" // x-release-please-version } subprojects { @@ -21,7 +21,6 @@ subprojects { group = "Verification" description = "Verifies all source files are formatted." } - apply(plugin = "org.jetbrains.dokka") } subprojects { diff --git a/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OkHttpClient.kt b/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OkHttpClient.kt index 461d09d7..6d7d9c5c 100644 --- a/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OkHttpClient.kt +++ b/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OkHttpClient.kt @@ -8,9 +8,11 @@ import com.openlayer.api.core.http.HttpMethod import com.openlayer.api.core.http.HttpRequest import com.openlayer.api.core.http.HttpRequestBody import com.openlayer.api.core.http.HttpResponse +import com.openlayer.api.core.http.ProxyAuthenticator import com.openlayer.api.errors.OpenlayerIoException import java.io.IOException import java.io.InputStream +import java.io.OutputStream import java.net.Proxy import java.time.Duration import java.util.concurrent.CancellationException @@ -20,10 +22,12 @@ import java.util.concurrent.TimeUnit import javax.net.ssl.HostnameVerifier import javax.net.ssl.SSLSocketFactory import javax.net.ssl.X509TrustManager +import kotlin.jvm.optionals.getOrNull import okhttp3.Call import okhttp3.Callback import okhttp3.ConnectionPool import okhttp3.Dispatcher +import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.MediaType import okhttp3.MediaType.Companion.toMediaType @@ -33,6 +37,8 @@ import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response import okhttp3.logging.HttpLoggingInterceptor import okio.BufferedSink +import okio.buffer +import okio.sink class OkHttpClient internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient { @@ -41,7 +47,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie val call = newCall(request, requestOptions) return try { - call.execute().toResponse() + call.execute().toHttpResponse() } catch (e: IOException) { throw OpenlayerIoException("Request failed", e) } finally { @@ -59,7 +65,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie call.enqueue( object : Callback { override fun onResponse(call: Call, response: Response) { - future.complete(response.toResponse()) + future.complete(response.toHttpResponse()) } override fun onFailure(call: Call, e: IOException) { @@ -111,89 +117,6 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie return client.newCall(request.toRequest(client)) } - private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request { - var body: RequestBody? = body?.toRequestBody() - if (body == null && requiresBody(method)) { - body = "".toRequestBody() - } - - val builder = Request.Builder().url(toUrl()).method(method.name, body) - headers.names().forEach { name -> - headers.values(name).forEach { builder.addHeader(name, it) } - } - - if ( - !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 - ) { - builder.addHeader( - "X-Stainless-Read-Timeout", - Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), - ) - } - if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { - builder.addHeader( - "X-Stainless-Timeout", - Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), - ) - } - - return builder.build() - } - - /** `OkHttpClient` always requires a request body for some methods. */ - private fun requiresBody(method: HttpMethod): Boolean = - when (method) { - HttpMethod.POST, - HttpMethod.PUT, - HttpMethod.PATCH -> true - else -> false - } - - private fun HttpRequest.toUrl(): String { - val builder = baseUrl.toHttpUrl().newBuilder() - pathSegments.forEach(builder::addPathSegment) - queryParams.keys().forEach { key -> - queryParams.values(key).forEach { builder.addQueryParameter(key, it) } - } - - return builder.toString() - } - - private fun HttpRequestBody.toRequestBody(): RequestBody { - val mediaType = contentType()?.toMediaType() - val length = contentLength() - - return object : RequestBody() { - override fun contentType(): MediaType? = mediaType - - override fun contentLength(): Long = length - - override fun isOneShot(): Boolean = !repeatable() - - override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream()) - } - } - - private fun Response.toResponse(): HttpResponse { - val headers = headers.toHeaders() - - return object : HttpResponse { - override fun statusCode(): Int = code - - override fun headers(): Headers = headers - - override fun body(): InputStream = body!!.byteStream() - - override fun close() = body!!.close() - } - } - - private fun okhttp3.Headers.toHeaders(): Headers { - val headersBuilder = Headers.builder() - forEach { (name, value) -> headersBuilder.put(name, value) } - return headersBuilder.build() - } - companion object { @JvmStatic fun builder() = Builder() } @@ -202,6 +125,7 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie private var timeout: Timeout = Timeout.default() private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null private var maxIdleConnections: Int? = null private var keepAliveDuration: Duration? = null private var dispatcherExecutorService: ExecutorService? = null @@ -215,6 +139,10 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie fun proxy(proxy: Proxy?) = apply { this.proxy = proxy } + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + /** * Sets the maximum number of idle connections kept by the underlying [ConnectionPool]. * @@ -264,6 +192,19 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie .callTimeout(timeout.request()) .proxy(proxy) .apply { + proxyAuthenticator?.let { auth -> + proxyAuthenticator { route, response -> + auth + .authenticate( + route?.proxy ?: Proxy.NO_PROXY, + response.request.toHttpRequest(), + response.toHttpResponse(), + ) + .getOrNull() + ?.toRequest(client = null) + } + } + dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) } val maxIdleConnections = maxIdleConnections @@ -303,3 +244,126 @@ internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClie ) } } + +private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient?): Request { + var body: RequestBody? = body?.toRequestBody() + if (body == null && requiresBody(method)) { + body = "".toRequestBody() + } + + val builder = Request.Builder().url(toUrl()).method(method.name, body) + headers.names().forEach { name -> headers.values(name).forEach { builder.addHeader(name, it) } } + + if (client != null) { + if ( + !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 + ) { + builder.addHeader( + "X-Stainless-Read-Timeout", + Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), + ) + } + if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { + builder.addHeader( + "X-Stainless-Timeout", + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), + ) + } + } + + return builder.build() +} + +/** `OkHttpClient` always requires a request body for some methods. */ +private fun requiresBody(method: HttpMethod): Boolean = + when (method) { + HttpMethod.POST, + HttpMethod.PUT, + HttpMethod.PATCH -> true + else -> false + } + +private fun HttpRequest.toUrl(): String { + val builder = baseUrl.toHttpUrl().newBuilder() + pathSegments.forEach(builder::addPathSegment) + queryParams.keys().forEach { key -> + queryParams.values(key).forEach { builder.addQueryParameter(key, it) } + } + + return builder.toString() +} + +private fun HttpRequestBody.toRequestBody(): RequestBody { + val mediaType = contentType()?.toMediaType() + val length = contentLength() + + return object : RequestBody() { + override fun contentType(): MediaType? = mediaType + + override fun contentLength(): Long = length + + override fun isOneShot(): Boolean = !repeatable() + + override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream()) + } +} + +private fun Request.toHttpRequest(): HttpRequest { + val builder = HttpRequest.builder().method(HttpMethod.valueOf(method)).baseUrl(url.toBaseUrl()) + url.pathSegments.forEach(builder::addPathSegment) + url.queryParameterNames.forEach { name -> + url.queryParameterValues(name).filterNotNull().forEach { builder.putQueryParam(name, it) } + } + headers.forEach { (name, value) -> builder.putHeader(name, value) } + body?.let { builder.body(it.toHttpRequestBody()) } + return builder.build() +} + +private fun HttpUrl.toBaseUrl(): String = buildString { + append(scheme).append("://").append(host) + if (port != HttpUrl.defaultPort(scheme)) { + append(":").append(port) + } +} + +private fun RequestBody.toHttpRequestBody(): HttpRequestBody { + val mediaType = contentType()?.toString() + val length = contentLength() + val isOneShot = isOneShot() + val source = this + return object : HttpRequestBody { + override fun contentType(): String? = mediaType + + override fun contentLength(): Long = length + + override fun repeatable(): Boolean = !isOneShot + + override fun writeTo(outputStream: OutputStream) { + val sink = outputStream.sink().buffer() + source.writeTo(sink) + sink.flush() + } + + override fun close() {} + } +} + +private fun Response.toHttpResponse(): HttpResponse { + val headers = headers.toHeaders() + + return object : HttpResponse { + override fun statusCode(): Int = code + + override fun headers(): Headers = headers + + override fun body(): InputStream = body!!.byteStream() + + override fun close() = body!!.close() + } +} + +private fun okhttp3.Headers.toHeaders(): Headers { + val headersBuilder = Headers.builder() + forEach { (name, value) -> headersBuilder.put(name, value) } + return headersBuilder.build() +} diff --git a/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt b/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt index 75c67968..a833c9de 100644 --- a/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt +++ b/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt @@ -10,6 +10,7 @@ import com.openlayer.api.core.Sleeper import com.openlayer.api.core.Timeout import com.openlayer.api.core.http.Headers import com.openlayer.api.core.http.HttpClient +import com.openlayer.api.core.http.ProxyAuthenticator import com.openlayer.api.core.http.QueryParams import com.openlayer.api.core.jsonMapper import java.net.Proxy @@ -47,6 +48,7 @@ class OpenlayerOkHttpClient private constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var dispatcherExecutorService: ExecutorService? = null private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null private var maxIdleConnections: Int? = null private var keepAliveDuration: Duration? = null private var sslSocketFactory: SSLSocketFactory? = null @@ -77,6 +79,20 @@ class OpenlayerOkHttpClient private constructor() { /** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */ fun proxy(proxy: Optional) = proxy(proxy.getOrNull()) + /** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication + * Required`. + */ + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`. + */ + fun proxyAuthenticator(proxyAuthenticator: Optional) = + proxyAuthenticator(proxyAuthenticator.getOrNull()) + /** * The maximum number of idle connections kept by the underlying OkHttp connection pool. * @@ -217,6 +233,9 @@ class OpenlayerOkHttpClient private constructor() { /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -362,6 +381,7 @@ class OpenlayerOkHttpClient private constructor() { OkHttpClient.builder() .timeout(clientOptions.timeout()) .proxy(proxy) + .proxyAuthenticator(proxyAuthenticator) .maxIdleConnections(maxIdleConnections) .keepAliveDuration(keepAliveDuration) .dispatcherExecutorService(dispatcherExecutorService) diff --git a/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt b/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt index aa3da5ec..b5665647 100644 --- a/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt +++ b/openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt @@ -10,6 +10,7 @@ import com.openlayer.api.core.Sleeper import com.openlayer.api.core.Timeout import com.openlayer.api.core.http.Headers import com.openlayer.api.core.http.HttpClient +import com.openlayer.api.core.http.ProxyAuthenticator import com.openlayer.api.core.http.QueryParams import com.openlayer.api.core.jsonMapper import java.net.Proxy @@ -47,6 +48,7 @@ class OpenlayerOkHttpClientAsync private constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var dispatcherExecutorService: ExecutorService? = null private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null private var maxIdleConnections: Int? = null private var keepAliveDuration: Duration? = null private var sslSocketFactory: SSLSocketFactory? = null @@ -77,6 +79,20 @@ class OpenlayerOkHttpClientAsync private constructor() { /** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */ fun proxy(proxy: Optional) = proxy(proxy.getOrNull()) + /** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication + * Required`. + */ + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`. + */ + fun proxyAuthenticator(proxyAuthenticator: Optional) = + proxyAuthenticator(proxyAuthenticator.getOrNull()) + /** * The maximum number of idle connections kept by the underlying OkHttp connection pool. * @@ -217,6 +233,9 @@ class OpenlayerOkHttpClientAsync private constructor() { /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -362,6 +381,7 @@ class OpenlayerOkHttpClientAsync private constructor() { OkHttpClient.builder() .timeout(clientOptions.timeout()) .proxy(proxy) + .proxyAuthenticator(proxyAuthenticator) .maxIdleConnections(maxIdleConnections) .keepAliveDuration(keepAliveDuration) .dispatcherExecutorService(dispatcherExecutorService) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ClientOptions.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ClientOptions.kt index 166a2acf..91a55f92 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ClientOptions.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ClientOptions.kt @@ -66,6 +66,9 @@ private constructor( /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for existing + * fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -230,6 +233,9 @@ private constructor( /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -377,6 +383,14 @@ private constructor( (System.getProperty("openlayer.apiKey") ?: System.getenv("OPENLAYER_API_KEY"))?.let { apiKey(it) } + System.getenv("OPENLAYER_CUSTOM_HEADERS")?.let { customHeadersEnv -> + for (line in customHeadersEnv.split("\n")) { + val colon = line.indexOf(':') + if (colon >= 0) { + putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim()) + } + } + } } /** diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ObjectMappers.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ObjectMappers.kt index 560baaef..dee2331d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ObjectMappers.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/ObjectMappers.kt @@ -29,7 +29,9 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoField -fun jsonMapper(): JsonMapper = +fun jsonMapper(): JsonMapper = JSON_MAPPER + +private val JSON_MAPPER: JsonMapper = JsonMapper.builder() .addModule(kotlinModule()) .addModule(Jdk8Module()) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/RequestOptions.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/RequestOptions.kt index 5ca3fddb..76ae5230 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/RequestOptions.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/RequestOptions.kt @@ -33,6 +33,15 @@ class RequestOptions private constructor(val responseValidation: Boolean?, val t private var responseValidation: Boolean? = null private var timeout: Timeout? = null + /** + * Whether to call `validate` on the response before returning it. + * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * + * Defaults to false, which means the shape of the response will not be validated upfront. + * Instead, validation will only occur for the parts of the response that are accessed. + */ fun responseValidation(responseValidation: Boolean) = apply { this.responseValidation = responseValidation } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/http/ProxyAuthenticator.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/http/ProxyAuthenticator.kt new file mode 100644 index 00000000..889d2537 --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/http/ProxyAuthenticator.kt @@ -0,0 +1,59 @@ +package com.openlayer.api.core.http + +import java.net.Proxy +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets +import java.util.Base64 +import java.util.Optional + +/** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication Required`. + * + * Implementations inspect the 407 [response] (typically its `Proxy-Authenticate` header) and return + * the request to retry with a `Proxy-Authorization` header set, or [Optional.empty] to abandon + * authentication and surface the 407 to the caller. + * + * Implementations must be thread-safe; they may be invoked concurrently from multiple HTTP calls. + */ +fun interface ProxyAuthenticator { + + /** + * @param proxy the proxy that produced the challenge, or [Proxy.NO_PROXY] if the route is not + * yet established + * @param request the request that produced [response] + * @param response the 407 challenge response + * @return the retry request to send (typically [request] with a `Proxy-Authorization` header + * added), or [Optional.empty] to abandon authentication + */ + fun authenticate( + proxy: Proxy, + request: HttpRequest, + response: HttpResponse, + ): Optional + + companion object { + + /** + * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the ISO-8859-1 + * charset. + */ + @JvmStatic + fun basic(username: String, password: String): ProxyAuthenticator = + basic(username, password, StandardCharsets.ISO_8859_1) + + /** + * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the given [charset]. + */ + @JvmStatic + fun basic(username: String, password: String, charset: Charset): ProxyAuthenticator { + val token = + Base64.getEncoder().encodeToString("$username:$password".toByteArray(charset)) + val headerValue = "Basic $token" + return ProxyAuthenticator { _, request, _ -> + Optional.of( + request.toBuilder().putHeader("Proxy-Authorization", headerValue).build() + ) + } + } + } +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/BadRequestException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/BadRequestException.kt index 9acdcaa2..9b276d6f 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/BadRequestException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/BadRequestException.kt @@ -5,12 +5,16 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class BadRequestException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - OpenlayerServiceException("400: $body", cause) { + OpenlayerServiceException( + "400: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 400 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/InternalServerException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/InternalServerException.kt index aca354d8..bd6df58f 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/InternalServerException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/InternalServerException.kt @@ -5,6 +5,7 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -14,7 +15,11 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : OpenlayerServiceException("$statusCode: $body", cause) { +) : + OpenlayerServiceException( + "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = statusCode diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/NotFoundException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/NotFoundException.kt index 4bf98a53..ef9dc2b6 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/NotFoundException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/NotFoundException.kt @@ -5,12 +5,16 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class NotFoundException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - OpenlayerServiceException("404: $body", cause) { + OpenlayerServiceException( + "404: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 404 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/PermissionDeniedException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/PermissionDeniedException.kt index 844dd555..f923bbf5 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/PermissionDeniedException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/PermissionDeniedException.kt @@ -5,12 +5,16 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class PermissionDeniedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - OpenlayerServiceException("403: $body", cause) { + OpenlayerServiceException( + "403: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 403 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/RateLimitException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/RateLimitException.kt index a3fba535..400a960c 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/RateLimitException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/RateLimitException.kt @@ -5,12 +5,16 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class RateLimitException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - OpenlayerServiceException("429: $body", cause) { + OpenlayerServiceException( + "429: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 429 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnauthorizedException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnauthorizedException.kt index ead1e7c7..715d2a4a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnauthorizedException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnauthorizedException.kt @@ -5,12 +5,16 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class UnauthorizedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - OpenlayerServiceException("401: $body", cause) { + OpenlayerServiceException( + "401: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 401 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnexpectedStatusCodeException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnexpectedStatusCodeException.kt index e8ed72b9..03ff9656 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnexpectedStatusCodeException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnexpectedStatusCodeException.kt @@ -5,6 +5,7 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -14,7 +15,11 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : OpenlayerServiceException("$statusCode: $body", cause) { +) : + OpenlayerServiceException( + "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = statusCode diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnprocessableEntityException.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnprocessableEntityException.kt index 10abb5a2..5ab2e67c 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnprocessableEntityException.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/UnprocessableEntityException.kt @@ -5,12 +5,16 @@ package com.openlayer.api.errors import com.openlayer.api.core.JsonValue import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class UnprocessableEntityException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - OpenlayerServiceException("422: $body", cause) { + OpenlayerServiceException( + "422: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 422 diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/CommitRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/CommitRetrieveResponse.kt index 7c0ecd1d..e7232259 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/CommitRetrieveResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/CommitRetrieveResponse.kt @@ -789,6 +789,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CommitRetrieveResponse = apply { if (validated) { return@apply @@ -1423,6 +1431,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Commit = apply { if (validated) { return@apply @@ -1634,6 +1651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1782,6 +1808,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListParams.kt index 790389c0..19be489e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListParams.kt @@ -404,6 +404,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -553,6 +562,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt index 9ab343ef..d2db7c8c 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt @@ -157,6 +157,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestResultListResponse = apply { if (validated) { return@apply @@ -849,6 +857,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1012,6 +1029,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1268,6 +1295,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ExpectedValue = apply { if (validated) { return@apply @@ -2334,6 +2371,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Goal = apply { if (validated) { return@apply @@ -2730,6 +2777,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -3120,6 +3177,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -3452,6 +3519,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -3635,6 +3712,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -3803,6 +3890,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -3941,6 +4038,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -4018,6 +4125,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not + * known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden + * in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -4029,6 +4167,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -4333,6 +4481,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4916,6 +5074,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RowsBody = apply { if (validated) { return@apply @@ -4985,6 +5153,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -4995,6 +5193,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -5384,6 +5592,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -5531,6 +5749,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -5593,6 +5821,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -5602,6 +5861,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -5981,6 +6250,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -6134,6 +6413,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -6406,6 +6695,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -6535,6 +6834,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -6597,6 +6906,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -6606,6 +6946,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveParams.kt index 86a579cb..bcc99087 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveParams.kt @@ -307,6 +307,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Expand = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt index c67ae495..38994255 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt @@ -998,6 +998,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InferencePipelineRetrieveResponse = apply { if (validated) { return@apply @@ -1174,6 +1182,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1330,6 +1347,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1421,6 +1447,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataBackend.accept(new DataBackend.Visitor>() { + * @Override + * public Optional visitBigQuery(BigQueryDataBackend bigQuery) { + * return Optional.of(bigQuery.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { bigQuery != null -> visitor.visitBigQuery(bigQuery) @@ -1434,6 +1489,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DataBackend = apply { if (validated) { return@apply @@ -2020,6 +2084,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): BigQueryDataBackend = apply { if (validated) { return@apply @@ -2147,6 +2221,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -2516,6 +2600,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -2683,6 +2777,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): PartitionType = apply { if (validated) { return@apply @@ -2880,6 +2984,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DefaultDataBackend = apply { if (validated) { return@apply @@ -2994,6 +3108,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3366,6 +3490,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SnowflakeDataBackend = apply { if (validated) { return@apply @@ -3491,6 +3625,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3860,6 +4004,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -4203,6 +4357,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DatabricksDtlDataBackend = apply { if (validated) { return@apply @@ -4324,6 +4488,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4693,6 +4867,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5076,6 +5260,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RedshiftDataBackend = apply { if (validated) { return@apply @@ -5199,6 +5393,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -5568,6 +5772,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5981,6 +6195,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): PostgresDataBackend = apply { if (validated) { return@apply @@ -6106,6 +6330,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -6475,6 +6709,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -7289,6 +7533,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Project = apply { if (validated) { return@apply @@ -7461,6 +7714,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -7601,6 +7864,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -7744,6 +8017,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -8294,6 +8577,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply @@ -9178,6 +9471,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply @@ -9362,6 +9664,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -9597,6 +9909,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsParams.kt index 09018b1e..17ab059d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsParams.kt @@ -1103,6 +1103,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1207,6 +1216,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -1217,6 +1255,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -1594,6 +1641,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -1736,6 +1793,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -1797,6 +1864,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -1806,6 +1903,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -2172,6 +2279,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -2320,6 +2437,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2582,6 +2709,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -2706,6 +2843,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2767,6 +2914,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -2776,6 +2953,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsResponse.kt index 55c201d9..484773dd 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveSessionsResponse.kt @@ -151,6 +151,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InferencePipelineRetrieveSessionsResponse = apply { if (validated) { return@apply @@ -731,6 +739,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -842,6 +859,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): FirstRecord = apply { if (validated) { return@apply @@ -945,6 +972,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): LastRecord = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersParams.kt index 49eb7d3b..12134e3b 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersParams.kt @@ -1102,6 +1102,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1206,6 +1215,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -1216,6 +1254,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -1593,6 +1640,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -1735,6 +1792,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -1796,6 +1863,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -1805,6 +1902,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -2171,6 +2278,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -2319,6 +2436,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2581,6 +2708,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -2705,6 +2842,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2766,6 +2913,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -2775,6 +2952,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersResponse.kt index 5c54529a..1936bf37 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveUsersResponse.kt @@ -151,6 +151,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InferencePipelineRetrieveUsersResponse = apply { if (validated) { return@apply @@ -522,6 +530,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt index 32e8501e..ecf6783e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt @@ -519,6 +519,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt index 4b336edc..5d46c0e8 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt @@ -998,6 +998,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InferencePipelineUpdateResponse = apply { if (validated) { return@apply @@ -1174,6 +1182,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1330,6 +1347,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1421,6 +1447,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataBackend.accept(new DataBackend.Visitor>() { + * @Override + * public Optional visitBigQuery(BigQueryDataBackend bigQuery) { + * return Optional.of(bigQuery.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { bigQuery != null -> visitor.visitBigQuery(bigQuery) @@ -1434,6 +1489,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DataBackend = apply { if (validated) { return@apply @@ -2020,6 +2084,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): BigQueryDataBackend = apply { if (validated) { return@apply @@ -2147,6 +2221,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -2516,6 +2600,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -2683,6 +2777,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): PartitionType = apply { if (validated) { return@apply @@ -2880,6 +2984,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DefaultDataBackend = apply { if (validated) { return@apply @@ -2994,6 +3108,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3366,6 +3490,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SnowflakeDataBackend = apply { if (validated) { return@apply @@ -3491,6 +3625,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3860,6 +4004,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -4203,6 +4357,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DatabricksDtlDataBackend = apply { if (validated) { return@apply @@ -4324,6 +4488,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4693,6 +4867,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5076,6 +5260,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RedshiftDataBackend = apply { if (validated) { return@apply @@ -5199,6 +5393,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -5568,6 +5772,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5981,6 +6195,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): PostgresDataBackend = apply { if (validated) { return@apply @@ -6106,6 +6330,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -6475,6 +6709,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -7289,6 +7533,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Project = apply { if (validated) { return@apply @@ -7461,6 +7714,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -7601,6 +7864,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -7744,6 +8017,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -8294,6 +8577,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply @@ -9178,6 +9471,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply @@ -9362,6 +9664,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -9597,6 +9909,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt index 082e94eb..7017abe3 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt @@ -528,6 +528,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -620,6 +629,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = config.accept(new Config.Visitor>() { + * @Override + * public Optional visitLlmData(LlmData llmData) { + * return Optional.of(llmData.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { llmData != null -> visitor.visitLlmData(llmData) @@ -634,6 +672,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -1551,6 +1598,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): LlmData = apply { if (validated) { return@apply @@ -1738,6 +1795,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Prompt = apply { if (validated) { return@apply @@ -2388,6 +2455,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TabularClassificationData = apply { if (validated) { return@apply @@ -2903,6 +2980,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TabularRegressionData = apply { if (validated) { return@apply @@ -3456,6 +3543,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TextClassificationData = apply { if (validated) { return@apply @@ -3595,6 +3692,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Row = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamResponse.kt index c2b4a487..b9aaf91c 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamResponse.kt @@ -129,6 +129,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DataStreamResponse = apply { if (validated) { return@apply @@ -233,6 +241,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Success = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListParams.kt index a3aa6e7b..1093709a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListParams.kt @@ -1091,6 +1091,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1195,6 +1204,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -1205,6 +1243,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -1582,6 +1629,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -1724,6 +1781,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -1785,6 +1852,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -1794,6 +1891,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -2160,6 +2267,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -2308,6 +2425,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2570,6 +2697,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -2694,6 +2831,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2755,6 +2902,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -2764,6 +2941,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListResponse.kt index f443821e..58aa0ee3 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowListResponse.kt @@ -143,6 +143,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RowListResponse = apply { if (validated) { return@apply @@ -289,6 +297,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt index f0f1524e..b0e0d3ce 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowRetrieveResponse.kt @@ -124,6 +124,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RowRetrieveResponse = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt index 16e06f1b..52828333 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt @@ -421,6 +421,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -789,6 +798,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Config = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateResponse.kt index f6882879..63ee43e3 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateResponse.kt @@ -129,6 +129,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RowUpdateResponse = apply { if (validated) { return@apply @@ -233,6 +241,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Success = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListParams.kt index 0fdd624b..a2309714 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListParams.kt @@ -382,6 +382,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -531,6 +540,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt index 8e4f684f..eb93048e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt @@ -157,6 +157,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestResultListResponse = apply { if (validated) { return@apply @@ -849,6 +857,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1012,6 +1029,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1268,6 +1295,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ExpectedValue = apply { if (validated) { return@apply @@ -2334,6 +2371,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Goal = apply { if (validated) { return@apply @@ -2730,6 +2777,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -3120,6 +3177,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -3452,6 +3519,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -3635,6 +3712,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -3803,6 +3890,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -3941,6 +4038,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -4018,6 +4125,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not + * known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden + * in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -4029,6 +4167,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -4333,6 +4481,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4916,6 +5074,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RowsBody = apply { if (validated) { return@apply @@ -4985,6 +5153,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -4995,6 +5193,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -5384,6 +5592,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -5531,6 +5749,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -5593,6 +5821,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -5602,6 +5861,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -5981,6 +6250,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -6134,6 +6413,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -6406,6 +6695,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -6535,6 +6834,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -6597,6 +6906,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -6606,6 +6946,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt index 4e4983a2..56ecdcb6 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt @@ -1421,6 +1421,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1642,6 +1651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1780,6 +1798,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -1920,6 +1947,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -2447,6 +2483,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt index f793b347..ec1d77e4 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt @@ -710,6 +710,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ProjectCreateResponse = apply { if (validated) { return@apply @@ -877,6 +885,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1015,6 +1032,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -1155,6 +1181,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -1682,6 +1717,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListParams.kt index b8beda81..1a2a4917 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListParams.kt @@ -339,6 +339,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt index 8cb399b7..40b9490a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt @@ -146,6 +146,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ProjectListResponse = apply { if (validated) { return@apply @@ -886,6 +894,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1058,6 +1075,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1198,6 +1225,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -1341,6 +1378,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -1891,6 +1938,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt index 6f3d62fc..f58e43bd 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt @@ -1584,6 +1584,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2274,6 +2283,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Commit = apply { if (validated) { return@apply @@ -2485,6 +2503,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -2633,6 +2660,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateResponse.kt index c56489c4..0883de08 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateResponse.kt @@ -789,6 +789,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CommitCreateResponse = apply { if (validated) { return@apply @@ -1423,6 +1431,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Commit = apply { if (validated) { return@apply @@ -1634,6 +1651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1782,6 +1808,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitListResponse.kt index e92fc2b6..e92d8a94 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitListResponse.kt @@ -146,6 +146,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CommitListResponse = apply { if (validated) { return@apply @@ -961,6 +969,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1618,6 +1635,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Commit = apply { if (validated) { return@apply @@ -1831,6 +1858,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1983,6 +2020,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt index 0d763456..368a2300 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt @@ -1960,6 +1960,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2200,6 +2209,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -2356,6 +2374,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -2447,6 +2474,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataBackend.accept(new DataBackend.Visitor>() { + * @Override + * public Optional visitBigQuery(BigQueryDataBackend bigQuery) { + * return Optional.of(bigQuery.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { bigQuery != null -> visitor.visitBigQuery(bigQuery) @@ -2460,6 +2516,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DataBackend = apply { if (validated) { return@apply @@ -3049,6 +3114,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): BigQueryDataBackend = apply { if (validated) { return@apply @@ -3176,6 +3251,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3545,6 +3630,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -3712,6 +3807,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): PartitionType = apply { if (validated) { return@apply @@ -3909,6 +4014,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DefaultDataBackend = apply { if (validated) { return@apply @@ -4023,6 +4138,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4395,6 +4520,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SnowflakeDataBackend = apply { if (validated) { return@apply @@ -4520,6 +4655,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4889,6 +5034,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5232,6 +5387,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DatabricksDtlDataBackend = apply { if (validated) { return@apply @@ -5353,6 +5518,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -5722,6 +5897,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -6105,6 +6290,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RedshiftDataBackend = apply { if (validated) { return@apply @@ -6228,6 +6423,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -6597,6 +6802,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -7010,6 +7225,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): PostgresDataBackend = apply { if (validated) { return@apply @@ -7135,6 +7360,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -7504,6 +7739,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -8318,6 +8563,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Project = apply { if (validated) { return@apply @@ -8490,6 +8744,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -8630,6 +8894,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -8773,6 +9047,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -9326,6 +9610,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply @@ -10210,6 +10504,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply @@ -10394,6 +10697,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -10629,6 +10942,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt index 9a9230c5..0201f815 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt @@ -998,6 +998,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InferencePipelineCreateResponse = apply { if (validated) { return@apply @@ -1174,6 +1182,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1330,6 +1347,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1421,6 +1447,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataBackend.accept(new DataBackend.Visitor>() { + * @Override + * public Optional visitBigQuery(BigQueryDataBackend bigQuery) { + * return Optional.of(bigQuery.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in [visitor] + * and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { bigQuery != null -> visitor.visitBigQuery(bigQuery) @@ -1434,6 +1489,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DataBackend = apply { if (validated) { return@apply @@ -2020,6 +2084,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): BigQueryDataBackend = apply { if (validated) { return@apply @@ -2147,6 +2221,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -2516,6 +2600,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -2683,6 +2777,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): PartitionType = apply { if (validated) { return@apply @@ -2880,6 +2984,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DefaultDataBackend = apply { if (validated) { return@apply @@ -2994,6 +3108,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3366,6 +3490,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): SnowflakeDataBackend = apply { if (validated) { return@apply @@ -3491,6 +3625,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3860,6 +4004,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -4203,6 +4357,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DatabricksDtlDataBackend = apply { if (validated) { return@apply @@ -4324,6 +4488,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4693,6 +4867,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5076,6 +5260,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RedshiftDataBackend = apply { if (validated) { return@apply @@ -5199,6 +5393,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -5568,6 +5772,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5981,6 +6195,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): PostgresDataBackend = apply { if (validated) { return@apply @@ -6106,6 +6330,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -6475,6 +6709,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -7289,6 +7533,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Project = apply { if (validated) { return@apply @@ -7461,6 +7714,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -7601,6 +7864,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -7744,6 +8017,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -8294,6 +8577,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply @@ -9178,6 +9471,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply @@ -9362,6 +9664,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -9597,6 +9909,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt index f6d98352..56ddf9ad 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt @@ -159,6 +159,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InferencePipelineListResponse = apply { if (validated) { return@apply @@ -1176,6 +1184,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1357,6 +1374,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -1515,6 +1542,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1608,6 +1645,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataBackend.accept(new DataBackend.Visitor>() { + * @Override + * public Optional visitBigQuery(BigQueryDataBackend bigQuery) { + * return Optional.of(bigQuery.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { bigQuery != null -> visitor.visitBigQuery(bigQuery) @@ -1622,6 +1689,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): DataBackend = apply { if (validated) { return@apply @@ -2233,6 +2310,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): BigQueryDataBackend = apply { if (validated) { return@apply @@ -2364,6 +2451,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -2737,6 +2834,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -2907,6 +3014,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): PartitionType = apply { if (validated) { return@apply @@ -3108,6 +3225,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): DefaultDataBackend = apply { if (validated) { return@apply @@ -3226,6 +3353,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -3611,6 +3748,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): SnowflakeDataBackend = apply { if (validated) { return@apply @@ -3740,6 +3887,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4113,6 +4270,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -4460,6 +4627,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): DatabricksDtlDataBackend = apply { if (validated) { return@apply @@ -4585,6 +4762,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -4958,6 +5145,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -5347,6 +5544,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): RedshiftDataBackend = apply { if (validated) { return@apply @@ -5474,6 +5681,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -5847,6 +6064,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -6270,6 +6497,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): PostgresDataBackend = apply { if (validated) { return@apply @@ -6399,6 +6636,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): BackendType = apply { if (validated) { return@apply @@ -6772,6 +7019,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Config = apply { if (validated) { return@apply @@ -7622,6 +7879,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Project = apply { if (validated) { return@apply @@ -7794,6 +8061,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Links = apply { if (validated) { return@apply @@ -7937,6 +8214,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Source = apply { if (validated) { return@apply @@ -8081,6 +8368,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): TaskType = apply { if (validated) { return@apply @@ -8647,6 +8944,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): GitRepo = apply { if (validated) { return@apply @@ -9565,6 +9872,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply @@ -9751,6 +10068,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -9989,6 +10316,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateParams.kt index e0fea77e..33d0d407 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateParams.kt @@ -2358,6 +2358,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2830,6 +2839,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -3205,6 +3223,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -3528,6 +3555,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -3704,6 +3741,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -3865,6 +3912,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -3997,6 +4054,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -4073,6 +4140,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -4084,6 +4181,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -4381,6 +4488,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateResponse.kt index cb52075d..6ae31f9e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestCreateResponse.kt @@ -1230,6 +1230,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestCreateResponse = apply { if (validated) { return@apply @@ -1628,6 +1636,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -2003,6 +2020,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -2326,6 +2352,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -2502,6 +2538,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -2663,6 +2709,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2795,6 +2851,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -2871,6 +2937,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, + * unless [visitor] overrides [Visitor.unknown]. To handle variants not known to this + * version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -2882,6 +2978,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -3179,6 +3285,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListParams.kt index 5f246d62..ea722651 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListParams.kt @@ -446,6 +446,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListResponse.kt index 08aaa74d..6381bc51 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestListResponse.kt @@ -157,6 +157,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestListResponse = apply { if (validated) { return@apply @@ -1408,6 +1416,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1810,6 +1827,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -2196,6 +2223,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -2522,6 +2559,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -2701,6 +2748,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -2866,6 +2923,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -3000,6 +3067,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -3076,6 +3153,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -3087,6 +3194,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -3386,6 +3503,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateParams.kt index a0a49730..4fc21c51 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateParams.kt @@ -410,6 +410,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -732,6 +741,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Payload = apply { if (validated) { return@apply @@ -851,6 +869,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Suggested = apply { if (validated) { return@apply @@ -1237,6 +1265,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -1563,6 +1601,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -1742,6 +1790,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -1907,6 +1965,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -2041,6 +2109,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -2117,6 +2195,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -2128,6 +2236,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateResponse.kt index 9504d8b6..cbed49d1 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/tests/TestUpdateResponse.kt @@ -151,6 +151,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestUpdateResponse = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateResponse.kt index 740def93..6d6ada8a 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateResponse.kt @@ -184,6 +184,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PresignedUrlCreateResponse = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateParams.kt index b2b3fa3b..deb57691 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateParams.kt @@ -622,6 +622,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateResponse.kt index 22be370b..6040c6bc 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestEvaluateResponse.kt @@ -308,6 +308,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestEvaluateResponse = apply { if (validated) { return@apply @@ -544,6 +552,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Task = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestListResultsResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestListResultsResponse.kt index 7dc68758..87baeb99 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestListResultsResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/tests/TestListResultsResponse.kt @@ -201,6 +201,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TestListResultsResponse = apply { if (validated) { return@apply @@ -895,6 +903,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -1058,6 +1075,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1314,6 +1341,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ExpectedValue = apply { if (validated) { return@apply @@ -2380,6 +2417,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Goal = apply { if (validated) { return@apply @@ -2776,6 +2823,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -3166,6 +3223,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -3498,6 +3565,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -3681,6 +3758,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -3849,6 +3936,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -3987,6 +4084,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -4064,6 +4171,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not + * known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden + * in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -4075,6 +4213,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -4379,6 +4527,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -4962,6 +5120,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RowsBody = apply { if (validated) { return@apply @@ -5031,6 +5199,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -5041,6 +5239,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -5430,6 +5638,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -5577,6 +5795,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -5639,6 +5867,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -5648,6 +5907,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -6027,6 +6296,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -6180,6 +6459,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -6452,6 +6741,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -6581,6 +6880,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -6643,6 +6952,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -6652,6 +6992,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -7566,6 +7916,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LastUnskippedResult = apply { if (validated) { return@apply @@ -7729,6 +8088,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -7985,6 +8354,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): ExpectedValue = apply { if (validated) { return@apply @@ -9051,6 +9430,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Goal = apply { if (validated) { return@apply @@ -9447,6 +9836,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Subtype = apply { if (validated) { return@apply @@ -9837,6 +10236,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Threshold = apply { if (validated) { return@apply @@ -10169,6 +10578,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightName = apply { if (validated) { return@apply @@ -10352,6 +10771,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): InsightParameter = apply { if (validated) { return@apply @@ -10520,6 +10949,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -10658,6 +11097,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): ThresholdMode = apply { if (validated) { return@apply @@ -10735,6 +11184,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not + * known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden + * in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { number != null -> visitor.visitNumber(number) @@ -10746,6 +11226,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -11050,6 +11540,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -11633,6 +12133,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): RowsBody = apply { if (validated) { return@apply @@ -11702,6 +12212,36 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given + * [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the + * API, unless [visitor] overrides [Visitor.unknown]. To handle variants not known + * to this version of the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = columnFilter.accept(new ColumnFilter.Visitor>() { + * @Override + * public Optional visitSet(SetColumnFilter set) { + * return Optional.of(set.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { set != null -> visitor.visitSet(set) @@ -11712,6 +12252,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't + * match its expected type. + */ fun validate(): ColumnFilter = apply { if (validated) { return@apply @@ -12101,6 +12651,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): SetColumnFilter = apply { if (validated) { return@apply @@ -12248,6 +12808,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -12310,6 +12880,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -12319,6 +12920,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply @@ -12698,6 +13309,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): NumericColumnFilter = apply { if (validated) { return@apply @@ -12851,6 +13472,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -13123,6 +13754,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected + * types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): StringColumnFilter = apply { if (validated) { return@apply @@ -13252,6 +13893,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -13314,6 +13965,37 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the + * given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from + * the API, unless [visitor] overrides [Visitor.unknown]. To handle variants + * not known to this version of the SDK gracefully, consider overriding + * [Visitor.unknown]: + * ```java + * import com.openlayer.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitString(String string) { + * return Optional.of(string.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws OpenlayerInvalidDataException if [Visitor.unknown] is not + * overridden in [visitor] and the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { string != null -> visitor.visitString(string) @@ -13323,6 +14005,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their + * expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for + * existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object + * doesn't match its expected type. + */ fun validate(): Value = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceRetrieveResponse.kt index c760efa1..0cea1f75 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceRetrieveResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceRetrieveResponse.kt @@ -736,6 +736,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WorkspaceRetrieveResponse = apply { if (validated) { return@apply @@ -917,6 +925,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1143,6 +1160,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateParams.kt index 8d5d1890..9b6aeaa5 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateParams.kt @@ -466,6 +466,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateResponse.kt index 2b9e4048..09154242 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/WorkspaceUpdateResponse.kt @@ -736,6 +736,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): WorkspaceUpdateResponse = apply { if (validated) { return@apply @@ -917,6 +925,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1143,6 +1160,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): MonthlyUsage = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateParams.kt index 286c57fc..748833b9 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateParams.kt @@ -351,6 +351,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateResponse.kt index 608e0e84..63985cfb 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/apikeys/ApiKeyCreateResponse.kt @@ -326,6 +326,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ApiKeyCreateResponse = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateParams.kt index c45f895a..141129df 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateParams.kt @@ -429,6 +429,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -573,6 +582,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Role = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateResponse.kt index 8fe2eb44..1f5e6c0d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteCreateResponse.kt @@ -146,6 +146,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InviteCreateResponse = apply { if (validated) { return@apply @@ -496,6 +504,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -708,6 +725,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Creator = apply { if (validated) { return@apply @@ -857,6 +884,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Role = apply { if (validated) { return@apply @@ -987,6 +1024,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1285,6 +1332,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteListResponse.kt index e90ec654..e8866d64 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/workspaces/invites/InviteListResponse.kt @@ -146,6 +146,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): InviteListResponse = apply { if (validated) { return@apply @@ -496,6 +504,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply @@ -708,6 +725,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Creator = apply { if (validated) { return@apply @@ -857,6 +884,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Role = apply { if (validated) { return@apply @@ -987,6 +1024,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1285,6 +1332,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match + * its expected type. + */ fun validate(): Workspace = apply { if (validated) { return@apply diff --git a/scripts/mock b/scripts/mock index 5cd7c157..feebe5ed 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.2 -- steady --version + npm exec --package=@stdy/cli@0.22.1 -- steady --version - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 61c11637..7d7f08e3 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1