diff --git a/.gitignore b/.gitignore index 2c17e5ce..face920d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -.gradle // templates/JavaSDK/Root.ts:336:50 +.gradle .idea build codegen.log diff --git a/.gradle/8.0.2/checksums/checksums.lock b/.gradle/8.0.2/checksums/checksums.lock index 03a5a754..a6e0726d 100644 Binary files a/.gradle/8.0.2/checksums/checksums.lock and b/.gradle/8.0.2/checksums/checksums.lock differ diff --git a/.gradle/8.0.2/executionHistory/executionHistory.bin b/.gradle/8.0.2/executionHistory/executionHistory.bin index a14d2b16..c331b8ad 100644 Binary files a/.gradle/8.0.2/executionHistory/executionHistory.bin and b/.gradle/8.0.2/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.0.2/executionHistory/executionHistory.lock b/.gradle/8.0.2/executionHistory/executionHistory.lock index df2d65c9..f6026f11 100644 Binary files a/.gradle/8.0.2/executionHistory/executionHistory.lock and b/.gradle/8.0.2/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.0.2/fileHashes/fileHashes.bin b/.gradle/8.0.2/fileHashes/fileHashes.bin index 931e5955..b558f98c 100644 Binary files a/.gradle/8.0.2/fileHashes/fileHashes.bin and b/.gradle/8.0.2/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.0.2/fileHashes/fileHashes.lock b/.gradle/8.0.2/fileHashes/fileHashes.lock index 110db404..49ec5cc4 100644 Binary files a/.gradle/8.0.2/fileHashes/fileHashes.lock and b/.gradle/8.0.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.0.2/fileHashes/resourceHashesCache.bin b/.gradle/8.0.2/fileHashes/resourceHashesCache.bin index 078a6dcd..70c44470 100644 Binary files a/.gradle/8.0.2/fileHashes/resourceHashesCache.bin and b/.gradle/8.0.2/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index a5fea9ba..257768d8 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index 75421771..c5e6053e 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/README.md b/README.md index e684a46d..8ad77589 100644 --- a/README.md +++ b/README.md @@ -34,36 +34,32 @@ implementation("com.langsmith.api:langsmith-java:0.0.1-alpha.0") ### Configure the client -Use `LangSmithOkHttpClient.builder()` to configure the client. At a minimum you need to set `.apiKey()`, `.tenantId()` and `.bearerToken()`: // templates/JavaDocs.ts:866:17 +Use `LangSmithOkHttpClient.builder()` to configure the client. At a minimum you need to set `.apiKey()`: -```java // templates/JavaDocs.ts:847:16 -import com.langsmith.api.client.LangSmithClient; // templates/JavaDocs.ts:849:25 +```java +import com.langsmith.api.client.LangSmithClient; import com.langsmith.api.client.okhttp.LangSmithOkHttpClient; -LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.ts:856:24 - .apiKey("My API Key") // templates/JavaDocs.ts:813:30 // templates/JavaDocs.ts:813:30 - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") +LangSmithClient client = LangSmithOkHttpClient.builder() + .apiKey("My API Key") .build(); ``` -Alternately, set the environment with `LANG_SMITH_API_KEY`, `LANG_SMITH_TENANT_ID` or `LANG_SMITH_BEARER_TOKEN`, and use `LangSmithOkHttpClient.fromEnv()` to read from the environment. +Alternately, set the environment with `LANGCHAIN_API_KEY`, and use `LangSmithOkHttpClient.fromEnv()` to read from the environment. -```java // templates/JavaDocs.ts:877:14 -LangSmithClient client = LangSmithOkHttpClient.fromEnv(); // templates/JavaDocs.ts:879:24 +```java +LangSmithClient client = LangSmithOkHttpClient.fromEnv(); -// Note: you can also call fromEnv() from the client builder, for example if you need to set additional properties // templates/JavaDocs.ts:887:17 -LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.ts:892:28 +// Note: you can also call fromEnv() from the client builder, for example if you need to set additional properties +LangSmithClient client = LangSmithOkHttpClient.builder() .fromEnv() // ... set properties on the builder .build(); ``` -| Property | Environment variable | Required | Default value | // templates/JavaDocs.ts:904:13 | -| ----------- | ------------------------- | -------- | ------------- | ------------------------------- | -| apiKey | `LANG_SMITH_API_KEY` | true | — | -| tenantId | `LANG_SMITH_TENANT_ID` | true | — | -| bearerToken | `LANG_SMITH_BEARER_TOKEN` | true | — | +| Property | Environment variable | Required | Default value | +| -------- | -------------------- | -------- | ------------- | +| apiKey | `LANGCHAIN_API_KEY` | true | — | Read the documentation for more configuration options. @@ -71,14 +67,14 @@ Read the documentation for more configuration options. ### Example: creating a resource -To create a new api key, first use the `ApiKeyRetrieveParams` builder to specify attributes, // templates/JavaDocs.ts:77:16 +To create a new api key, first use the `ApiKeyRetrieveParams` builder to specify attributes, then pass that to the `retrieve` method of the `apiKeys` service. -```java // templates/JavaDocs.ts:85:16 -import com.langsmith.api.models.ApiKeyRetrieveParams; // templates/JavaDocs.ts:87:24 +```java +import com.langsmith.api.models.ApiKeyRetrieveParams; import com.langsmith.api.models.List; -ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder().build(); // templates/JavaSDK/Examples.ts:49:15 // templates/JavaSDK/Examples.ts:49:15 +ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder().build(); List apiKeyRetrieveResponse = client.apiKeys().retrieve(params); ``` @@ -90,14 +86,14 @@ List apiKeyRetrieveResponse = client.apiKeys().retrieve(param To make a request to the Lang Smith API, you generally build an instance of the appropriate `Params` class. -In [Example: creating a resource](#example-creating-a-resource) above, we used the `ApiKeyRetrieveParams.builder()` to pass to // templates/JavaDocs.ts:338:16 +In [Example: creating a resource](#example-creating-a-resource) above, we used the `ApiKeyRetrieveParams.builder()` to pass to the `retrieve` method of the `apiKeys` service. Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using the `putAdditionalProperty` method. -```java // templates/JavaDocs.ts:350:16 -ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder() // templates/JavaDocs.ts:356:24 // templates/JavaDocs.ts:352:23 +```java +ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder() // ... normal properties .putAdditionalProperty("secret_param", "4242") .build(); @@ -109,7 +105,7 @@ ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder() // templates/JavaDo When receiving a response, the Lang Smith Java SDK will deserialize it into instances of the typed model classes. In rare cases, the API may return a response property that doesn't match the expected Java type. If you directly access the mistaken property, the SDK will throw an unchecked `LangSmithInvalidDataException` at runtime. If you would prefer to check in advance that that response is completely well-typed, call `.validate()` on the returned model. -```java // templates/JavaDocs.ts:369:19 +```java List apiKeyRetrieveResponse = client.apiKeys().retrieve().validate(); ``` @@ -118,8 +114,8 @@ List apiKeyRetrieveResponse = client.apiKeys().retrieve().val In rare cases, you may want to access the underlying JSON value for a response property rather than using the typed version provided by this SDK. Each model property has a corresponding JSON version, with an underscore before the method name, which returns a `JsonField` value. -```java // templates/JavaDocs.ts:482:19 -JsonField field = responseObj._field(); // templates/JavaDocs.ts:485:19 +```java +JsonField field = responseObj._field(); if (field.isMissing()) { // Value was not specified in the JSON response @@ -139,7 +135,7 @@ if (field.isMissing()) { Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's `_additionalProperties` method: -```java // templates/JavaDocs.ts:453:19 +```java JsonValue secret = apiKeyRetrieveResponse._additionalProperties().get("secret_field"); ``` @@ -172,13 +168,13 @@ This library throws exceptions in a single hierarchy for easy handling: ## Network options -### Retries // templates/JavaDocs.ts:620:16 +### Retries Requests that experience certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default. You can provide a `maxRetries` on the client builder to configure this: -```java // templates/JavaDocs.ts:547:33 -LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.ts:552:20 +```java +LangSmithClient client = LangSmithOkHttpClient.builder() .fromEnv() .maxRetries(4) .build(); @@ -188,8 +184,8 @@ LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.t Requests time out after 1 minute by default. You can configure this on the client builder: -```java // templates/JavaDocs.ts:561:35 -LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.ts:566:20 +```java +LangSmithClient client = LangSmithOkHttpClient.builder() .fromEnv() .timeout(Duration.ofSeconds(30)) .build(); @@ -199,8 +195,8 @@ LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.t Requests can be routed through a proxy. You can configure this on the client builder: -```java // templates/JavaDocs.ts:575:33 -LangSmithClient client = LangSmithOkHttpClient.builder() // templates/JavaDocs.ts:580:20 +```java +LangSmithClient client = LangSmithOkHttpClient.builder() .fromEnv() .proxy(new Proxy( Type.HTTP, diff --git a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin index 9cb50876..93a7aa72 100644 Binary files a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin and b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin differ diff --git a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock index c052936a..e7c26fe1 100644 Binary files a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock and b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock differ diff --git a/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 34313263..aa6ce45a 100644 Binary files a/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin b/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin index 818b75c6..306abb1e 100644 Binary files a/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin and b/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/examples/.keep b/examples/.keep index 38b5050f..d8c73e93 100644 --- a/examples/.keep +++ b/examples/.keep @@ -1,4 +1,4 @@ -File generated from our OpenAPI spec by Stainless. // templates/common/index.ts:14:45 +File generated from our OpenAPI spec by Stainless. This directory can be used to store example files demonstrating usage of this SDK. It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClient.kt b/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClient.kt index 09770289..649f421d 100644 --- a/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClient.kt +++ b/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClient.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.client.okhttp -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.databind.json.JsonMapper // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.databind.json.JsonMapper import com.langsmith.api.client.LangSmithClient import com.langsmith.api.client.LangSmithClientImpl import com.langsmith.api.core.ClientOptions @@ -12,110 +10,65 @@ import java.net.Proxy import java.time.Clock import java.time.Duration -class LangSmithOkHttpClient -private constructor() { // templates/JavaSDK/okhttp.ts:33:13 // templates/JavaSDK/okhttp.ts:33:13 // - // templates/JavaSDK/okhttp.ts:33:13 +class LangSmithOkHttpClient private constructor() { - companion object { // templates/JavaSDK/okhttp.ts:37:10 // templates/JavaSDK/okhttp.ts:33:13 + companion object { - @JvmStatic // templates/JavaSDK/okhttp.ts:38:12 // templates/JavaSDK/okhttp.ts:37:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() - @JvmStatic // templates/JavaSDK/okhttp.ts:43:12 - fun fromEnv(): LangSmithClient = builder().fromEnv().build() + @JvmStatic fun fromEnv(): LangSmithClient = builder().fromEnv().build() } - class Builder { // templates/JavaSDK/okhttp.ts:51:10 + class Builder { - private var clientOptions: ClientOptions.Builder = - ClientOptions - .builder() // templates/JavaSDK/okhttp.ts:53:16 // templates/JavaSDK/okhttp.ts:53:16 - // // templates/JavaSDK/okhttp.ts:51:10 + private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var baseUrl: String = ClientOptions.PRODUCTION_URL // default timeout for client is 1 minute private var timeout: Duration = Duration.ofSeconds(60) private var proxy: Proxy? = null - fun baseUrl(baseUrl: String) = apply { // templates/JavaSDK/okhttp.ts:79:30 - clientOptions.baseUrl( - baseUrl - ) // templates/JavaSDK/okhttp.ts:79:30 // templates/JavaSDK/okhttp.ts:79:30 + fun baseUrl(baseUrl: String) = apply { + clientOptions.baseUrl(baseUrl) this.baseUrl = baseUrl } - fun jsonMapper(jsonMapper: JsonMapper) = apply { // templates/JavaSDK/okhttp.ts:90:30 - clientOptions.jsonMapper(jsonMapper) + fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) } + + fun clock(clock: Clock) = apply { clientOptions.clock(clock) } + + fun headers(headers: Map>) = apply { + clientOptions.headers(headers) } - fun clock(clock: Clock) = apply { // templates/JavaSDK/okhttp.ts:106:30 - clientOptions.clock(clock) + fun putHeader(name: String, value: String) = apply { clientOptions.putHeader(name, value) } + + fun putHeaders(name: String, values: Iterable) = apply { + clientOptions.putHeaders(name, values) } - fun headers(headers: Map>) = - apply { // templates/JavaSDK/okhttp.ts:122:30 - clientOptions.headers(headers) - } - - fun putHeader(name: String, value: String) = apply { // templates/JavaSDK/okhttp.ts:138:30 - clientOptions.putHeader(name, value) + fun putAllHeaders(headers: Map>) = apply { + clientOptions.putAllHeaders(headers) } - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/okhttp.ts:154:30 - clientOptions.putHeaders(name, values) - } + fun removeHeader(name: String) = apply { clientOptions.removeHeader(name) } - fun putAllHeaders(headers: Map>) = - apply { // templates/JavaSDK/okhttp.ts:170:30 - clientOptions.putAllHeaders(headers) - } + fun timeout(timeout: Duration) = apply { this.timeout = timeout } - fun removeHeader(name: String) = apply { // templates/JavaSDK/okhttp.ts:186:30 - clientOptions.removeHeader(name) + fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + + fun proxy(proxy: Proxy) = apply { this.proxy = proxy } + + fun responseValidation(responseValidation: Boolean) = apply { + clientOptions.responseValidation(responseValidation) } - fun timeout(timeout: Duration) = apply { // templates/JavaSDK/okhttp.ts:202:30 - this.timeout = timeout - } + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } - fun maxRetries(maxRetries: Int) = apply { // templates/JavaSDK/okhttp.ts:213:30 - clientOptions.maxRetries(maxRetries) - } + fun fromEnv() = apply { clientOptions.fromEnv() } - fun proxy(proxy: Proxy) = apply { // templates/JavaSDK/okhttp.ts:229:30 - this.proxy = proxy - } - - fun responseValidation(responseValidation: Boolean) = - apply { // templates/JavaSDK/okhttp.ts:240:30 - clientOptions.responseValidation(responseValidation) - } - - fun apiKey(apiKey: String) = - apply { // templates/JavaSDK/okhttp.ts:264:34 // templates/JavaSDK/okhttp.ts:254:26 - clientOptions.apiKey(apiKey) - } - - fun tenantId(tenantId: String) = - apply { // templates/JavaSDK/okhttp.ts:264:34 // templates/JavaSDK/okhttp.ts:254:26 - clientOptions.tenantId(tenantId) - } - - fun bearerToken(bearerToken: String) = - apply { // templates/JavaSDK/okhttp.ts:264:34 // templates/JavaSDK/okhttp.ts:254:26 - clientOptions.bearerToken(bearerToken) - } - - fun fromEnv() = apply { // templates/JavaSDK/okhttp.ts:275:30 - clientOptions.fromEnv() - } - - fun build(): LangSmithClient { // templates/JavaSDK/okhttp.ts:281:14 + fun build(): LangSmithClient { return LangSmithClientImpl( - clientOptions // templates/JavaSDK/okhttp.ts:289:27 // - // templates/JavaSDK/okhttp.ts:286:30 // - // templates/JavaSDK/okhttp.ts:285:26 // - // templates/JavaSDK/okhttp.ts:285:26 + clientOptions .httpClient( OkHttpClient.builder() .baseUrl(baseUrl) diff --git a/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClientAsync.kt b/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClientAsync.kt index 5b4067e7..ee328116 100644 --- a/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClientAsync.kt +++ b/langsmith-java-client-okhttp/src/main/kotlin/com/langsmith/api/client/okhttp/LangSmithOkHttpClientAsync.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.client.okhttp -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.databind.json.JsonMapper // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.databind.json.JsonMapper import com.langsmith.api.client.LangSmithClientAsync import com.langsmith.api.client.LangSmithClientAsyncImpl import com.langsmith.api.core.ClientOptions @@ -12,110 +10,65 @@ import java.net.Proxy import java.time.Clock import java.time.Duration -class LangSmithOkHttpClientAsync -private constructor() { // templates/JavaSDK/okhttp.ts:33:13 // templates/JavaSDK/okhttp.ts:33:13 // - // templates/JavaSDK/okhttp.ts:33:13 +class LangSmithOkHttpClientAsync private constructor() { - companion object { // templates/JavaSDK/okhttp.ts:37:10 // templates/JavaSDK/okhttp.ts:33:13 + companion object { - @JvmStatic // templates/JavaSDK/okhttp.ts:38:12 // templates/JavaSDK/okhttp.ts:37:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() - @JvmStatic // templates/JavaSDK/okhttp.ts:43:12 - fun fromEnv(): LangSmithClientAsync = builder().fromEnv().build() + @JvmStatic fun fromEnv(): LangSmithClientAsync = builder().fromEnv().build() } - class Builder { // templates/JavaSDK/okhttp.ts:51:10 + class Builder { - private var clientOptions: ClientOptions.Builder = - ClientOptions - .builder() // templates/JavaSDK/okhttp.ts:53:16 // templates/JavaSDK/okhttp.ts:53:16 - // // templates/JavaSDK/okhttp.ts:51:10 + private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var baseUrl: String = ClientOptions.PRODUCTION_URL // default timeout for client is 1 minute private var timeout: Duration = Duration.ofSeconds(60) private var proxy: Proxy? = null - fun baseUrl(baseUrl: String) = apply { // templates/JavaSDK/okhttp.ts:79:30 - clientOptions.baseUrl( - baseUrl - ) // templates/JavaSDK/okhttp.ts:79:30 // templates/JavaSDK/okhttp.ts:79:30 + fun baseUrl(baseUrl: String) = apply { + clientOptions.baseUrl(baseUrl) this.baseUrl = baseUrl } - fun jsonMapper(jsonMapper: JsonMapper) = apply { // templates/JavaSDK/okhttp.ts:90:30 - clientOptions.jsonMapper(jsonMapper) + fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) } + + fun clock(clock: Clock) = apply { clientOptions.clock(clock) } + + fun headers(headers: Map>) = apply { + clientOptions.headers(headers) } - fun clock(clock: Clock) = apply { // templates/JavaSDK/okhttp.ts:106:30 - clientOptions.clock(clock) + fun putHeader(name: String, value: String) = apply { clientOptions.putHeader(name, value) } + + fun putHeaders(name: String, values: Iterable) = apply { + clientOptions.putHeaders(name, values) } - fun headers(headers: Map>) = - apply { // templates/JavaSDK/okhttp.ts:122:30 - clientOptions.headers(headers) - } - - fun putHeader(name: String, value: String) = apply { // templates/JavaSDK/okhttp.ts:138:30 - clientOptions.putHeader(name, value) + fun putAllHeaders(headers: Map>) = apply { + clientOptions.putAllHeaders(headers) } - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/okhttp.ts:154:30 - clientOptions.putHeaders(name, values) - } + fun removeHeader(name: String) = apply { clientOptions.removeHeader(name) } - fun putAllHeaders(headers: Map>) = - apply { // templates/JavaSDK/okhttp.ts:170:30 - clientOptions.putAllHeaders(headers) - } + fun timeout(timeout: Duration) = apply { this.timeout = timeout } - fun removeHeader(name: String) = apply { // templates/JavaSDK/okhttp.ts:186:30 - clientOptions.removeHeader(name) + fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + + fun proxy(proxy: Proxy) = apply { this.proxy = proxy } + + fun responseValidation(responseValidation: Boolean) = apply { + clientOptions.responseValidation(responseValidation) } - fun timeout(timeout: Duration) = apply { // templates/JavaSDK/okhttp.ts:202:30 - this.timeout = timeout - } + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } - fun maxRetries(maxRetries: Int) = apply { // templates/JavaSDK/okhttp.ts:213:30 - clientOptions.maxRetries(maxRetries) - } + fun fromEnv() = apply { clientOptions.fromEnv() } - fun proxy(proxy: Proxy) = apply { // templates/JavaSDK/okhttp.ts:229:30 - this.proxy = proxy - } - - fun responseValidation(responseValidation: Boolean) = - apply { // templates/JavaSDK/okhttp.ts:240:30 - clientOptions.responseValidation(responseValidation) - } - - fun apiKey(apiKey: String) = - apply { // templates/JavaSDK/okhttp.ts:264:34 // templates/JavaSDK/okhttp.ts:254:26 - clientOptions.apiKey(apiKey) - } - - fun tenantId(tenantId: String) = - apply { // templates/JavaSDK/okhttp.ts:264:34 // templates/JavaSDK/okhttp.ts:254:26 - clientOptions.tenantId(tenantId) - } - - fun bearerToken(bearerToken: String) = - apply { // templates/JavaSDK/okhttp.ts:264:34 // templates/JavaSDK/okhttp.ts:254:26 - clientOptions.bearerToken(bearerToken) - } - - fun fromEnv() = apply { // templates/JavaSDK/okhttp.ts:275:30 - clientOptions.fromEnv() - } - - fun build(): LangSmithClientAsync { // templates/JavaSDK/okhttp.ts:281:14 + fun build(): LangSmithClientAsync { return LangSmithClientAsyncImpl( - clientOptions // templates/JavaSDK/okhttp.ts:289:27 // - // templates/JavaSDK/okhttp.ts:286:30 // - // templates/JavaSDK/okhttp.ts:285:26 // - // templates/JavaSDK/okhttp.ts:285:26 + clientOptions .httpClient( OkHttpClient.builder() .baseUrl(baseUrl) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClient.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClient.kt index 000df2e9..570ad1d8 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClient.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClient.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -7,11 +7,9 @@ package com.langsmith.api.client import com.langsmith.api.models.* import com.langsmith.api.services.blocking.* -interface LangSmithClient { // templates/JavaSDK/client.ts:29:13 // - // templates/JavaSDK/client.ts:29:13 // - // templates/JavaSDK/client.ts:29:13 +interface LangSmithClient { - fun async(): LangSmithClientAsync // templates/JavaSDK/client.ts:29:13 + fun async(): LangSmithClientAsync fun sessions(): SessionService diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsync.kt index 3db8aff5..01e526e0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -7,11 +7,9 @@ package com.langsmith.api.client import com.langsmith.api.models.* import com.langsmith.api.services.async.* -interface LangSmithClientAsync { // templates/JavaSDK/client.ts:29:13 // - // templates/JavaSDK/client.ts:29:13 // - // templates/JavaSDK/client.ts:29:13 +interface LangSmithClientAsync { - fun sync(): LangSmithClient // templates/JavaSDK/client.ts:29:13 + fun sync(): LangSmithClient fun sessions(): SessionServiceAsync diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsyncImpl.kt index 396a7f3b..e5c74cbe 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.client @@ -12,11 +12,9 @@ import com.langsmith.api.services.errorHandler class LangSmithClientAsyncImpl constructor( private val clientOptions: ClientOptions, -) : LangSmithClientAsync { // templates/JavaSDK/client.ts:54:13 // templates/JavaSDK/client.ts:54:13 - // // templates/JavaSDK/client.ts:54:13 +) : LangSmithClientAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/client.ts:54:13 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val sync: LangSmithClient by lazy { LangSmithClientImpl(clientOptions) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientImpl.kt index 9c06b877..6d2f265e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/client/LangSmithClientImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.client @@ -12,11 +12,9 @@ import com.langsmith.api.services.errorHandler class LangSmithClientImpl constructor( private val clientOptions: ClientOptions, -) : LangSmithClient { // templates/JavaSDK/client.ts:54:13 // templates/JavaSDK/client.ts:54:13 // - // templates/JavaSDK/client.ts:54:13 +) : LangSmithClient { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/client.ts:54:13 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val async: LangSmithClientAsync by lazy { LangSmithClientAsyncImpl(clientOptions) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/core/ClientOptions.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/core/ClientOptions.kt index 8b54c12f..d09bf02f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/core/ClientOptions.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/core/ClientOptions.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.core -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.databind.json.JsonMapper // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.databind.json.JsonMapper import com.google.common.collect.ArrayListMultimap import com.google.common.collect.ListMultimap import com.langsmith.api.core.http.HttpClient @@ -12,38 +10,28 @@ import com.langsmith.api.core.http.RetryingHttpClient import java.time.Clock class ClientOptions -private constructor( // templates/JavaSDK/options.ts:33:13 // templates/JavaSDK/options.ts:33:13 // - // templates/JavaSDK/options.ts:33:13 // templates/JavaSDK/options.ts:33:13 - @get:JvmName("httpClient") - val httpClient: - HttpClient, // templates/JavaSDK/options.ts:33:13 // templates/JavaSDK/options.ts:33:13 +private constructor( + @get:JvmName("httpClient") val httpClient: HttpClient, @get:JvmName("jsonMapper") val jsonMapper: JsonMapper, @get:JvmName("clock") val clock: Clock, @get:JvmName("baseUrl") val baseUrl: String, @get:JvmName("apiKey") val apiKey: String, - @get:JvmName("tenantId") val tenantId: String, - @get:JvmName("bearerToken") val bearerToken: String, @get:JvmName("headers") val headers: ListMultimap, @get:JvmName("responseValidation") val responseValidation: Boolean, ) { - companion object { // templates/JavaSDK/options.ts:53:10 // templates/JavaSDK/options.ts:33:13 + companion object { - const val PRODUCTION_URL = - "https://localhost:8080/test-api" // templates/JavaSDK/options.ts:53:10 + const val PRODUCTION_URL = "https://localhost:8080/test-api" - @JvmStatic // templates/JavaSDK/options.ts:61:12 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() - @JvmStatic // templates/JavaSDK/options.ts:66:12 - fun fromEnv(): ClientOptions = builder().fromEnv().build() + @JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build() } - class Builder { // templates/JavaSDK/options.ts:73:10 + class Builder { - private var httpClient: HttpClient? = - null // templates/JavaSDK/options.ts:75:16 // templates/JavaSDK/options.ts:75:16 // - // templates/JavaSDK/options.ts:73:10 + private var httpClient: HttpClient? = null private var jsonMapper: JsonMapper? = null private var clock: Clock = Clock.systemUTC() private var baseUrl: String = PRODUCTION_URL @@ -51,106 +39,49 @@ private constructor( // templates/JavaSDK/options.ts:33:13 // templates/JavaSDK/ private var responseValidation: Boolean = false private var maxRetries: Int = 2 private var apiKey: String? = null - private var tenantId: String? = null - private var bearerToken: String? = null - fun httpClient(httpClient: HttpClient) = apply { // templates/JavaSDK/options.ts:95:30 - this.httpClient = httpClient + fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient } + + fun jsonMapper(jsonMapper: JsonMapper) = apply { this.jsonMapper = jsonMapper } + + fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl } + + fun clock(clock: Clock) = apply { this.clock = clock } + + fun headers(headers: Map>) = apply { + this.headers.clear() + putAllHeaders(headers) } - fun jsonMapper(jsonMapper: JsonMapper) = apply { // templates/JavaSDK/options.ts:106:30 - this.jsonMapper = jsonMapper - } - - fun baseUrl(baseUrl: String) = apply { // templates/JavaSDK/options.ts:117:30 - this.baseUrl = baseUrl - } - - fun clock(clock: Clock) = apply { // templates/JavaSDK/options.ts:128:30 - this.clock = clock - } - - fun headers(headers: Map>) = - apply { // templates/JavaSDK/options.ts:139:30 - this.headers.clear() // templates/JavaSDK/options.ts:139:30 // - // templates/JavaSDK/options.ts:139:30 - putAllHeaders(headers) - } - - fun putHeader(name: String, value: String) = apply { // templates/JavaSDK/options.ts:150:30 + fun putHeader(name: String, value: String) = apply { this.headers.getOrPut(name) { mutableListOf() }.add(value) } - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/options.ts:161:30 - this.headers.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(headers: Map>) = - apply { // templates/JavaSDK/options.ts:172:30 - headers.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/options.ts:183:30 - this.headers.put(name, mutableListOf()) + fun putHeaders(name: String, values: Iterable) = apply { + this.headers.getOrPut(name) { mutableListOf() }.addAll(values) } - fun responseValidation(responseValidation: Boolean) = - apply { // templates/JavaSDK/options.ts:194:30 - this.responseValidation = responseValidation - } - - fun maxRetries(maxRetries: Int) = apply { // templates/JavaSDK/options.ts:205:30 - this.maxRetries = maxRetries + fun putAllHeaders(headers: Map>) = apply { + headers.forEach(this::putHeaders) } - fun apiKey(apiKey: String) = apply { // templates/JavaSDK/options.ts:219:32 - this.apiKey = apiKey + fun removeHeader(name: String) = apply { this.headers.put(name, mutableListOf()) } + + fun responseValidation(responseValidation: Boolean) = apply { + this.responseValidation = responseValidation } - fun tenantId(tenantId: String) = apply { // templates/JavaSDK/options.ts:219:32 - this.tenantId = tenantId - } + fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } - fun bearerToken(bearerToken: String) = apply { // templates/JavaSDK/options.ts:219:32 - this.bearerToken = bearerToken - } + fun apiKey(apiKey: String) = apply { this.apiKey = apiKey } - fun fromEnv() = apply { // templates/JavaSDK/options.ts:230:30 - System.getenv("LANG_SMITH_API_KEY")?.let { // templates/JavaSDK/options.ts:236:26 // - // templates/JavaSDK/options.ts:230:30 // - // templates/JavaSDK/options.ts:230:30 - apiKey(it) - } - System.getenv("LANG_SMITH_TENANT_ID")?.let { // templates/JavaSDK/options.ts:236:26 - tenantId(it) - } - System.getenv("LANG_SMITH_BEARER_TOKEN")?.let { // templates/JavaSDK/options.ts:236:26 - bearerToken(it) - } - } + fun fromEnv() = apply { System.getenv("LANGCHAIN_API_KEY")?.let { apiKey(it) } } - fun build(): ClientOptions { // templates/JavaSDK/options.ts:262:14 - checkNotNull( - httpClient - ) { // templates/JavaSDK/options.ts:380:13 // templates/JavaSDK/options.ts:267:22 // - // templates/JavaSDK/options.ts:267:22 // templates/JavaSDK/options.ts:266:28 - "`httpClient` is required but was not set" - } - checkNotNull(apiKey) { // templates/JavaSDK/options.ts:380:13 - "`apiKey` is required but was not set" - } - checkNotNull(tenantId) { // templates/JavaSDK/options.ts:380:13 - "`tenantId` is required but was not set" - } - checkNotNull(bearerToken) { // templates/JavaSDK/options.ts:380:13 - "`bearerToken` is required but was not set" - } + fun build(): ClientOptions { + checkNotNull(httpClient) { "`httpClient` is required but was not set" } + checkNotNull(apiKey) { "`apiKey` is required but was not set" } - val headers = - ArrayListMultimap.create< - String, String - >() // templates/JavaSDK/options.ts:271:22 // templates/JavaSDK/options.ts:271:22 + val headers = ArrayListMultimap.create() headers.put("X-Stainless-Lang", "java") headers.put("X-Stainless-Arch", getOsArch()) headers.put("X-Stainless-OS", getOsName()) @@ -158,16 +89,10 @@ private constructor( // templates/JavaSDK/options.ts:33:13 // templates/JavaSDK/ headers.put("X-Stainless-Package-Version", getPackageVersion()) headers.put("X-Stainless-Runtime-Version", getJavaVersion()) headers.put("X-API-Key", apiKey) - headers.put("X-Tenant-Id", tenantId) - if (!bearerToken.isNullOrEmpty()) { // templates/JavaSDK/options.ts:346:18 - headers.put("Authorization", "Bearer ${bearerToken}") - } this.headers.forEach(headers::replaceValues) - return ClientOptions( // templates/JavaSDK/options.ts:293:30 - RetryingHttpClient.builder() // templates/JavaSDK/options.ts:296:26 // - // templates/JavaSDK/options.ts:296:26 // - // templates/JavaSDK/options.ts:293:30 + return ClientOptions( + RetryingHttpClient.builder() .httpClient(httpClient!!) .clock(clock) .maxRetries(maxRetries) @@ -176,8 +101,6 @@ private constructor( // templates/JavaSDK/options.ts:33:13 // templates/JavaSDK/ clock, baseUrl, apiKey!!, - tenantId!!, - bearerToken!!, headers.toUnmodifiable(), responseValidation, ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/errors/LangSmithError.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/errors/LangSmithError.kt index 005ac17c..caf87587 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/errors/LangSmithError.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/errors/LangSmithError.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.errors -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.JsonValue @@ -12,70 +10,55 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = LangSmithError.Builder::class -) // templates/JavaSDK/errors.ts:36:13 // templates/JavaSDK/errors.ts:36:13 // -// templates/JavaSDK/errors.ts:36:13 // templates/JavaSDK/errors.ts:36:13 // -// templates/JavaSDK/errors.ts:36:13 +@JsonDeserialize(builder = LangSmithError.Builder::class) @NoAutoDetect class LangSmithError constructor( private val additionalProperties: Map, ) { - @JsonAnyGetter // templates/JavaSDK/errors.ts:41:10 // templates/JavaSDK/errors.ts:36:13 - fun additionalProperties(): Map = additionalProperties + @JsonAnyGetter fun additionalProperties(): Map = additionalProperties fun toBuilder() = Builder() - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is LangSmithError && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is LangSmithError && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalProperties) } override fun toString() = "LangSmithError{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/errors.ts:54:10 + companion object { - @JvmStatic // templates/JavaSDK/errors.ts:55:12 // templates/JavaSDK/errors.ts:54:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/errors.ts:61:10 // templates/JavaSDK/errors.ts:61:10 // - // templates/JavaSDK/errors.ts:61:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/errors.ts:61:10 + private var additionalProperties: MutableMap = mutableMapOf() - fun from(error: LangSmithError) = apply { // templates/JavaSDK/errors.ts:69:30 - additionalProperties(error.additionalProperties) + fun from(error: LangSmithError) = apply { additionalProperties(error.additionalProperties) } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/errors.ts:79:30 - this.additionalProperties.clear() // templates/JavaSDK/errors.ts:79:30 // - // templates/JavaSDK/errors.ts:79:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonAnySetter // templates/JavaSDK/errors.ts:88:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/errors.ts:93:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/errors.ts:103:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): LangSmithError = LangSmithError(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueCreateParams.kt index c93327cf..c9b20d73 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,12 +16,8 @@ import java.util.Objects import java.util.Optional class AnnotationQueueCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val name: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val name: String, private val id: String?, private val createdAt: OffsetDateTime?, private val description: String?, @@ -33,8 +27,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun name(): String = name // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun name(): String = name fun id(): Optional = Optional.ofNullable(id) @@ -44,12 +37,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun updatedAt(): Optional = Optional.ofNullable(updatedAt) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - AnnotationQueueCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return AnnotationQueueCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - name, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): AnnotationQueueCreateBody { + return AnnotationQueueCreateBody( + name, id, createdAt, description, @@ -58,22 +49,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** AnnotationQueue schema. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AnnotationQueueCreateBody.Builder::class) @NoAutoDetect class AnnotationQueueCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val name: String?, private val id: String?, private val createdAt: OffsetDateTime?, private val description: String?, @@ -81,38 +66,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonProperty("updated_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun updatedAt(): OffsetDateTime? = updatedAt + @JsonProperty("updated_at") fun updatedAt(): OffsetDateTime? = updatedAt - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueCreateBody && this.name == other.name && this.id == other.id && this.createdAt == other.createdAt && @@ -121,15 +98,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, id, createdAt, description, @@ -143,98 +116,60 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "AnnotationQueueCreateBody{name=$name, id=$id, createdAt=$createdAt, description=$description, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: String? = null private var id: String? = null private var createdAt: OffsetDateTime? = null private var description: String? = null private var updatedAt: OffsetDateTime? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueCreateBody: AnnotationQueueCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - annotationQueueCreateBody - .name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.id = annotationQueueCreateBody.id - this.createdAt = annotationQueueCreateBody.createdAt - this.description = annotationQueueCreateBody.description - this.updatedAt = annotationQueueCreateBody.updatedAt - additionalProperties(annotationQueueCreateBody.additionalProperties) - } - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(annotationQueueCreateBody: AnnotationQueueCreateBody) = apply { + this.name = annotationQueueCreateBody.name + this.id = annotationQueueCreateBody.id + this.createdAt = annotationQueueCreateBody.createdAt + this.description = annotationQueueCreateBody.description + this.updatedAt = annotationQueueCreateBody.updatedAt + additionalProperties(annotationQueueCreateBody.additionalProperties) } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } + + @JsonProperty("updated_at") + fun updatedAt(updatedAt: OffsetDateTime) = apply { this.updatedAt = updatedAt } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } - - @JsonProperty("updated_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun updatedAt(updatedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.updatedAt = updatedAt - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueCreateBody = - AnnotationQueueCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(name) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`name` is required but was not set" - }, + AnnotationQueueCreateBody( + checkNotNull(name) { "`name` is required but was not set" }, id, createdAt, description, @@ -250,13 +185,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueCreateParams && this.name == other.name && this.id == other.id && this.createdAt == other.createdAt && @@ -267,10 +201,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - name, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + name, id, createdAt, description, @@ -286,20 +219,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var name: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var name: String? = null private var id: String? = null private var createdAt: OffsetDateTime? = null private var description: String? = null @@ -308,121 +236,85 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueCreateParams: AnnotationQueueCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.name = - annotationQueueCreateParams - .name // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.id = annotationQueueCreateParams.id - this.createdAt = annotationQueueCreateParams.createdAt - this.description = annotationQueueCreateParams.description - this.updatedAt = annotationQueueCreateParams.updatedAt - additionalQueryParams(annotationQueueCreateParams.additionalQueryParams) - additionalHeaders(annotationQueueCreateParams.additionalHeaders) - additionalBodyProperties(annotationQueueCreateParams.additionalBodyProperties) - } - - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + @JvmSynthetic + internal fun from(annotationQueueCreateParams: AnnotationQueueCreateParams) = apply { + this.name = annotationQueueCreateParams.name + this.id = annotationQueueCreateParams.id + this.createdAt = annotationQueueCreateParams.createdAt + this.description = annotationQueueCreateParams.description + this.updatedAt = annotationQueueCreateParams.updatedAt + additionalQueryParams(annotationQueueCreateParams.additionalQueryParams) + additionalHeaders(annotationQueueCreateParams.additionalHeaders) + additionalBodyProperties(annotationQueueCreateParams.additionalBodyProperties) } - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id + fun name(name: String) = apply { this.name = name } + + fun id(id: String) = apply { this.id = id } + + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + fun description(description: String) = apply { this.description = description } + + fun updatedAt(updatedAt: OffsetDateTime) = apply { this.updatedAt = updatedAt } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.createdAt = createdAt - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun updatedAt(updatedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.updatedAt = updatedAt - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): AnnotationQueueCreateParams = - AnnotationQueueCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(name) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`name` is required but was not set" - }, + AnnotationQueueCreateParams( + checkNotNull(name) { "`name` is required but was not set" }, id, createdAt, description, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParams.kt index 03f6449b..5bc46107 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class AnnotationQueueDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val queueId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val queueId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId else -> "" } } @@ -50,23 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueDeleteParams && this.queueId == other.queueId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -78,116 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueDeleteParams: AnnotationQueueDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueDeleteParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(annotationQueueDeleteParams.additionalQueryParams) - additionalHeaders(annotationQueueDeleteParams.additionalHeaders) - additionalBodyProperties(annotationQueueDeleteParams.additionalBodyProperties) - } - - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + @JvmSynthetic + internal fun from(annotationQueueDeleteParams: AnnotationQueueDeleteParams) = apply { + this.queueId = annotationQueueDeleteParams.queueId + additionalQueryParams(annotationQueueDeleteParams.additionalQueryParams) + additionalHeaders(annotationQueueDeleteParams.additionalHeaders) + additionalBodyProperties(annotationQueueDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun queueId(queueId: String) = apply { this.queueId = queueId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): AnnotationQueueDeleteParams = - AnnotationQueueDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, + AnnotationQueueDeleteParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteResponse.kt index ad56ff04..9b101cac 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = AnnotationQueueDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = AnnotationQueueDeleteResponse.Builder::class) @NoAutoDetect class AnnotationQueueDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueDeleteResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): AnnotationQueueDeleteResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,33 @@ private constructor( override fun toString() = "AnnotationQueueDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueDeleteResponse: AnnotationQueueDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(annotationQueueDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(annotationQueueDeleteResponse: AnnotationQueueDeleteResponse) = apply { + additionalProperties(annotationQueueDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueDeleteResponse = AnnotationQueueDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueListParams.kt index 350007fc..c143fd09 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -9,12 +9,8 @@ import java.util.Objects import java.util.Optional class AnnotationQueueListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val ids: List?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val ids: List?, private val limit: Long?, private val name: String?, private val nameContains: String?, @@ -23,9 +19,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalHeaders: Map>, ) { - fun ids(): Optional> = - Optional.ofNullable(ids) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun ids(): Optional> = Optional.ofNullable(ids) fun limit(): Optional = Optional.ofNullable(limit) @@ -35,44 +29,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun offset(): Optional = Optional.ofNullable(offset) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.ids?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("ids", listOf(it.joinToString(separator = ","))) - } - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.name?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("name", listOf(it.toString())) - } - this.nameContains?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("name_contains", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.ids?.let { params.put("ids", listOf(it.joinToString(separator = ","))) } + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.name?.let { params.put("name", listOf(it.toString())) } + this.nameContains?.let { params.put("name_contains", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is AnnotationQueueListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueListParams && this.ids == other.ids && this.limit == other.limit && this.name == other.name && @@ -82,10 +62,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - ids, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + ids, limit, name, nameContains, @@ -100,21 +79,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var ids: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var ids: MutableList = mutableListOf() private var limit: Long? = null private var name: String? = null private var nameContains: String? = null @@ -122,104 +95,75 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueListParams: AnnotationQueueListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.ids( - annotationQueueListParams.ids ?: listOf() - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.limit = annotationQueueListParams.limit - this.name = annotationQueueListParams.name - this.nameContains = annotationQueueListParams.nameContains - this.offset = annotationQueueListParams.offset - additionalQueryParams(annotationQueueListParams.additionalQueryParams) - additionalHeaders(annotationQueueListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(annotationQueueListParams: AnnotationQueueListParams) = apply { + this.ids(annotationQueueListParams.ids ?: listOf()) + this.limit = annotationQueueListParams.limit + this.name = annotationQueueListParams.name + this.nameContains = annotationQueueListParams.nameContains + this.offset = annotationQueueListParams.offset + additionalQueryParams(annotationQueueListParams.additionalQueryParams) + additionalHeaders(annotationQueueListParams.additionalHeaders) + } - fun ids(ids: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.ids.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun ids(ids: List) = apply { + this.ids.clear() this.ids.addAll(ids) } - fun addId(id: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.ids.add(id) + fun addId(id: String) = apply { this.ids.add(id) } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun name(name: String) = apply { this.name = name } + + fun nameContains(nameContains: String) = apply { this.nameContains = nameContains } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun nameContains(nameContains: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.nameContains = nameContains - } - - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): AnnotationQueueListParams = - AnnotationQueueListParams( // templates/JavaSDK/entities/params.ts:683:22 - if (ids.size == 0) null - else ids.toUnmodifiable(), // templates/JavaSDK/entities/params.ts:683:22 + AnnotationQueueListParams( + if (ids.size == 0) null else ids.toUnmodifiable(), limit, name, nameContains, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParams.kt index 4977bbe7..2eae49b6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val runId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun runId(): String = runId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun runId(): String = runId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> runId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> runId else -> "" } } @@ -36,22 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueQueueListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueQueueListParams && this.runId == other.runId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + runId, additionalQueryParams, additionalHeaders, ) @@ -62,96 +55,70 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var runId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var runId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueQueueListParams: AnnotationQueueQueueListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.runId = - annotationQueueQueueListParams - .runId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(annotationQueueQueueListParams.additionalQueryParams) - additionalHeaders(annotationQueueQueueListParams.additionalHeaders) - } - - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + @JvmSynthetic + internal fun from(annotationQueueQueueListParams: AnnotationQueueQueueListParams) = apply { + this.runId = annotationQueueQueueListParams.runId + additionalQueryParams(annotationQueueQueueListParams.additionalQueryParams) + additionalHeaders(annotationQueueQueueListParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun runId(runId: String) = apply { this.runId = runId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): AnnotationQueueQueueListParams = - AnnotationQueueQueueListParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`runId` is required but was not set" - }, + AnnotationQueueQueueListParams( + checkNotNull(runId) { "`runId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParams.kt index 9cda98ee..f7e784b2 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -16,48 +14,35 @@ import com.langsmith.api.models.* import java.util.Objects class AnnotationQueueRunCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val queueId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val queueId: String, private val body: List, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId fun body(): List = body - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - AnnotationQueueRunCreateBody { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): AnnotationQueueRunCreateBody { return AnnotationQueueRunCreateBody(body, additionalBodyProperties) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId else -> "" } } - @JsonDeserialize( - builder = AnnotationQueueRunCreateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = AnnotationQueueRunCreateBody.Builder::class) @NoAutoDetect class AnnotationQueueRunCreateBody internal constructor( @@ -65,34 +50,28 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("body") // templates/JavaSDK/entities/objects.ts:113:14 - fun body(): List? = body + @JsonProperty("body") fun body(): List? = body - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunCreateBody && this.body == other.body && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(body, additionalProperties) } return hashCode @@ -101,65 +80,41 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "AnnotationQueueRunCreateBody{body=$body, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var body: List? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var body: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueRunCreateBody: AnnotationQueueRunCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.body = - annotationQueueRunCreateBody - .body // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(annotationQueueRunCreateBody.additionalProperties) - } - - @JsonProperty("body") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun body(body: List) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.body = body + @JvmSynthetic + internal fun from(annotationQueueRunCreateBody: AnnotationQueueRunCreateBody) = apply { + this.body = annotationQueueRunCreateBody.body + additionalProperties(annotationQueueRunCreateBody.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("body") fun body(body: List) = apply { this.body = body } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueRunCreateBody = AnnotationQueueRunCreateBody( - checkNotNull(body) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`body` is required but was not set" - } - .toUnmodifiable(), + checkNotNull(body) { "`body` is required but was not set" }.toUnmodifiable(), additionalProperties.toUnmodifiable() ) } @@ -171,13 +126,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunCreateParams && this.queueId == other.queueId && this.body == other.body && this.additionalQueryParams == other.additionalQueryParams && @@ -185,10 +139,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, body, additionalQueryParams, additionalHeaders, @@ -201,132 +154,96 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var body: MutableList = mutableListOf() private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueRunCreateParams: AnnotationQueueRunCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueRunCreateParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.body(annotationQueueRunCreateParams.body) - additionalQueryParams(annotationQueueRunCreateParams.additionalQueryParams) - additionalHeaders(annotationQueueRunCreateParams.additionalHeaders) - additionalBodyProperties(annotationQueueRunCreateParams.additionalBodyProperties) - } - - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + @JvmSynthetic + internal fun from(annotationQueueRunCreateParams: AnnotationQueueRunCreateParams) = apply { + this.queueId = annotationQueueRunCreateParams.queueId + this.body(annotationQueueRunCreateParams.body) + additionalQueryParams(annotationQueueRunCreateParams.additionalQueryParams) + additionalHeaders(annotationQueueRunCreateParams.additionalHeaders) + additionalBodyProperties(annotationQueueRunCreateParams.additionalBodyProperties) } - fun body(body: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.body.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun queueId(queueId: String) = apply { this.queueId = queueId } + + fun body(body: List) = apply { + this.body.clear() this.body.addAll(body) } - fun addBody(body: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.body.add(body) + fun addBody(body: String) = apply { this.body.add(body) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): AnnotationQueueRunCreateParams = - AnnotationQueueRunCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, - checkNotNull(body) { // templates/JavaSDK/entities/params.ts:844:13 - "`body` is required but was not set" - } - .toUnmodifiable(), + AnnotationQueueRunCreateParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, + checkNotNull(body) { "`body` is required but was not set" }.toUnmodifiable(), additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParams.kt index 5e12cdc9..eb1ba20f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,39 +10,30 @@ import java.util.Objects import java.util.Optional class AnnotationQueueRunDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val queueId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val queueId: String, private val queueRunId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId fun queueRunId(): String = queueRunId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId 1 -> queueRunId else -> "" } @@ -54,13 +45,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunDeleteParams && this.queueId == other.queueId && this.queueRunId == other.queueRunId && this.additionalQueryParams == other.additionalQueryParams && @@ -68,10 +58,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, queueRunId, additionalQueryParams, additionalHeaders, @@ -84,125 +73,91 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var queueRunId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueRunDeleteParams: AnnotationQueueRunDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueRunDeleteParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.queueRunId = annotationQueueRunDeleteParams.queueRunId - additionalQueryParams(annotationQueueRunDeleteParams.additionalQueryParams) - additionalHeaders(annotationQueueRunDeleteParams.additionalHeaders) - additionalBodyProperties(annotationQueueRunDeleteParams.additionalBodyProperties) - } - - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + @JvmSynthetic + internal fun from(annotationQueueRunDeleteParams: AnnotationQueueRunDeleteParams) = apply { + this.queueId = annotationQueueRunDeleteParams.queueId + this.queueRunId = annotationQueueRunDeleteParams.queueRunId + additionalQueryParams(annotationQueueRunDeleteParams.additionalQueryParams) + additionalHeaders(annotationQueueRunDeleteParams.additionalHeaders) + additionalBodyProperties(annotationQueueRunDeleteParams.additionalBodyProperties) } - fun queueRunId(queueRunId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueRunId = queueRunId + fun queueId(queueId: String) = apply { this.queueId = queueId } + + fun queueRunId(queueRunId: String) = apply { this.queueRunId = queueRunId } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): AnnotationQueueRunDeleteParams = - AnnotationQueueRunDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, - checkNotNull(queueRunId) { // templates/JavaSDK/entities/params.ts:844:13 - "`queueRunId` is required but was not set" - }, + AnnotationQueueRunDeleteParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, + checkNotNull(queueRunId) { "`queueRunId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteResponse.kt index 7e0b6104..d6edb774 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = AnnotationQueueRunDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = AnnotationQueueRunDeleteResponse.Builder::class) @NoAutoDetect class AnnotationQueueRunDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueRunDeleteResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): AnnotationQueueRunDeleteResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,34 @@ private constructor( override fun toString() = "AnnotationQueueRunDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(annotationQueueRunDeleteResponse: AnnotationQueueRunDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 + apply { additionalProperties(annotationQueueRunDeleteResponse.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueRunDeleteResponse = AnnotationQueueRunDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunListParams.kt index 5f8dc4ce..e8989394 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -9,48 +9,34 @@ import java.util.Objects import java.util.Optional class AnnotationQueueRunListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val queueId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val queueId: String, private val limit: Long?, private val offset: Long?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId fun limit(): Optional = Optional.ofNullable(limit) fun offset(): Optional = Optional.ofNullable(offset) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId else -> "" } } @@ -59,13 +45,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunListParams && this.queueId == other.queueId && this.limit == other.limit && this.offset == other.offset && @@ -73,10 +58,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, limit, offset, additionalQueryParams, @@ -89,108 +73,78 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var limit: Long? = null private var offset: Long? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueRunListParams: AnnotationQueueRunListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueRunListParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.limit = annotationQueueRunListParams.limit - this.offset = annotationQueueRunListParams.offset - additionalQueryParams(annotationQueueRunListParams.additionalQueryParams) - additionalHeaders(annotationQueueRunListParams.additionalHeaders) - } - - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + @JvmSynthetic + internal fun from(annotationQueueRunListParams: AnnotationQueueRunListParams) = apply { + this.queueId = annotationQueueRunListParams.queueId + this.limit = annotationQueueRunListParams.limit + this.offset = annotationQueueRunListParams.offset + additionalQueryParams(annotationQueueRunListParams.additionalQueryParams) + additionalHeaders(annotationQueueRunListParams.additionalHeaders) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit + fun queueId(queueId: String) = apply { this.queueId = queueId } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): AnnotationQueueRunListParams = - AnnotationQueueRunListParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, + AnnotationQueueRunListParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, limit, offset, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunSchema.kt index 4a2ac7bb..8fef2c0e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,15 +17,11 @@ import java.util.Objects import java.util.Optional /** AnnotationQueueRun schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AnnotationQueueRunSchema.Builder::class) @NoAutoDetect class AnnotationQueueRunSchema -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val runId: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val runId: JsonField, private val queueId: JsonField, private val lastReviewedTime: JsonField, private val addedAt: JsonField, @@ -35,8 +29,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -51,54 +44,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun id(): String = id.getRequired("id") - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runId() = runId + @JsonProperty("run_id") @ExcludeMissing fun _runId() = runId - @JsonProperty("queue_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _queueId() = queueId + @JsonProperty("queue_id") @ExcludeMissing fun _queueId() = queueId - @JsonProperty("last_reviewed_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _lastReviewedTime() = lastReviewedTime + @JsonProperty("last_reviewed_time") @ExcludeMissing fun _lastReviewedTime() = lastReviewedTime - @JsonProperty("added_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _addedAt() = addedAt + @JsonProperty("added_at") @ExcludeMissing fun _addedAt() = addedAt - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueRunSchema = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - runId() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - queueId() - lastReviewedTime() - addedAt() - id() - validated = true - } + fun validate(): AnnotationQueueRunSchema = apply { + if (!validated) { + runId() + queueId() + lastReviewedTime() + addedAt() + id() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is AnnotationQueueRunSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunSchema && this.runId == other.runId && this.queueId == other.queueId && this.lastReviewedTime == other.lastReviewedTime && @@ -107,15 +85,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + runId, queueId, lastReviewedTime, addedAt, @@ -129,112 +103,78 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "AnnotationQueueRunSchema{runId=$runId, queueId=$queueId, lastReviewedTime=$lastReviewedTime, addedAt=$addedAt, id=$id, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var runId: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var runId: JsonField = JsonMissing.of() private var queueId: JsonField = JsonMissing.of() private var lastReviewedTime: JsonField = JsonMissing.of() private var addedAt: JsonField = JsonMissing.of() private var id: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueRunSchema: AnnotationQueueRunSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.runId = - annotationQueueRunSchema - .runId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.queueId = annotationQueueRunSchema.queueId - this.lastReviewedTime = annotationQueueRunSchema.lastReviewedTime - this.addedAt = annotationQueueRunSchema.addedAt - this.id = annotationQueueRunSchema.id - additionalProperties(annotationQueueRunSchema.additionalProperties) - } - - fun runId(runId: String) = - runId(JsonField.of(runId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun runId(runId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runId = runId - } - - fun queueId(queueId: String) = - queueId(JsonField.of(queueId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("queue_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun queueId(queueId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.queueId = queueId - } - - fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = - lastReviewedTime( - JsonField.of(lastReviewedTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("last_reviewed_time") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun lastReviewedTime(lastReviewedTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastReviewedTime = lastReviewedTime - } - - fun addedAt(addedAt: OffsetDateTime) = - addedAt(JsonField.of(addedAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("added_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun addedAt(addedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.addedAt = addedAt - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(annotationQueueRunSchema: AnnotationQueueRunSchema) = apply { + this.runId = annotationQueueRunSchema.runId + this.queueId = annotationQueueRunSchema.queueId + this.lastReviewedTime = annotationQueueRunSchema.lastReviewedTime + this.addedAt = annotationQueueRunSchema.addedAt + this.id = annotationQueueRunSchema.id + additionalProperties(annotationQueueRunSchema.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun runId(runId: String) = runId(JsonField.of(runId)) - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("run_id") + @ExcludeMissing + fun runId(runId: JsonField) = apply { this.runId = runId } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun queueId(queueId: String) = queueId(JsonField.of(queueId)) + + @JsonProperty("queue_id") + @ExcludeMissing + fun queueId(queueId: JsonField) = apply { this.queueId = queueId } + + fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = + lastReviewedTime(JsonField.of(lastReviewedTime)) + + @JsonProperty("last_reviewed_time") + @ExcludeMissing + fun lastReviewedTime(lastReviewedTime: JsonField) = apply { + this.lastReviewedTime = lastReviewedTime + } + + fun addedAt(addedAt: OffsetDateTime) = addedAt(JsonField.of(addedAt)) + + @JsonProperty("added_at") + @ExcludeMissing + fun addedAt(addedAt: JsonField) = apply { this.addedAt = addedAt } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueRunSchema = - AnnotationQueueRunSchema( // templates/JavaSDK/entities/objects.ts:326:30 - runId, // templates/JavaSDK/entities/objects.ts:326:30 + AnnotationQueueRunSchema( + runId, queueId, lastReviewedTime, addedAt, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParams.kt index 34de4ae3..90ec089c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,12 +16,8 @@ import java.util.Objects import java.util.Optional class AnnotationQueueRunUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val queueId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val queueId: String, private val queueRunId: String, private val addedAt: OffsetDateTime?, private val lastReviewedTime: OffsetDateTime?, @@ -32,8 +26,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId fun queueRunId(): String = queueRunId @@ -41,37 +34,28 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun lastReviewedTime(): Optional = Optional.ofNullable(lastReviewedTime) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - AnnotationQueueRunUpdateBody { // templates/JavaSDK/entities/params.ts:165:16 - return AnnotationQueueRunUpdateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - addedAt, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): AnnotationQueueRunUpdateBody { + return AnnotationQueueRunUpdateBody( + addedAt, lastReviewedTime, additionalBodyProperties, ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId 1 -> queueRunId else -> "" } } - @JsonDeserialize( - builder = AnnotationQueueRunUpdateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = AnnotationQueueRunUpdateBody.Builder::class) @NoAutoDetect class AnnotationQueueRunUpdateBody internal constructor( @@ -80,43 +64,35 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("added_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun addedAt(): OffsetDateTime? = addedAt + @JsonProperty("added_at") fun addedAt(): OffsetDateTime? = addedAt - @JsonProperty("last_reviewed_time") // templates/JavaSDK/entities/objects.ts:113:14 + @JsonProperty("last_reviewed_time") fun lastReviewedTime(): OffsetDateTime? = lastReviewedTime - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunUpdateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunUpdateBody && this.addedAt == other.addedAt && this.lastReviewedTime == other.lastReviewedTime && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - addedAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + addedAt, lastReviewedTime, additionalProperties, ) @@ -127,71 +103,49 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "AnnotationQueueRunUpdateBody{addedAt=$addedAt, lastReviewedTime=$lastReviewedTime, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var addedAt: OffsetDateTime? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var addedAt: OffsetDateTime? = null private var lastReviewedTime: OffsetDateTime? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueRunUpdateBody: AnnotationQueueRunUpdateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.addedAt = - annotationQueueRunUpdateBody - .addedAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.lastReviewedTime = annotationQueueRunUpdateBody.lastReviewedTime - additionalProperties(annotationQueueRunUpdateBody.additionalProperties) - } + @JvmSynthetic + internal fun from(annotationQueueRunUpdateBody: AnnotationQueueRunUpdateBody) = apply { + this.addedAt = annotationQueueRunUpdateBody.addedAt + this.lastReviewedTime = annotationQueueRunUpdateBody.lastReviewedTime + additionalProperties(annotationQueueRunUpdateBody.additionalProperties) + } - @JsonProperty("added_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun addedAt(addedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.addedAt = addedAt - } + @JsonProperty("added_at") + fun addedAt(addedAt: OffsetDateTime) = apply { this.addedAt = addedAt } - @JsonProperty("last_reviewed_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastReviewedTime = lastReviewedTime - } + @JsonProperty("last_reviewed_time") + fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = apply { + this.lastReviewedTime = lastReviewedTime + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueRunUpdateBody = - AnnotationQueueRunUpdateBody( // templates/JavaSDK/entities/objects.ts:326:30 - addedAt, // templates/JavaSDK/entities/objects.ts:326:30 + AnnotationQueueRunUpdateBody( + addedAt, lastReviewedTime, additionalProperties.toUnmodifiable(), ) @@ -204,13 +158,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunUpdateParams && this.queueId == other.queueId && this.queueRunId == other.queueRunId && this.addedAt == other.addedAt && @@ -220,10 +173,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, queueRunId, addedAt, lastReviewedTime, @@ -238,20 +190,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var queueRunId: String? = null private var addedAt: OffsetDateTime? = null private var lastReviewedTime: OffsetDateTime? = null @@ -259,118 +206,85 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueRunUpdateParams: AnnotationQueueRunUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueRunUpdateParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.queueRunId = annotationQueueRunUpdateParams.queueRunId - this.addedAt = annotationQueueRunUpdateParams.addedAt - this.lastReviewedTime = annotationQueueRunUpdateParams.lastReviewedTime - additionalQueryParams(annotationQueueRunUpdateParams.additionalQueryParams) - additionalHeaders(annotationQueueRunUpdateParams.additionalHeaders) - additionalBodyProperties(annotationQueueRunUpdateParams.additionalBodyProperties) - } - - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + @JvmSynthetic + internal fun from(annotationQueueRunUpdateParams: AnnotationQueueRunUpdateParams) = apply { + this.queueId = annotationQueueRunUpdateParams.queueId + this.queueRunId = annotationQueueRunUpdateParams.queueRunId + this.addedAt = annotationQueueRunUpdateParams.addedAt + this.lastReviewedTime = annotationQueueRunUpdateParams.lastReviewedTime + additionalQueryParams(annotationQueueRunUpdateParams.additionalQueryParams) + additionalHeaders(annotationQueueRunUpdateParams.additionalHeaders) + additionalBodyProperties(annotationQueueRunUpdateParams.additionalBodyProperties) } - fun queueRunId(queueRunId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueRunId = queueRunId + fun queueId(queueId: String) = apply { this.queueId = queueId } + + fun queueRunId(queueRunId: String) = apply { this.queueRunId = queueRunId } + + fun addedAt(addedAt: OffsetDateTime) = apply { this.addedAt = addedAt } + + fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = apply { + this.lastReviewedTime = lastReviewedTime } - fun addedAt(addedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.addedAt = addedAt - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.lastReviewedTime = lastReviewedTime - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): AnnotationQueueRunUpdateParams = - AnnotationQueueRunUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, - checkNotNull(queueRunId) { // templates/JavaSDK/entities/params.ts:844:13 - "`queueRunId` is required but was not set" - }, + AnnotationQueueRunUpdateParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, + checkNotNull(queueRunId) { "`queueRunId` is required but was not set" }, addedAt, lastReviewedTime, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateResponse.kt index 812d4979..5c734fd5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = AnnotationQueueRunUpdateResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = AnnotationQueueRunUpdateResponse.Builder::class) @NoAutoDetect class AnnotationQueueRunUpdateResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueRunUpdateResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): AnnotationQueueRunUpdateResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueRunUpdateResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueRunUpdateResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,34 @@ private constructor( override fun toString() = "AnnotationQueueRunUpdateResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(annotationQueueRunUpdateResponse: AnnotationQueueRunUpdateResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 + apply { additionalProperties(annotationQueueRunUpdateResponse.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueRunUpdateResponse = AnnotationQueueRunUpdateResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSchema.kt index c178c19e..ee76a2b7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,15 +17,11 @@ import java.util.Objects import java.util.Optional /** AnnotationQueue schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AnnotationQueueSchema.Builder::class) @NoAutoDetect class AnnotationQueueSchema -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val name: JsonField, private val description: JsonField, private val createdAt: JsonField, private val updatedAt: JsonField, @@ -36,8 +30,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -56,41 +49,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun tenantId(): String = tenantId.getRequired("tenant_id") - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _description() = description + @JsonProperty("description") @ExcludeMissing fun _description() = description - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("updated_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _updatedAt() = updatedAt + @JsonProperty("updated_at") @ExcludeMissing fun _updatedAt() = updatedAt - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): AnnotationQueueSchema = apply { + if (!validated) { + name() description() createdAt() updatedAt() @@ -102,12 +79,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is AnnotationQueueSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueSchema && this.name == other.name && this.description == other.description && this.createdAt == other.createdAt && @@ -117,15 +94,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, description, createdAt, updatedAt, @@ -140,21 +113,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "AnnotationQueueSchema{name=$name, description=$description, createdAt=$createdAt, updatedAt=$updatedAt, id=$id, tenantId=$tenantId, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() @@ -162,98 +128,68 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var tenantId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueSchema: AnnotationQueueSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - annotationQueueSchema.name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.description = annotationQueueSchema.description - this.createdAt = annotationQueueSchema.createdAt - this.updatedAt = annotationQueueSchema.updatedAt - this.id = annotationQueueSchema.id - this.tenantId = annotationQueueSchema.tenantId - additionalProperties(annotationQueueSchema.additionalProperties) - } - - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(annotationQueueSchema: AnnotationQueueSchema) = apply { + this.name = annotationQueueSchema.name + this.description = annotationQueueSchema.description + this.createdAt = annotationQueueSchema.createdAt + this.updatedAt = annotationQueueSchema.updatedAt + this.id = annotationQueueSchema.id + this.tenantId = annotationQueueSchema.tenantId + additionalProperties(annotationQueueSchema.additionalProperties) } - fun description(description: String) = - description(JsonField.of(description)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun description(description: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + fun name(name: JsonField) = apply { this.name = name } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("description") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun description(description: JsonField) = apply { this.description = description } - fun updatedAt(updatedAt: OffsetDateTime) = - updatedAt(JsonField.of(updatedAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("updated_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun updatedAt(updatedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.updatedAt = updatedAt - } + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("updated_at") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) + + @JsonProperty("tenant_id") + @ExcludeMissing + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueSchema = - AnnotationQueueSchema( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + AnnotationQueueSchema( + name, description, createdAt, updatedAt, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParams.kt index 3d6c7b9f..99890a63 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val queueId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId else -> "" } } @@ -36,22 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueSizeRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueSizeRetrieveParams && this.queueId == other.queueId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, additionalQueryParams, additionalHeaders, ) @@ -62,96 +55,71 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 + @JvmSynthetic internal fun from(annotationQueueSizeRetrieveParams: AnnotationQueueSizeRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueSizeRetrieveParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 + apply { + this.queueId = annotationQueueSizeRetrieveParams.queueId additionalQueryParams(annotationQueueSizeRetrieveParams.additionalQueryParams) additionalHeaders(annotationQueueSizeRetrieveParams.additionalHeaders) } - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + fun queueId(queueId: String) = apply { this.queueId = queueId } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): AnnotationQueueSizeRetrieveParams = - AnnotationQueueSizeRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, + AnnotationQueueSizeRetrieveParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchema.kt index 734f584d..065f6466 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,9 +15,6 @@ import com.langsmith.api.core.toUnmodifiable import java.util.Objects /** Size of an Annotation Queue */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AnnotationQueueSizeSchema.Builder::class) @NoAutoDetect class AnnotationQueueSizeSchema @@ -28,49 +23,39 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun size(): Long = size.getRequired("size") - @JsonProperty("size") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _size() = size + @JsonProperty("size") @ExcludeMissing fun _size() = size - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueSizeSchema = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - size() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): AnnotationQueueSizeSchema = apply { + if (!validated) { + size() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is AnnotationQueueSizeSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueSizeSchema && this.size == other.size && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(size, additionalProperties) } return hashCode @@ -79,59 +64,41 @@ private constructor( override fun toString() = "AnnotationQueueSizeSchema{size=$size, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var size: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var size: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueSizeSchema: AnnotationQueueSizeSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.size = - annotationQueueSizeSchema - .size // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(annotationQueueSizeSchema.additionalProperties) - } - - fun size(size: Long) = - size(JsonField.of(size)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("size") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun size(size: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.size = size + @JvmSynthetic + internal fun from(annotationQueueSizeSchema: AnnotationQueueSizeSchema) = apply { + this.size = annotationQueueSizeSchema.size + additionalProperties(annotationQueueSizeSchema.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun size(size: Long) = size(JsonField.of(size)) - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("size") + @ExcludeMissing + fun size(size: JsonField) = apply { this.size = size } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueSizeSchema = AnnotationQueueSizeSchema(size, additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParams.kt index 60f027ff..fa30aceb 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,12 +16,8 @@ import java.util.Objects import java.util.Optional class AnnotationQueueUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val queueId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val queueId: String, private val name: String, private val createdAt: OffsetDateTime?, private val description: String?, @@ -33,8 +27,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun queueId(): String = queueId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun queueId(): String = queueId fun name(): String = name @@ -44,12 +37,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun updatedAt(): Optional = Optional.ofNullable(updatedAt) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - AnnotationQueueUpdateBody { // templates/JavaSDK/entities/params.ts:165:16 - return AnnotationQueueUpdateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - name, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): AnnotationQueueUpdateBody { + return AnnotationQueueUpdateBody( + name, createdAt, description, updatedAt, @@ -57,65 +48,51 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> queueId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> queueId else -> "" } } /** AnnotationQueue update schema. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AnnotationQueueUpdateBody.Builder::class) @NoAutoDetect class AnnotationQueueUpdateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val name: String?, private val createdAt: OffsetDateTime?, private val description: String?, private val updatedAt: OffsetDateTime?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonProperty("updated_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun updatedAt(): OffsetDateTime? = updatedAt + @JsonProperty("updated_at") fun updatedAt(): OffsetDateTime? = updatedAt - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueUpdateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueUpdateBody && this.name == other.name && this.createdAt == other.createdAt && this.description == other.description && @@ -123,15 +100,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, createdAt, description, updatedAt, @@ -144,90 +117,56 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "AnnotationQueueUpdateBody{name=$name, createdAt=$createdAt, description=$description, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: String? = null private var createdAt: OffsetDateTime? = null private var description: String? = null private var updatedAt: OffsetDateTime? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueUpdateBody: AnnotationQueueUpdateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - annotationQueueUpdateBody - .name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = annotationQueueUpdateBody.createdAt - this.description = annotationQueueUpdateBody.description - this.updatedAt = annotationQueueUpdateBody.updatedAt - additionalProperties(annotationQueueUpdateBody.additionalProperties) - } - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(annotationQueueUpdateBody: AnnotationQueueUpdateBody) = apply { + this.name = annotationQueueUpdateBody.name + this.createdAt = annotationQueueUpdateBody.createdAt + this.description = annotationQueueUpdateBody.description + this.updatedAt = annotationQueueUpdateBody.updatedAt + additionalProperties(annotationQueueUpdateBody.additionalProperties) } - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + @JsonProperty("name") fun name(name: String) = apply { this.name = name } - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } - @JsonProperty("updated_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun updatedAt(updatedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.updatedAt = updatedAt - } + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("updated_at") + fun updatedAt(updatedAt: OffsetDateTime) = apply { this.updatedAt = updatedAt } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueUpdateBody = - AnnotationQueueUpdateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(name) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`name` is required but was not set" - }, + AnnotationQueueUpdateBody( + checkNotNull(name) { "`name` is required but was not set" }, createdAt, description, updatedAt, @@ -242,13 +181,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueUpdateParams && this.queueId == other.queueId && this.name == other.name && this.createdAt == other.createdAt && @@ -259,10 +197,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - queueId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + queueId, name, createdAt, description, @@ -278,20 +215,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var queueId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var queueId: String? = null private var name: String? = null private var createdAt: OffsetDateTime? = null private var description: String? = null @@ -300,124 +232,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(annotationQueueUpdateParams: AnnotationQueueUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.queueId = - annotationQueueUpdateParams - .queueId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.name = annotationQueueUpdateParams.name - this.createdAt = annotationQueueUpdateParams.createdAt - this.description = annotationQueueUpdateParams.description - this.updatedAt = annotationQueueUpdateParams.updatedAt - additionalQueryParams(annotationQueueUpdateParams.additionalQueryParams) - additionalHeaders(annotationQueueUpdateParams.additionalHeaders) - additionalBodyProperties(annotationQueueUpdateParams.additionalBodyProperties) - } - - fun queueId(queueId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.queueId = queueId + @JvmSynthetic + internal fun from(annotationQueueUpdateParams: AnnotationQueueUpdateParams) = apply { + this.queueId = annotationQueueUpdateParams.queueId + this.name = annotationQueueUpdateParams.name + this.createdAt = annotationQueueUpdateParams.createdAt + this.description = annotationQueueUpdateParams.description + this.updatedAt = annotationQueueUpdateParams.updatedAt + additionalQueryParams(annotationQueueUpdateParams.additionalQueryParams) + additionalHeaders(annotationQueueUpdateParams.additionalHeaders) + additionalBodyProperties(annotationQueueUpdateParams.additionalBodyProperties) } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun queueId(queueId: String) = apply { this.queueId = queueId } + + fun name(name: String) = apply { this.name = name } + + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + fun description(description: String) = apply { this.description = description } + + fun updatedAt(updatedAt: OffsetDateTime) = apply { this.updatedAt = updatedAt } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.createdAt = createdAt - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun updatedAt(updatedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.updatedAt = updatedAt - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): AnnotationQueueUpdateParams = - AnnotationQueueUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(queueId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`queueId` is required but was not set" - }, - checkNotNull(name) { // templates/JavaSDK/entities/params.ts:844:13 - "`name` is required but was not set" - }, + AnnotationQueueUpdateParams( + checkNotNull(queueId) { "`queueId` is required but was not set" }, + checkNotNull(name) { "`name` is required but was not set" }, createdAt, description, updatedAt, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateResponse.kt index e9b2f781..3dc870c3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/AnnotationQueueUpdateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = AnnotationQueueUpdateResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = AnnotationQueueUpdateResponse.Builder::class) @NoAutoDetect class AnnotationQueueUpdateResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AnnotationQueueUpdateResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): AnnotationQueueUpdateResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - AnnotationQueueUpdateResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AnnotationQueueUpdateResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,33 @@ private constructor( override fun toString() = "AnnotationQueueUpdateResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(annotationQueueUpdateResponse: AnnotationQueueUpdateResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(annotationQueueUpdateResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(annotationQueueUpdateResponse: AnnotationQueueUpdateResponse) = apply { + additionalProperties(annotationQueueUpdateResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): AnnotationQueueUpdateResponse = AnnotationQueueUpdateResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateParams.kt index 8c90c248..9e95de7f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,36 +15,25 @@ import java.util.Objects import java.util.Optional class ApiKeyCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val readOnly: Boolean?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val readOnly: Boolean?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun readOnly(): Optional = - Optional.ofNullable(readOnly) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun readOnly(): Optional = Optional.ofNullable(readOnly) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): ApiKeyCreateBody { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): ApiKeyCreateBody { return ApiKeyCreateBody(readOnly, additionalBodyProperties) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** API key POST schema. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ApiKeyCreateBody.Builder::class) @NoAutoDetect class ApiKeyCreateBody @@ -55,33 +42,28 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:113:14 - fun readOnly(): Boolean? = readOnly + @JsonProperty("read_only") fun readOnly(): Boolean? = readOnly - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiKeyCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiKeyCreateBody && this.readOnly == other.readOnly && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(readOnly, additionalProperties) } return hashCode @@ -90,56 +72,38 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ApiKeyCreateBody{readOnly=$readOnly, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var readOnly: Boolean? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var readOnly: Boolean? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(apiKeyCreateBody: ApiKeyCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.readOnly = - apiKeyCreateBody.readOnly // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(apiKeyCreateBody.additionalProperties) - } + @JvmSynthetic + internal fun from(apiKeyCreateBody: ApiKeyCreateBody) = apply { + this.readOnly = apiKeyCreateBody.readOnly + additionalProperties(apiKeyCreateBody.additionalProperties) + } - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun readOnly(readOnly: Boolean) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } + @JsonProperty("read_only") + fun readOnly(readOnly: Boolean) = apply { this.readOnly = readOnly } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ApiKeyCreateBody = ApiKeyCreateBody(readOnly, additionalProperties.toUnmodifiable()) @@ -152,22 +116,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiKeyCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiKeyCreateParams && this.readOnly == other.readOnly && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - readOnly, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + readOnly, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -179,112 +142,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var readOnly: Boolean? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var readOnly: Boolean? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(apiKeyCreateParams: ApiKeyCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.readOnly = - apiKeyCreateParams.readOnly // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(apiKeyCreateParams.additionalQueryParams) - additionalHeaders(apiKeyCreateParams.additionalHeaders) - additionalBodyProperties(apiKeyCreateParams.additionalBodyProperties) - } - - fun readOnly(readOnly: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.readOnly = readOnly + @JvmSynthetic + internal fun from(apiKeyCreateParams: ApiKeyCreateParams) = apply { + this.readOnly = apiKeyCreateParams.readOnly + additionalQueryParams(apiKeyCreateParams.additionalQueryParams) + additionalHeaders(apiKeyCreateParams.additionalHeaders) + additionalBodyProperties(apiKeyCreateParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun readOnly(readOnly: Boolean) = apply { this.readOnly = readOnly } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ApiKeyCreateParams = - ApiKeyCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - readOnly, // templates/JavaSDK/entities/params.ts:683:22 + ApiKeyCreateParams( + readOnly, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateResponse.kt index 2703a5b4..a0097cd9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyCreateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,16 +17,11 @@ import java.util.Objects import java.util.Optional /** API key POST schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ApiKeyCreateResponse.Builder::class) @NoAutoDetect class ApiKeyCreateResponse -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val createdAt: JsonField, private val id: JsonField, private val shortKey: JsonField, private val readOnly: JsonField, @@ -36,8 +29,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -52,37 +44,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun key(): String = key.getRequired("key") - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("short_key") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _shortKey() = shortKey + @JsonProperty("short_key") @ExcludeMissing fun _shortKey() = shortKey - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _readOnly() = readOnly + @JsonProperty("read_only") @ExcludeMissing fun _readOnly() = readOnly - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _key() = key + @JsonProperty("key") @ExcludeMissing fun _key() = key - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ApiKeyCreateResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): ApiKeyCreateResponse = apply { + if (!validated) { + createdAt() id() shortKey() readOnly() @@ -93,12 +71,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiKeyCreateResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiKeyCreateResponse && this.createdAt == other.createdAt && this.id == other.id && this.shortKey == other.shortKey && @@ -107,15 +85,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, id, shortKey, readOnly, @@ -129,109 +103,75 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "ApiKeyCreateResponse{createdAt=$createdAt, id=$id, shortKey=$shortKey, readOnly=$readOnly, key=$key, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var id: JsonField = JsonMissing.of() private var shortKey: JsonField = JsonMissing.of() private var readOnly: JsonField = JsonMissing.of() private var key: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(apiKeyCreateResponse: ApiKeyCreateResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - apiKeyCreateResponse - .createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.id = apiKeyCreateResponse.id - this.shortKey = apiKeyCreateResponse.shortKey - this.readOnly = apiKeyCreateResponse.readOnly - this.key = apiKeyCreateResponse.key - additionalProperties(apiKeyCreateResponse.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(apiKeyCreateResponse: ApiKeyCreateResponse) = apply { + this.createdAt = apiKeyCreateResponse.createdAt + this.id = apiKeyCreateResponse.id + this.shortKey = apiKeyCreateResponse.shortKey + this.readOnly = apiKeyCreateResponse.readOnly + this.key = apiKeyCreateResponse.key + additionalProperties(apiKeyCreateResponse.additionalProperties) } - fun shortKey(shortKey: String) = - shortKey(JsonField.of(shortKey)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("short_key") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun shortKey(shortKey: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.shortKey = shortKey - } + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - fun readOnly(readOnly: Boolean) = - readOnly(JsonField.of(readOnly)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun shortKey(shortKey: String) = shortKey(JsonField.of(shortKey)) + + @JsonProperty("short_key") @ExcludeMissing - fun readOnly(readOnly: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } + fun shortKey(shortKey: JsonField) = apply { this.shortKey = shortKey } - fun key(key: String) = - key(JsonField.of(key)) // templates/JavaSDK/entities/objects.ts:252:20 + fun readOnly(readOnly: Boolean) = readOnly(JsonField.of(readOnly)) - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("read_only") @ExcludeMissing - fun key(key: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.key = key + fun readOnly(readOnly: JsonField) = apply { this.readOnly = readOnly } + + fun key(key: String) = key(JsonField.of(key)) + + @JsonProperty("key") + @ExcludeMissing + fun key(key: JsonField) = apply { this.key = key } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ApiKeyCreateResponse = - ApiKeyCreateResponse( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + ApiKeyCreateResponse( + createdAt, id, shortKey, readOnly, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyDeleteParams.kt index 8cfbc867..3823ff80 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class ApiKeyDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val apiKeyId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val apiKeyId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun apiKeyId(): String = apiKeyId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun apiKeyId(): String = apiKeyId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> apiKeyId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> apiKeyId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiKeyDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiKeyDeleteParams && this.apiKeyId == other.apiKeyId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - apiKeyId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + apiKeyId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,115 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var apiKeyId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var apiKeyId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(apiKeyDeleteParams: ApiKeyDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.apiKeyId = - apiKeyDeleteParams.apiKeyId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(apiKeyDeleteParams.additionalQueryParams) - additionalHeaders(apiKeyDeleteParams.additionalHeaders) - additionalBodyProperties(apiKeyDeleteParams.additionalBodyProperties) - } - - fun apiKeyId(apiKeyId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.apiKeyId = apiKeyId + @JvmSynthetic + internal fun from(apiKeyDeleteParams: ApiKeyDeleteParams) = apply { + this.apiKeyId = apiKeyDeleteParams.apiKeyId + additionalQueryParams(apiKeyDeleteParams.additionalQueryParams) + additionalHeaders(apiKeyDeleteParams.additionalHeaders) + additionalBodyProperties(apiKeyDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun apiKeyId(apiKeyId: String) = apply { this.apiKeyId = apiKeyId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ApiKeyDeleteParams = - ApiKeyDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(apiKeyId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`apiKeyId` is required but was not set" - }, + ApiKeyDeleteParams( + checkNotNull(apiKeyId) { "`apiKeyId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyGetResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyGetResponse.kt index 8983ae9d..601381f5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyGetResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyGetResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,24 +17,18 @@ import java.util.Objects import java.util.Optional /** API key GET schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ApiKeyGetResponse.Builder::class) @NoAutoDetect class ApiKeyGetResponse -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val createdAt: JsonField, private val id: JsonField, private val shortKey: JsonField, private val readOnly: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -49,33 +41,21 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun readOnly(): Boolean = readOnly.getRequired("read_only") - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("short_key") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _shortKey() = shortKey + @JsonProperty("short_key") @ExcludeMissing fun _shortKey() = shortKey - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _readOnly() = readOnly + @JsonProperty("read_only") @ExcludeMissing fun _readOnly() = readOnly - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ApiKeyGetResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): ApiKeyGetResponse = apply { + if (!validated) { + createdAt() id() shortKey() readOnly() @@ -85,12 +65,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiKeyGetResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiKeyGetResponse && this.createdAt == other.createdAt && this.id == other.id && this.shortKey == other.shortKey && @@ -98,15 +78,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, id, shortKey, readOnly, @@ -119,97 +95,67 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "ApiKeyGetResponse{createdAt=$createdAt, id=$id, shortKey=$shortKey, readOnly=$readOnly, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var id: JsonField = JsonMissing.of() private var shortKey: JsonField = JsonMissing.of() private var readOnly: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(apiKeyGetResponse: ApiKeyGetResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - apiKeyGetResponse.createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.id = apiKeyGetResponse.id - this.shortKey = apiKeyGetResponse.shortKey - this.readOnly = apiKeyGetResponse.readOnly - additionalProperties(apiKeyGetResponse.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(apiKeyGetResponse: ApiKeyGetResponse) = apply { + this.createdAt = apiKeyGetResponse.createdAt + this.id = apiKeyGetResponse.id + this.shortKey = apiKeyGetResponse.shortKey + this.readOnly = apiKeyGetResponse.readOnly + additionalProperties(apiKeyGetResponse.additionalProperties) } - fun shortKey(shortKey: String) = - shortKey(JsonField.of(shortKey)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("short_key") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun shortKey(shortKey: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.shortKey = shortKey - } + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - fun readOnly(readOnly: Boolean) = - readOnly(JsonField.of(readOnly)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun shortKey(shortKey: String) = shortKey(JsonField.of(shortKey)) + + @JsonProperty("short_key") @ExcludeMissing - fun readOnly(readOnly: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } + fun shortKey(shortKey: JsonField) = apply { this.shortKey = shortKey } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun readOnly(readOnly: Boolean) = readOnly(JsonField.of(readOnly)) - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("read_only") + @ExcludeMissing + fun readOnly(readOnly: JsonField) = apply { this.readOnly = readOnly } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ApiKeyGetResponse = - ApiKeyGetResponse( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + ApiKeyGetResponse( + createdAt, id, shortKey, readOnly, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyRetrieveParams.kt index fa63ef2a..6b368dcb 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ApiKeyRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class ApiKeyRetrieveParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiKeyRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiKeyRetrieveParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(apiKeyRetrieveParams: ApiKeyRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - apiKeyRetrieveParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(apiKeyRetrieveParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(apiKeyRetrieveParams: ApiKeyRetrieveParams) = apply { + additionalQueryParams(apiKeyRetrieveParams.additionalQueryParams) + additionalHeaders(apiKeyRetrieveParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): ApiKeyRetrieveParams = ApiKeyRetrieveParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Dataset.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Dataset.kt index de46c463..33ed229f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Dataset.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Dataset.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,15 +19,11 @@ import java.util.Objects import java.util.Optional /** Dataset schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = Dataset.Builder::class) @NoAutoDetect class Dataset -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val name: JsonField, private val description: JsonField, private val createdAt: JsonField, private val dataType: JsonField, @@ -42,8 +36,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -71,58 +64,36 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun lastSessionStartTime(): Optional = Optional.ofNullable(lastSessionStartTime.getNullable("last_session_start_time")) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _description() = description + @JsonProperty("description") @ExcludeMissing fun _description() = description - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _dataType() = dataType + @JsonProperty("data_type") @ExcludeMissing fun _dataType() = dataType - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("example_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _exampleCount() = exampleCount + @JsonProperty("example_count") @ExcludeMissing fun _exampleCount() = exampleCount - @JsonProperty("session_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sessionCount() = sessionCount + @JsonProperty("session_count") @ExcludeMissing fun _sessionCount() = sessionCount - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonProperty("last_session_start_time") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("last_session_start_time") @ExcludeMissing fun _lastSessionStartTime() = lastSessionStartTime - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Dataset = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Dataset = apply { + if (!validated) { + name() description() createdAt() dataType() @@ -138,12 +109,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Dataset && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Dataset && this.name == other.name && this.description == other.description && this.createdAt == other.createdAt && @@ -157,15 +128,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, description, createdAt, dataType, @@ -184,21 +151,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Dataset{name=$name, description=$description, createdAt=$createdAt, dataType=$dataType, id=$id, tenantId=$tenantId, exampleCount=$exampleCount, sessionCount=$sessionCount, modifiedAt=$modifiedAt, lastSessionStartTime=$lastSessionStartTime, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var dataType: JsonField = JsonMissing.of() @@ -210,145 +170,103 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var lastSessionStartTime: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(dataset: Dataset) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = dataset.name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.description = dataset.description - this.createdAt = dataset.createdAt - this.dataType = dataset.dataType - this.id = dataset.id - this.tenantId = dataset.tenantId - this.exampleCount = dataset.exampleCount - this.sessionCount = dataset.sessionCount - this.modifiedAt = dataset.modifiedAt - this.lastSessionStartTime = dataset.lastSessionStartTime - additionalProperties(dataset.additionalProperties) - } - - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(dataset: Dataset) = apply { + this.name = dataset.name + this.description = dataset.description + this.createdAt = dataset.createdAt + this.dataType = dataset.dataType + this.id = dataset.id + this.tenantId = dataset.tenantId + this.exampleCount = dataset.exampleCount + this.sessionCount = dataset.sessionCount + this.modifiedAt = dataset.modifiedAt + this.lastSessionStartTime = dataset.lastSessionStartTime + additionalProperties(dataset.additionalProperties) } - fun description(description: String) = - description(JsonField.of(description)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun description(description: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + fun name(name: JsonField) = apply { this.name = name } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("description") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun description(description: JsonField) = apply { this.description = description } + + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") + @ExcludeMissing + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** Enum for dataset data types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun dataType(dataType: DataType) = dataType(JsonField.of(dataType)) /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("data_type") @ExcludeMissing - fun dataType(dataType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dataType = dataType - } + fun dataType(dataType: JsonField) = apply { this.dataType = dataType } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) + + @JsonProperty("tenant_id") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } + + fun exampleCount(exampleCount: Long) = exampleCount(JsonField.of(exampleCount)) + + @JsonProperty("example_count") + @ExcludeMissing + fun exampleCount(exampleCount: JsonField) = apply { this.exampleCount = exampleCount } + + fun sessionCount(sessionCount: Long) = sessionCount(JsonField.of(sessionCount)) + + @JsonProperty("session_count") + @ExcludeMissing + fun sessionCount(sessionCount: JsonField) = apply { this.sessionCount = sessionCount } + + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) + + @JsonProperty("modified_at") + @ExcludeMissing + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } - - fun exampleCount(exampleCount: Long) = - exampleCount(JsonField.of(exampleCount)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("example_count") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun exampleCount(exampleCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.exampleCount = exampleCount - } - - fun sessionCount(sessionCount: Long) = - sessionCount(JsonField.of(sessionCount)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("session_count") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun sessionCount(sessionCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sessionCount = sessionCount - } - - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } - fun lastSessionStartTime(lastSessionStartTime: OffsetDateTime) = - lastSessionStartTime( - JsonField.of(lastSessionStartTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + lastSessionStartTime(JsonField.of(lastSessionStartTime)) - @JsonProperty("last_session_start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_session_start_time") @ExcludeMissing - fun lastSessionStartTime(lastSessionStartTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastSessionStartTime = lastSessionStartTime - } + fun lastSessionStartTime(lastSessionStartTime: JsonField) = apply { + this.lastSessionStartTime = lastSessionStartTime + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Dataset = - Dataset( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + Dataset( + name, description, createdAt, dataType, @@ -366,30 +284,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DataType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is DataType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val KV = DataType(JsonField.of("kv")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val KV = DataType(JsonField.of("kv")) @JvmField val LLM = DataType(JsonField.of("llm")) @@ -398,34 +311,30 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = DataType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - KV, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + KV, LLM, CHAT, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - KV, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + KV, LLM, CHAT, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - KV -> Value.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Value.KV LLM -> Value.LLM CHAT -> Value.CHAT else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - KV -> Known.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Known.KV LLM -> Known.LLM CHAT -> Known.CHAT else -> throw LangSmithInvalidDataException("Unknown DataType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCreateParams.kt index 384219cd..8d647298 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,12 +19,8 @@ import java.util.Objects import java.util.Optional class DatasetCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val name: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val name: String, private val id: String?, private val createdAt: OffsetDateTime?, private val dataType: DataType?, @@ -36,8 +30,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun name(): String = name // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun name(): String = name fun id(): Optional = Optional.ofNullable(id) @@ -47,11 +40,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun description(): Optional = Optional.ofNullable(description) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): DatasetCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return DatasetCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - name, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): DatasetCreateBody { + return DatasetCreateBody( + name, id, createdAt, dataType, @@ -60,22 +52,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Create class for Dataset. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = DatasetCreateBody.Builder::class) @NoAutoDetect class DatasetCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val name: String?, private val id: String?, private val createdAt: OffsetDateTime?, private val dataType: DataType?, @@ -83,38 +69,31 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:113:14 - fun dataType(): DataType? = dataType + @JsonProperty("data_type") fun dataType(): DataType? = dataType - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetCreateBody && this.name == other.name && this.id == other.id && this.createdAt == other.createdAt && @@ -123,15 +102,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, id, createdAt, dataType, @@ -145,98 +120,61 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "DatasetCreateBody{name=$name, id=$id, createdAt=$createdAt, dataType=$dataType, description=$description, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: String? = null private var id: String? = null private var createdAt: OffsetDateTime? = null private var dataType: DataType? = null private var description: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetCreateBody: DatasetCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - datasetCreateBody.name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.id = datasetCreateBody.id - this.createdAt = datasetCreateBody.createdAt - this.dataType = datasetCreateBody.dataType - this.description = datasetCreateBody.description - additionalProperties(datasetCreateBody.additionalProperties) - } - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(datasetCreateBody: DatasetCreateBody) = apply { + this.name = datasetCreateBody.name + this.id = datasetCreateBody.id + this.createdAt = datasetCreateBody.createdAt + this.dataType = datasetCreateBody.dataType + this.description = datasetCreateBody.description + additionalProperties(datasetCreateBody.additionalProperties) } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id - } + @JsonProperty("name") fun name(name: String) = apply { this.name = name } - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } /** Enum for dataset data types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:264:20 - fun dataType(dataType: DataType) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dataType = dataType - } + @JsonProperty("data_type") + fun dataType(dataType: DataType) = apply { this.dataType = dataType } - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetCreateBody = - DatasetCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(name) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`name` is required but was not set" - }, + DatasetCreateBody( + checkNotNull(name) { "`name` is required but was not set" }, id, createdAt, dataType, @@ -252,12 +190,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetCreateParams && this.name == other.name && this.id == other.id && this.createdAt == other.createdAt && @@ -268,10 +206,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - name, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + name, id, createdAt, dataType, @@ -287,20 +224,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var name: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var name: String? = null private var id: String? = null private var createdAt: OffsetDateTime? = null private var dataType: DataType? = null @@ -309,120 +241,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetCreateParams: DatasetCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.name = - datasetCreateParams.name // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.id = datasetCreateParams.id - this.createdAt = datasetCreateParams.createdAt - this.dataType = datasetCreateParams.dataType - this.description = datasetCreateParams.description - additionalQueryParams(datasetCreateParams.additionalQueryParams) - additionalHeaders(datasetCreateParams.additionalHeaders) - additionalBodyProperties(datasetCreateParams.additionalBodyProperties) - } - - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + @JvmSynthetic + internal fun from(datasetCreateParams: DatasetCreateParams) = apply { + this.name = datasetCreateParams.name + this.id = datasetCreateParams.id + this.createdAt = datasetCreateParams.createdAt + this.dataType = datasetCreateParams.dataType + this.description = datasetCreateParams.description + additionalQueryParams(datasetCreateParams.additionalQueryParams) + additionalHeaders(datasetCreateParams.additionalHeaders) + additionalBodyProperties(datasetCreateParams.additionalBodyProperties) } - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id - } + fun name(name: String) = apply { this.name = name } - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.createdAt = createdAt - } + fun id(id: String) = apply { this.id = id } + + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } /** Enum for dataset data types. */ - fun dataType(dataType: DataType) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.dataType = dataType + fun dataType(dataType: DataType) = apply { this.dataType = dataType } + + fun description(description: String) = apply { this.description = description } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): DatasetCreateParams = - DatasetCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(name) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`name` is required but was not set" - }, + DatasetCreateParams( + checkNotNull(name) { "`name` is required but was not set" }, id, createdAt, dataType, @@ -437,30 +335,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DataType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is DataType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val KV = DataType(JsonField.of("kv")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val KV = DataType(JsonField.of("kv")) @JvmField val LLM = DataType(JsonField.of("llm")) @@ -469,34 +362,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = DataType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - KV, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + KV, LLM, CHAT, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - KV, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + KV, LLM, CHAT, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - KV -> Value.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Value.KV LLM -> Value.LLM CHAT -> Value.CHAT else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - KV -> Known.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Known.KV LLM -> Known.LLM CHAT -> Known.CHAT else -> throw LangSmithInvalidDataException("Unknown DataType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParams.kt index 133c3ebb..3aede715 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,42 +10,30 @@ import java.util.Objects import java.util.Optional class DatasetCsvRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val asOf: OffsetDateTime?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun asOf(): Optional = Optional.ofNullable(asOf) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.asOf?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("as_of", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.asOf?.let { params.put("as_of", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -54,22 +42,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetCsvRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetCsvRetrieveParams && this.datasetId == other.datasetId && this.asOf == other.asOf && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, asOf, additionalQueryParams, additionalHeaders, @@ -81,107 +68,78 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var asOf: OffsetDateTime? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetCsvRetrieveParams: DatasetCsvRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetCsvRetrieveParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.asOf = datasetCsvRetrieveParams.asOf - additionalQueryParams(datasetCsvRetrieveParams.additionalQueryParams) - additionalHeaders(datasetCsvRetrieveParams.additionalHeaders) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetCsvRetrieveParams: DatasetCsvRetrieveParams) = apply { + this.datasetId = datasetCsvRetrieveParams.datasetId + this.asOf = datasetCsvRetrieveParams.asOf + additionalQueryParams(datasetCsvRetrieveParams.additionalQueryParams) + additionalHeaders(datasetCsvRetrieveParams.additionalHeaders) } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + /** - * // templates/JavaSDK/entities/params.ts:629:10 // - * templates/JavaSDK/entities/params.ts:629:10 Timestamp of the version at which to fetch - * the dataset. If not provided, the latest version is fetched. + * Timestamp of the version at which to fetch the dataset. If not provided, the latest + * version is fetched. */ - fun asOf(asOf: OffsetDateTime) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.asOf = asOf + fun asOf(asOf: OffsetDateTime) = apply { this.asOf = asOf } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): DatasetCsvRetrieveParams = - DatasetCsvRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetCsvRetrieveParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, asOf, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveResponse.kt index 9bbbf787..5dc75db9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetCsvRetrieveResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,51 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = DatasetCsvRetrieveResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = DatasetCsvRetrieveResponse.Builder::class) @NoAutoDetect class DatasetCsvRetrieveResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetCsvRetrieveResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): DatasetCsvRetrieveResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetCsvRetrieveResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetCsvRetrieveResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -66,43 +53,33 @@ private constructor( override fun toString() = "DatasetCsvRetrieveResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetCsvRetrieveResponse: DatasetCsvRetrieveResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(datasetCsvRetrieveResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(datasetCsvRetrieveResponse: DatasetCsvRetrieveResponse) = apply { + additionalProperties(datasetCsvRetrieveResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetCsvRetrieveResponse = DatasetCsvRetrieveResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteParams.kt index 30fc1ee5..103d575f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class DatasetDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetDeleteParams && this.datasetId == other.datasetId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,115 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetDeleteParams: DatasetDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetDeleteParams.datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(datasetDeleteParams.additionalQueryParams) - additionalHeaders(datasetDeleteParams.additionalHeaders) - additionalBodyProperties(datasetDeleteParams.additionalBodyProperties) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetDeleteParams: DatasetDeleteParams) = apply { + this.datasetId = datasetDeleteParams.datasetId + additionalQueryParams(datasetDeleteParams.additionalQueryParams) + additionalHeaders(datasetDeleteParams.additionalHeaders) + additionalBodyProperties(datasetDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): DatasetDeleteParams = - DatasetDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetDeleteParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteResponse.kt index 4f68922f..8db8b8ab 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = DatasetDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = DatasetDeleteResponse.Builder::class) @NoAutoDetect class DatasetDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetDeleteResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): DatasetDeleteResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "DatasetDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetDeleteResponse: DatasetDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(datasetDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(datasetDeleteResponse: DatasetDeleteResponse) = apply { + additionalProperties(datasetDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetDeleteResponse = DatasetDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetListParams.kt index 035c509e..6f996c63 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -14,12 +14,8 @@ import java.util.Objects import java.util.Optional class DatasetListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val id: List?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val id: List?, private val asOf: OffsetDateTime?, private val dataType: DataType?, private val limit: Long?, @@ -30,9 +26,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalHeaders: Map>, ) { - fun id(): Optional> = - Optional.ofNullable(id) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): Optional> = Optional.ofNullable(id) fun asOf(): Optional = Optional.ofNullable(asOf) @@ -46,50 +40,32 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun offset(): Optional = Optional.ofNullable(offset) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.id?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("id", listOf(it.joinToString(separator = ","))) - } - this.asOf?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("as_of", listOf(it.toString())) - } - this.dataType?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("data_type", listOf(it.toString())) - } - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.name?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("name", listOf(it.toString())) - } - this.nameContains?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("name_contains", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.id?.let { params.put("id", listOf(it.joinToString(separator = ","))) } + this.asOf?.let { params.put("as_of", listOf(it.toString())) } + this.dataType?.let { params.put("data_type", listOf(it.toString())) } + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.name?.let { params.put("name", listOf(it.toString())) } + this.nameContains?.let { params.put("name_contains", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetListParams && this.id == other.id && this.asOf == other.asOf && this.dataType == other.dataType && @@ -101,10 +77,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, asOf, dataType, limit, @@ -121,21 +96,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: MutableList = mutableListOf() private var asOf: OffsetDateTime? = null private var dataType: DataType? = null private var limit: Long? = null @@ -145,115 +114,82 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetListParams: DatasetListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.id( - datasetListParams.id ?: listOf() - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.asOf = datasetListParams.asOf - this.dataType = datasetListParams.dataType - this.limit = datasetListParams.limit - this.name = datasetListParams.name - this.nameContains = datasetListParams.nameContains - this.offset = datasetListParams.offset - additionalQueryParams(datasetListParams.additionalQueryParams) - additionalHeaders(datasetListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(datasetListParams: DatasetListParams) = apply { + this.id(datasetListParams.id ?: listOf()) + this.asOf = datasetListParams.asOf + this.dataType = datasetListParams.dataType + this.limit = datasetListParams.limit + this.name = datasetListParams.name + this.nameContains = datasetListParams.nameContains + this.offset = datasetListParams.offset + additionalQueryParams(datasetListParams.additionalQueryParams) + additionalHeaders(datasetListParams.additionalHeaders) + } - fun id(id: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.id.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun id(id: List) = apply { + this.id.clear() this.id.addAll(id) } - fun addId(id: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.id.add(id) - } + fun addId(id: String) = apply { this.id.add(id) } - fun asOf(asOf: OffsetDateTime) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.asOf = asOf - } + fun asOf(asOf: OffsetDateTime) = apply { this.asOf = asOf } /** Enum for dataset data types. */ - fun dataType(dataType: DataType) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.dataType = dataType + fun dataType(dataType: DataType) = apply { this.dataType = dataType } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun name(name: String) = apply { this.name = name } + + fun nameContains(nameContains: String) = apply { this.nameContains = nameContains } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun nameContains(nameContains: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.nameContains = nameContains - } - - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): DatasetListParams = - DatasetListParams( // templates/JavaSDK/entities/params.ts:683:22 - if (id.size == 0) null - else id.toUnmodifiable(), // templates/JavaSDK/entities/params.ts:683:22 + DatasetListParams( + if (id.size == 0) null else id.toUnmodifiable(), asOf, dataType, limit, @@ -269,30 +205,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DataType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is DataType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val KV = DataType(JsonField.of("kv")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val KV = DataType(JsonField.of("kv")) @JvmField val LLM = DataType(JsonField.of("llm")) @@ -301,34 +232,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = DataType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - KV, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + KV, LLM, CHAT, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - KV, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + KV, LLM, CHAT, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - KV -> Value.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Value.KV LLM -> Value.LLM CHAT -> Value.CHAT else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - KV -> Known.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Known.KV LLM -> Known.LLM CHAT -> Known.CHAT else -> throw LangSmithInvalidDataException("Unknown DataType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParams.kt index ed052747..74142684 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,42 +10,30 @@ import java.util.Objects import java.util.Optional class DatasetOpenAIFtRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val asOf: OffsetDateTime?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun asOf(): Optional = Optional.ofNullable(asOf) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.asOf?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("as_of", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.asOf?.let { params.put("as_of", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -54,23 +42,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - DatasetOpenAIFtRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetOpenAIFtRetrieveParams && this.datasetId == other.datasetId && this.asOf == other.asOf && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, asOf, additionalQueryParams, additionalHeaders, @@ -82,107 +68,78 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var asOf: OffsetDateTime? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetOpenAIFtRetrieveParams: DatasetOpenAIFtRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetOpenAIFtRetrieveParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.asOf = datasetOpenAIFtRetrieveParams.asOf - additionalQueryParams(datasetOpenAIFtRetrieveParams.additionalQueryParams) - additionalHeaders(datasetOpenAIFtRetrieveParams.additionalHeaders) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetOpenAIFtRetrieveParams: DatasetOpenAIFtRetrieveParams) = apply { + this.datasetId = datasetOpenAIFtRetrieveParams.datasetId + this.asOf = datasetOpenAIFtRetrieveParams.asOf + additionalQueryParams(datasetOpenAIFtRetrieveParams.additionalQueryParams) + additionalHeaders(datasetOpenAIFtRetrieveParams.additionalHeaders) } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + /** - * // templates/JavaSDK/entities/params.ts:629:10 // - * templates/JavaSDK/entities/params.ts:629:10 Timestamp of the version at which to fetch - * the dataset. If not provided, the latest version is fetched. + * Timestamp of the version at which to fetch the dataset. If not provided, the latest + * version is fetched. */ - fun asOf(asOf: OffsetDateTime) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.asOf = asOf + fun asOf(asOf: OffsetDateTime) = apply { this.asOf = asOf } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): DatasetOpenAIFtRetrieveParams = - DatasetOpenAIFtRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetOpenAIFtRetrieveParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, asOf, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveResponse.kt index 74f0fe93..1bbeef84 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = DatasetOpenAIFtRetrieveResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = DatasetOpenAIFtRetrieveResponse.Builder::class) @NoAutoDetect class DatasetOpenAIFtRetrieveResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetOpenAIFtRetrieveResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): DatasetOpenAIFtRetrieveResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - DatasetOpenAIFtRetrieveResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetOpenAIFtRetrieveResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,34 @@ private constructor( override fun toString() = "DatasetOpenAIFtRetrieveResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(datasetOpenAIFtRetrieveResponse: DatasetOpenAIFtRetrieveResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 + apply { additionalProperties(datasetOpenAIFtRetrieveResponse.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetOpenAIFtRetrieveResponse = DatasetOpenAIFtRetrieveResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParams.kt index 09f605be..b363feff 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,42 +10,30 @@ import java.util.Objects import java.util.Optional class DatasetOpenAIRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val asOf: OffsetDateTime?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun asOf(): Optional = Optional.ofNullable(asOf) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.asOf?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("as_of", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.asOf?.let { params.put("as_of", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -54,23 +42,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - DatasetOpenAIRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetOpenAIRetrieveParams && this.datasetId == other.datasetId && this.asOf == other.asOf && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, asOf, additionalQueryParams, additionalHeaders, @@ -82,107 +68,78 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var asOf: OffsetDateTime? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetOpenAIRetrieveParams: DatasetOpenAIRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetOpenAIRetrieveParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.asOf = datasetOpenAIRetrieveParams.asOf - additionalQueryParams(datasetOpenAIRetrieveParams.additionalQueryParams) - additionalHeaders(datasetOpenAIRetrieveParams.additionalHeaders) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetOpenAIRetrieveParams: DatasetOpenAIRetrieveParams) = apply { + this.datasetId = datasetOpenAIRetrieveParams.datasetId + this.asOf = datasetOpenAIRetrieveParams.asOf + additionalQueryParams(datasetOpenAIRetrieveParams.additionalQueryParams) + additionalHeaders(datasetOpenAIRetrieveParams.additionalHeaders) } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + /** - * // templates/JavaSDK/entities/params.ts:629:10 // - * templates/JavaSDK/entities/params.ts:629:10 Timestamp of the version at which to fetch - * the dataset. If not provided, the latest version is fetched. + * Timestamp of the version at which to fetch the dataset. If not provided, the latest + * version is fetched. */ - fun asOf(asOf: OffsetDateTime) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.asOf = asOf + fun asOf(asOf: OffsetDateTime) = apply { this.asOf = asOf } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): DatasetOpenAIRetrieveParams = - DatasetOpenAIRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetOpenAIRetrieveParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, asOf, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveResponse.kt index ac2c5207..b12fb8bd 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = DatasetOpenAIRetrieveResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = DatasetOpenAIRetrieveResponse.Builder::class) @NoAutoDetect class DatasetOpenAIRetrieveResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetOpenAIRetrieveResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): DatasetOpenAIRetrieveResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - DatasetOpenAIRetrieveResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetOpenAIRetrieveResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,33 @@ private constructor( override fun toString() = "DatasetOpenAIRetrieveResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetOpenAIRetrieveResponse: DatasetOpenAIRetrieveResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(datasetOpenAIRetrieveResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(datasetOpenAIRetrieveResponse: DatasetOpenAIRetrieveResponse) = apply { + additionalProperties(datasetOpenAIRetrieveResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetOpenAIRetrieveResponse = DatasetOpenAIRetrieveResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetPublicSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetPublicSchema.kt index 3f7d361a..dd36d8b0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetPublicSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetPublicSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,10 +19,7 @@ import java.util.Objects import java.util.Optional /** - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - * templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - * templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - * templates/JavaSDK/entities/objects.ts:76:13 Public schema for datasets. + * Public schema for datasets. * * Doesn't currently include session counts/stats since public test project sharing is not yet * shipped @@ -32,9 +27,8 @@ import java.util.Optional @JsonDeserialize(builder = DatasetPublicSchema.Builder::class) @NoAutoDetect class DatasetPublicSchema -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val name: JsonField, private val description: JsonField, private val createdAt: JsonField, private val dataType: JsonField, @@ -43,8 +37,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -63,42 +56,26 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun exampleCount(): Long = exampleCount.getRequired("example_count") - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _description() = description + @JsonProperty("description") @ExcludeMissing fun _description() = description - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _dataType() = dataType + @JsonProperty("data_type") @ExcludeMissing fun _dataType() = dataType - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("example_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _exampleCount() = exampleCount + @JsonProperty("example_count") @ExcludeMissing fun _exampleCount() = exampleCount - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetPublicSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): DatasetPublicSchema = apply { + if (!validated) { + name() description() createdAt() dataType() @@ -110,12 +87,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetPublicSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetPublicSchema && this.name == other.name && this.description == other.description && this.createdAt == other.createdAt && @@ -125,15 +102,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, description, createdAt, dataType, @@ -148,21 +121,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "DatasetPublicSchema{name=$name, description=$description, createdAt=$createdAt, dataType=$dataType, id=$id, exampleCount=$exampleCount, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var dataType: JsonField = JsonMissing.of() @@ -170,100 +136,70 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var exampleCount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetPublicSchema: DatasetPublicSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - datasetPublicSchema.name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.description = datasetPublicSchema.description - this.createdAt = datasetPublicSchema.createdAt - this.dataType = datasetPublicSchema.dataType - this.id = datasetPublicSchema.id - this.exampleCount = datasetPublicSchema.exampleCount - additionalProperties(datasetPublicSchema.additionalProperties) - } - - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(datasetPublicSchema: DatasetPublicSchema) = apply { + this.name = datasetPublicSchema.name + this.description = datasetPublicSchema.description + this.createdAt = datasetPublicSchema.createdAt + this.dataType = datasetPublicSchema.dataType + this.id = datasetPublicSchema.id + this.exampleCount = datasetPublicSchema.exampleCount + additionalProperties(datasetPublicSchema.additionalProperties) } - fun description(description: String) = - description(JsonField.of(description)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun description(description: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + fun name(name: JsonField) = apply { this.name = name } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("description") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun description(description: JsonField) = apply { this.description = description } + + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") + @ExcludeMissing + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** Enum for dataset data types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun dataType(dataType: DataType) = dataType(JsonField.of(dataType)) /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("data_type") @ExcludeMissing - fun dataType(dataType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dataType = dataType - } + fun dataType(dataType: JsonField) = apply { this.dataType = dataType } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun exampleCount(exampleCount: Long) = exampleCount(JsonField.of(exampleCount)) + + @JsonProperty("example_count") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun exampleCount(exampleCount: JsonField) = apply { this.exampleCount = exampleCount } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun exampleCount(exampleCount: Long) = - exampleCount(JsonField.of(exampleCount)) // templates/JavaSDK/entities/objects.ts:252:20 + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonProperty("example_count") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun exampleCount(exampleCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.exampleCount = exampleCount - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetPublicSchema = - DatasetPublicSchema( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + DatasetPublicSchema( + name, description, createdAt, dataType, @@ -277,30 +213,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DataType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is DataType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val KV = DataType(JsonField.of("kv")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val KV = DataType(JsonField.of("kv")) @JvmField val LLM = DataType(JsonField.of("llm")) @@ -309,34 +240,30 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = DataType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - KV, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + KV, LLM, CHAT, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - KV, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + KV, LLM, CHAT, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - KV -> Value.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Value.KV LLM -> Value.LLM CHAT -> Value.CHAT else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - KV -> Known.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Known.KV LLM -> Known.LLM CHAT -> Known.CHAT else -> throw LangSmithInvalidDataException("Unknown DataType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRetrieveParams.kt index 6fb01a37..1ede3bdc 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val datasetId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -36,21 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetRetrieveParams && this.datasetId == other.datasetId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, additionalQueryParams, additionalHeaders, ) @@ -61,96 +55,70 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetRetrieveParams: DatasetRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetRetrieveParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(datasetRetrieveParams.additionalQueryParams) - additionalHeaders(datasetRetrieveParams.additionalHeaders) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetRetrieveParams: DatasetRetrieveParams) = apply { + this.datasetId = datasetRetrieveParams.datasetId + additionalQueryParams(datasetRetrieveParams.additionalQueryParams) + additionalHeaders(datasetRetrieveParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): DatasetRetrieveParams = - DatasetRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetRetrieveParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateParams.kt index 588311f5..b6f65620 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,12 +15,8 @@ import java.util.Objects import java.util.Optional class DatasetRunCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val sessionIds: List, private val filters: Filters?, private val limit: Long?, @@ -32,8 +26,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun sessionIds(): List = sessionIds @@ -43,11 +36,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun offset(): Optional = Optional.ofNullable(offset) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): DatasetRunCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return DatasetRunCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - sessionIds, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): DatasetRunCreateBody { + return DatasetRunCreateBody( + sessionIds, filters, limit, offset, @@ -55,64 +47,50 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } - @JsonDeserialize( - builder = DatasetRunCreateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = DatasetRunCreateBody.Builder::class) @NoAutoDetect class DatasetRunCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val sessionIds: List?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val sessionIds: List?, private val filters: Filters?, private val limit: Long?, private val offset: Long?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("session_ids") // templates/JavaSDK/entities/objects.ts:113:14 - fun sessionIds(): List? = sessionIds + @JsonProperty("session_ids") fun sessionIds(): List? = sessionIds - @JsonProperty("filters") // templates/JavaSDK/entities/objects.ts:113:14 - fun filters(): Filters? = filters + @JsonProperty("filters") fun filters(): Filters? = filters - @JsonProperty("limit") // templates/JavaSDK/entities/objects.ts:113:14 - fun limit(): Long? = limit + @JsonProperty("limit") fun limit(): Long? = limit - @JsonProperty("offset") // templates/JavaSDK/entities/objects.ts:113:14 - fun offset(): Long? = offset + @JsonProperty("offset") fun offset(): Long? = offset - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetRunCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetRunCreateBody && this.sessionIds == other.sessionIds && this.filters == other.filters && this.limit == other.limit && @@ -120,15 +98,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - sessionIds, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + sessionIds, filters, limit, offset, @@ -141,89 +115,55 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "DatasetRunCreateBody{sessionIds=$sessionIds, filters=$filters, limit=$limit, offset=$offset, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var sessionIds: List? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var sessionIds: List? = null private var filters: Filters? = null private var limit: Long? = null private var offset: Long? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetRunCreateBody: DatasetRunCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.sessionIds = - datasetRunCreateBody - .sessionIds // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.filters = datasetRunCreateBody.filters - this.limit = datasetRunCreateBody.limit - this.offset = datasetRunCreateBody.offset - additionalProperties(datasetRunCreateBody.additionalProperties) - } - - @JsonProperty("session_ids") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun sessionIds(sessionIds: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sessionIds = sessionIds - } - - @JsonProperty("filters") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun filters(filters: Filters) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.filters = filters + @JvmSynthetic + internal fun from(datasetRunCreateBody: DatasetRunCreateBody) = apply { + this.sessionIds = datasetRunCreateBody.sessionIds + this.filters = datasetRunCreateBody.filters + this.limit = datasetRunCreateBody.limit + this.offset = datasetRunCreateBody.offset + additionalProperties(datasetRunCreateBody.additionalProperties) } - @JsonProperty("limit") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.limit = limit + @JsonProperty("session_ids") + fun sessionIds(sessionIds: List) = apply { this.sessionIds = sessionIds } + + @JsonProperty("filters") + fun filters(filters: Filters) = apply { this.filters = filters } + + @JsonProperty("limit") fun limit(limit: Long) = apply { this.limit = limit } + + @JsonProperty("offset") fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("offset") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.offset = offset + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetRunCreateBody = - DatasetRunCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(sessionIds) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`sessionIds` is required but was not set" - } + DatasetRunCreateBody( + checkNotNull(sessionIds) { "`sessionIds` is required but was not set" } .toUnmodifiable(), filters, limit, @@ -239,12 +179,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetRunCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetRunCreateParams && this.datasetId == other.datasetId && this.sessionIds == other.sessionIds && this.filters == other.filters && @@ -255,10 +195,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, sessionIds, filters, limit, @@ -274,20 +213,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var sessionIds: MutableList = mutableListOf() private var filters: Filters? = null private var limit: Long? = null @@ -296,128 +230,91 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetRunCreateParams: DatasetRunCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetRunCreateParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.sessionIds(datasetRunCreateParams.sessionIds) - this.filters = datasetRunCreateParams.filters - this.limit = datasetRunCreateParams.limit - this.offset = datasetRunCreateParams.offset - additionalQueryParams(datasetRunCreateParams.additionalQueryParams) - additionalHeaders(datasetRunCreateParams.additionalHeaders) - additionalBodyProperties(datasetRunCreateParams.additionalBodyProperties) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetRunCreateParams: DatasetRunCreateParams) = apply { + this.datasetId = datasetRunCreateParams.datasetId + this.sessionIds(datasetRunCreateParams.sessionIds) + this.filters = datasetRunCreateParams.filters + this.limit = datasetRunCreateParams.limit + this.offset = datasetRunCreateParams.offset + additionalQueryParams(datasetRunCreateParams.additionalQueryParams) + additionalHeaders(datasetRunCreateParams.additionalHeaders) + additionalBodyProperties(datasetRunCreateParams.additionalBodyProperties) } - fun sessionIds(sessionIds: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.sessionIds.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.sessionIds.addAll(sessionIds) - } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun addSessionId(sessionId: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.sessionIds.add(sessionId) + fun sessionIds(sessionIds: List) = apply { + this.sessionIds.clear() + this.sessionIds.addAll(sessionIds) } - fun filters(filters: Filters) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.filters = filters + fun addSessionId(sessionId: String) = apply { this.sessionIds.add(sessionId) } + + fun filters(filters: Filters) = apply { this.filters = filters } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): DatasetRunCreateParams = - DatasetRunCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, - checkNotNull(sessionIds) { // templates/JavaSDK/entities/params.ts:844:13 - "`sessionIds` is required but was not set" - } + DatasetRunCreateParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, + checkNotNull(sessionIds) { "`sessionIds` is required but was not set" } .toUnmodifiable(), filters, limit, @@ -428,40 +325,31 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JsonDeserialize( - builder = Filters.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Filters.Builder::class) @NoAutoDetect class Filters private constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Filters && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is Filters && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -469,44 +357,33 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "Filters{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(filters: Filters) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(filters.additionalProperties) - } + @JvmSynthetic + internal fun from(filters: Filters) = apply { + additionalProperties(filters.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Filters = Filters(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateResponse.kt index 3c527c6c..c5e08cde 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetRunCreateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -29,11 +27,7 @@ import java.time.OffsetDateTime import java.util.Objects import java.util.Optional -@JsonDeserialize( - using = DatasetRunCreateResponse.Deserializer::class -) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // -// templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // -// templates/JavaSDK/entities/unions.ts:68:13 +@JsonDeserialize(using = DatasetRunCreateResponse.Deserializer::class) @JsonSerialize(using = DatasetRunCreateResponse.Serializer::class) class DatasetRunCreateResponse private constructor( @@ -42,80 +36,60 @@ private constructor( private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun exampleWithRuns(): Optional> = - Optional.ofNullable(exampleWithRuns) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun exampleWithRuns(): Optional> = Optional.ofNullable(exampleWithRuns) fun exampleWithRunsChes(): Optional> = Optional.ofNullable(exampleWithRunsChes) - fun isExampleWithRuns(): Boolean = - exampleWithRuns != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isExampleWithRuns(): Boolean = exampleWithRuns != null fun isExampleWithRunsChes(): Boolean = exampleWithRunsChes != null - fun asExampleWithRuns(): List = - exampleWithRuns.getOrThrow( - "exampleWithRuns" - ) // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asExampleWithRuns(): List = exampleWithRuns.getOrThrow("exampleWithRuns") fun asExampleWithRunsChes(): List = exampleWithRunsChes.getOrThrow("exampleWithRunsChes") fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - exampleWithRuns != null -> - visitor.visitExampleWithRuns( - exampleWithRuns - ) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + exampleWithRuns != null -> visitor.visitExampleWithRuns(exampleWithRuns) exampleWithRunsChes != null -> visitor.visitExampleWithRunsChes(exampleWithRunsChes) else -> visitor.unknown(_json) } } - fun validate(): DatasetRunCreateResponse = - apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - exampleWithRuns == null && exampleWithRunsChes == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 - throw LangSmithInvalidDataException("Unknown DatasetRunCreateResponse: $_json") - } - exampleWithRuns?.forEach { it.validate() } - exampleWithRunsChes?.forEach { it.validate() } - validated = true + fun validate(): DatasetRunCreateResponse = apply { + if (!validated) { + if (exampleWithRuns == null && exampleWithRunsChes == null) { + throw LangSmithInvalidDataException("Unknown DatasetRunCreateResponse: $_json") } + exampleWithRuns?.forEach { it.validate() } + exampleWithRunsChes?.forEach { it.validate() } + validated = true } + } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetRunCreateResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetRunCreateResponse && this.exampleWithRuns == other.exampleWithRuns && this.exampleWithRunsChes == other.exampleWithRunsChes } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(exampleWithRuns, exampleWithRunsChes) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - exampleWithRuns != null -> - "DatasetRunCreateResponse{exampleWithRuns=$exampleWithRuns}" // templates/JavaSDK/entities/unions.ts:188:16 // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + exampleWithRuns != null -> "DatasetRunCreateResponse{exampleWithRuns=$exampleWithRuns}" exampleWithRunsChes != null -> "DatasetRunCreateResponse{exampleWithRunsChes=$exampleWithRunsChes}" _json != null -> "DatasetRunCreateResponse{_unknown=$_json}" @@ -123,58 +97,43 @@ private constructor( } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 + @JvmStatic fun ofExampleWithRuns(exampleWithRuns: List) = DatasetRunCreateResponse(exampleWithRuns = exampleWithRuns) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 + @JvmStatic fun ofExampleWithRunsChes(exampleWithRunsChes: List) = DatasetRunCreateResponse(exampleWithRunsChes = exampleWithRunsChes) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitExampleWithRuns( - exampleWithRuns: List - ): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitExampleWithRuns(exampleWithRuns: List): T fun visitExampleWithRunsChes(exampleWithRunsChes: List): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown DatasetRunCreateResponse: $json") } } class Deserializer : - BaseDeserializer( - DatasetRunCreateResponse::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + BaseDeserializer(DatasetRunCreateResponse::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): DatasetRunCreateResponse { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 + override fun ObjectCodec.deserialize(node: JsonNode): DatasetRunCreateResponse { + val json = JsonValue.fromJsonNode(node) tryDeserialize(node, jacksonTypeRef>()) { it.forEach { it.validate() } } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return DatasetRunCreateResponse(exampleWithRuns = it, _json = json) } tryDeserialize(node, jacksonTypeRef>()) { it.forEach { it.validate() } } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return DatasetRunCreateResponse(exampleWithRunsChes = it, _json = json) } @@ -182,25 +141,15 @@ private constructor( } } - class Serializer : - BaseSerializer( - DatasetRunCreateResponse::class - ) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(DatasetRunCreateResponse::class) { override fun serialize( value: DatasetRunCreateResponse, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.exampleWithRuns != null -> - generator.writeObject( - value.exampleWithRuns - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.exampleWithRuns != null -> generator.writeObject(value.exampleWithRuns) value.exampleWithRunsChes != null -> generator.writeObject(value.exampleWithRunsChes) value._json != null -> generator.writeObject(value._json) @@ -210,16 +159,11 @@ private constructor( } /** Example schema with list of runs. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ExampleWithRun.Builder::class) @NoAutoDetect class ExampleWithRun - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val createdAt: JsonField, private val inputs: JsonValue, private val outputs: JsonValue, private val datasetId: JsonField, @@ -233,8 +177,7 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -261,61 +204,35 @@ private constructor( fun runs(): List = runs.getRequired("runs") - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputs() = inputs + @JsonProperty("inputs") @ExcludeMissing fun _inputs() = inputs - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputs() = outputs + @JsonProperty("outputs") @ExcludeMissing fun _outputs() = outputs - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _datasetId() = datasetId + @JsonProperty("dataset_id") @ExcludeMissing fun _datasetId() = datasetId - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sourceRunId() = sourceRunId + @JsonProperty("source_run_id") @ExcludeMissing fun _sourceRunId() = sourceRunId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonProperty("version_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _versionCount() = versionCount + @JsonProperty("version_count") @ExcludeMissing fun _versionCount() = versionCount - @JsonProperty("version_list") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _versionList() = versionList + @JsonProperty("version_list") @ExcludeMissing fun _versionList() = versionList - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runs() = runs + @JsonProperty("runs") @ExcludeMissing fun _runs() = runs - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ExampleWithRun = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): ExampleWithRun = apply { + if (!validated) { + createdAt() datasetId() sourceRunId() id() @@ -330,12 +247,12 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleWithRun && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleWithRun && this.createdAt == other.createdAt && this.inputs == other.inputs && this.outputs == other.outputs && @@ -350,15 +267,11 @@ private constructor( this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, inputs, outputs, datasetId, @@ -378,21 +291,14 @@ private constructor( override fun toString() = "ExampleWithRun{createdAt=$createdAt, inputs=$inputs, outputs=$outputs, datasetId=$datasetId, sourceRunId=$sourceRunId, id=$id, name=$name, modifiedAt=$modifiedAt, versionCount=$versionCount, versionList=$versionList, runs=$runs, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var inputs: JsonValue = JsonMissing.of() private var outputs: JsonValue = JsonMissing.of() private var datasetId: JsonField = JsonMissing.of() @@ -405,157 +311,112 @@ private constructor( private var runs: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleWithRun: ExampleWithRun) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - exampleWithRun.createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = exampleWithRun.inputs - this.outputs = exampleWithRun.outputs - this.datasetId = exampleWithRun.datasetId - this.sourceRunId = exampleWithRun.sourceRunId - this.id = exampleWithRun.id - this.name = exampleWithRun.name - this.modifiedAt = exampleWithRun.modifiedAt - this.versionCount = exampleWithRun.versionCount - this.versionList = exampleWithRun.versionList - this.runs = exampleWithRun.runs - additionalProperties(exampleWithRun.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - @ExcludeMissing - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs + @JvmSynthetic + internal fun from(exampleWithRun: ExampleWithRun) = apply { + this.createdAt = exampleWithRun.createdAt + this.inputs = exampleWithRun.inputs + this.outputs = exampleWithRun.outputs + this.datasetId = exampleWithRun.datasetId + this.sourceRunId = exampleWithRun.sourceRunId + this.id = exampleWithRun.id + this.name = exampleWithRun.name + this.modifiedAt = exampleWithRun.modifiedAt + this.versionCount = exampleWithRun.versionCount + this.versionList = exampleWithRun.versionList + this.runs = exampleWithRun.runs + additionalProperties(exampleWithRun.additionalProperties) } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") @ExcludeMissing - fun outputs(outputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs - } - - fun datasetId(datasetId: String) = - datasetId(JsonField.of(datasetId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun datasetId(datasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } - - fun sourceRunId(sourceRunId: String) = - sourceRunId( - JsonField.of(sourceRunId) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun sourceRunId(sourceRunId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sourceRunId = sourceRunId - } - - fun id(id: String) = - id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("inputs") @ExcludeMissing - fun name(name: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name - } + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("outputs") @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - fun versionCount(versionCount: Long) = - versionCount( - JsonField.of(versionCount) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun datasetId(datasetId: String) = datasetId(JsonField.of(datasetId)) - @JsonProperty("version_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("dataset_id") @ExcludeMissing - fun versionCount(versionCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.versionCount = versionCount - } + fun datasetId(datasetId: JsonField) = apply { this.datasetId = datasetId } + + fun sourceRunId(sourceRunId: String) = sourceRunId(JsonField.of(sourceRunId)) + + @JsonProperty("source_run_id") + @ExcludeMissing + fun sourceRunId(sourceRunId: JsonField) = apply { + this.sourceRunId = sourceRunId + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) + + @JsonProperty("modified_at") + @ExcludeMissing + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt + } + + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + @JsonProperty("version_count") + @ExcludeMissing + fun versionCount(versionCount: JsonField) = apply { + this.versionCount = versionCount + } fun versionList(versionList: List) = - versionList( - JsonField.of(versionList) - ) // templates/JavaSDK/entities/objects.ts:252:20 + versionList(JsonField.of(versionList)) - @JsonProperty("version_list") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("version_list") @ExcludeMissing - fun versionList(versionList: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.versionList = versionList - } + fun versionList(versionList: JsonField>) = apply { + this.versionList = versionList + } - fun runs(runs: List) = - runs(JsonField.of(runs)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runs(runs: List) = runs(JsonField.of(runs)) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("runs") @ExcludeMissing - fun runs(runs: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runs = runs - } + fun runs(runs: JsonField>) = apply { this.runs = runs } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleWithRun = - ExampleWithRun( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + ExampleWithRun( + createdAt, inputs, outputs, datasetId, @@ -572,16 +433,11 @@ private constructor( } /** Example schema with list of runs. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ExampleWithRunsCh.Builder::class) @NoAutoDetect class ExampleWithRunsCh - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val createdAt: JsonField, private val inputs: JsonValue, private val outputs: JsonValue, private val datasetId: JsonField, @@ -591,12 +447,11 @@ private constructor( private val modifiedAt: JsonField, private val versionCount: JsonField, private val versionList: JsonField>, - private val runs: JsonField>, + private val runs: JsonField>, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -621,63 +476,37 @@ private constructor( fun versionList(): Optional> = Optional.ofNullable(versionList.getNullable("version_list")) - fun runs(): List = runs.getRequired("runs") + fun runs(): List = runs.getRequired("runs") - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputs() = inputs + @JsonProperty("inputs") @ExcludeMissing fun _inputs() = inputs - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputs() = outputs + @JsonProperty("outputs") @ExcludeMissing fun _outputs() = outputs - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _datasetId() = datasetId + @JsonProperty("dataset_id") @ExcludeMissing fun _datasetId() = datasetId - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sourceRunId() = sourceRunId + @JsonProperty("source_run_id") @ExcludeMissing fun _sourceRunId() = sourceRunId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonProperty("version_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _versionCount() = versionCount + @JsonProperty("version_count") @ExcludeMissing fun _versionCount() = versionCount - @JsonProperty("version_list") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _versionList() = versionList + @JsonProperty("version_list") @ExcludeMissing fun _versionList() = versionList - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runs() = runs + @JsonProperty("runs") @ExcludeMissing fun _runs() = runs - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ExampleWithRunsCh = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): ExampleWithRunsCh = apply { + if (!validated) { + createdAt() datasetId() sourceRunId() id() @@ -692,12 +521,12 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleWithRunsCh && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleWithRunsCh && this.createdAt == other.createdAt && this.inputs == other.inputs && this.outputs == other.outputs && @@ -712,15 +541,11 @@ private constructor( this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, inputs, outputs, datasetId, @@ -740,21 +565,14 @@ private constructor( override fun toString() = "ExampleWithRunsCh{createdAt=$createdAt, inputs=$inputs, outputs=$outputs, datasetId=$datasetId, sourceRunId=$sourceRunId, id=$id, name=$name, modifiedAt=$modifiedAt, versionCount=$versionCount, versionList=$versionList, runs=$runs, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var inputs: JsonValue = JsonMissing.of() private var outputs: JsonValue = JsonMissing.of() private var datasetId: JsonField = JsonMissing.of() @@ -764,161 +582,115 @@ private constructor( private var modifiedAt: JsonField = JsonMissing.of() private var versionCount: JsonField = JsonMissing.of() private var versionList: JsonField> = JsonMissing.of() - private var runs: JsonField> = JsonMissing.of() + private var runs: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleWithRunsCh: ExampleWithRunsCh) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - exampleWithRunsCh - .createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = exampleWithRunsCh.inputs - this.outputs = exampleWithRunsCh.outputs - this.datasetId = exampleWithRunsCh.datasetId - this.sourceRunId = exampleWithRunsCh.sourceRunId - this.id = exampleWithRunsCh.id - this.name = exampleWithRunsCh.name - this.modifiedAt = exampleWithRunsCh.modifiedAt - this.versionCount = exampleWithRunsCh.versionCount - this.versionList = exampleWithRunsCh.versionList - this.runs = exampleWithRunsCh.runs - additionalProperties(exampleWithRunsCh.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - @ExcludeMissing - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs + @JvmSynthetic + internal fun from(exampleWithRunsCh: ExampleWithRunsCh) = apply { + this.createdAt = exampleWithRunsCh.createdAt + this.inputs = exampleWithRunsCh.inputs + this.outputs = exampleWithRunsCh.outputs + this.datasetId = exampleWithRunsCh.datasetId + this.sourceRunId = exampleWithRunsCh.sourceRunId + this.id = exampleWithRunsCh.id + this.name = exampleWithRunsCh.name + this.modifiedAt = exampleWithRunsCh.modifiedAt + this.versionCount = exampleWithRunsCh.versionCount + this.versionList = exampleWithRunsCh.versionList + this.runs = exampleWithRunsCh.runs + additionalProperties(exampleWithRunsCh.additionalProperties) } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") @ExcludeMissing - fun outputs(outputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs - } - - fun datasetId(datasetId: String) = - datasetId(JsonField.of(datasetId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun datasetId(datasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } - - fun sourceRunId(sourceRunId: String) = - sourceRunId( - JsonField.of(sourceRunId) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun sourceRunId(sourceRunId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sourceRunId = sourceRunId - } - - fun id(id: String) = - id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("inputs") @ExcludeMissing - fun name(name: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name - } + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("outputs") @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - fun versionCount(versionCount: Long) = - versionCount( - JsonField.of(versionCount) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun datasetId(datasetId: String) = datasetId(JsonField.of(datasetId)) - @JsonProperty("version_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("dataset_id") @ExcludeMissing - fun versionCount(versionCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.versionCount = versionCount - } + fun datasetId(datasetId: JsonField) = apply { this.datasetId = datasetId } + + fun sourceRunId(sourceRunId: String) = sourceRunId(JsonField.of(sourceRunId)) + + @JsonProperty("source_run_id") + @ExcludeMissing + fun sourceRunId(sourceRunId: JsonField) = apply { + this.sourceRunId = sourceRunId + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) + + @JsonProperty("modified_at") + @ExcludeMissing + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt + } + + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + @JsonProperty("version_count") + @ExcludeMissing + fun versionCount(versionCount: JsonField) = apply { + this.versionCount = versionCount + } fun versionList(versionList: List) = - versionList( - JsonField.of(versionList) - ) // templates/JavaSDK/entities/objects.ts:252:20 + versionList(JsonField.of(versionList)) - @JsonProperty("version_list") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("version_list") @ExcludeMissing - fun versionList(versionList: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.versionList = versionList - } + fun versionList(versionList: JsonField>) = apply { + this.versionList = versionList + } - fun runs(runs: List) = - runs(JsonField.of(runs)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runs(runs: List) = runs(JsonField.of(runs)) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("runs") @ExcludeMissing - fun runs(runs: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runs = runs - } + fun runs(runs: JsonField>) = apply { this.runs = runs } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleWithRunsCh = - ExampleWithRunsCh( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + ExampleWithRunsCh( + createdAt, inputs, outputs, datasetId, @@ -934,17 +706,11 @@ private constructor( } /** Run schema for comparison view. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - @JsonDeserialize(builder = RunSchemaComparisonView.Builder::class) + @JsonDeserialize(builder = Run.Builder::class) @NoAutoDetect - class RunSchemaComparisonView - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + class Run + private constructor( + private val name: JsonField, private val inputs: JsonValue, private val runType: JsonField, private val startTime: JsonField, @@ -978,8 +744,7 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -1050,182 +815,116 @@ private constructor( fun appPath(): Optional = Optional.ofNullable(appPath.getNullable("app_path")) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputs() = inputs + @JsonProperty("inputs") @ExcludeMissing fun _inputs() = inputs /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runType() = runType + @JsonProperty("run_type") @ExcludeMissing fun _runType() = runType - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _startTime() = startTime + @JsonProperty("start_time") @ExcludeMissing fun _startTime() = startTime - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _endTime() = endTime + @JsonProperty("end_time") @ExcludeMissing fun _endTime() = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _extra() = extra + @JsonProperty("extra") @ExcludeMissing fun _extra() = extra - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _error() = error + @JsonProperty("error") @ExcludeMissing fun _error() = error - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _executionOrder() = executionOrder + @JsonProperty("execution_order") @ExcludeMissing fun _executionOrder() = executionOrder - @JsonProperty("serialized") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _serialized() = serialized + @JsonProperty("serialized") @ExcludeMissing fun _serialized() = serialized - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputs() = outputs + @JsonProperty("outputs") @ExcludeMissing fun _outputs() = outputs - @JsonProperty("parent_run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parentRunId() = parentRunId + @JsonProperty("parent_run_id") @ExcludeMissing fun _parentRunId() = parentRunId - @JsonProperty("manifest_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _manifestId() = manifestId + @JsonProperty("manifest_id") @ExcludeMissing fun _manifestId() = manifestId - @JsonProperty("manifest_s3_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _manifestS3Id() = manifestS3Id + @JsonProperty("manifest_s3_id") @ExcludeMissing fun _manifestS3Id() = manifestS3Id - @JsonProperty("events") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _events() = events + @JsonProperty("events") @ExcludeMissing fun _events() = events - @JsonProperty("tags") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tags() = tags + @JsonProperty("tags") @ExcludeMissing fun _tags() = tags - @JsonProperty("inputs_s3_urls") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputsS3Urls() = inputsS3Urls + @JsonProperty("inputs_s3_urls") @ExcludeMissing fun _inputsS3Urls() = inputsS3Urls - @JsonProperty("outputs_s3_urls") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputsS3Urls() = outputsS3Urls + @JsonProperty("outputs_s3_urls") @ExcludeMissing fun _outputsS3Urls() = outputsS3Urls - @JsonProperty("trace_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _traceId() = traceId + @JsonProperty("trace_id") @ExcludeMissing fun _traceId() = traceId - @JsonProperty("dotted_order") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _dottedOrder() = dottedOrder + @JsonProperty("dotted_order") @ExcludeMissing fun _dottedOrder() = dottedOrder - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("session_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sessionId() = sessionId + @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId - @JsonProperty("reference_example_id") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("reference_example_id") @ExcludeMissing fun _referenceExampleId() = referenceExampleId - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalTokens() = totalTokens + @JsonProperty("total_tokens") @ExcludeMissing fun _totalTokens() = totalTokens - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptTokens() = promptTokens + @JsonProperty("prompt_tokens") @ExcludeMissing fun _promptTokens() = promptTokens - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("completion_tokens") @ExcludeMissing fun _completionTokens() = completionTokens - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalCost() = totalCost + @JsonProperty("total_cost") @ExcludeMissing fun _totalCost() = totalCost - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptCost() = promptCost + @JsonProperty("prompt_cost") @ExcludeMissing fun _promptCost() = promptCost - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionCost() = completionCost + @JsonProperty("completion_cost") @ExcludeMissing fun _completionCost() = completionCost - @JsonProperty("status") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _status() = status + @JsonProperty("status") @ExcludeMissing fun _status() = status - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackStats() = feedbackStats + @JsonProperty("feedback_stats") @ExcludeMissing fun _feedbackStats() = feedbackStats - @JsonProperty("app_path") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _appPath() = appPath + @JsonProperty("app_path") @ExcludeMissing fun _appPath() = appPath - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunSchemaComparisonView = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - runType() - startTime() - endTime() - error() - executionOrder() - parentRunId() - manifestId() - manifestS3Id() - events() - tags() - traceId() - dottedOrder() - id() - sessionId() - referenceExampleId() - totalTokens() - promptTokens() - completionTokens() - totalCost() - promptCost() - completionCost() - status() - feedbackStats().map { it.validate() } - appPath() - validated = true - } + fun validate(): Run = apply { + if (!validated) { + name() + runType() + startTime() + endTime() + error() + executionOrder() + parentRunId() + manifestId() + manifestS3Id() + events() + tags() + traceId() + dottedOrder() + id() + sessionId() + referenceExampleId() + totalTokens() + promptTokens() + completionTokens() + totalCost() + promptCost() + completionCost() + status() + feedbackStats().map { it.validate() } + appPath() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - RunSchemaComparisonView && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Run && this.name == other.name && this.inputs == other.inputs && this.runType == other.runType && @@ -1260,15 +959,11 @@ private constructor( this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, inputs, runType, startTime, @@ -1306,23 +1001,16 @@ private constructor( } override fun toString() = - "RunSchemaComparisonView{name=$name, inputs=$inputs, runType=$runType, startTime=$startTime, endTime=$endTime, extra=$extra, error=$error, executionOrder=$executionOrder, serialized=$serialized, outputs=$outputs, parentRunId=$parentRunId, manifestId=$manifestId, manifestS3Id=$manifestS3Id, events=$events, tags=$tags, inputsS3Urls=$inputsS3Urls, outputsS3Urls=$outputsS3Urls, traceId=$traceId, dottedOrder=$dottedOrder, id=$id, sessionId=$sessionId, referenceExampleId=$referenceExampleId, totalTokens=$totalTokens, promptTokens=$promptTokens, completionTokens=$completionTokens, totalCost=$totalCost, promptCost=$promptCost, completionCost=$completionCost, status=$status, feedbackStats=$feedbackStats, appPath=$appPath, additionalProperties=$additionalProperties}" + "Run{name=$name, inputs=$inputs, runType=$runType, startTime=$startTime, endTime=$endTime, extra=$extra, error=$error, executionOrder=$executionOrder, serialized=$serialized, outputs=$outputs, parentRunId=$parentRunId, manifestId=$manifestId, manifestS3Id=$manifestS3Id, events=$events, tags=$tags, inputsS3Urls=$inputsS3Urls, outputsS3Urls=$outputsS3Urls, traceId=$traceId, dottedOrder=$dottedOrder, id=$id, sessionId=$sessionId, referenceExampleId=$referenceExampleId, totalTokens=$totalTokens, promptTokens=$promptTokens, completionTokens=$completionTokens, totalCost=$totalCost, promptCost=$promptCost, completionCost=$completionCost, status=$status, feedbackStats=$feedbackStats, appPath=$appPath, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var inputs: JsonValue = JsonMissing.of() private var runType: JsonField = JsonMissing.of() private var startTime: JsonField = JsonMissing.of() @@ -1355,400 +1043,271 @@ private constructor( private var appPath: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runSchemaComparisonView: RunSchemaComparisonView) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - runSchemaComparisonView - .name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = runSchemaComparisonView.inputs - this.runType = runSchemaComparisonView.runType - this.startTime = runSchemaComparisonView.startTime - this.endTime = runSchemaComparisonView.endTime - this.extra = runSchemaComparisonView.extra - this.error = runSchemaComparisonView.error - this.executionOrder = runSchemaComparisonView.executionOrder - this.serialized = runSchemaComparisonView.serialized - this.outputs = runSchemaComparisonView.outputs - this.parentRunId = runSchemaComparisonView.parentRunId - this.manifestId = runSchemaComparisonView.manifestId - this.manifestS3Id = runSchemaComparisonView.manifestS3Id - this.events = runSchemaComparisonView.events - this.tags = runSchemaComparisonView.tags - this.inputsS3Urls = runSchemaComparisonView.inputsS3Urls - this.outputsS3Urls = runSchemaComparisonView.outputsS3Urls - this.traceId = runSchemaComparisonView.traceId - this.dottedOrder = runSchemaComparisonView.dottedOrder - this.id = runSchemaComparisonView.id - this.sessionId = runSchemaComparisonView.sessionId - this.referenceExampleId = runSchemaComparisonView.referenceExampleId - this.totalTokens = runSchemaComparisonView.totalTokens - this.promptTokens = runSchemaComparisonView.promptTokens - this.completionTokens = runSchemaComparisonView.completionTokens - this.totalCost = runSchemaComparisonView.totalCost - this.promptCost = runSchemaComparisonView.promptCost - this.completionCost = runSchemaComparisonView.completionCost - this.status = runSchemaComparisonView.status - this.feedbackStats = runSchemaComparisonView.feedbackStats - this.appPath = runSchemaComparisonView.appPath - additionalProperties(runSchemaComparisonView.additionalProperties) - } + @JvmSynthetic + internal fun from(run: Run) = apply { + this.name = run.name + this.inputs = run.inputs + this.runType = run.runType + this.startTime = run.startTime + this.endTime = run.endTime + this.extra = run.extra + this.error = run.error + this.executionOrder = run.executionOrder + this.serialized = run.serialized + this.outputs = run.outputs + this.parentRunId = run.parentRunId + this.manifestId = run.manifestId + this.manifestS3Id = run.manifestS3Id + this.events = run.events + this.tags = run.tags + this.inputsS3Urls = run.inputsS3Urls + this.outputsS3Urls = run.outputsS3Urls + this.traceId = run.traceId + this.dottedOrder = run.dottedOrder + this.id = run.id + this.sessionId = run.sessionId + this.referenceExampleId = run.referenceExampleId + this.totalTokens = run.totalTokens + this.promptTokens = run.promptTokens + this.completionTokens = run.completionTokens + this.totalCost = run.totalCost + this.promptCost = run.promptCost + this.completionCost = run.completionCost + this.status = run.status + this.feedbackStats = run.feedbackStats + this.appPath = run.appPath + additionalProperties(run.additionalProperties) + } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun name(name: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name - } + fun name(name: JsonField) = apply { this.name = name } - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("inputs") @ExcludeMissing - fun inputs(inputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs - } + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } /** Enum for run types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun runType(runType: RunType) = runType(JsonField.of(runType)) /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_type") @ExcludeMissing - fun runType(runType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runType = runType - } + fun runType(runType: JsonField) = apply { this.runType = runType } - fun startTime(startTime: OffsetDateTime) = - startTime( - JsonField.of(startTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun startTime(startTime: OffsetDateTime) = startTime(JsonField.of(startTime)) - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("start_time") @ExcludeMissing - fun startTime(startTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } + fun startTime(startTime: JsonField) = apply { + this.startTime = startTime + } - fun endTime(endTime: OffsetDateTime) = - endTime(JsonField.of(endTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun endTime(endTime: OffsetDateTime) = endTime(JsonField.of(endTime)) - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("end_time") @ExcludeMissing - fun endTime(endTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } + fun endTime(endTime: JsonField) = apply { this.endTime = endTime } - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("extra") @ExcludeMissing - fun extra(extra: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra - } + fun extra(extra: JsonValue) = apply { this.extra = extra } - fun error(error: String) = - error(JsonField.of(error)) // templates/JavaSDK/entities/objects.ts:252:20 + fun error(error: String) = error(JsonField.of(error)) - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("error") @ExcludeMissing - fun error(error: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.error = error - } + fun error(error: JsonField) = apply { this.error = error } fun executionOrder(executionOrder: Long) = - executionOrder( - JsonField.of(executionOrder) - ) // templates/JavaSDK/entities/objects.ts:252:20 + executionOrder(JsonField.of(executionOrder)) - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("execution_order") @ExcludeMissing - fun executionOrder(executionOrder: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.executionOrder = executionOrder - } + fun executionOrder(executionOrder: JsonField) = apply { + this.executionOrder = executionOrder + } - @JsonProperty("serialized") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("serialized") @ExcludeMissing - fun serialized(serialized: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.serialized = serialized - } + fun serialized(serialized: JsonValue) = apply { this.serialized = serialized } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("outputs") @ExcludeMissing - fun outputs(outputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs - } + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - fun parentRunId(parentRunId: String) = - parentRunId( - JsonField.of(parentRunId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun parentRunId(parentRunId: String) = parentRunId(JsonField.of(parentRunId)) - @JsonProperty("parent_run_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("parent_run_id") @ExcludeMissing - fun parentRunId(parentRunId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRunId = parentRunId - } + fun parentRunId(parentRunId: JsonField) = apply { + this.parentRunId = parentRunId + } - fun manifestId(manifestId: String) = - manifestId( - JsonField.of(manifestId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun manifestId(manifestId: String) = manifestId(JsonField.of(manifestId)) - @JsonProperty("manifest_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("manifest_id") @ExcludeMissing - fun manifestId(manifestId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.manifestId = manifestId - } + fun manifestId(manifestId: JsonField) = apply { + this.manifestId = manifestId + } - fun manifestS3Id(manifestS3Id: String) = - manifestS3Id( - JsonField.of(manifestS3Id) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun manifestS3Id(manifestS3Id: String) = manifestS3Id(JsonField.of(manifestS3Id)) - @JsonProperty("manifest_s3_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("manifest_s3_id") @ExcludeMissing - fun manifestS3Id(manifestS3Id: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.manifestS3Id = manifestS3Id - } + fun manifestS3Id(manifestS3Id: JsonField) = apply { + this.manifestS3Id = manifestS3Id + } - fun events(events: List) = - events(JsonField.of(events)) // templates/JavaSDK/entities/objects.ts:252:20 + fun events(events: List) = events(JsonField.of(events)) - @JsonProperty("events") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("events") @ExcludeMissing - fun events(events: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.events = events - } + fun events(events: JsonField>) = apply { this.events = events } - fun tags(tags: List) = - tags(JsonField.of(tags)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tags(tags: List) = tags(JsonField.of(tags)) - @JsonProperty("tags") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tags") @ExcludeMissing - fun tags(tags: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tags = tags - } + fun tags(tags: JsonField>) = apply { this.tags = tags } - @JsonProperty("inputs_s3_urls") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("inputs_s3_urls") @ExcludeMissing - fun inputsS3Urls(inputsS3Urls: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputsS3Urls = inputsS3Urls - } + fun inputsS3Urls(inputsS3Urls: JsonValue) = apply { + this.inputsS3Urls = inputsS3Urls + } - @JsonProperty("outputs_s3_urls") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("outputs_s3_urls") @ExcludeMissing - fun outputsS3Urls(outputsS3Urls: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputsS3Urls = outputsS3Urls - } + fun outputsS3Urls(outputsS3Urls: JsonValue) = apply { + this.outputsS3Urls = outputsS3Urls + } - fun traceId(traceId: String) = - traceId(JsonField.of(traceId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun traceId(traceId: String) = traceId(JsonField.of(traceId)) - @JsonProperty("trace_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("trace_id") @ExcludeMissing - fun traceId(traceId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.traceId = traceId - } + fun traceId(traceId: JsonField) = apply { this.traceId = traceId } - fun dottedOrder(dottedOrder: String) = - dottedOrder( - JsonField.of(dottedOrder) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun dottedOrder(dottedOrder: String) = dottedOrder(JsonField.of(dottedOrder)) - @JsonProperty("dotted_order") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("dotted_order") @ExcludeMissing - fun dottedOrder(dottedOrder: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dottedOrder = dottedOrder - } + fun dottedOrder(dottedOrder: JsonField) = apply { + this.dottedOrder = dottedOrder + } - fun id(id: String) = - id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing - fun id(id: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id - } + fun id(id: JsonField) = apply { this.id = id } - fun sessionId(sessionId: String) = - sessionId( - JsonField.of(sessionId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) - @JsonProperty("session_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("session_id") @ExcludeMissing - fun sessionId(sessionId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sessionId = sessionId - } + fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } fun referenceExampleId(referenceExampleId: String) = - referenceExampleId( - JsonField.of(referenceExampleId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + referenceExampleId(JsonField.of(referenceExampleId)) - @JsonProperty( - "reference_example_id" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("reference_example_id") @ExcludeMissing - fun referenceExampleId(referenceExampleId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceExampleId = referenceExampleId - } + fun referenceExampleId(referenceExampleId: JsonField) = apply { + this.referenceExampleId = referenceExampleId + } - fun totalTokens(totalTokens: Long) = - totalTokens( - JsonField.of(totalTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalTokens(totalTokens: Long) = totalTokens(JsonField.of(totalTokens)) - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_tokens") @ExcludeMissing - fun totalTokens(totalTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalTokens = totalTokens - } + fun totalTokens(totalTokens: JsonField) = apply { + this.totalTokens = totalTokens + } - fun promptTokens(promptTokens: Long) = - promptTokens( - JsonField.of(promptTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptTokens(promptTokens: Long) = promptTokens(JsonField.of(promptTokens)) - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_tokens") @ExcludeMissing - fun promptTokens(promptTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptTokens = promptTokens - } + fun promptTokens(promptTokens: JsonField) = apply { + this.promptTokens = promptTokens + } fun completionTokens(completionTokens: Long) = - completionTokens( - JsonField.of(completionTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + completionTokens(JsonField.of(completionTokens)) - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_tokens") @ExcludeMissing - fun completionTokens(completionTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionTokens = completionTokens - } + fun completionTokens(completionTokens: JsonField) = apply { + this.completionTokens = completionTokens + } - fun totalCost(totalCost: Double) = - totalCost( - JsonField.of(totalCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalCost(totalCost: Double) = totalCost(JsonField.of(totalCost)) - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_cost") @ExcludeMissing - fun totalCost(totalCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalCost = totalCost - } + fun totalCost(totalCost: JsonField) = apply { this.totalCost = totalCost } - fun promptCost(promptCost: Double) = - promptCost( - JsonField.of(promptCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptCost(promptCost: Double) = promptCost(JsonField.of(promptCost)) - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_cost") @ExcludeMissing - fun promptCost(promptCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptCost = promptCost - } + fun promptCost(promptCost: JsonField) = apply { + this.promptCost = promptCost + } fun completionCost(completionCost: Double) = - completionCost( - JsonField.of(completionCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + completionCost(JsonField.of(completionCost)) - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_cost") @ExcludeMissing - fun completionCost(completionCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionCost = completionCost - } + fun completionCost(completionCost: JsonField) = apply { + this.completionCost = completionCost + } - fun status(status: String) = - status(JsonField.of(status)) // templates/JavaSDK/entities/objects.ts:252:20 + fun status(status: String) = status(JsonField.of(status)) - @JsonProperty("status") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("status") @ExcludeMissing - fun status(status: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.status = status - } + fun status(status: JsonField) = apply { this.status = status } fun feedbackStats(feedbackStats: FeedbackStats) = - feedbackStats( - JsonField.of(feedbackStats) - ) // templates/JavaSDK/entities/objects.ts:252:20 + feedbackStats(JsonField.of(feedbackStats)) - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_stats") @ExcludeMissing - fun feedbackStats(feedbackStats: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackStats = feedbackStats - } + fun feedbackStats(feedbackStats: JsonField) = apply { + this.feedbackStats = feedbackStats + } - fun appPath(appPath: String) = - appPath(JsonField.of(appPath)) // templates/JavaSDK/entities/objects.ts:252:20 + fun appPath(appPath: String) = appPath(JsonField.of(appPath)) - @JsonProperty("app_path") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("app_path") @ExcludeMissing - fun appPath(appPath: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.appPath = appPath - } + fun appPath(appPath: JsonField) = apply { this.appPath = appPath } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } - fun build(): RunSchemaComparisonView = - RunSchemaComparisonView( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + fun build(): Run = + Run( + name, inputs, runType, startTime, @@ -1787,33 +1346,25 @@ private constructor( @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is RunType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val TOOL = - RunType(JsonField.of("tool")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val TOOL = RunType(JsonField.of("tool")) @JvmField val CHAIN = RunType(JsonField.of("chain")) @@ -1830,9 +1381,8 @@ private constructor( @JvmStatic fun of(value: String) = RunType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - TOOL, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + TOOL, CHAIN, LLM, RETRIEVER, @@ -1841,9 +1391,8 @@ private constructor( PARSER, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - TOOL, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + TOOL, CHAIN, LLM, RETRIEVER, @@ -1854,9 +1403,8 @@ private constructor( } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - TOOL -> Value.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Value.TOOL CHAIN -> Value.CHAIN LLM -> Value.LLM RETRIEVER -> Value.RETRIEVER @@ -1867,9 +1415,8 @@ private constructor( } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - TOOL -> Known.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Known.TOOL CHAIN -> Known.CHAIN LLM -> Known.LLM RETRIEVER -> Known.RETRIEVER @@ -1882,56 +1429,40 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } - @JsonDeserialize( - builder = FeedbackStats.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackStats.Builder::class) @NoAutoDetect class FeedbackStats private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = - false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackStats = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): FeedbackStats = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackStats && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackStats && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -1940,42 +1471,32 @@ private constructor( override fun toString() = "FeedbackStats{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackStats: FeedbackStats) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(feedbackStats.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackStats: FeedbackStats) = apply { + additionalProperties(feedbackStats.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetSchemaForUpdate.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetSchemaForUpdate.kt index 7094e3be..0c97dbe5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetSchemaForUpdate.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetSchemaForUpdate.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,15 +19,11 @@ import java.util.Objects import java.util.Optional /** Base class for Dataset. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = DatasetSchemaForUpdate.Builder::class) @NoAutoDetect class DatasetSchemaForUpdate -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val name: JsonField, private val description: JsonField, private val createdAt: JsonField, private val dataType: JsonField, @@ -38,8 +32,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -58,42 +51,26 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun tenantId(): String = tenantId.getRequired("tenant_id") - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _description() = description + @JsonProperty("description") @ExcludeMissing fun _description() = description - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _dataType() = dataType + @JsonProperty("data_type") @ExcludeMissing fun _dataType() = dataType - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetSchemaForUpdate = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): DatasetSchemaForUpdate = apply { + if (!validated) { + name() description() createdAt() dataType() @@ -105,12 +82,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetSchemaForUpdate && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetSchemaForUpdate && this.name == other.name && this.description == other.description && this.createdAt == other.createdAt && @@ -120,15 +97,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, description, createdAt, dataType, @@ -143,21 +116,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "DatasetSchemaForUpdate{name=$name, description=$description, createdAt=$createdAt, dataType=$dataType, id=$id, tenantId=$tenantId, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var dataType: JsonField = JsonMissing.of() @@ -165,100 +131,70 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var tenantId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetSchemaForUpdate: DatasetSchemaForUpdate) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - datasetSchemaForUpdate.name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.description = datasetSchemaForUpdate.description - this.createdAt = datasetSchemaForUpdate.createdAt - this.dataType = datasetSchemaForUpdate.dataType - this.id = datasetSchemaForUpdate.id - this.tenantId = datasetSchemaForUpdate.tenantId - additionalProperties(datasetSchemaForUpdate.additionalProperties) - } - - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(datasetSchemaForUpdate: DatasetSchemaForUpdate) = apply { + this.name = datasetSchemaForUpdate.name + this.description = datasetSchemaForUpdate.description + this.createdAt = datasetSchemaForUpdate.createdAt + this.dataType = datasetSchemaForUpdate.dataType + this.id = datasetSchemaForUpdate.id + this.tenantId = datasetSchemaForUpdate.tenantId + additionalProperties(datasetSchemaForUpdate.additionalProperties) } - fun description(description: String) = - description(JsonField.of(description)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun description(description: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + fun name(name: JsonField) = apply { this.name = name } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("description") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun description(description: JsonField) = apply { this.description = description } + + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") + @ExcludeMissing + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** Enum for dataset data types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun dataType(dataType: DataType) = dataType(JsonField.of(dataType)) /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("data_type") @ExcludeMissing - fun dataType(dataType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dataType = dataType - } + fun dataType(dataType: JsonField) = apply { this.dataType = dataType } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) + + @JsonProperty("tenant_id") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetSchemaForUpdate = - DatasetSchemaForUpdate( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + DatasetSchemaForUpdate( + name, description, createdAt, dataType, @@ -272,30 +208,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DataType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is DataType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val KV = DataType(JsonField.of("kv")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val KV = DataType(JsonField.of("kv")) @JvmField val LLM = DataType(JsonField.of("llm")) @@ -304,34 +235,30 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = DataType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - KV, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + KV, LLM, CHAT, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - KV, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + KV, LLM, CHAT, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - KV -> Value.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Value.KV LLM -> Value.LLM CHAT -> Value.CHAT else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - KV -> Known.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Known.KV LLM -> Known.LLM CHAT -> Known.CHAT else -> throw LangSmithInvalidDataException("Unknown DataType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareRetrieveParams.kt index 3fea8ff2..2717f69a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val datasetId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -36,21 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetShareRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetShareRetrieveParams && this.datasetId == other.datasetId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, additionalQueryParams, additionalHeaders, ) @@ -61,96 +55,70 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetShareRetrieveParams: DatasetShareRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetShareRetrieveParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(datasetShareRetrieveParams.additionalQueryParams) - additionalHeaders(datasetShareRetrieveParams.additionalHeaders) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetShareRetrieveParams: DatasetShareRetrieveParams) = apply { + this.datasetId = datasetShareRetrieveParams.datasetId + additionalQueryParams(datasetShareRetrieveParams.additionalQueryParams) + additionalHeaders(datasetShareRetrieveParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): DatasetShareRetrieveParams = - DatasetShareRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetShareRetrieveParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareSchema.kt index 2b242537..2da23078 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -16,11 +14,7 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = DatasetShareSchema.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = DatasetShareSchema.Builder::class) @NoAutoDetect class DatasetShareSchema private constructor( @@ -29,8 +23,7 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -38,25 +31,17 @@ private constructor( fun shareToken(): String = shareToken.getRequired("share_token") - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _datasetId() = datasetId + @JsonProperty("dataset_id") @ExcludeMissing fun _datasetId() = datasetId - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _shareToken() = shareToken + @JsonProperty("share_token") @ExcludeMissing fun _shareToken() = shareToken - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): DatasetShareSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - datasetId() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): DatasetShareSchema = apply { + if (!validated) { + datasetId() shareToken() validated = true } @@ -64,26 +49,22 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetShareSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetShareSchema && this.datasetId == other.datasetId && this.shareToken == other.shareToken && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + datasetId, shareToken, additionalProperties, ) @@ -94,75 +75,53 @@ private constructor( override fun toString() = "DatasetShareSchema{datasetId=$datasetId, shareToken=$shareToken, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var datasetId: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var datasetId: JsonField = JsonMissing.of() private var shareToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetShareSchema: DatasetShareSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.datasetId = - datasetShareSchema.datasetId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.shareToken = datasetShareSchema.shareToken - additionalProperties(datasetShareSchema.additionalProperties) - } + @JvmSynthetic + internal fun from(datasetShareSchema: DatasetShareSchema) = apply { + this.datasetId = datasetShareSchema.datasetId + this.shareToken = datasetShareSchema.shareToken + additionalProperties(datasetShareSchema.additionalProperties) + } - fun datasetId(datasetId: String) = - datasetId(JsonField.of(datasetId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun datasetId(datasetId: String) = datasetId(JsonField.of(datasetId)) - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("dataset_id") @ExcludeMissing - fun datasetId(datasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } + fun datasetId(datasetId: JsonField) = apply { this.datasetId = datasetId } - fun shareToken(shareToken: String) = - shareToken(JsonField.of(shareToken)) // templates/JavaSDK/entities/objects.ts:252:20 + fun shareToken(shareToken: String) = shareToken(JsonField.of(shareToken)) - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("share_token") @ExcludeMissing - fun shareToken(shareToken: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.shareToken = shareToken - } + fun shareToken(shareToken: JsonField) = apply { this.shareToken = shareToken } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetShareSchema = - DatasetShareSchema( // templates/JavaSDK/entities/objects.ts:326:30 - datasetId, // templates/JavaSDK/entities/objects.ts:326:30 + DatasetShareSchema( + datasetId, shareToken, additionalProperties.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareUpdateParams.kt index 1c35eb1e..7d6ca20e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetShareUpdateParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,49 +10,36 @@ import java.util.Objects import java.util.Optional class DatasetShareUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val shareProjects: Boolean?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun shareProjects(): Optional = Optional.ofNullable(shareProjects) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.shareProjects?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("share_projects", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.shareProjects?.let { params.put("share_projects", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } @@ -63,12 +50,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetShareUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetShareUpdateParams && this.datasetId == other.datasetId && this.shareProjects == other.shareProjects && this.additionalQueryParams == other.additionalQueryParams && @@ -76,10 +63,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, shareProjects, additionalQueryParams, additionalHeaders, @@ -92,123 +78,90 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var shareProjects: Boolean? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetShareUpdateParams: DatasetShareUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetShareUpdateParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.shareProjects = datasetShareUpdateParams.shareProjects - additionalQueryParams(datasetShareUpdateParams.additionalQueryParams) - additionalHeaders(datasetShareUpdateParams.additionalHeaders) - additionalBodyProperties(datasetShareUpdateParams.additionalBodyProperties) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetShareUpdateParams: DatasetShareUpdateParams) = apply { + this.datasetId = datasetShareUpdateParams.datasetId + this.shareProjects = datasetShareUpdateParams.shareProjects + additionalQueryParams(datasetShareUpdateParams.additionalQueryParams) + additionalHeaders(datasetShareUpdateParams.additionalHeaders) + additionalBodyProperties(datasetShareUpdateParams.additionalBodyProperties) } - fun shareProjects(shareProjects: Boolean) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.shareProjects = shareProjects - } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun shareProjects(shareProjects: Boolean) = apply { this.shareProjects = shareProjects } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): DatasetShareUpdateParams = - DatasetShareUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetShareUpdateParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, shareProjects, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUpdateParams.kt index 41a1a683..e02f423a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUpdateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,12 +15,8 @@ import java.util.Objects import java.util.Optional class DatasetUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val description: String?, private val name: String?, private val additionalQueryParams: Map>, @@ -30,41 +24,33 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun description(): Optional = Optional.ofNullable(description) fun name(): Optional = Optional.ofNullable(name) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): DatasetUpdateBody { // templates/JavaSDK/entities/params.ts:165:16 - return DatasetUpdateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - description, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): DatasetUpdateBody { + return DatasetUpdateBody( + description, name, additionalBodyProperties, ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } /** Update class for Dataset. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = DatasetUpdateBody.Builder::class) @NoAutoDetect class DatasetUpdateBody @@ -74,42 +60,34 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetUpdateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetUpdateBody && this.description == other.description && this.name == other.name && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - description, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + description, name, additionalProperties, ) @@ -120,70 +98,46 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "DatasetUpdateBody{description=$description, name=$name, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var description: String? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var description: String? = null private var name: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetUpdateBody: DatasetUpdateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.description = - datasetUpdateBody - .description // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.name = datasetUpdateBody.name - additionalProperties(datasetUpdateBody.additionalProperties) - } - - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(datasetUpdateBody: DatasetUpdateBody) = apply { + this.description = datasetUpdateBody.description + this.name = datasetUpdateBody.name + additionalProperties(datasetUpdateBody.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("name") fun name(name: String) = apply { this.name = name } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetUpdateBody = - DatasetUpdateBody( // templates/JavaSDK/entities/objects.ts:326:30 - description, // templates/JavaSDK/entities/objects.ts:326:30 + DatasetUpdateBody( + description, name, additionalProperties.toUnmodifiable(), ) @@ -196,12 +150,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetUpdateParams && this.datasetId == other.datasetId && this.description == other.description && this.name == other.name && @@ -210,10 +164,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, description, name, additionalQueryParams, @@ -227,128 +180,94 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var description: String? = null private var name: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetUpdateParams: DatasetUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - datasetUpdateParams.datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.description = datasetUpdateParams.description - this.name = datasetUpdateParams.name - additionalQueryParams(datasetUpdateParams.additionalQueryParams) - additionalHeaders(datasetUpdateParams.additionalHeaders) - additionalBodyProperties(datasetUpdateParams.additionalBodyProperties) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(datasetUpdateParams: DatasetUpdateParams) = apply { + this.datasetId = datasetUpdateParams.datasetId + this.description = datasetUpdateParams.description + this.name = datasetUpdateParams.name + additionalQueryParams(datasetUpdateParams.additionalQueryParams) + additionalHeaders(datasetUpdateParams.additionalHeaders) + additionalBodyProperties(datasetUpdateParams.additionalBodyProperties) } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun description(description: String) = apply { this.description = description } + + fun name(name: String) = apply { this.name = name } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): DatasetUpdateParams = - DatasetUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, + DatasetUpdateParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, description, name, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUploadParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUploadParams.kt index 9a2098d0..ca152db7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUploadParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/DatasetUploadParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -20,12 +18,8 @@ import java.util.Objects import java.util.Optional class DatasetUploadParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val file: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val file: String, private val inputKeys: List, private val dataType: DataType?, private val description: String?, @@ -36,8 +30,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun file(): String = file // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun file(): String = file fun inputKeys(): List = inputKeys @@ -49,11 +42,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun outputKeys(): Optional> = Optional.ofNullable(outputKeys) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): DatasetUploadBody { // templates/JavaSDK/entities/params.ts:165:16 - return DatasetUploadBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - file, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): DatasetUploadBody { + return DatasetUploadBody( + file, inputKeys, dataType, description, @@ -63,22 +55,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - @JsonDeserialize( - builder = DatasetUploadBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = DatasetUploadBody.Builder::class) @NoAutoDetect class DatasetUploadBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val file: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val file: String?, private val inputKeys: List?, private val dataType: DataType?, private val description: String?, @@ -87,41 +72,33 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("file") // templates/JavaSDK/entities/objects.ts:113:14 - fun file(): String? = file + @JsonProperty("file") fun file(): String? = file - @JsonProperty("input_keys") // templates/JavaSDK/entities/objects.ts:113:14 - fun inputKeys(): List? = inputKeys + @JsonProperty("input_keys") fun inputKeys(): List? = inputKeys /** Enum for dataset data types. */ - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:113:14 - fun dataType(): DataType? = dataType + @JsonProperty("data_type") fun dataType(): DataType? = dataType - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonProperty("output_keys") // templates/JavaSDK/entities/objects.ts:113:14 - fun outputKeys(): List? = outputKeys + @JsonProperty("output_keys") fun outputKeys(): List? = outputKeys - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetUploadBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetUploadBody && this.file == other.file && this.inputKeys == other.inputKeys && this.dataType == other.dataType && @@ -131,15 +108,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - file, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + file, inputKeys, dataType, description, @@ -154,20 +127,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "DatasetUploadBody{file=$file, inputKeys=$inputKeys, dataType=$dataType, description=$description, name=$name, outputKeys=$outputKeys, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var file: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var file: String? = null private var inputKeys: List? = null private var dataType: DataType? = null private var description: String? = null @@ -175,89 +142,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var outputKeys: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(datasetUploadBody: DatasetUploadBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.file = - datasetUploadBody.file // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputKeys = datasetUploadBody.inputKeys - this.dataType = datasetUploadBody.dataType - this.description = datasetUploadBody.description - this.name = datasetUploadBody.name - this.outputKeys = datasetUploadBody.outputKeys - additionalProperties(datasetUploadBody.additionalProperties) - } - - @JsonProperty("file") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun file(file: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.file = file + @JvmSynthetic + internal fun from(datasetUploadBody: DatasetUploadBody) = apply { + this.file = datasetUploadBody.file + this.inputKeys = datasetUploadBody.inputKeys + this.dataType = datasetUploadBody.dataType + this.description = datasetUploadBody.description + this.name = datasetUploadBody.name + this.outputKeys = datasetUploadBody.outputKeys + additionalProperties(datasetUploadBody.additionalProperties) } - @JsonProperty("input_keys") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun inputKeys(inputKeys: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputKeys = inputKeys - } + @JsonProperty("file") fun file(file: String) = apply { this.file = file } + + @JsonProperty("input_keys") + fun inputKeys(inputKeys: List) = apply { this.inputKeys = inputKeys } /** Enum for dataset data types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("data_type") // templates/JavaSDK/entities/objects.ts:264:20 - fun dataType(dataType: DataType) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dataType = dataType - } + @JsonProperty("data_type") + fun dataType(dataType: DataType) = apply { this.dataType = dataType } - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + @JsonProperty("output_keys") + fun outputKeys(outputKeys: List) = apply { this.outputKeys = outputKeys } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("output_keys") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun outputKeys(outputKeys: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputKeys = outputKeys - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): DatasetUploadBody = - DatasetUploadBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(file) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`file` is required but was not set" - }, - checkNotNull(inputKeys) { // templates/JavaSDK/entities/objects.ts:358:13 - "`inputKeys` is required but was not set" - } + DatasetUploadBody( + checkNotNull(file) { "`file` is required but was not set" }, + checkNotNull(inputKeys) { "`inputKeys` is required but was not set" } .toUnmodifiable(), dataType, description, @@ -274,12 +204,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DatasetUploadParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is DatasetUploadParams && this.file == other.file && this.inputKeys == other.inputKeys && this.dataType == other.dataType && @@ -291,10 +221,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - file, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + file, inputKeys, dataType, description, @@ -311,20 +240,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var file: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var file: String? = null private var inputKeys: MutableList = mutableListOf() private var dataType: DataType? = null private var description: String? = null @@ -334,141 +258,100 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(datasetUploadParams: DatasetUploadParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.file = - datasetUploadParams.file // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.inputKeys(datasetUploadParams.inputKeys) - this.dataType = datasetUploadParams.dataType - this.description = datasetUploadParams.description - this.name = datasetUploadParams.name - this.outputKeys(datasetUploadParams.outputKeys ?: listOf()) - additionalQueryParams(datasetUploadParams.additionalQueryParams) - additionalHeaders(datasetUploadParams.additionalHeaders) - additionalBodyProperties(datasetUploadParams.additionalBodyProperties) - } - - fun file(file: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.file = file + @JvmSynthetic + internal fun from(datasetUploadParams: DatasetUploadParams) = apply { + this.file = datasetUploadParams.file + this.inputKeys(datasetUploadParams.inputKeys) + this.dataType = datasetUploadParams.dataType + this.description = datasetUploadParams.description + this.name = datasetUploadParams.name + this.outputKeys(datasetUploadParams.outputKeys ?: listOf()) + additionalQueryParams(datasetUploadParams.additionalQueryParams) + additionalHeaders(datasetUploadParams.additionalHeaders) + additionalBodyProperties(datasetUploadParams.additionalBodyProperties) } - fun inputKeys(inputKeys: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.inputKeys.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.inputKeys.addAll(inputKeys) - } + fun file(file: String) = apply { this.file = file } - fun addInputKey(inputKey: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.inputKeys.add(inputKey) + fun inputKeys(inputKeys: List) = apply { + this.inputKeys.clear() + this.inputKeys.addAll(inputKeys) } + fun addInputKey(inputKey: String) = apply { this.inputKeys.add(inputKey) } + /** Enum for dataset data types. */ - fun dataType(dataType: DataType) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.dataType = dataType + fun dataType(dataType: DataType) = apply { this.dataType = dataType } + + fun description(description: String) = apply { this.description = description } + + fun name(name: String) = apply { this.name = name } + + fun outputKeys(outputKeys: List) = apply { + this.outputKeys.clear() + this.outputKeys.addAll(outputKeys) } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } + fun addOutputKey(outputKey: String) = apply { this.outputKeys.add(outputKey) } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun outputKeys(outputKeys: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.outputKeys.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.outputKeys.addAll(outputKeys) - } - - fun addOutputKey(outputKey: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.outputKeys.add(outputKey) + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): DatasetUploadParams = - DatasetUploadParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(file) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`file` is required but was not set" - }, - checkNotNull(inputKeys) { // templates/JavaSDK/entities/params.ts:844:13 - "`inputKeys` is required but was not set" - } + DatasetUploadParams( + checkNotNull(file) { "`file` is required but was not set" }, + checkNotNull(inputKeys) { "`inputKeys` is required but was not set" } .toUnmodifiable(), dataType, description, @@ -484,30 +367,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is DataType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is DataType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val KV = DataType(JsonField.of("kv")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val KV = DataType(JsonField.of("kv")) @JvmField val LLM = DataType(JsonField.of("llm")) @@ -516,34 +394,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = DataType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - KV, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + KV, LLM, CHAT, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - KV, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + KV, LLM, CHAT, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - KV -> Value.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Value.KV LLM -> Value.LLM CHAT -> Value.CHAT else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - KV -> Known.KV // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + KV -> Known.KV LLM -> Known.LLM CHAT -> Known.CHAT else -> throw LangSmithInvalidDataException("Unknown DataType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Example.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Example.kt index 7acc1354..d68c66cf 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Example.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Example.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,16 +17,11 @@ import java.util.Objects import java.util.Optional /** Example schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = Example.Builder::class) @NoAutoDetect class Example -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val createdAt: JsonField, private val inputs: JsonValue, private val outputs: JsonValue, private val datasetId: JsonField, @@ -41,8 +34,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -67,57 +59,33 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun versionList(): Optional> = Optional.ofNullable(versionList.getNullable("version_list")) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputs() = inputs + @JsonProperty("inputs") @ExcludeMissing fun _inputs() = inputs - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputs() = outputs + @JsonProperty("outputs") @ExcludeMissing fun _outputs() = outputs - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _datasetId() = datasetId + @JsonProperty("dataset_id") @ExcludeMissing fun _datasetId() = datasetId - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sourceRunId() = sourceRunId + @JsonProperty("source_run_id") @ExcludeMissing fun _sourceRunId() = sourceRunId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonProperty("version_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _versionCount() = versionCount + @JsonProperty("version_count") @ExcludeMissing fun _versionCount() = versionCount - @JsonProperty("version_list") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _versionList() = versionList + @JsonProperty("version_list") @ExcludeMissing fun _versionList() = versionList - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Example = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Example = apply { + if (!validated) { + createdAt() datasetId() sourceRunId() id() @@ -131,12 +99,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Example && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Example && this.createdAt == other.createdAt && this.inputs == other.inputs && this.outputs == other.outputs && @@ -150,15 +118,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, inputs, outputs, datasetId, @@ -177,21 +141,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Example{createdAt=$createdAt, inputs=$inputs, outputs=$outputs, datasetId=$datasetId, sourceRunId=$sourceRunId, id=$id, name=$name, modifiedAt=$modifiedAt, versionCount=$versionCount, versionList=$versionList, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var inputs: JsonValue = JsonMissing.of() private var outputs: JsonValue = JsonMissing.of() private var datasetId: JsonField = JsonMissing.of() @@ -203,136 +160,96 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var versionList: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(example: Example) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - example.createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = example.inputs - this.outputs = example.outputs - this.datasetId = example.datasetId - this.sourceRunId = example.sourceRunId - this.id = example.id - this.name = example.name - this.modifiedAt = example.modifiedAt - this.versionCount = example.versionCount - this.versionList = example.versionList - additionalProperties(example.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - @ExcludeMissing - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs + @JvmSynthetic + internal fun from(example: Example) = apply { + this.createdAt = example.createdAt + this.inputs = example.inputs + this.outputs = example.outputs + this.datasetId = example.datasetId + this.sourceRunId = example.sourceRunId + this.id = example.id + this.name = example.name + this.modifiedAt = example.modifiedAt + this.versionCount = example.versionCount + this.versionList = example.versionList + additionalProperties(example.additionalProperties) } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") @ExcludeMissing - fun outputs(outputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + @JsonProperty("inputs") + @ExcludeMissing + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } + + @JsonProperty("outputs") + @ExcludeMissing + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } + + fun datasetId(datasetId: String) = datasetId(JsonField.of(datasetId)) + + @JsonProperty("dataset_id") + @ExcludeMissing + fun datasetId(datasetId: JsonField) = apply { this.datasetId = datasetId } + + fun sourceRunId(sourceRunId: String) = sourceRunId(JsonField.of(sourceRunId)) + + @JsonProperty("source_run_id") + @ExcludeMissing + fun sourceRunId(sourceRunId: JsonField) = apply { this.sourceRunId = sourceRunId } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) + + @JsonProperty("modified_at") + @ExcludeMissing + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt } - fun datasetId(datasetId: String) = - datasetId(JsonField.of(datasetId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("version_count") @ExcludeMissing - fun datasetId(datasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } + fun versionCount(versionCount: JsonField) = apply { this.versionCount = versionCount } - fun sourceRunId(sourceRunId: String) = - sourceRunId(JsonField.of(sourceRunId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun versionList(versionList: List) = versionList(JsonField.of(versionList)) - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("version_list") @ExcludeMissing - fun sourceRunId(sourceRunId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sourceRunId = sourceRunId - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun versionList(versionList: JsonField>) = apply { + this.versionList = versionList } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } - - fun versionCount(versionCount: Long) = - versionCount(JsonField.of(versionCount)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("version_count") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun versionCount(versionCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.versionCount = versionCount - } - - fun versionList(versionList: List) = - versionList(JsonField.of(versionList)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("version_list") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun versionList(versionList: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.versionList = versionList - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Example = - Example( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + Example( + createdAt, inputs, outputs, datasetId, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleBulkCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleBulkCreateParams.kt index 27f53fa7..885324d5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleBulkCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleBulkCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,70 +15,54 @@ import java.time.OffsetDateTime import java.util.Objects class ExampleBulkCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val body: List, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val body: List, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun body(): List = body // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun body(): List = body - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): ExampleBulkCreateBody { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): ExampleBulkCreateBody { return ExampleBulkCreateBody(body, additionalBodyProperties) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - @JsonDeserialize( - builder = ExampleBulkCreateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = ExampleBulkCreateBody.Builder::class) @NoAutoDetect class ExampleBulkCreateBody internal constructor( - private val body: List?, + private val body: List?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("body") // templates/JavaSDK/entities/objects.ts:113:14 - fun body(): List? = body + @JsonProperty("body") fun body(): List? = body - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleBulkCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleBulkCreateBody && this.body == other.body && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(body, additionalProperties) } return hashCode @@ -89,66 +71,41 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ExampleBulkCreateBody{body=$body, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var body: List? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var body: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleBulkCreateBody: ExampleBulkCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.body = - exampleBulkCreateBody - .body // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(exampleBulkCreateBody.additionalProperties) - } + @JvmSynthetic + internal fun from(exampleBulkCreateBody: ExampleBulkCreateBody) = apply { + this.body = exampleBulkCreateBody.body + additionalProperties(exampleBulkCreateBody.additionalProperties) + } - @JsonProperty("body") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun body(body: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.body = body - } + @JsonProperty("body") fun body(body: List) = apply { this.body = body } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleBulkCreateBody = ExampleBulkCreateBody( - checkNotNull(body) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`body` is required but was not set" - } - .toUnmodifiable(), + checkNotNull(body) { "`body` is required but was not set" }.toUnmodifiable(), additionalProperties.toUnmodifiable() ) } @@ -160,22 +117,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleBulkCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleBulkCreateParams && this.body == other.body && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - body, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + body, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -187,124 +143,91 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var body: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var body: MutableList = mutableListOf() private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleBulkCreateParams: ExampleBulkCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.body( - exampleBulkCreateParams.body - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(exampleBulkCreateParams.additionalQueryParams) - additionalHeaders(exampleBulkCreateParams.additionalHeaders) - additionalBodyProperties(exampleBulkCreateParams.additionalBodyProperties) - } + @JvmSynthetic + internal fun from(exampleBulkCreateParams: ExampleBulkCreateParams) = apply { + this.body(exampleBulkCreateParams.body) + additionalQueryParams(exampleBulkCreateParams.additionalQueryParams) + additionalHeaders(exampleBulkCreateParams.additionalHeaders) + additionalBodyProperties(exampleBulkCreateParams.additionalBodyProperties) + } - fun body(body: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.body.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun body(body: List) = apply { + this.body.clear() this.body.addAll(body) } - fun addBody(body: ExampleCreate) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.body.add(body) + fun addBody(body: Body) = apply { this.body.add(body) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ExampleBulkCreateParams = - ExampleBulkCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(body) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`body` is required but was not set" - } - .toUnmodifiable(), + ExampleBulkCreateParams( + checkNotNull(body) { "`body` is required but was not set" }.toUnmodifiable(), additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), @@ -312,15 +235,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Create class for Example. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ExampleCreate.Builder::class) @NoAutoDetect class ExampleCreate - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: OffsetDateTime?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val createdAt: OffsetDateTime?, private val inputs: JsonValue?, private val outputs: JsonValue?, private val datasetId: String?, @@ -329,40 +248,32 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:113:14 - fun inputs(): JsonValue? = inputs + @JsonProperty("inputs") fun inputs(): JsonValue? = inputs - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:113:14 - fun outputs(): JsonValue? = outputs + @JsonProperty("outputs") fun outputs(): JsonValue? = outputs - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun datasetId(): String? = datasetId + @JsonProperty("dataset_id") fun datasetId(): String? = datasetId - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun sourceRunId(): String? = sourceRunId + @JsonProperty("source_run_id") fun sourceRunId(): String? = sourceRunId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleCreate && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleCreate && this.createdAt == other.createdAt && this.inputs == other.inputs && this.outputs == other.outputs && @@ -372,15 +283,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, inputs, outputs, datasetId, @@ -395,21 +302,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ExampleCreate{createdAt=$createdAt, inputs=$inputs, outputs=$outputs, datasetId=$datasetId, sourceRunId=$sourceRunId, id=$id, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: OffsetDateTime? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: OffsetDateTime? = null private var inputs: JsonValue? = null private var outputs: JsonValue? = null private var datasetId: String? = null @@ -417,89 +317,53 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var id: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleCreate: ExampleCreate) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - exampleCreate.createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = exampleCreate.inputs - this.outputs = exampleCreate.outputs - this.datasetId = exampleCreate.datasetId - this.sourceRunId = exampleCreate.sourceRunId - this.id = exampleCreate.id - additionalProperties(exampleCreate.additionalProperties) - } - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs + @JvmSynthetic + internal fun from(exampleCreate: ExampleCreate) = apply { + this.createdAt = exampleCreate.createdAt + this.inputs = exampleCreate.inputs + this.outputs = exampleCreate.outputs + this.datasetId = exampleCreate.datasetId + this.sourceRunId = exampleCreate.sourceRunId + this.id = exampleCreate.id + additionalProperties(exampleCreate.additionalProperties) } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun outputs(outputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs - } + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun datasetId(datasetId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } + @JsonProperty("inputs") fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun sourceRunId(sourceRunId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sourceRunId = sourceRunId - } + @JsonProperty("outputs") + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JsonProperty("dataset_id") + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + + @JsonProperty("source_run_id") + fun sourceRunId(sourceRunId: String) = apply { this.sourceRunId = sourceRunId } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleCreate = - ExampleCreate( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(inputs) { // templates/JavaSDK/entities/objects.ts:358:13 - "`inputs` is required but was not set" - }, + ExampleCreate( + createdAt, + checkNotNull(inputs) { "`inputs` is required but was not set" }, outputs, - checkNotNull(datasetId) { // templates/JavaSDK/entities/objects.ts:358:13 - "`datasetId` is required but was not set" - }, + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, sourceRunId, id, additionalProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleCreateParams.kt index 78c47b73..50087c80 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,12 +16,8 @@ import java.util.Objects import java.util.Optional class ExampleCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val inputs: JsonValue, private val id: String?, private val createdAt: OffsetDateTime?, @@ -34,8 +28,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun inputs(): JsonValue = inputs @@ -47,11 +40,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun sourceRunId(): Optional = Optional.ofNullable(sourceRunId) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): ExampleCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return ExampleCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - datasetId, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): ExampleCreateBody { + return ExampleCreateBody( + datasetId, inputs, id, createdAt, @@ -61,22 +53,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Create class for Example. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ExampleCreateBody.Builder::class) @NoAutoDetect class ExampleCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val datasetId: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val datasetId: String?, private val inputs: JsonValue?, private val id: String?, private val createdAt: OffsetDateTime?, @@ -85,40 +71,32 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun datasetId(): String? = datasetId + @JsonProperty("dataset_id") fun datasetId(): String? = datasetId - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:113:14 - fun inputs(): JsonValue? = inputs + @JsonProperty("inputs") fun inputs(): JsonValue? = inputs - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:113:14 - fun outputs(): JsonValue? = outputs + @JsonProperty("outputs") fun outputs(): JsonValue? = outputs - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun sourceRunId(): String? = sourceRunId + @JsonProperty("source_run_id") fun sourceRunId(): String? = sourceRunId - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleCreateBody && this.datasetId == other.datasetId && this.inputs == other.inputs && this.id == other.id && @@ -128,15 +106,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + datasetId, inputs, id, createdAt, @@ -151,20 +125,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ExampleCreateBody{datasetId=$datasetId, inputs=$inputs, id=$id, createdAt=$createdAt, outputs=$outputs, sourceRunId=$sourceRunId, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var datasetId: String? = null private var inputs: JsonValue? = null private var id: String? = null private var createdAt: OffsetDateTime? = null @@ -172,89 +140,51 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var sourceRunId: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleCreateBody: ExampleCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.datasetId = - exampleCreateBody - .datasetId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = exampleCreateBody.inputs - this.id = exampleCreateBody.id - this.createdAt = exampleCreateBody.createdAt - this.outputs = exampleCreateBody.outputs - this.sourceRunId = exampleCreateBody.sourceRunId - additionalProperties(exampleCreateBody.additionalProperties) - } - - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun datasetId(datasetId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } - - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs + @JvmSynthetic + internal fun from(exampleCreateBody: ExampleCreateBody) = apply { + this.datasetId = exampleCreateBody.datasetId + this.inputs = exampleCreateBody.inputs + this.id = exampleCreateBody.id + this.createdAt = exampleCreateBody.createdAt + this.outputs = exampleCreateBody.outputs + this.sourceRunId = exampleCreateBody.sourceRunId + additionalProperties(exampleCreateBody.additionalProperties) } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JsonProperty("dataset_id") + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + + @JsonProperty("inputs") fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + @JsonProperty("outputs") + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } + + @JsonProperty("source_run_id") + fun sourceRunId(sourceRunId: String) = apply { this.sourceRunId = sourceRunId } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun outputs(outputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs - } - - @JsonProperty("source_run_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun sourceRunId(sourceRunId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sourceRunId = sourceRunId - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleCreateBody = - ExampleCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(datasetId) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`datasetId` is required but was not set" - }, - checkNotNull(inputs) { // templates/JavaSDK/entities/objects.ts:358:13 - "`inputs` is required but was not set" - }, + ExampleCreateBody( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, + checkNotNull(inputs) { "`inputs` is required but was not set" }, id, createdAt, outputs, @@ -270,12 +200,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleCreateParams && this.datasetId == other.datasetId && this.inputs == other.inputs && this.id == other.id && @@ -287,10 +217,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, inputs, id, createdAt, @@ -307,20 +236,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var inputs: JsonValue? = null private var id: String? = null private var createdAt: OffsetDateTime? = null @@ -330,127 +254,89 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleCreateParams: ExampleCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - exampleCreateParams.datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.inputs = exampleCreateParams.inputs - this.id = exampleCreateParams.id - this.createdAt = exampleCreateParams.createdAt - this.outputs = exampleCreateParams.outputs - this.sourceRunId = exampleCreateParams.sourceRunId - additionalQueryParams(exampleCreateParams.additionalQueryParams) - additionalHeaders(exampleCreateParams.additionalHeaders) - additionalBodyProperties(exampleCreateParams.additionalBodyProperties) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(exampleCreateParams: ExampleCreateParams) = apply { + this.datasetId = exampleCreateParams.datasetId + this.inputs = exampleCreateParams.inputs + this.id = exampleCreateParams.id + this.createdAt = exampleCreateParams.createdAt + this.outputs = exampleCreateParams.outputs + this.sourceRunId = exampleCreateParams.sourceRunId + additionalQueryParams(exampleCreateParams.additionalQueryParams) + additionalHeaders(exampleCreateParams.additionalHeaders) + additionalBodyProperties(exampleCreateParams.additionalBodyProperties) } - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.inputs = inputs + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } + + fun id(id: String) = apply { this.id = id } + + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } + + fun sourceRunId(sourceRunId: String) = apply { this.sourceRunId = sourceRunId } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.createdAt = createdAt - } - - fun outputs(outputs: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.outputs = outputs + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun sourceRunId(sourceRunId: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sourceRunId = sourceRunId - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ExampleCreateParams = - ExampleCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, - checkNotNull(inputs) { // templates/JavaSDK/entities/params.ts:844:13 - "`inputs` is required but was not set" - }, + ExampleCreateParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, + checkNotNull(inputs) { "`inputs` is required but was not set" }, id, createdAt, outputs, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteParams.kt index 85ddc4f6..d10ccae3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,41 +10,29 @@ import java.util.Objects import java.util.Optional class ExampleDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val exampleIds: List, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val exampleIds: List, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun exampleIds(): List = exampleIds // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun exampleIds(): List = exampleIds - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.exampleIds.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("example_ids", listOf(it.joinToString(separator = ","))) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.exampleIds.let { params.put("example_ids", listOf(it.joinToString(separator = ","))) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams @@ -52,22 +40,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleDeleteParams && this.exampleIds == other.exampleIds && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - exampleIds, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + exampleIds, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -79,124 +66,91 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var exampleIds: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var exampleIds: MutableList = mutableListOf() private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleDeleteParams: ExampleDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.exampleIds( - exampleDeleteParams.exampleIds - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(exampleDeleteParams.additionalQueryParams) - additionalHeaders(exampleDeleteParams.additionalHeaders) - additionalBodyProperties(exampleDeleteParams.additionalBodyProperties) - } - - fun exampleIds(exampleIds: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.exampleIds.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.exampleIds.addAll(exampleIds) - } - - fun addExampleId(exampleId: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.exampleIds.add(exampleId) + @JvmSynthetic + internal fun from(exampleDeleteParams: ExampleDeleteParams) = apply { + this.exampleIds(exampleDeleteParams.exampleIds) + additionalQueryParams(exampleDeleteParams.additionalQueryParams) + additionalHeaders(exampleDeleteParams.additionalHeaders) + additionalBodyProperties(exampleDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun exampleIds(exampleIds: List) = apply { + this.exampleIds.clear() + this.exampleIds.addAll(exampleIds) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun addExampleId(exampleId: String) = apply { this.exampleIds.add(exampleId) } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ExampleDeleteParams = - ExampleDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(exampleIds) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`exampleIds` is required but was not set" - } + ExampleDeleteParams( + checkNotNull(exampleIds) { "`exampleIds` is required but was not set" } .toUnmodifiable(), additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteResponse.kt index d37875d9..a1a611bb 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = ExampleDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = ExampleDeleteResponse.Builder::class) @NoAutoDetect class ExampleDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ExampleDeleteResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): ExampleDeleteResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "ExampleDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleDeleteResponse: ExampleDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(exampleDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(exampleDeleteResponse: ExampleDeleteResponse) = apply { + additionalProperties(exampleDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleDeleteResponse = ExampleDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleListParams.kt index 061f6cfe..dec7c984 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,12 +10,8 @@ import java.util.Objects import java.util.Optional class ExampleListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val id: List?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val id: List?, private val asOf: OffsetDateTime?, private val dataset: String?, private val limit: Long?, @@ -24,9 +20,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalHeaders: Map>, ) { - fun id(): Optional> = - Optional.ofNullable(id) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): Optional> = Optional.ofNullable(id) fun asOf(): Optional = Optional.ofNullable(asOf) @@ -36,44 +30,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun offset(): Optional = Optional.ofNullable(offset) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.id?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("id", listOf(it.joinToString(separator = ","))) - } - this.asOf?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("as_of", listOf(it.toString())) - } - this.dataset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("dataset", listOf(it.toString())) - } - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.id?.let { params.put("id", listOf(it.joinToString(separator = ","))) } + this.asOf?.let { params.put("as_of", listOf(it.toString())) } + this.dataset?.let { params.put("dataset", listOf(it.toString())) } + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleListParams && this.id == other.id && this.asOf == other.asOf && this.dataset == other.dataset && @@ -83,10 +63,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, asOf, dataset, limit, @@ -101,21 +80,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: MutableList = mutableListOf() private var asOf: OffsetDateTime? = null private var dataset: String? = null private var limit: Long? = null @@ -123,103 +96,75 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleListParams: ExampleListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.id( - exampleListParams.id ?: listOf() - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.asOf = exampleListParams.asOf - this.dataset = exampleListParams.dataset - this.limit = exampleListParams.limit - this.offset = exampleListParams.offset - additionalQueryParams(exampleListParams.additionalQueryParams) - additionalHeaders(exampleListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(exampleListParams: ExampleListParams) = apply { + this.id(exampleListParams.id ?: listOf()) + this.asOf = exampleListParams.asOf + this.dataset = exampleListParams.dataset + this.limit = exampleListParams.limit + this.offset = exampleListParams.offset + additionalQueryParams(exampleListParams.additionalQueryParams) + additionalHeaders(exampleListParams.additionalHeaders) + } - fun id(id: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.id.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun id(id: List) = apply { + this.id.clear() this.id.addAll(id) } - fun addId(id: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.id.add(id) + fun addId(id: String) = apply { this.id.add(id) } + + fun asOf(asOf: OffsetDateTime) = apply { this.asOf = asOf } + + fun dataset(dataset: String) = apply { this.dataset = dataset } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun asOf(asOf: OffsetDateTime) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.asOf = asOf + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun dataset(dataset: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.dataset = dataset + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) } - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset - } - - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): ExampleListParams = - ExampleListParams( // templates/JavaSDK/entities/params.ts:683:22 - if (id.size == 0) null - else id.toUnmodifiable(), // templates/JavaSDK/entities/params.ts:683:22 + ExampleListParams( + if (id.size == 0) null else id.toUnmodifiable(), asOf, dataset, limit, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleRetrieveParams.kt index 048c9cbd..fb45e622 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,42 +10,30 @@ import java.util.Objects import java.util.Optional class ExampleRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val exampleId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val exampleId: String, private val asOf: OffsetDateTime?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun exampleId(): String = exampleId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun exampleId(): String = exampleId fun asOf(): Optional = Optional.ofNullable(asOf) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.asOf?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("as_of", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.asOf?.let { params.put("as_of", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> exampleId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> exampleId else -> "" } } @@ -54,22 +42,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleRetrieveParams && this.exampleId == other.exampleId && this.asOf == other.asOf && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - exampleId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + exampleId, asOf, additionalQueryParams, additionalHeaders, @@ -81,103 +68,75 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var exampleId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var exampleId: String? = null private var asOf: OffsetDateTime? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleRetrieveParams: ExampleRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.exampleId = - exampleRetrieveParams - .exampleId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.asOf = exampleRetrieveParams.asOf - additionalQueryParams(exampleRetrieveParams.additionalQueryParams) - additionalHeaders(exampleRetrieveParams.additionalHeaders) - } - - fun exampleId(exampleId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.exampleId = exampleId + @JvmSynthetic + internal fun from(exampleRetrieveParams: ExampleRetrieveParams) = apply { + this.exampleId = exampleRetrieveParams.exampleId + this.asOf = exampleRetrieveParams.asOf + additionalQueryParams(exampleRetrieveParams.additionalQueryParams) + additionalHeaders(exampleRetrieveParams.additionalHeaders) } + fun exampleId(exampleId: String) = apply { this.exampleId = exampleId } + /** Return the example as it was at this time. Defaults to the current time. */ - fun asOf(asOf: OffsetDateTime) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.asOf = asOf + fun asOf(asOf: OffsetDateTime) = apply { this.asOf = asOf } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): ExampleRetrieveParams = - ExampleRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(exampleId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`exampleId` is required but was not set" - }, + ExampleRetrieveParams( + checkNotNull(exampleId) { "`exampleId` is required but was not set" }, asOf, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateParams.kt index 2ad2248c..137dadf5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,12 +15,8 @@ import java.util.Objects import java.util.Optional class ExampleUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val exampleId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val exampleId: String, private val datasetId: String?, private val inputs: JsonValue?, private val outputs: JsonValue?, @@ -31,8 +25,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun exampleId(): String = exampleId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun exampleId(): String = exampleId fun datasetId(): Optional = Optional.ofNullable(datasetId) @@ -40,86 +33,69 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun outputs(): Optional = Optional.ofNullable(outputs) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): ExampleUpdateBody { // templates/JavaSDK/entities/params.ts:165:16 - return ExampleUpdateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - datasetId, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): ExampleUpdateBody { + return ExampleUpdateBody( + datasetId, inputs, outputs, additionalBodyProperties, ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> exampleId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> exampleId else -> "" } } /** Update class for Example. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ExampleUpdateBody.Builder::class) @NoAutoDetect class ExampleUpdateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val datasetId: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val datasetId: String?, private val inputs: JsonValue?, private val outputs: JsonValue?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun datasetId(): String? = datasetId + @JsonProperty("dataset_id") fun datasetId(): String? = datasetId - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:113:14 - fun inputs(): JsonValue? = inputs + @JsonProperty("inputs") fun inputs(): JsonValue? = inputs - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:113:14 - fun outputs(): JsonValue? = outputs + @JsonProperty("outputs") fun outputs(): JsonValue? = outputs - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleUpdateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleUpdateBody && this.datasetId == other.datasetId && this.inputs == other.inputs && this.outputs == other.outputs && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + datasetId, inputs, outputs, additionalProperties, @@ -131,78 +107,51 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ExampleUpdateBody{datasetId=$datasetId, inputs=$inputs, outputs=$outputs, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var datasetId: String? = null private var inputs: JsonValue? = null private var outputs: JsonValue? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleUpdateBody: ExampleUpdateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.datasetId = - exampleUpdateBody - .datasetId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = exampleUpdateBody.inputs - this.outputs = exampleUpdateBody.outputs - additionalProperties(exampleUpdateBody.additionalProperties) - } - - @JsonProperty("dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun datasetId(datasetId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetId = datasetId - } - - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs + @JvmSynthetic + internal fun from(exampleUpdateBody: ExampleUpdateBody) = apply { + this.datasetId = exampleUpdateBody.datasetId + this.inputs = exampleUpdateBody.inputs + this.outputs = exampleUpdateBody.outputs + additionalProperties(exampleUpdateBody.additionalProperties) } - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun outputs(outputs: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs - } + @JsonProperty("dataset_id") + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("inputs") fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("outputs") + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleUpdateBody = - ExampleUpdateBody( // templates/JavaSDK/entities/objects.ts:326:30 - datasetId, // templates/JavaSDK/entities/objects.ts:326:30 + ExampleUpdateBody( + datasetId, inputs, outputs, additionalProperties.toUnmodifiable(), @@ -216,12 +165,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleUpdateParams && this.exampleId == other.exampleId && this.datasetId == other.datasetId && this.inputs == other.inputs && @@ -231,10 +180,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - exampleId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + exampleId, datasetId, inputs, outputs, @@ -249,20 +197,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var exampleId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var exampleId: String? = null private var datasetId: String? = null private var inputs: JsonValue? = null private var outputs: JsonValue? = null @@ -270,112 +213,82 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleUpdateParams: ExampleUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.exampleId = - exampleUpdateParams.exampleId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = exampleUpdateParams.datasetId - this.inputs = exampleUpdateParams.inputs - this.outputs = exampleUpdateParams.outputs - additionalQueryParams(exampleUpdateParams.additionalQueryParams) - additionalHeaders(exampleUpdateParams.additionalHeaders) - additionalBodyProperties(exampleUpdateParams.additionalBodyProperties) - } - - fun exampleId(exampleId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.exampleId = exampleId + @JvmSynthetic + internal fun from(exampleUpdateParams: ExampleUpdateParams) = apply { + this.exampleId = exampleUpdateParams.exampleId + this.datasetId = exampleUpdateParams.datasetId + this.inputs = exampleUpdateParams.inputs + this.outputs = exampleUpdateParams.outputs + additionalQueryParams(exampleUpdateParams.additionalQueryParams) + additionalHeaders(exampleUpdateParams.additionalHeaders) + additionalBodyProperties(exampleUpdateParams.additionalBodyProperties) } - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + fun exampleId(exampleId: String) = apply { this.exampleId = exampleId } + + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } + + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.inputs = inputs + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun outputs(outputs: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.outputs = outputs + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ExampleUpdateParams = - ExampleUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(exampleId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`exampleId` is required but was not set" - }, + ExampleUpdateParams( + checkNotNull(exampleId) { "`exampleId` is required but was not set" }, datasetId, inputs, outputs, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateResponse.kt index dd0d3466..0f851b4d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUpdateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = ExampleUpdateResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = ExampleUpdateResponse.Builder::class) @NoAutoDetect class ExampleUpdateResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ExampleUpdateResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): ExampleUpdateResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleUpdateResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleUpdateResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "ExampleUpdateResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleUpdateResponse: ExampleUpdateResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(exampleUpdateResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(exampleUpdateResponse: ExampleUpdateResponse) = apply { + additionalProperties(exampleUpdateResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleUpdateResponse = ExampleUpdateResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUploadCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUploadCreateParams.kt index a627c8f5..e46965ec 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUploadCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ExampleUploadCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,12 +15,8 @@ import java.util.Objects import java.util.Optional class ExampleUploadCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val datasetId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val datasetId: String, private val file: String, private val inputKeys: List, private val outputKeys: List?, @@ -31,8 +25,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun datasetId(): String = datasetId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun datasetId(): String = datasetId fun file(): String = file @@ -40,87 +33,68 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun outputKeys(): Optional> = Optional.ofNullable(outputKeys) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): ExampleUploadCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return ExampleUploadCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - file, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): ExampleUploadCreateBody { + return ExampleUploadCreateBody( + file, inputKeys, outputKeys, additionalBodyProperties, ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> datasetId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> datasetId else -> "" } } - @JsonDeserialize( - builder = ExampleUploadCreateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = ExampleUploadCreateBody.Builder::class) @NoAutoDetect class ExampleUploadCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val file: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val file: String?, private val inputKeys: List?, private val outputKeys: List?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("file") // templates/JavaSDK/entities/objects.ts:113:14 - fun file(): String? = file + @JsonProperty("file") fun file(): String? = file - @JsonProperty("input_keys") // templates/JavaSDK/entities/objects.ts:113:14 - fun inputKeys(): List? = inputKeys + @JsonProperty("input_keys") fun inputKeys(): List? = inputKeys - @JsonProperty("output_keys") // templates/JavaSDK/entities/objects.ts:113:14 - fun outputKeys(): List? = outputKeys + @JsonProperty("output_keys") fun outputKeys(): List? = outputKeys - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - ExampleUploadCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleUploadCreateBody && this.file == other.file && this.inputKeys == other.inputKeys && this.outputKeys == other.outputKeys && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - file, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + file, inputKeys, outputKeys, additionalProperties, @@ -132,84 +106,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ExampleUploadCreateBody{file=$file, inputKeys=$inputKeys, outputKeys=$outputKeys, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var file: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var file: String? = null private var inputKeys: List? = null private var outputKeys: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(exampleUploadCreateBody: ExampleUploadCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.file = - exampleUploadCreateBody - .file // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputKeys = exampleUploadCreateBody.inputKeys - this.outputKeys = exampleUploadCreateBody.outputKeys - additionalProperties(exampleUploadCreateBody.additionalProperties) - } - - @JsonProperty("file") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun file(file: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.file = file + @JvmSynthetic + internal fun from(exampleUploadCreateBody: ExampleUploadCreateBody) = apply { + this.file = exampleUploadCreateBody.file + this.inputKeys = exampleUploadCreateBody.inputKeys + this.outputKeys = exampleUploadCreateBody.outputKeys + additionalProperties(exampleUploadCreateBody.additionalProperties) } - @JsonProperty("input_keys") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun inputKeys(inputKeys: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputKeys = inputKeys - } + @JsonProperty("file") fun file(file: String) = apply { this.file = file } - @JsonProperty("output_keys") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun outputKeys(outputKeys: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputKeys = outputKeys - } + @JsonProperty("input_keys") + fun inputKeys(inputKeys: List) = apply { this.inputKeys = inputKeys } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("output_keys") + fun outputKeys(outputKeys: List) = apply { this.outputKeys = outputKeys } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ExampleUploadCreateBody = - ExampleUploadCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(file) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`file` is required but was not set" - }, - checkNotNull(inputKeys) { // templates/JavaSDK/entities/objects.ts:358:13 - "`inputKeys` is required but was not set" - } + ExampleUploadCreateBody( + checkNotNull(file) { "`file` is required but was not set" }, + checkNotNull(inputKeys) { "`inputKeys` is required but was not set" } .toUnmodifiable(), outputKeys?.toUnmodifiable(), additionalProperties.toUnmodifiable(), @@ -223,12 +165,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ExampleUploadCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ExampleUploadCreateParams && this.datasetId == other.datasetId && this.file == other.file && this.inputKeys == other.inputKeys && @@ -238,10 +180,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - datasetId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + datasetId, file, inputKeys, outputKeys, @@ -256,20 +197,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var datasetId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var datasetId: String? = null private var file: String? = null private var inputKeys: MutableList = mutableListOf() private var outputKeys: MutableList = mutableListOf() @@ -277,133 +213,94 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(exampleUploadCreateParams: ExampleUploadCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.datasetId = - exampleUploadCreateParams - .datasetId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.file = exampleUploadCreateParams.file - this.inputKeys(exampleUploadCreateParams.inputKeys) - this.outputKeys(exampleUploadCreateParams.outputKeys ?: listOf()) - additionalQueryParams(exampleUploadCreateParams.additionalQueryParams) - additionalHeaders(exampleUploadCreateParams.additionalHeaders) - additionalBodyProperties(exampleUploadCreateParams.additionalBodyProperties) - } - - fun datasetId(datasetId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.datasetId = datasetId + @JvmSynthetic + internal fun from(exampleUploadCreateParams: ExampleUploadCreateParams) = apply { + this.datasetId = exampleUploadCreateParams.datasetId + this.file = exampleUploadCreateParams.file + this.inputKeys(exampleUploadCreateParams.inputKeys) + this.outputKeys(exampleUploadCreateParams.outputKeys ?: listOf()) + additionalQueryParams(exampleUploadCreateParams.additionalQueryParams) + additionalHeaders(exampleUploadCreateParams.additionalHeaders) + additionalBodyProperties(exampleUploadCreateParams.additionalBodyProperties) } - fun file(file: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.file = file + fun datasetId(datasetId: String) = apply { this.datasetId = datasetId } + + fun file(file: String) = apply { this.file = file } + + fun inputKeys(inputKeys: List) = apply { + this.inputKeys.clear() + this.inputKeys.addAll(inputKeys) } - fun inputKeys(inputKeys: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.inputKeys.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.inputKeys.addAll(inputKeys) - } + fun addInputKey(inputKey: String) = apply { this.inputKeys.add(inputKey) } - fun addInputKey(inputKey: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.inputKeys.add(inputKey) + fun outputKeys(outputKeys: List) = apply { + this.outputKeys.clear() + this.outputKeys.addAll(outputKeys) } - fun outputKeys(outputKeys: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.outputKeys.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.outputKeys.addAll(outputKeys) - } + fun addOutputKey(outputKey: String) = apply { this.outputKeys.add(outputKey) } - fun addOutputKey(outputKey: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.outputKeys.add(outputKey) + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): ExampleUploadCreateParams = - ExampleUploadCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(datasetId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`datasetId` is required but was not set" - }, - checkNotNull(file) { // templates/JavaSDK/entities/params.ts:844:13 - "`file` is required but was not set" - }, - checkNotNull(inputKeys) { // templates/JavaSDK/entities/params.ts:844:13 - "`inputKeys` is required but was not set" - } + ExampleUploadCreateParams( + checkNotNull(datasetId) { "`datasetId` is required but was not set" }, + checkNotNull(file) { "`file` is required but was not set" }, + checkNotNull(inputKeys) { "`inputKeys` is required but was not set" } .toUnmodifiable(), if (outputKeys.size == 0) null else outputKeys.toUnmodifiable(), additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Feedback.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Feedback.kt index 0ce9fcdd..725796f1 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Feedback.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Feedback.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.core.JsonGenerator @@ -29,16 +27,11 @@ import java.util.Objects import java.util.Optional /** Schema for getting feedback. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = Feedback.Builder::class) @NoAutoDetect class Feedback -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val createdAt: JsonField, private val modifiedAt: JsonField, private val runId: JsonField, private val key: JsonField, @@ -51,8 +44,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -78,58 +70,34 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun feedbackSource(): Optional = Optional.ofNullable(feedbackSource.getNullable("feedback_source")) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runId() = runId + @JsonProperty("run_id") @ExcludeMissing fun _runId() = runId - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _key() = key + @JsonProperty("key") @ExcludeMissing fun _key() = key - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _score() = score + @JsonProperty("score") @ExcludeMissing fun _score() = score - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _value() = value + @JsonProperty("value") @ExcludeMissing fun _value() = value - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _comment() = comment + @JsonProperty("comment") @ExcludeMissing fun _comment() = comment - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _correction() = correction + @JsonProperty("correction") @ExcludeMissing fun _correction() = correction - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id /** The feedback source loaded from the database. */ - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackSource() = feedbackSource + @JsonProperty("feedback_source") @ExcludeMissing fun _feedbackSource() = feedbackSource - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Feedback = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Feedback = apply { + if (!validated) { + createdAt() modifiedAt() runId() key() @@ -144,12 +112,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Feedback && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Feedback && this.createdAt == other.createdAt && this.modifiedAt == other.modifiedAt && this.runId == other.runId && @@ -163,15 +131,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, modifiedAt, runId, key, @@ -190,21 +154,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Feedback{createdAt=$createdAt, modifiedAt=$modifiedAt, runId=$runId, key=$key, score=$score, value=$value, comment=$comment, correction=$correction, id=$id, feedbackSource=$feedbackSource, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var modifiedAt: JsonField = JsonMissing.of() private var runId: JsonField = JsonMissing.of() private var key: JsonField = JsonMissing.of() @@ -216,141 +173,101 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var feedbackSource: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedback: Feedback) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - feedback.createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.modifiedAt = feedback.modifiedAt - this.runId = feedback.runId - this.key = feedback.key - this.score = feedback.score - this.value = feedback.value - this.comment = feedback.comment - this.correction = feedback.correction - this.id = feedback.id - this.feedbackSource = feedback.feedbackSource - additionalProperties(feedback.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } - - fun runId(runId: String) = - runId(JsonField.of(runId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun runId(runId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runId = runId - } - - fun key(key: String) = - key(JsonField.of(key)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun key(key: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.key = key + @JvmSynthetic + internal fun from(feedback: Feedback) = apply { + this.createdAt = feedback.createdAt + this.modifiedAt = feedback.modifiedAt + this.runId = feedback.runId + this.key = feedback.key + this.score = feedback.score + this.value = feedback.value + this.comment = feedback.comment + this.correction = feedback.correction + this.id = feedback.id + this.feedbackSource = feedback.feedbackSource + additionalProperties(feedback.additionalProperties) } - fun score(score: Score) = - score(JsonField.of(score)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun score(score: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.score = score + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) + + @JsonProperty("modified_at") + @ExcludeMissing + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt } - fun value(value: Value) = - value(JsonField.of(value)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runId(runId: String) = runId(JsonField.of(runId)) - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_id") @ExcludeMissing - fun value(value: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value - } + fun runId(runId: JsonField) = apply { this.runId = runId } - fun comment(comment: String) = - comment(JsonField.of(comment)) // templates/JavaSDK/entities/objects.ts:252:20 + fun key(key: String) = key(JsonField.of(key)) - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("key") @ExcludeMissing - fun comment(comment: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.comment = comment - } + fun key(key: JsonField) = apply { this.key = key } - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun score(score: Score) = score(JsonField.of(score)) + + @JsonProperty("score") @ExcludeMissing - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.correction = correction - } + fun score(score: JsonField) = apply { this.score = score } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun value(value: Value) = value(JsonField.of(value)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("value") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id - } + fun value(value: JsonField) = apply { this.value = value } + + fun comment(comment: String) = comment(JsonField.of(comment)) + + @JsonProperty("comment") + @ExcludeMissing + fun comment(comment: JsonField) = apply { this.comment = comment } + + @JsonProperty("correction") + @ExcludeMissing + fun correction(correction: JsonValue) = apply { this.correction = correction } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } /** The feedback source loaded from the database. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun feedbackSource(feedbackSource: FeedbackSource) = feedbackSource(JsonField.of(feedbackSource)) /** The feedback source loaded from the database. */ - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_source") @ExcludeMissing - fun feedbackSource(feedbackSource: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackSource = feedbackSource - } + fun feedbackSource(feedbackSource: JsonField) = apply { + this.feedbackSource = feedbackSource + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Feedback = - Feedback( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + Feedback( + createdAt, modifiedAt, runId, key, @@ -365,22 +282,17 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } /** The feedback source loaded from the database. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = FeedbackSource.Builder::class) @NoAutoDetect class FeedbackSource - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: JsonField, private val metadata: JsonValue, private val userId: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -388,29 +300,19 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun userId(): Optional = Optional.ofNullable(userId.getNullable("user_id")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonProperty("user_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _userId() = userId + @JsonProperty("user_id") @ExcludeMissing fun _userId() = userId - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackSource = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): FeedbackSource = apply { + if (!validated) { + type() userId() validated = true } @@ -418,27 +320,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackSource && this.type == other.type && this.metadata == other.metadata && this.userId == other.userId && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, userId, additionalProperties, @@ -450,86 +348,59 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackSource{type=$type, metadata=$metadata, userId=$userId, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var userId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackSource: FeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackSource.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = feedbackSource.metadata - this.userId = feedbackSource.userId - additionalProperties(feedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackSource: FeedbackSource) = apply { + this.type = feedbackSource.type + this.metadata = feedbackSource.metadata + this.userId = feedbackSource.userId + additionalProperties(feedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun userId(userId: String) = - userId(JsonField.of(userId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun userId(userId: String) = userId(JsonField.of(userId)) - @JsonProperty("user_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("user_id") @ExcludeMissing - fun userId(userId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.userId = userId - } + fun userId(userId: JsonField) = apply { this.userId = userId } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackSource = - FeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + FeedbackSource( + type, metadata, userId, additionalProperties.toUnmodifiable(), @@ -537,11 +408,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - @JsonDeserialize( - using = Score.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Score.Deserializer::class) @JsonSerialize(using = Score.Serializer::class) class Score private constructor( @@ -550,145 +417,102 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) else -> visitor.unknown(_json) } } - fun validate(): Score = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Score = apply { + if (!validated) { + if (double == null && boolean == null) { throw LangSmithInvalidDataException("Unknown Score: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Score && // templates/JavaSDK/entities/fields.ts:143:33 - this.double == other.double && - this.boolean == other.boolean + return other is Score && this.double == other.double && this.boolean == other.boolean } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(double, boolean) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Score{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Score{double=$double}" boolean != null -> "Score{boolean=$boolean}" _json != null -> "Score{_unknown=$_json}" else -> throw IllegalStateException("Invalid Score") } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Score(double = double) + @JvmStatic fun ofDouble(double: Double) = Score(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Score: $json") } } - class Deserializer : - BaseDeserializer( - Score::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Score::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Score { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(boolean = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Score { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(boolean = it, _json = json) + } return Score(_json = json) } } - class Serializer : - BaseSerializer(Score::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Score::class) { override fun serialize( value: Score, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Score") @@ -697,27 +521,20 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - @JsonDeserialize( - using = Value.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Value.Deserializer::class) @JsonSerialize(using = Value.Serializer::class) class Value - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val double: Double? = null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val double: Double? = null, private val boolean: Boolean? = null, private val string: String? = null, private val jsonValue: JsonValue? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) @@ -725,8 +542,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun jsonValue(): Optional = Optional.ofNullable(jsonValue) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null @@ -734,9 +550,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun isJsonValue(): Boolean = jsonValue != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") @@ -746,11 +560,9 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) string != null -> visitor.visitString(string) jsonValue != null -> visitor.visitJsonValue(jsonValue) @@ -758,48 +570,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - fun validate(): Value = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null && string == null && jsonValue == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Value = apply { + if (!validated) { + if (double == null && boolean == null && string == null && jsonValue == null) { throw LangSmithInvalidDataException("Unknown Value: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Value && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Value && this.double == other.double && this.boolean == other.boolean && this.string == other.string && this.jsonValue == other.jsonValue } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - double, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + double, boolean, string, jsonValue, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Value{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Value{double=$double}" boolean != null -> "Value{boolean=$boolean}" string != null -> "Value{string=$string}" jsonValue != null -> "Value{jsonValue=$jsonValue}" @@ -808,27 +611,20 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Value(double = double) + @JvmStatic fun ofDouble(double: Double) = Value(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofString(string: String) = Value(string = string) + @JvmStatic fun ofString(string: String) = Value(string = string) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) + @JvmStatic fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T @@ -836,64 +632,41 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun visitJsonValue(jsonValue: JsonValue): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Value: $json") } } - class Deserializer : - BaseDeserializer( - Value::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Value::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Value { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(jsonValue = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(boolean = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(string = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(jsonValue = it, _json = json) + } return Value(_json = json) } } - class Serializer : - BaseSerializer(Value::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Value::class) { override fun serialize( value: Value, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value.string != null -> generator.writeObject(value.string) value.jsonValue != null -> generator.writeObject(value.jsonValue) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigCreateParams.kt index ec2acf7b..a6ba30f0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -19,46 +17,32 @@ import com.langsmith.api.models.* import java.util.Objects class FeedbackConfigCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val feedbackConfig: FeedbackConfig, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val feedbackConfig: FeedbackConfig, private val feedbackKey: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun feedbackConfig(): FeedbackConfig = - feedbackConfig // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun feedbackConfig(): FeedbackConfig = feedbackConfig fun feedbackKey(): String = feedbackKey - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - FeedbackConfigCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return FeedbackConfigCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - feedbackConfig, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): FeedbackConfigCreateBody { + return FeedbackConfigCreateBody( + feedbackConfig, feedbackKey, additionalBodyProperties, ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - @JsonDeserialize( - builder = FeedbackConfigCreateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackConfigCreateBody.Builder::class) @NoAutoDetect class FeedbackConfigCreateBody internal constructor( @@ -67,43 +51,34 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackConfig(): FeedbackConfig? = feedbackConfig + @JsonProperty("feedback_config") fun feedbackConfig(): FeedbackConfig? = feedbackConfig - @JsonProperty("feedback_key") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackKey(): String? = feedbackKey + @JsonProperty("feedback_key") fun feedbackKey(): String? = feedbackKey - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - FeedbackConfigCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfigCreateBody && this.feedbackConfig == other.feedbackConfig && this.feedbackKey == other.feedbackKey && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - feedbackConfig, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + feedbackConfig, feedbackKey, additionalProperties, ) @@ -114,79 +89,50 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackConfigCreateBody{feedbackConfig=$feedbackConfig, feedbackKey=$feedbackKey, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var feedbackConfig: FeedbackConfig? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var feedbackConfig: FeedbackConfig? = null private var feedbackKey: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfigCreateBody: FeedbackConfigCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.feedbackConfig = - feedbackConfigCreateBody - .feedbackConfig // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.feedbackKey = feedbackConfigCreateBody.feedbackKey - additionalProperties(feedbackConfigCreateBody.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfigCreateBody: FeedbackConfigCreateBody) = apply { + this.feedbackConfig = feedbackConfigCreateBody.feedbackConfig + this.feedbackKey = feedbackConfigCreateBody.feedbackKey + additionalProperties(feedbackConfigCreateBody.additionalProperties) + } - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackConfig = feedbackConfig - } + @JsonProperty("feedback_config") + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig + } - @JsonProperty("feedback_key") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackKey(feedbackKey: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackKey = feedbackKey - } + @JsonProperty("feedback_key") + fun feedbackKey(feedbackKey: String) = apply { this.feedbackKey = feedbackKey } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackConfigCreateBody = - FeedbackConfigCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull( - feedbackConfig - ) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`feedbackConfig` is required but was not set" - }, - checkNotNull(feedbackKey) { // templates/JavaSDK/entities/objects.ts:358:13 - "`feedbackKey` is required but was not set" - }, + FeedbackConfigCreateBody( + checkNotNull(feedbackConfig) { "`feedbackConfig` is required but was not set" }, + checkNotNull(feedbackKey) { "`feedbackKey` is required but was not set" }, additionalProperties.toUnmodifiable(), ) } @@ -198,12 +144,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfigCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfigCreateParams && this.feedbackConfig == other.feedbackConfig && this.feedbackKey == other.feedbackKey && this.additionalQueryParams == other.additionalQueryParams && @@ -211,10 +157,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - feedbackConfig, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + feedbackConfig, feedbackKey, additionalQueryParams, additionalHeaders, @@ -227,179 +172,133 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var feedbackConfig: FeedbackConfig? = - null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var feedbackConfig: FeedbackConfig? = null private var feedbackKey: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackConfigCreateParams: FeedbackConfigCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.feedbackConfig = - feedbackConfigCreateParams - .feedbackConfig // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.feedbackKey = feedbackConfigCreateParams.feedbackKey - additionalQueryParams(feedbackConfigCreateParams.additionalQueryParams) - additionalHeaders(feedbackConfigCreateParams.additionalHeaders) - additionalBodyProperties(feedbackConfigCreateParams.additionalBodyProperties) - } + @JvmSynthetic + internal fun from(feedbackConfigCreateParams: FeedbackConfigCreateParams) = apply { + this.feedbackConfig = feedbackConfigCreateParams.feedbackConfig + this.feedbackKey = feedbackConfigCreateParams.feedbackKey + additionalQueryParams(feedbackConfigCreateParams.additionalQueryParams) + additionalHeaders(feedbackConfigCreateParams.additionalHeaders) + additionalBodyProperties(feedbackConfigCreateParams.additionalBodyProperties) + } - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackConfig = feedbackConfig - } + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig + } - fun feedbackKey(feedbackKey: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackKey = feedbackKey - } + fun feedbackKey(feedbackKey: String) = apply { this.feedbackKey = feedbackKey } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): FeedbackConfigCreateParams = - FeedbackConfigCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(feedbackConfig) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`feedbackConfig` is required but was not set" - }, - checkNotNull(feedbackKey) { // templates/JavaSDK/entities/params.ts:844:13 - "`feedbackKey` is required but was not set" - }, + FeedbackConfigCreateParams( + checkNotNull(feedbackConfig) { "`feedbackConfig` is required but was not set" }, + checkNotNull(feedbackKey) { "`feedbackKey` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), ) } - @JsonDeserialize( - builder = FeedbackConfig.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackConfig.Builder::class) @NoAutoDetect class FeedbackConfig - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: Type?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: Type?, private val min: Double?, private val max: Double?, - private val categories: List?, + private val categories: List?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 /** Enum for feedback types. */ - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:113:14 - fun type(): Type? = type + @JsonProperty("type") fun type(): Type? = type - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:113:14 - fun min(): Double? = min + @JsonProperty("min") fun min(): Double? = min - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:113:14 - fun max(): Double? = max + @JsonProperty("max") fun max(): Double? = max - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:113:14 - fun categories(): List? = categories + @JsonProperty("categories") fun categories(): List? = categories - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfig && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfig && this.type == other.type && this.min == other.min && this.max == other.max && @@ -407,15 +306,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, min, max, categories, @@ -428,88 +323,55 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackConfig{type=$type, min=$min, max=$max, categories=$categories, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: Type? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: Type? = null private var min: Double? = null private var max: Double? = null - private var categories: List? = null + private var categories: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackConfig.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.min = feedbackConfig.min - this.max = feedbackConfig.max - this.categories = feedbackConfig.categories - additionalProperties(feedbackConfig.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfig: FeedbackConfig) = apply { + this.type = feedbackConfig.type + this.min = feedbackConfig.min + this.max = feedbackConfig.max + this.categories = feedbackConfig.categories + additionalProperties(feedbackConfig.additionalProperties) + } /** Enum for feedback types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 - fun type(type: Type) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type + @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + + @JsonProperty("min") fun min(min: Double) = apply { this.min = min } + + @JsonProperty("max") fun max(max: Double) = apply { this.max = max } + + @JsonProperty("categories") + fun categories(categories: List) = apply { this.categories = categories } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun min(min: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.min = min + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun max(max: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.max = max + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun categories(categories: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.categories = categories - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } - fun build(): FeedbackConfig = - FeedbackConfig( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(type) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`type` is required but was not set" - }, + FeedbackConfig( + checkNotNull(type) { "`type` is required but was not set" }, min, max, categories?.toUnmodifiable(), @@ -521,35 +383,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 - // // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Type && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Type && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val CONTINUOUS = - Type(JsonField.of("continuous")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val CONTINUOUS = Type(JsonField.of("continuous")) @JvmField val CATEGORICAL = Type(JsonField.of("categorical")) @@ -558,34 +410,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + CONTINUOUS, CATEGORICAL, FREEFORM, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + CONTINUOUS, CATEGORICAL, FREEFORM, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - CONTINUOUS -> Value.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Value.CONTINUOUS CATEGORICAL -> Value.CATEGORICAL FREEFORM -> Value.FREEFORM else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - CONTINUOUS -> Known.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Known.CONTINUOUS CATEGORICAL -> Known.CATEGORICAL FREEFORM -> Known.FREEFORM else -> throw LangSmithInvalidDataException("Unknown Type: $value") @@ -595,58 +443,43 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Specific value and label pair for feedback */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - @JsonDeserialize(builder = FeedbackCategory.Builder::class) + @JsonDeserialize(builder = Category.Builder::class) @NoAutoDetect - class FeedbackCategory + class Category private constructor( private val value: Double?, private val label: String?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Double? = value + @JsonProperty("value") fun value(): Double? = value - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:113:14 - fun label(): String? = label + @JsonProperty("label") fun label(): String? = label - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCategory && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Category && this.value == other.value && this.label == other.label && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - value, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + value, label, additionalProperties, ) @@ -655,73 +488,48 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } override fun toString() = - "FeedbackCategory{value=$value, label=$label, additionalProperties=$additionalProperties}" + "Category{value=$value, label=$label, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var value: Double? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var value: Double? = null private var label: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackCategory: FeedbackCategory) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.value = - feedbackCategory - .value // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.label = feedbackCategory.label - additionalProperties(feedbackCategory.additionalProperties) - } - - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + @JvmSynthetic + internal fun from(category: Category) = apply { + this.value = category.value + this.label = category.label + additionalProperties(category.additionalProperties) } - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun label(label: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.label = label + @JsonProperty("value") fun value(value: Double) = apply { this.value = value } + + @JsonProperty("label") fun label(label: String) = apply { this.label = label } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } - fun build(): FeedbackCategory = - FeedbackCategory( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(value) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`value` is required but was not set" - }, + fun build(): Category = + Category( + checkNotNull(value) { "`value` is required but was not set" }, label, additionalProperties.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigListParams.kt index 81b28279..2640ac0f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class FeedbackConfigListParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfigListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfigListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackConfigListParams: FeedbackConfigListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - feedbackConfigListParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(feedbackConfigListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(feedbackConfigListParams: FeedbackConfigListParams) = apply { + additionalQueryParams(feedbackConfigListParams.additionalQueryParams) + additionalHeaders(feedbackConfigListParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): FeedbackConfigListParams = FeedbackConfigListParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigSchema.kt index a189e2fe..8a3aaf90 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackConfigSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -20,24 +18,18 @@ import java.time.OffsetDateTime import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = FeedbackConfigSchema.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = FeedbackConfigSchema.Builder::class) @NoAutoDetect class FeedbackConfigSchema -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val feedbackKey: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val feedbackKey: JsonField, private val feedbackConfig: JsonField, private val tenantId: JsonField, private val modifiedAt: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -49,33 +41,21 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun modifiedAt(): OffsetDateTime = modifiedAt.getRequired("modified_at") - @JsonProperty("feedback_key") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackKey() = feedbackKey + @JsonProperty("feedback_key") @ExcludeMissing fun _feedbackKey() = feedbackKey - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackConfig() = feedbackConfig + @JsonProperty("feedback_config") @ExcludeMissing fun _feedbackConfig() = feedbackConfig - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackConfigSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - feedbackKey() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): FeedbackConfigSchema = apply { + if (!validated) { + feedbackKey() feedbackConfig().validate() tenantId() modifiedAt() @@ -85,12 +65,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfigSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfigSchema && this.feedbackKey == other.feedbackKey && this.feedbackConfig == other.feedbackConfig && this.tenantId == other.tenantId && @@ -98,15 +78,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - feedbackKey, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + feedbackKey, feedbackConfig, tenantId, modifiedAt, @@ -119,102 +95,74 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackConfigSchema{feedbackKey=$feedbackKey, feedbackConfig=$feedbackConfig, tenantId=$tenantId, modifiedAt=$modifiedAt, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var feedbackKey: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var feedbackKey: JsonField = JsonMissing.of() private var feedbackConfig: JsonField = JsonMissing.of() private var tenantId: JsonField = JsonMissing.of() private var modifiedAt: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfigSchema: FeedbackConfigSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.feedbackKey = - feedbackConfigSchema - .feedbackKey // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.feedbackConfig = feedbackConfigSchema.feedbackConfig - this.tenantId = feedbackConfigSchema.tenantId - this.modifiedAt = feedbackConfigSchema.modifiedAt - additionalProperties(feedbackConfigSchema.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfigSchema: FeedbackConfigSchema) = apply { + this.feedbackKey = feedbackConfigSchema.feedbackKey + this.feedbackConfig = feedbackConfigSchema.feedbackConfig + this.tenantId = feedbackConfigSchema.tenantId + this.modifiedAt = feedbackConfigSchema.modifiedAt + additionalProperties(feedbackConfigSchema.additionalProperties) + } - fun feedbackKey(feedbackKey: String) = - feedbackKey(JsonField.of(feedbackKey)) // templates/JavaSDK/entities/objects.ts:252:20 + fun feedbackKey(feedbackKey: String) = feedbackKey(JsonField.of(feedbackKey)) - @JsonProperty("feedback_key") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_key") @ExcludeMissing - fun feedbackKey(feedbackKey: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackKey = feedbackKey - } + fun feedbackKey(feedbackKey: JsonField) = apply { this.feedbackKey = feedbackKey } fun feedbackConfig(feedbackConfig: FeedbackConfig) = - feedbackConfig( - JsonField.of(feedbackConfig) - ) // templates/JavaSDK/entities/objects.ts:252:20 + feedbackConfig(JsonField.of(feedbackConfig)) - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_config") @ExcludeMissing - fun feedbackConfig(feedbackConfig: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackConfig = feedbackConfig - } + fun feedbackConfig(feedbackConfig: JsonField) = apply { + this.feedbackConfig = feedbackConfig + } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_id") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("modified_at") @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackConfigSchema = - FeedbackConfigSchema( // templates/JavaSDK/entities/objects.ts:326:30 - feedbackKey, // templates/JavaSDK/entities/objects.ts:326:30 + FeedbackConfigSchema( + feedbackKey, feedbackConfig, tenantId, modifiedAt, @@ -222,24 +170,18 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 ) } - @JsonDeserialize( - builder = FeedbackConfig.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackConfig.Builder::class) @NoAutoDetect class FeedbackConfig - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: JsonField, private val min: JsonField, private val max: JsonField, - private val categories: JsonField>, + private val categories: JsonField>, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -250,37 +192,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun max(): Optional = Optional.ofNullable(max.getNullable("max")) - fun categories(): Optional> = + fun categories(): Optional> = Optional.ofNullable(categories.getNullable("categories")) /** Enum for feedback types. */ - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _min() = min + @JsonProperty("min") @ExcludeMissing fun _min() = min - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _max() = max + @JsonProperty("max") @ExcludeMissing fun _max() = max - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _categories() = categories + @JsonProperty("categories") @ExcludeMissing fun _categories() = categories - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackConfig = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): FeedbackConfig = apply { + if (!validated) { + type() min() max() categories().map { it.forEach { it.validate() } } @@ -290,12 +220,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfig && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfig && this.type == other.type && this.min == other.min && this.max == other.max && @@ -303,15 +233,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, min, max, categories, @@ -324,102 +250,73 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackConfig{type=$type, min=$min, max=$max, categories=$categories, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var min: JsonField = JsonMissing.of() private var max: JsonField = JsonMissing.of() - private var categories: JsonField> = JsonMissing.of() + private var categories: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackConfig.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.min = feedbackConfig.min - this.max = feedbackConfig.max - this.categories = feedbackConfig.categories - additionalProperties(feedbackConfig.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfig: FeedbackConfig) = apply { + this.type = feedbackConfig.type + this.min = feedbackConfig.min + this.max = feedbackConfig.max + this.categories = feedbackConfig.categories + additionalProperties(feedbackConfig.additionalProperties) + } /** Enum for feedback types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun type(type: Type) = type(JsonField.of(type)) /** Enum for feedback types. */ - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - fun min(min: Double) = - min(JsonField.of(min)) // templates/JavaSDK/entities/objects.ts:252:20 + fun min(min: Double) = min(JsonField.of(min)) - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("min") @ExcludeMissing - fun min(min: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.min = min - } + fun min(min: JsonField) = apply { this.min = min } - fun max(max: Double) = - max(JsonField.of(max)) // templates/JavaSDK/entities/objects.ts:252:20 + fun max(max: Double) = max(JsonField.of(max)) - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max") @ExcludeMissing - fun max(max: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.max = max - } + fun max(max: JsonField) = apply { this.max = max } - fun categories(categories: List) = - categories(JsonField.of(categories)) // templates/JavaSDK/entities/objects.ts:252:20 + fun categories(categories: List) = categories(JsonField.of(categories)) - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("categories") @ExcludeMissing - fun categories(categories: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.categories = categories - } + fun categories(categories: JsonField>) = apply { + this.categories = categories + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackConfig = - FeedbackConfig( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + FeedbackConfig( + type, min, max, categories.map { it.toUnmodifiable() }, @@ -431,35 +328,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 - // // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Type && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Type && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val CONTINUOUS = - Type(JsonField.of("continuous")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val CONTINUOUS = Type(JsonField.of("continuous")) @JvmField val CATEGORICAL = Type(JsonField.of("categorical")) @@ -468,34 +355,30 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + CONTINUOUS, CATEGORICAL, FREEFORM, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + CONTINUOUS, CATEGORICAL, FREEFORM, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - CONTINUOUS -> Value.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Value.CONTINUOUS CATEGORICAL -> Value.CATEGORICAL FREEFORM -> Value.FREEFORM else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - CONTINUOUS -> Known.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Known.CONTINUOUS CATEGORICAL -> Known.CATEGORICAL FREEFORM -> Known.FREEFORM else -> throw LangSmithInvalidDataException("Unknown Type: $value") @@ -505,22 +388,16 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } /** Specific value and label pair for feedback */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - @JsonDeserialize(builder = FeedbackCategory.Builder::class) + @JsonDeserialize(builder = Category.Builder::class) @NoAutoDetect - class FeedbackCategory + class Category private constructor( private val value: JsonField, private val label: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -528,55 +405,40 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun label(): Optional = Optional.ofNullable(label.getNullable("label")) - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _value() = value + @JsonProperty("value") @ExcludeMissing fun _value() = value - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _label() = label + @JsonProperty("label") @ExcludeMissing fun _label() = label - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackCategory = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - value() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - label() - validated = true - } + fun validate(): Category = apply { + if (!validated) { + value() + label() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCategory && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Category && this.value == other.value && this.label == other.label && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - value, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + value, label, additionalProperties, ) @@ -585,79 +447,56 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } override fun toString() = - "FeedbackCategory{value=$value, label=$label, additionalProperties=$additionalProperties}" + "Category{value=$value, label=$label, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var value: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var value: JsonField = JsonMissing.of() private var label: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackCategory: FeedbackCategory) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.value = - feedbackCategory - .value // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.label = feedbackCategory.label - additionalProperties(feedbackCategory.additionalProperties) - } + @JvmSynthetic + internal fun from(category: Category) = apply { + this.value = category.value + this.label = category.label + additionalProperties(category.additionalProperties) + } - fun value(value: Double) = - value(JsonField.of(value)) // templates/JavaSDK/entities/objects.ts:252:20 + fun value(value: Double) = value(JsonField.of(value)) - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("value") @ExcludeMissing - fun value(value: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value - } + fun value(value: JsonField) = apply { this.value = value } - fun label(label: String) = - label(JsonField.of(label)) // templates/JavaSDK/entities/objects.ts:252:20 + fun label(label: String) = label(JsonField.of(label)) - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("label") @ExcludeMissing - fun label(label: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.label = label - } + fun label(label: JsonField) = apply { this.label = label } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } - fun build(): FeedbackCategory = - FeedbackCategory( // templates/JavaSDK/entities/objects.ts:326:30 - value, // templates/JavaSDK/entities/objects.ts:326:30 + fun build(): Category = + Category( + value, label, additionalProperties.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackCreateParams.kt index f89c82a7..32ac421d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -31,12 +29,8 @@ import java.util.Objects import java.util.Optional class FeedbackCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val key: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val key: String, private val runId: String, private val id: String?, private val comment: String?, @@ -52,8 +46,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun key(): String = key // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun key(): String = key fun runId(): String = runId @@ -75,11 +68,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun value(): Optional = Optional.ofNullable(value) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): FeedbackCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return FeedbackCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - key, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): FeedbackCreateBody { + return FeedbackCreateBody( + key, runId, id, comment, @@ -94,22 +86,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Schema used for creating feedback. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = FeedbackCreateBody.Builder::class) @NoAutoDetect class FeedbackCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val key: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val key: String?, private val runId: String?, private val id: String?, private val comment: String?, @@ -123,55 +109,42 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:113:14 - fun key(): String? = key + @JsonProperty("key") fun key(): String? = key - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun runId(): String? = runId + @JsonProperty("run_id") fun runId(): String? = runId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:113:14 - fun comment(): String? = comment + @JsonProperty("comment") fun comment(): String? = comment - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:113:14 - fun correction(): JsonValue? = correction + @JsonProperty("correction") fun correction(): JsonValue? = correction - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackConfig(): FeedbackConfig? = feedbackConfig + @JsonProperty("feedback_config") fun feedbackConfig(): FeedbackConfig? = feedbackConfig - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackSource(): FeedbackSource? = feedbackSource + @JsonProperty("feedback_source") fun feedbackSource(): FeedbackSource? = feedbackSource - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun modifiedAt(): OffsetDateTime? = modifiedAt + @JsonProperty("modified_at") fun modifiedAt(): OffsetDateTime? = modifiedAt - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:113:14 - fun score(): Score? = score + @JsonProperty("score") fun score(): Score? = score - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Value? = value + @JsonProperty("value") fun value(): Value? = value - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackCreateBody && this.key == other.key && this.runId == other.runId && this.id == other.id && @@ -186,15 +159,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - key, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + key, runId, id, comment, @@ -214,20 +183,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackCreateBody{key=$key, runId=$runId, id=$id, comment=$comment, correction=$correction, createdAt=$createdAt, feedbackConfig=$feedbackConfig, feedbackSource=$feedbackSource, modifiedAt=$modifiedAt, score=$score, value=$value, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var key: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var key: String? = null private var runId: String? = null private var id: String? = null private var comment: String? = null @@ -240,124 +203,71 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var value: Value? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackCreateBody: FeedbackCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.key = - feedbackCreateBody.key // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.runId = feedbackCreateBody.runId - this.id = feedbackCreateBody.id - this.comment = feedbackCreateBody.comment - this.correction = feedbackCreateBody.correction - this.createdAt = feedbackCreateBody.createdAt - this.feedbackConfig = feedbackCreateBody.feedbackConfig - this.feedbackSource = feedbackCreateBody.feedbackSource - this.modifiedAt = feedbackCreateBody.modifiedAt - this.score = feedbackCreateBody.score - this.value = feedbackCreateBody.value - additionalProperties(feedbackCreateBody.additionalProperties) - } - - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun key(key: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.key = key + @JvmSynthetic + internal fun from(feedbackCreateBody: FeedbackCreateBody) = apply { + this.key = feedbackCreateBody.key + this.runId = feedbackCreateBody.runId + this.id = feedbackCreateBody.id + this.comment = feedbackCreateBody.comment + this.correction = feedbackCreateBody.correction + this.createdAt = feedbackCreateBody.createdAt + this.feedbackConfig = feedbackCreateBody.feedbackConfig + this.feedbackSource = feedbackCreateBody.feedbackSource + this.modifiedAt = feedbackCreateBody.modifiedAt + this.score = feedbackCreateBody.score + this.value = feedbackCreateBody.value + additionalProperties(feedbackCreateBody.additionalProperties) } - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun runId(runId: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runId = runId + @JsonProperty("key") fun key(key: String) = apply { this.key = key } + + @JsonProperty("run_id") fun runId(runId: String) = apply { this.runId = runId } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("comment") fun comment(comment: String) = apply { this.comment = comment } + + @JsonProperty("correction") + fun correction(correction: JsonValue) = apply { this.correction = correction } + + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + @JsonProperty("feedback_config") + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JsonProperty("feedback_source") + fun feedbackSource(feedbackSource: FeedbackSource) = apply { + this.feedbackSource = feedbackSource } - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun comment(comment: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.comment = comment + @JsonProperty("modified_at") + fun modifiedAt(modifiedAt: OffsetDateTime) = apply { this.modifiedAt = modifiedAt } + + @JsonProperty("score") fun score(score: Score) = apply { this.score = score } + + @JsonProperty("value") fun value(value: Value) = apply { this.value = value } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.correction = correction - } - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackConfig = feedbackConfig - } - - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackSource(feedbackSource: FeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackSource = feedbackSource - } - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun modifiedAt(modifiedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } - - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun score(score: Score) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.score = score + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Value) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } - fun build(): FeedbackCreateBody = - FeedbackCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(key) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`key` is required but was not set" - }, - checkNotNull(runId) { // templates/JavaSDK/entities/objects.ts:358:13 - "`runId` is required but was not set" - }, + FeedbackCreateBody( + checkNotNull(key) { "`key` is required but was not set" }, + checkNotNull(runId) { "`runId` is required but was not set" }, id, comment, correction, @@ -378,12 +288,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackCreateParams && this.key == other.key && this.runId == other.runId && this.id == other.id && @@ -400,10 +310,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - key, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + key, runId, id, comment, @@ -425,20 +334,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var key: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var key: String? = null private var runId: String? = null private var id: String? = null private var comment: String? = null @@ -453,198 +357,136 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackCreateParams: FeedbackCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.key = - feedbackCreateParams.key // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.runId = feedbackCreateParams.runId - this.id = feedbackCreateParams.id - this.comment = feedbackCreateParams.comment - this.correction = feedbackCreateParams.correction - this.createdAt = feedbackCreateParams.createdAt - this.feedbackConfig = feedbackCreateParams.feedbackConfig - this.feedbackSource = feedbackCreateParams.feedbackSource - this.modifiedAt = feedbackCreateParams.modifiedAt - this.score = feedbackCreateParams.score - this.value = feedbackCreateParams.value - additionalQueryParams(feedbackCreateParams.additionalQueryParams) - additionalHeaders(feedbackCreateParams.additionalHeaders) - additionalBodyProperties(feedbackCreateParams.additionalBodyProperties) - } - - fun key(key: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.key = key + @JvmSynthetic + internal fun from(feedbackCreateParams: FeedbackCreateParams) = apply { + this.key = feedbackCreateParams.key + this.runId = feedbackCreateParams.runId + this.id = feedbackCreateParams.id + this.comment = feedbackCreateParams.comment + this.correction = feedbackCreateParams.correction + this.createdAt = feedbackCreateParams.createdAt + this.feedbackConfig = feedbackCreateParams.feedbackConfig + this.feedbackSource = feedbackCreateParams.feedbackSource + this.modifiedAt = feedbackCreateParams.modifiedAt + this.score = feedbackCreateParams.score + this.value = feedbackCreateParams.value + additionalQueryParams(feedbackCreateParams.additionalQueryParams) + additionalHeaders(feedbackCreateParams.additionalHeaders) + additionalBodyProperties(feedbackCreateParams.additionalBodyProperties) } - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + fun key(key: String) = apply { this.key = key } + + fun runId(runId: String) = apply { this.runId = runId } + + fun id(id: String) = apply { this.id = id } + + fun comment(comment: String) = apply { this.comment = comment } + + fun correction(correction: JsonValue) = apply { this.correction = correction } + + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig } - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id - } - - fun comment(comment: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.comment = comment - } - - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.correction = correction - } - - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.createdAt = createdAt - } - - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackConfig = feedbackConfig - } - /** Feedback from the LangChainPlus App. */ - fun feedbackSource(feedbackSource: FeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackSource = feedbackSource - } + fun feedbackSource(feedbackSource: FeedbackSource) = apply { + this.feedbackSource = feedbackSource + } /** Feedback from the LangChainPlus App. */ - fun feedbackSource(appFeedbackSource: FeedbackSource.AppFeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:659:30 - this.feedbackSource = FeedbackSource.ofAppFeedbackSource(appFeedbackSource) - } + fun feedbackSource(appFeedbackSource: AppFeedbackSource) = apply { + this.feedbackSource = FeedbackSource.ofAppFeedbackSource(appFeedbackSource) + } /** Feedback from the LangChainPlus App. */ - fun feedbackSource(apiFeedbackSource: FeedbackSource.ApiFeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:659:30 - this.feedbackSource = FeedbackSource.ofApiFeedbackSource(apiFeedbackSource) - } + fun feedbackSource(apiFeedbackSource: ApiFeedbackSource) = apply { + this.feedbackSource = FeedbackSource.ofApiFeedbackSource(apiFeedbackSource) + } /** Feedback from the LangChainPlus App. */ - fun feedbackSource(modelFeedbackSource: FeedbackSource.ModelFeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:659:30 - this.feedbackSource = FeedbackSource.ofModelFeedbackSource(modelFeedbackSource) - } - - fun modifiedAt(modifiedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.modifiedAt = modifiedAt - } - - fun score(score: Score) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.score = score + fun feedbackSource(modelFeedbackSource: ModelFeedbackSource) = apply { + this.feedbackSource = FeedbackSource.ofModelFeedbackSource(modelFeedbackSource) } - fun score(double: Double) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.score = Score.ofDouble(double) + fun modifiedAt(modifiedAt: OffsetDateTime) = apply { this.modifiedAt = modifiedAt } + + fun score(score: Score) = apply { this.score = score } + + fun score(double: Double) = apply { this.score = Score.ofDouble(double) } + + fun score(boolean: Boolean) = apply { this.score = Score.ofBoolean(boolean) } + + fun value(value: Value) = apply { this.value = value } + + fun value(double: Double) = apply { this.value = Value.ofDouble(double) } + + fun value(boolean: Boolean) = apply { this.value = Value.ofBoolean(boolean) } + + fun value(string: String) = apply { this.value = Value.ofString(string) } + + fun value(jsonValue: JsonValue) = apply { this.value = Value.ofJsonValue(jsonValue) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun score(boolean: Boolean) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.score = Score.ofBoolean(boolean) + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun value(value: Value) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.value = value + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun value(double: Double) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofDouble(double) + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) } - fun value(boolean: Boolean) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofBoolean(boolean) - } - - fun value(string: String) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofString(string) - } - - fun value(jsonValue: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofJsonValue(jsonValue) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): FeedbackCreateParams = - FeedbackCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(key) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`key` is required but was not set" - }, - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 - "`runId` is required but was not set" - }, + FeedbackCreateParams( + checkNotNull(key) { "`key` is required but was not set" }, + checkNotNull(runId) { "`runId` is required but was not set" }, id, comment, correction, @@ -660,51 +502,40 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JsonDeserialize( - builder = FeedbackConfig.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackConfig.Builder::class) @NoAutoDetect class FeedbackConfig - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: Type?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: Type?, private val min: Double?, private val max: Double?, - private val categories: List?, + private val categories: List?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 /** Enum for feedback types. */ - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:113:14 - fun type(): Type? = type + @JsonProperty("type") fun type(): Type? = type - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:113:14 - fun min(): Double? = min + @JsonProperty("min") fun min(): Double? = min - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:113:14 - fun max(): Double? = max + @JsonProperty("max") fun max(): Double? = max - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:113:14 - fun categories(): List? = categories + @JsonProperty("categories") fun categories(): List? = categories - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfig && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfig && this.type == other.type && this.min == other.min && this.max == other.max && @@ -712,15 +543,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, min, max, categories, @@ -733,88 +560,55 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackConfig{type=$type, min=$min, max=$max, categories=$categories, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: Type? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: Type? = null private var min: Double? = null private var max: Double? = null - private var categories: List? = null + private var categories: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackConfig.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.min = feedbackConfig.min - this.max = feedbackConfig.max - this.categories = feedbackConfig.categories - additionalProperties(feedbackConfig.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfig: FeedbackConfig) = apply { + this.type = feedbackConfig.type + this.min = feedbackConfig.min + this.max = feedbackConfig.max + this.categories = feedbackConfig.categories + additionalProperties(feedbackConfig.additionalProperties) + } /** Enum for feedback types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 - fun type(type: Type) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type + @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + + @JsonProperty("min") fun min(min: Double) = apply { this.min = min } + + @JsonProperty("max") fun max(max: Double) = apply { this.max = max } + + @JsonProperty("categories") + fun categories(categories: List) = apply { this.categories = categories } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun min(min: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.min = min + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun max(max: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.max = max + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun categories(categories: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.categories = categories - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } - fun build(): FeedbackConfig = - FeedbackConfig( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(type) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`type` is required but was not set" - }, + FeedbackConfig( + checkNotNull(type) { "`type` is required but was not set" }, min, max, categories?.toUnmodifiable(), @@ -826,35 +620,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 - // // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Type && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Type && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val CONTINUOUS = - Type(JsonField.of("continuous")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val CONTINUOUS = Type(JsonField.of("continuous")) @JvmField val CATEGORICAL = Type(JsonField.of("categorical")) @@ -863,34 +647,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + CONTINUOUS, CATEGORICAL, FREEFORM, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + CONTINUOUS, CATEGORICAL, FREEFORM, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - CONTINUOUS -> Value.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Value.CONTINUOUS CATEGORICAL -> Value.CATEGORICAL FREEFORM -> Value.FREEFORM else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - CONTINUOUS -> Known.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Known.CONTINUOUS CATEGORICAL -> Known.CATEGORICAL FREEFORM -> Known.FREEFORM else -> throw LangSmithInvalidDataException("Unknown Type: $value") @@ -900,58 +680,43 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Specific value and label pair for feedback */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - @JsonDeserialize(builder = FeedbackCategory.Builder::class) + @JsonDeserialize(builder = Category.Builder::class) @NoAutoDetect - class FeedbackCategory + class Category private constructor( private val value: Double?, private val label: String?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Double? = value + @JsonProperty("value") fun value(): Double? = value - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:113:14 - fun label(): String? = label + @JsonProperty("label") fun label(): String? = label - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCategory && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Category && this.value == other.value && this.label == other.label && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - value, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + value, label, additionalProperties, ) @@ -960,73 +725,48 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } override fun toString() = - "FeedbackCategory{value=$value, label=$label, additionalProperties=$additionalProperties}" + "Category{value=$value, label=$label, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var value: Double? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var value: Double? = null private var label: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackCategory: FeedbackCategory) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.value = - feedbackCategory - .value // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.label = feedbackCategory.label - additionalProperties(feedbackCategory.additionalProperties) - } - - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + @JvmSynthetic + internal fun from(category: Category) = apply { + this.value = category.value + this.label = category.label + additionalProperties(category.additionalProperties) } - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun label(label: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.label = label + @JsonProperty("value") fun value(value: Double) = apply { this.value = value } + + @JsonProperty("label") fun label(label: String) = apply { this.label = label } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } - fun build(): FeedbackCategory = - FeedbackCategory( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(value) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`value` is required but was not set" - }, + fun build(): Category = + Category( + checkNotNull(value) { "`value` is required but was not set" }, label, additionalProperties.toUnmodifiable(), ) @@ -1034,26 +774,19 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = FeedbackSource.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = FeedbackSource.Deserializer::class) @JsonSerialize(using = FeedbackSource.Serializer::class) class FeedbackSource - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val appFeedbackSource: AppFeedbackSource? = - null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val appFeedbackSource: AppFeedbackSource? = null, private val apiFeedbackSource: ApiFeedbackSource? = null, private val modelFeedbackSource: ModelFeedbackSource? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false /** Feedback from the LangChainPlus App. */ - // templates/JavaSDK/entities/unions.ts:89:12 // templates/JavaSDK/entities/unions.ts:89:12 fun appFeedbackSource(): Optional = Optional.ofNullable(appFeedbackSource) /** API feedback source. */ @@ -1063,19 +796,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun modelFeedbackSource(): Optional = Optional.ofNullable(modelFeedbackSource) - fun isAppFeedbackSource(): Boolean = - appFeedbackSource != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isAppFeedbackSource(): Boolean = appFeedbackSource != null fun isApiFeedbackSource(): Boolean = apiFeedbackSource != null fun isModelFeedbackSource(): Boolean = modelFeedbackSource != null fun asAppFeedbackSource(): AppFeedbackSource = - appFeedbackSource.getOrThrow( - "appFeedbackSource" - ) // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + appFeedbackSource.getOrThrow("appFeedbackSource") fun asApiFeedbackSource(): ApiFeedbackSource = apiFeedbackSource.getOrThrow("apiFeedbackSource") @@ -1085,30 +813,22 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - appFeedbackSource != null -> - visitor.visitAppFeedbackSource( - appFeedbackSource - ) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + appFeedbackSource != null -> visitor.visitAppFeedbackSource(appFeedbackSource) apiFeedbackSource != null -> visitor.visitApiFeedbackSource(apiFeedbackSource) modelFeedbackSource != null -> visitor.visitModelFeedbackSource(modelFeedbackSource) else -> visitor.unknown(_json) } } - fun validate(): FeedbackSource = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 + fun validate(): FeedbackSource = apply { + if (!validated) { if ( appFeedbackSource == null && apiFeedbackSource == null && modelFeedbackSource == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + ) { throw LangSmithInvalidDataException("Unknown FeedbackSource: $_json") } appFeedbackSource?.validate() @@ -1118,30 +838,28 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackSource && this.appFeedbackSource == other.appFeedbackSource && this.apiFeedbackSource == other.apiFeedbackSource && this.modelFeedbackSource == other.modelFeedbackSource } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - appFeedbackSource, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + appFeedbackSource, apiFeedbackSource, modelFeedbackSource, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - appFeedbackSource != null -> - "FeedbackSource{appFeedbackSource=$appFeedbackSource}" // templates/JavaSDK/entities/unions.ts:188:16 // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + appFeedbackSource != null -> "FeedbackSource{appFeedbackSource=$appFeedbackSource}" apiFeedbackSource != null -> "FeedbackSource{apiFeedbackSource=$apiFeedbackSource}" modelFeedbackSource != null -> "FeedbackSource{modelFeedbackSource=$modelFeedbackSource}" @@ -1150,64 +868,48 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 + @JvmStatic fun ofAppFeedbackSource(appFeedbackSource: AppFeedbackSource) = FeedbackSource(appFeedbackSource = appFeedbackSource) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 + @JvmStatic fun ofApiFeedbackSource(apiFeedbackSource: ApiFeedbackSource) = FeedbackSource(apiFeedbackSource = apiFeedbackSource) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 + @JvmStatic fun ofModelFeedbackSource(modelFeedbackSource: ModelFeedbackSource) = FeedbackSource(modelFeedbackSource = modelFeedbackSource) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitAppFeedbackSource( - appFeedbackSource: AppFeedbackSource - ): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitAppFeedbackSource(appFeedbackSource: AppFeedbackSource): T fun visitApiFeedbackSource(apiFeedbackSource: ApiFeedbackSource): T fun visitModelFeedbackSource(modelFeedbackSource: ModelFeedbackSource): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown FeedbackSource: $json") } } - class Deserializer : - BaseDeserializer( - FeedbackSource::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(FeedbackSource::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): FeedbackSource { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 + override fun ObjectCodec.deserialize(node: JsonNode): FeedbackSource { + val json = JsonValue.fromJsonNode(node) tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return FeedbackSource(appFeedbackSource = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return FeedbackSource(apiFeedbackSource = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return FeedbackSource(modelFeedbackSource = it, _json = json) } @@ -1215,25 +917,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - class Serializer : - BaseSerializer( - FeedbackSource::class - ) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(FeedbackSource::class) { override fun serialize( value: FeedbackSource, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { value.appFeedbackSource != null -> - generator.writeObject( - value.appFeedbackSource - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + generator.writeObject(value.appFeedbackSource) value.apiFeedbackSource != null -> generator.writeObject(value.apiFeedbackSource) value.modelFeedbackSource != null -> @@ -1245,11 +938,6 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Feedback from the LangChainPlus App. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AppFeedbackSource.Builder::class) @NoAutoDetect class AppFeedbackSource @@ -1259,61 +947,45 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AppFeedbackSource = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): AppFeedbackSource = apply { + if (!validated) { + type() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is AppFeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AppFeedbackSource && this.type == other.type && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, additionalProperties, ) @@ -1324,75 +996,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "AppFeedbackSource{type=$type, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(appFeedbackSource: AppFeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - appFeedbackSource - .type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = appFeedbackSource.metadata - additionalProperties(appFeedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(appFeedbackSource: AppFeedbackSource) = apply { + this.type = appFeedbackSource.type + this.metadata = appFeedbackSource.metadata + additionalProperties(appFeedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } fun build(): AppFeedbackSource = - AppFeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + AppFeedbackSource( + type, metadata, additionalProperties.toUnmodifiable(), ) @@ -1400,11 +1049,6 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** API feedback source. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ApiFeedbackSource.Builder::class) @NoAutoDetect class ApiFeedbackSource @@ -1414,61 +1058,45 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ApiFeedbackSource = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): ApiFeedbackSource = apply { + if (!validated) { + type() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiFeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiFeedbackSource && this.type == other.type && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, additionalProperties, ) @@ -1479,75 +1107,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ApiFeedbackSource{type=$type, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(apiFeedbackSource: ApiFeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - apiFeedbackSource - .type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = apiFeedbackSource.metadata - additionalProperties(apiFeedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(apiFeedbackSource: ApiFeedbackSource) = apply { + this.type = apiFeedbackSource.type + this.metadata = apiFeedbackSource.metadata + additionalProperties(apiFeedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } fun build(): ApiFeedbackSource = - ApiFeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + ApiFeedbackSource( + type, metadata, additionalProperties.toUnmodifiable(), ) @@ -1555,11 +1160,6 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Model feedback source. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ModelFeedbackSource.Builder::class) @NoAutoDetect class ModelFeedbackSource @@ -1569,62 +1169,45 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ModelFeedbackSource = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): ModelFeedbackSource = apply { + if (!validated) { + type() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - ModelFeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ModelFeedbackSource && this.type == other.type && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, additionalProperties, ) @@ -1635,75 +1218,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ModelFeedbackSource{type=$type, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(modelFeedbackSource: ModelFeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - modelFeedbackSource - .type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = modelFeedbackSource.metadata - additionalProperties(modelFeedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(modelFeedbackSource: ModelFeedbackSource) = apply { + this.type = modelFeedbackSource.type + this.metadata = modelFeedbackSource.metadata + additionalProperties(modelFeedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } fun build(): ModelFeedbackSource = - ModelFeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + ModelFeedbackSource( + type, metadata, additionalProperties.toUnmodifiable(), ) @@ -1711,11 +1271,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = Score.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Score.Deserializer::class) @JsonSerialize(using = Score.Serializer::class) class Score private constructor( @@ -1724,145 +1280,102 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) else -> visitor.unknown(_json) } } - fun validate(): Score = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Score = apply { + if (!validated) { + if (double == null && boolean == null) { throw LangSmithInvalidDataException("Unknown Score: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Score && // templates/JavaSDK/entities/fields.ts:143:33 - this.double == other.double && - this.boolean == other.boolean + return other is Score && this.double == other.double && this.boolean == other.boolean } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(double, boolean) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Score{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Score{double=$double}" boolean != null -> "Score{boolean=$boolean}" _json != null -> "Score{_unknown=$_json}" else -> throw IllegalStateException("Invalid Score") } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Score(double = double) + @JvmStatic fun ofDouble(double: Double) = Score(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Score: $json") } } - class Deserializer : - BaseDeserializer( - Score::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Score::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Score { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(boolean = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Score { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(boolean = it, _json = json) + } return Score(_json = json) } } - class Serializer : - BaseSerializer(Score::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Score::class) { override fun serialize( value: Score, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Score") @@ -1871,27 +1384,20 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = Value.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Value.Deserializer::class) @JsonSerialize(using = Value.Serializer::class) class Value - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val double: Double? = null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val double: Double? = null, private val boolean: Boolean? = null, private val string: String? = null, private val jsonValue: JsonValue? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) @@ -1899,8 +1405,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun jsonValue(): Optional = Optional.ofNullable(jsonValue) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null @@ -1908,9 +1413,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun isJsonValue(): Boolean = jsonValue != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") @@ -1920,11 +1423,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) string != null -> visitor.visitString(string) jsonValue != null -> visitor.visitJsonValue(jsonValue) @@ -1932,48 +1433,39 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - fun validate(): Value = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null && string == null && jsonValue == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Value = apply { + if (!validated) { + if (double == null && boolean == null && string == null && jsonValue == null) { throw LangSmithInvalidDataException("Unknown Value: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Value && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Value && this.double == other.double && this.boolean == other.boolean && this.string == other.string && this.jsonValue == other.jsonValue } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - double, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + double, boolean, string, jsonValue, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Value{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Value{double=$double}" boolean != null -> "Value{boolean=$boolean}" string != null -> "Value{string=$string}" jsonValue != null -> "Value{jsonValue=$jsonValue}" @@ -1982,27 +1474,20 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Value(double = double) + @JvmStatic fun ofDouble(double: Double) = Value(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofString(string: String) = Value(string = string) + @JvmStatic fun ofString(string: String) = Value(string = string) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) + @JvmStatic fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T @@ -2010,64 +1495,41 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun visitJsonValue(jsonValue: JsonValue): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Value: $json") } } - class Deserializer : - BaseDeserializer( - Value::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Value::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Value { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(jsonValue = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(boolean = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(string = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(jsonValue = it, _json = json) + } return Value(_json = json) } } - class Serializer : - BaseSerializer(Value::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Value::class) { override fun serialize( value: Value, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value.string != null -> generator.writeObject(value.string) value.jsonValue != null -> generator.writeObject(value.jsonValue) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteParams.kt index 9d55e56d..8de65a4e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class FeedbackDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val feedbackId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val feedbackId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun feedbackId(): String = feedbackId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun feedbackId(): String = feedbackId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> feedbackId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> feedbackId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackDeleteParams && this.feedbackId == other.feedbackId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - feedbackId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + feedbackId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,116 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var feedbackId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var feedbackId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackDeleteParams: FeedbackDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.feedbackId = - feedbackDeleteParams - .feedbackId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(feedbackDeleteParams.additionalQueryParams) - additionalHeaders(feedbackDeleteParams.additionalHeaders) - additionalBodyProperties(feedbackDeleteParams.additionalBodyProperties) - } - - fun feedbackId(feedbackId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackId = feedbackId + @JvmSynthetic + internal fun from(feedbackDeleteParams: FeedbackDeleteParams) = apply { + this.feedbackId = feedbackDeleteParams.feedbackId + additionalQueryParams(feedbackDeleteParams.additionalQueryParams) + additionalHeaders(feedbackDeleteParams.additionalHeaders) + additionalBodyProperties(feedbackDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun feedbackId(feedbackId: String) = apply { this.feedbackId = feedbackId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): FeedbackDeleteParams = - FeedbackDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(feedbackId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`feedbackId` is required but was not set" - }, + FeedbackDeleteParams( + checkNotNull(feedbackId) { "`feedbackId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteResponse.kt index 1c1a7f81..428c783f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = FeedbackDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = FeedbackDeleteResponse.Builder::class) @NoAutoDetect class FeedbackDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackDeleteResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): FeedbackDeleteResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "FeedbackDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackDeleteResponse: FeedbackDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(feedbackDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackDeleteResponse: FeedbackDeleteResponse) = apply { + additionalProperties(feedbackDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackDeleteResponse = FeedbackDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackEagerParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackEagerParams.kt index 46ab4e9b..2e7c711e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackEagerParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackEagerParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -31,12 +29,8 @@ import java.util.Objects import java.util.Optional class FeedbackEagerParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val key: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val key: String, private val runId: String, private val id: String?, private val comment: String?, @@ -52,8 +46,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun key(): String = key // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun key(): String = key fun runId(): String = runId @@ -75,11 +68,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun value(): Optional = Optional.ofNullable(value) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): FeedbackEagerBody { // templates/JavaSDK/entities/params.ts:165:16 - return FeedbackEagerBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - key, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): FeedbackEagerBody { + return FeedbackEagerBody( + key, runId, id, comment, @@ -94,22 +86,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Schema used for creating feedback. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = FeedbackEagerBody.Builder::class) @NoAutoDetect class FeedbackEagerBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val key: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val key: String?, private val runId: String?, private val id: String?, private val comment: String?, @@ -123,55 +109,42 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:113:14 - fun key(): String? = key + @JsonProperty("key") fun key(): String? = key - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun runId(): String? = runId + @JsonProperty("run_id") fun runId(): String? = runId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:113:14 - fun comment(): String? = comment + @JsonProperty("comment") fun comment(): String? = comment - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:113:14 - fun correction(): JsonValue? = correction + @JsonProperty("correction") fun correction(): JsonValue? = correction - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun createdAt(): OffsetDateTime? = createdAt + @JsonProperty("created_at") fun createdAt(): OffsetDateTime? = createdAt - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackConfig(): FeedbackConfig? = feedbackConfig + @JsonProperty("feedback_config") fun feedbackConfig(): FeedbackConfig? = feedbackConfig - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackSource(): FeedbackSource? = feedbackSource + @JsonProperty("feedback_source") fun feedbackSource(): FeedbackSource? = feedbackSource - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:113:14 - fun modifiedAt(): OffsetDateTime? = modifiedAt + @JsonProperty("modified_at") fun modifiedAt(): OffsetDateTime? = modifiedAt - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:113:14 - fun score(): Score? = score + @JsonProperty("score") fun score(): Score? = score - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Value? = value + @JsonProperty("value") fun value(): Value? = value - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackEagerBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackEagerBody && this.key == other.key && this.runId == other.runId && this.id == other.id && @@ -186,15 +159,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - key, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + key, runId, id, comment, @@ -214,20 +183,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackEagerBody{key=$key, runId=$runId, id=$id, comment=$comment, correction=$correction, createdAt=$createdAt, feedbackConfig=$feedbackConfig, feedbackSource=$feedbackSource, modifiedAt=$modifiedAt, score=$score, value=$value, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var key: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var key: String? = null private var runId: String? = null private var id: String? = null private var comment: String? = null @@ -240,124 +203,71 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var value: Value? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackEagerBody: FeedbackEagerBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.key = - feedbackEagerBody.key // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.runId = feedbackEagerBody.runId - this.id = feedbackEagerBody.id - this.comment = feedbackEagerBody.comment - this.correction = feedbackEagerBody.correction - this.createdAt = feedbackEagerBody.createdAt - this.feedbackConfig = feedbackEagerBody.feedbackConfig - this.feedbackSource = feedbackEagerBody.feedbackSource - this.modifiedAt = feedbackEagerBody.modifiedAt - this.score = feedbackEagerBody.score - this.value = feedbackEagerBody.value - additionalProperties(feedbackEagerBody.additionalProperties) - } - - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun key(key: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.key = key + @JvmSynthetic + internal fun from(feedbackEagerBody: FeedbackEagerBody) = apply { + this.key = feedbackEagerBody.key + this.runId = feedbackEagerBody.runId + this.id = feedbackEagerBody.id + this.comment = feedbackEagerBody.comment + this.correction = feedbackEagerBody.correction + this.createdAt = feedbackEagerBody.createdAt + this.feedbackConfig = feedbackEagerBody.feedbackConfig + this.feedbackSource = feedbackEagerBody.feedbackSource + this.modifiedAt = feedbackEagerBody.modifiedAt + this.score = feedbackEagerBody.score + this.value = feedbackEagerBody.value + additionalProperties(feedbackEagerBody.additionalProperties) } - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun runId(runId: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runId = runId + @JsonProperty("key") fun key(key: String) = apply { this.key = key } + + @JsonProperty("run_id") fun runId(runId: String) = apply { this.runId = runId } + + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + + @JsonProperty("comment") fun comment(comment: String) = apply { this.comment = comment } + + @JsonProperty("correction") + fun correction(correction: JsonValue) = apply { this.correction = correction } + + @JsonProperty("created_at") + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + @JsonProperty("feedback_config") + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JsonProperty("feedback_source") + fun feedbackSource(feedbackSource: FeedbackSource) = apply { + this.feedbackSource = feedbackSource } - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun comment(comment: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.comment = comment + @JsonProperty("modified_at") + fun modifiedAt(modifiedAt: OffsetDateTime) = apply { this.modifiedAt = modifiedAt } + + @JsonProperty("score") fun score(score: Score) = apply { this.score = score } + + @JsonProperty("value") fun value(value: Value) = apply { this.value = value } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.correction = correction - } - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackConfig = feedbackConfig - } - - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackSource(feedbackSource: FeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackSource = feedbackSource - } - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun modifiedAt(modifiedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } - - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun score(score: Score) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.score = score + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Value) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } - fun build(): FeedbackEagerBody = - FeedbackEagerBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(key) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`key` is required but was not set" - }, - checkNotNull(runId) { // templates/JavaSDK/entities/objects.ts:358:13 - "`runId` is required but was not set" - }, + FeedbackEagerBody( + checkNotNull(key) { "`key` is required but was not set" }, + checkNotNull(runId) { "`runId` is required but was not set" }, id, comment, correction, @@ -378,12 +288,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackEagerParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackEagerParams && this.key == other.key && this.runId == other.runId && this.id == other.id && @@ -400,10 +310,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - key, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + key, runId, id, comment, @@ -425,20 +334,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var key: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var key: String? = null private var runId: String? = null private var id: String? = null private var comment: String? = null @@ -453,197 +357,136 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackEagerParams: FeedbackEagerParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.key = feedbackEagerParams.key // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.runId = feedbackEagerParams.runId - this.id = feedbackEagerParams.id - this.comment = feedbackEagerParams.comment - this.correction = feedbackEagerParams.correction - this.createdAt = feedbackEagerParams.createdAt - this.feedbackConfig = feedbackEagerParams.feedbackConfig - this.feedbackSource = feedbackEagerParams.feedbackSource - this.modifiedAt = feedbackEagerParams.modifiedAt - this.score = feedbackEagerParams.score - this.value = feedbackEagerParams.value - additionalQueryParams(feedbackEagerParams.additionalQueryParams) - additionalHeaders(feedbackEagerParams.additionalHeaders) - additionalBodyProperties(feedbackEagerParams.additionalBodyProperties) - } - - fun key(key: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.key = key + @JvmSynthetic + internal fun from(feedbackEagerParams: FeedbackEagerParams) = apply { + this.key = feedbackEagerParams.key + this.runId = feedbackEagerParams.runId + this.id = feedbackEagerParams.id + this.comment = feedbackEagerParams.comment + this.correction = feedbackEagerParams.correction + this.createdAt = feedbackEagerParams.createdAt + this.feedbackConfig = feedbackEagerParams.feedbackConfig + this.feedbackSource = feedbackEagerParams.feedbackSource + this.modifiedAt = feedbackEagerParams.modifiedAt + this.score = feedbackEagerParams.score + this.value = feedbackEagerParams.value + additionalQueryParams(feedbackEagerParams.additionalQueryParams) + additionalHeaders(feedbackEagerParams.additionalHeaders) + additionalBodyProperties(feedbackEagerParams.additionalBodyProperties) } - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + fun key(key: String) = apply { this.key = key } + + fun runId(runId: String) = apply { this.runId = runId } + + fun id(id: String) = apply { this.id = id } + + fun comment(comment: String) = apply { this.comment = comment } + + fun correction(correction: JsonValue) = apply { this.correction = correction } + + fun createdAt(createdAt: OffsetDateTime) = apply { this.createdAt = createdAt } + + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig } - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id - } - - fun comment(comment: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.comment = comment - } - - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.correction = correction - } - - fun createdAt(createdAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.createdAt = createdAt - } - - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackConfig = feedbackConfig - } - /** Feedback from the LangChainPlus App. */ - fun feedbackSource(feedbackSource: FeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackSource = feedbackSource - } + fun feedbackSource(feedbackSource: FeedbackSource) = apply { + this.feedbackSource = feedbackSource + } /** Feedback from the LangChainPlus App. */ - fun feedbackSource(appFeedbackSource: FeedbackSource.AppFeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:659:30 - this.feedbackSource = FeedbackSource.ofAppFeedbackSource(appFeedbackSource) - } + fun feedbackSource(appFeedbackSource: AppFeedbackSource) = apply { + this.feedbackSource = FeedbackSource.ofAppFeedbackSource(appFeedbackSource) + } /** Feedback from the LangChainPlus App. */ - fun feedbackSource(apiFeedbackSource: FeedbackSource.ApiFeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:659:30 - this.feedbackSource = FeedbackSource.ofApiFeedbackSource(apiFeedbackSource) - } + fun feedbackSource(apiFeedbackSource: ApiFeedbackSource) = apply { + this.feedbackSource = FeedbackSource.ofApiFeedbackSource(apiFeedbackSource) + } /** Feedback from the LangChainPlus App. */ - fun feedbackSource(modelFeedbackSource: FeedbackSource.ModelFeedbackSource) = - apply { // templates/JavaSDK/entities/params.ts:659:30 - this.feedbackSource = FeedbackSource.ofModelFeedbackSource(modelFeedbackSource) - } - - fun modifiedAt(modifiedAt: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.modifiedAt = modifiedAt - } - - fun score(score: Score) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.score = score + fun feedbackSource(modelFeedbackSource: ModelFeedbackSource) = apply { + this.feedbackSource = FeedbackSource.ofModelFeedbackSource(modelFeedbackSource) } - fun score(double: Double) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.score = Score.ofDouble(double) + fun modifiedAt(modifiedAt: OffsetDateTime) = apply { this.modifiedAt = modifiedAt } + + fun score(score: Score) = apply { this.score = score } + + fun score(double: Double) = apply { this.score = Score.ofDouble(double) } + + fun score(boolean: Boolean) = apply { this.score = Score.ofBoolean(boolean) } + + fun value(value: Value) = apply { this.value = value } + + fun value(double: Double) = apply { this.value = Value.ofDouble(double) } + + fun value(boolean: Boolean) = apply { this.value = Value.ofBoolean(boolean) } + + fun value(string: String) = apply { this.value = Value.ofString(string) } + + fun value(jsonValue: JsonValue) = apply { this.value = Value.ofJsonValue(jsonValue) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun score(boolean: Boolean) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.score = Score.ofBoolean(boolean) + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun value(value: Value) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.value = value + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun value(double: Double) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofDouble(double) + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) } - fun value(boolean: Boolean) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofBoolean(boolean) - } - - fun value(string: String) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofString(string) - } - - fun value(jsonValue: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofJsonValue(jsonValue) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): FeedbackEagerParams = - FeedbackEagerParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(key) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`key` is required but was not set" - }, - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 - "`runId` is required but was not set" - }, + FeedbackEagerParams( + checkNotNull(key) { "`key` is required but was not set" }, + checkNotNull(runId) { "`runId` is required but was not set" }, id, comment, correction, @@ -659,51 +502,40 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JsonDeserialize( - builder = FeedbackConfig.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackConfig.Builder::class) @NoAutoDetect class FeedbackConfig - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: Type?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: Type?, private val min: Double?, private val max: Double?, - private val categories: List?, + private val categories: List?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 /** Enum for feedback types. */ - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:113:14 - fun type(): Type? = type + @JsonProperty("type") fun type(): Type? = type - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:113:14 - fun min(): Double? = min + @JsonProperty("min") fun min(): Double? = min - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:113:14 - fun max(): Double? = max + @JsonProperty("max") fun max(): Double? = max - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:113:14 - fun categories(): List? = categories + @JsonProperty("categories") fun categories(): List? = categories - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfig && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfig && this.type == other.type && this.min == other.min && this.max == other.max && @@ -711,15 +543,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, min, max, categories, @@ -732,88 +560,55 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackConfig{type=$type, min=$min, max=$max, categories=$categories, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: Type? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: Type? = null private var min: Double? = null private var max: Double? = null - private var categories: List? = null + private var categories: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackConfig.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.min = feedbackConfig.min - this.max = feedbackConfig.max - this.categories = feedbackConfig.categories - additionalProperties(feedbackConfig.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfig: FeedbackConfig) = apply { + this.type = feedbackConfig.type + this.min = feedbackConfig.min + this.max = feedbackConfig.max + this.categories = feedbackConfig.categories + additionalProperties(feedbackConfig.additionalProperties) + } /** Enum for feedback types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 - fun type(type: Type) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type + @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + + @JsonProperty("min") fun min(min: Double) = apply { this.min = min } + + @JsonProperty("max") fun max(max: Double) = apply { this.max = max } + + @JsonProperty("categories") + fun categories(categories: List) = apply { this.categories = categories } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun min(min: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.min = min + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun max(max: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.max = max + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun categories(categories: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.categories = categories - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } - fun build(): FeedbackConfig = - FeedbackConfig( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(type) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`type` is required but was not set" - }, + FeedbackConfig( + checkNotNull(type) { "`type` is required but was not set" }, min, max, categories?.toUnmodifiable(), @@ -825,35 +620,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 - // // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Type && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Type && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val CONTINUOUS = - Type(JsonField.of("continuous")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val CONTINUOUS = Type(JsonField.of("continuous")) @JvmField val CATEGORICAL = Type(JsonField.of("categorical")) @@ -862,34 +647,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + CONTINUOUS, CATEGORICAL, FREEFORM, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + CONTINUOUS, CATEGORICAL, FREEFORM, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - CONTINUOUS -> Value.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Value.CONTINUOUS CATEGORICAL -> Value.CATEGORICAL FREEFORM -> Value.FREEFORM else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - CONTINUOUS -> Known.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Known.CONTINUOUS CATEGORICAL -> Known.CATEGORICAL FREEFORM -> Known.FREEFORM else -> throw LangSmithInvalidDataException("Unknown Type: $value") @@ -899,58 +680,43 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Specific value and label pair for feedback */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - @JsonDeserialize(builder = FeedbackCategory.Builder::class) + @JsonDeserialize(builder = Category.Builder::class) @NoAutoDetect - class FeedbackCategory + class Category private constructor( private val value: Double?, private val label: String?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Double? = value + @JsonProperty("value") fun value(): Double? = value - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:113:14 - fun label(): String? = label + @JsonProperty("label") fun label(): String? = label - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCategory && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Category && this.value == other.value && this.label == other.label && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - value, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + value, label, additionalProperties, ) @@ -959,73 +725,48 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } override fun toString() = - "FeedbackCategory{value=$value, label=$label, additionalProperties=$additionalProperties}" + "Category{value=$value, label=$label, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var value: Double? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var value: Double? = null private var label: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackCategory: FeedbackCategory) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.value = - feedbackCategory - .value // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.label = feedbackCategory.label - additionalProperties(feedbackCategory.additionalProperties) - } - - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + @JvmSynthetic + internal fun from(category: Category) = apply { + this.value = category.value + this.label = category.label + additionalProperties(category.additionalProperties) } - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun label(label: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.label = label + @JsonProperty("value") fun value(value: Double) = apply { this.value = value } + + @JsonProperty("label") fun label(label: String) = apply { this.label = label } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } - fun build(): FeedbackCategory = - FeedbackCategory( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(value) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`value` is required but was not set" - }, + fun build(): Category = + Category( + checkNotNull(value) { "`value` is required but was not set" }, label, additionalProperties.toUnmodifiable(), ) @@ -1033,26 +774,19 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = FeedbackSource.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = FeedbackSource.Deserializer::class) @JsonSerialize(using = FeedbackSource.Serializer::class) class FeedbackSource - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val appFeedbackSource: AppFeedbackSource? = - null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val appFeedbackSource: AppFeedbackSource? = null, private val apiFeedbackSource: ApiFeedbackSource? = null, private val modelFeedbackSource: ModelFeedbackSource? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false /** Feedback from the LangChainPlus App. */ - // templates/JavaSDK/entities/unions.ts:89:12 // templates/JavaSDK/entities/unions.ts:89:12 fun appFeedbackSource(): Optional = Optional.ofNullable(appFeedbackSource) /** API feedback source. */ @@ -1062,19 +796,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun modelFeedbackSource(): Optional = Optional.ofNullable(modelFeedbackSource) - fun isAppFeedbackSource(): Boolean = - appFeedbackSource != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isAppFeedbackSource(): Boolean = appFeedbackSource != null fun isApiFeedbackSource(): Boolean = apiFeedbackSource != null fun isModelFeedbackSource(): Boolean = modelFeedbackSource != null fun asAppFeedbackSource(): AppFeedbackSource = - appFeedbackSource.getOrThrow( - "appFeedbackSource" - ) // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + appFeedbackSource.getOrThrow("appFeedbackSource") fun asApiFeedbackSource(): ApiFeedbackSource = apiFeedbackSource.getOrThrow("apiFeedbackSource") @@ -1084,30 +813,22 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - appFeedbackSource != null -> - visitor.visitAppFeedbackSource( - appFeedbackSource - ) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + appFeedbackSource != null -> visitor.visitAppFeedbackSource(appFeedbackSource) apiFeedbackSource != null -> visitor.visitApiFeedbackSource(apiFeedbackSource) modelFeedbackSource != null -> visitor.visitModelFeedbackSource(modelFeedbackSource) else -> visitor.unknown(_json) } } - fun validate(): FeedbackSource = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 + fun validate(): FeedbackSource = apply { + if (!validated) { if ( appFeedbackSource == null && apiFeedbackSource == null && modelFeedbackSource == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + ) { throw LangSmithInvalidDataException("Unknown FeedbackSource: $_json") } appFeedbackSource?.validate() @@ -1117,30 +838,28 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackSource && this.appFeedbackSource == other.appFeedbackSource && this.apiFeedbackSource == other.apiFeedbackSource && this.modelFeedbackSource == other.modelFeedbackSource } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - appFeedbackSource, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + appFeedbackSource, apiFeedbackSource, modelFeedbackSource, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - appFeedbackSource != null -> - "FeedbackSource{appFeedbackSource=$appFeedbackSource}" // templates/JavaSDK/entities/unions.ts:188:16 // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + appFeedbackSource != null -> "FeedbackSource{appFeedbackSource=$appFeedbackSource}" apiFeedbackSource != null -> "FeedbackSource{apiFeedbackSource=$apiFeedbackSource}" modelFeedbackSource != null -> "FeedbackSource{modelFeedbackSource=$modelFeedbackSource}" @@ -1149,64 +868,48 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 + @JvmStatic fun ofAppFeedbackSource(appFeedbackSource: AppFeedbackSource) = FeedbackSource(appFeedbackSource = appFeedbackSource) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 + @JvmStatic fun ofApiFeedbackSource(apiFeedbackSource: ApiFeedbackSource) = FeedbackSource(apiFeedbackSource = apiFeedbackSource) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 + @JvmStatic fun ofModelFeedbackSource(modelFeedbackSource: ModelFeedbackSource) = FeedbackSource(modelFeedbackSource = modelFeedbackSource) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitAppFeedbackSource( - appFeedbackSource: AppFeedbackSource - ): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitAppFeedbackSource(appFeedbackSource: AppFeedbackSource): T fun visitApiFeedbackSource(apiFeedbackSource: ApiFeedbackSource): T fun visitModelFeedbackSource(modelFeedbackSource: ModelFeedbackSource): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown FeedbackSource: $json") } } - class Deserializer : - BaseDeserializer( - FeedbackSource::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(FeedbackSource::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): FeedbackSource { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 + override fun ObjectCodec.deserialize(node: JsonNode): FeedbackSource { + val json = JsonValue.fromJsonNode(node) tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return FeedbackSource(appFeedbackSource = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return FeedbackSource(apiFeedbackSource = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 + ?.let { return FeedbackSource(modelFeedbackSource = it, _json = json) } @@ -1214,25 +917,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - class Serializer : - BaseSerializer( - FeedbackSource::class - ) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(FeedbackSource::class) { override fun serialize( value: FeedbackSource, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { value.appFeedbackSource != null -> - generator.writeObject( - value.appFeedbackSource - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + generator.writeObject(value.appFeedbackSource) value.apiFeedbackSource != null -> generator.writeObject(value.apiFeedbackSource) value.modelFeedbackSource != null -> @@ -1244,11 +938,6 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Feedback from the LangChainPlus App. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = AppFeedbackSource.Builder::class) @NoAutoDetect class AppFeedbackSource @@ -1258,61 +947,45 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): AppFeedbackSource = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): AppFeedbackSource = apply { + if (!validated) { + type() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is AppFeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is AppFeedbackSource && this.type == other.type && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, additionalProperties, ) @@ -1323,75 +996,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "AppFeedbackSource{type=$type, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(appFeedbackSource: AppFeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - appFeedbackSource - .type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = appFeedbackSource.metadata - additionalProperties(appFeedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(appFeedbackSource: AppFeedbackSource) = apply { + this.type = appFeedbackSource.type + this.metadata = appFeedbackSource.metadata + additionalProperties(appFeedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } fun build(): AppFeedbackSource = - AppFeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + AppFeedbackSource( + type, metadata, additionalProperties.toUnmodifiable(), ) @@ -1399,11 +1049,6 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** API feedback source. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ApiFeedbackSource.Builder::class) @NoAutoDetect class ApiFeedbackSource @@ -1413,61 +1058,45 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ApiFeedbackSource = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): ApiFeedbackSource = apply { + if (!validated) { + type() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ApiFeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ApiFeedbackSource && this.type == other.type && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, additionalProperties, ) @@ -1478,75 +1107,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ApiFeedbackSource{type=$type, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(apiFeedbackSource: ApiFeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - apiFeedbackSource - .type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = apiFeedbackSource.metadata - additionalProperties(apiFeedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(apiFeedbackSource: ApiFeedbackSource) = apply { + this.type = apiFeedbackSource.type + this.metadata = apiFeedbackSource.metadata + additionalProperties(apiFeedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } fun build(): ApiFeedbackSource = - ApiFeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + ApiFeedbackSource( + type, metadata, additionalProperties.toUnmodifiable(), ) @@ -1554,11 +1160,6 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Model feedback source. */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = ModelFeedbackSource.Builder::class) @NoAutoDetect class ModelFeedbackSource @@ -1568,62 +1169,45 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun type(): Optional = Optional.ofNullable(type.getNullable("type")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ModelFeedbackSource = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - validated = true - } + fun validate(): ModelFeedbackSource = apply { + if (!validated) { + type() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - ModelFeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ModelFeedbackSource && this.type == other.type && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, additionalProperties, ) @@ -1634,75 +1218,52 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "ModelFeedbackSource{type=$type, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(modelFeedbackSource: ModelFeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - modelFeedbackSource - .type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = modelFeedbackSource.metadata - additionalProperties(modelFeedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(modelFeedbackSource: ModelFeedbackSource) = apply { + this.type = modelFeedbackSource.type + this.metadata = modelFeedbackSource.metadata + additionalProperties(modelFeedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } fun build(): ModelFeedbackSource = - ModelFeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + ModelFeedbackSource( + type, metadata, additionalProperties.toUnmodifiable(), ) @@ -1710,11 +1271,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = Score.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Score.Deserializer::class) @JsonSerialize(using = Score.Serializer::class) class Score private constructor( @@ -1723,145 +1280,102 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) else -> visitor.unknown(_json) } } - fun validate(): Score = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Score = apply { + if (!validated) { + if (double == null && boolean == null) { throw LangSmithInvalidDataException("Unknown Score: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Score && // templates/JavaSDK/entities/fields.ts:143:33 - this.double == other.double && - this.boolean == other.boolean + return other is Score && this.double == other.double && this.boolean == other.boolean } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(double, boolean) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Score{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Score{double=$double}" boolean != null -> "Score{boolean=$boolean}" _json != null -> "Score{_unknown=$_json}" else -> throw IllegalStateException("Invalid Score") } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Score(double = double) + @JvmStatic fun ofDouble(double: Double) = Score(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Score: $json") } } - class Deserializer : - BaseDeserializer( - Score::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Score::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Score { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(boolean = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Score { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(boolean = it, _json = json) + } return Score(_json = json) } } - class Serializer : - BaseSerializer(Score::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Score::class) { override fun serialize( value: Score, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Score") @@ -1870,27 +1384,20 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = Value.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Value.Deserializer::class) @JsonSerialize(using = Value.Serializer::class) class Value - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val double: Double? = null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val double: Double? = null, private val boolean: Boolean? = null, private val string: String? = null, private val jsonValue: JsonValue? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) @@ -1898,8 +1405,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun jsonValue(): Optional = Optional.ofNullable(jsonValue) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null @@ -1907,9 +1413,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun isJsonValue(): Boolean = jsonValue != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") @@ -1919,11 +1423,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) string != null -> visitor.visitString(string) jsonValue != null -> visitor.visitJsonValue(jsonValue) @@ -1931,48 +1433,39 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - fun validate(): Value = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null && string == null && jsonValue == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Value = apply { + if (!validated) { + if (double == null && boolean == null && string == null && jsonValue == null) { throw LangSmithInvalidDataException("Unknown Value: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Value && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Value && this.double == other.double && this.boolean == other.boolean && this.string == other.string && this.jsonValue == other.jsonValue } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - double, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + double, boolean, string, jsonValue, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Value{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Value{double=$double}" boolean != null -> "Value{boolean=$boolean}" string != null -> "Value{string=$string}" jsonValue != null -> "Value{jsonValue=$jsonValue}" @@ -1981,27 +1474,20 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Value(double = double) + @JvmStatic fun ofDouble(double: Double) = Value(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofString(string: String) = Value(string = string) + @JvmStatic fun ofString(string: String) = Value(string = string) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) + @JvmStatic fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T @@ -2009,64 +1495,41 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun visitJsonValue(jsonValue: JsonValue): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Value: $json") } } - class Deserializer : - BaseDeserializer( - Value::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Value::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Value { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(jsonValue = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(boolean = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(string = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(jsonValue = it, _json = json) + } return Value(_json = json) } } - class Serializer : - BaseSerializer(Value::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Value::class) { override fun serialize( value: Value, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value.string != null -> generator.writeObject(value.string) value.jsonValue != null -> generator.writeObject(value.jsonValue) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackListParams.kt index f5f7f6b3..ca5069f6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -13,27 +13,21 @@ import java.util.Objects import java.util.Optional class FeedbackListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val hasComment: Boolean?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val hasComment: Boolean?, private val hasScore: Boolean?, private val key: List?, private val limit: Long?, private val offset: Long?, private val run: List?, private val session: List?, - private val source: List?, + private val source: List?, private val user: List?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun hasComment(): Optional = - Optional.ofNullable(hasComment) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun hasComment(): Optional = Optional.ofNullable(hasComment) fun hasScore(): Optional = Optional.ofNullable(hasScore) @@ -47,60 +41,38 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun session(): Optional> = Optional.ofNullable(session) - fun source(): Optional> = Optional.ofNullable(source) + fun source(): Optional> = Optional.ofNullable(source) fun user(): Optional> = Optional.ofNullable(user) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.hasComment?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("has_comment", listOf(it.toString())) - } - this.hasScore?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("has_score", listOf(it.toString())) - } - this.key?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("key", listOf(it.joinToString(separator = ","))) - } - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } - this.run?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("run", listOf(it.joinToString(separator = ","))) - } - this.session?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("session", listOf(it.joinToString(separator = ","))) - } - this.source?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("source", listOf(it.joinToString(separator = ","))) - } - this.user?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("user", listOf(it.joinToString(separator = ","))) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.hasComment?.let { params.put("has_comment", listOf(it.toString())) } + this.hasScore?.let { params.put("has_score", listOf(it.toString())) } + this.key?.let { params.put("key", listOf(it.joinToString(separator = ","))) } + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } + this.run?.let { params.put("run", listOf(it.joinToString(separator = ","))) } + this.session?.let { params.put("session", listOf(it.joinToString(separator = ","))) } + this.source?.let { params.put("source", listOf(it.joinToString(separator = ","))) } + this.user?.let { params.put("user", listOf(it.joinToString(separator = ","))) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackListParams && this.hasComment == other.hasComment && this.hasScore == other.hasScore && this.key == other.key && @@ -114,10 +86,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - hasComment, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + hasComment, hasScore, key, limit, @@ -136,171 +107,127 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var hasComment: Boolean? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var hasComment: Boolean? = null private var hasScore: Boolean? = null private var key: MutableList = mutableListOf() private var limit: Long? = null private var offset: Long? = null private var run: MutableList = mutableListOf() private var session: MutableList = mutableListOf() - private var source: MutableList = mutableListOf() + private var source: MutableList = mutableListOf() private var user: MutableList = mutableListOf() private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackListParams: FeedbackListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.hasComment = - feedbackListParams.hasComment // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.hasScore = feedbackListParams.hasScore - this.key(feedbackListParams.key ?: listOf()) - this.limit = feedbackListParams.limit - this.offset = feedbackListParams.offset - this.run(feedbackListParams.run ?: listOf()) - this.session(feedbackListParams.session ?: listOf()) - this.source(feedbackListParams.source ?: listOf()) - this.user(feedbackListParams.user ?: listOf()) - additionalQueryParams(feedbackListParams.additionalQueryParams) - additionalHeaders(feedbackListParams.additionalHeaders) - } - - fun hasComment(hasComment: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.hasComment = hasComment + @JvmSynthetic + internal fun from(feedbackListParams: FeedbackListParams) = apply { + this.hasComment = feedbackListParams.hasComment + this.hasScore = feedbackListParams.hasScore + this.key(feedbackListParams.key ?: listOf()) + this.limit = feedbackListParams.limit + this.offset = feedbackListParams.offset + this.run(feedbackListParams.run ?: listOf()) + this.session(feedbackListParams.session ?: listOf()) + this.source(feedbackListParams.source ?: listOf()) + this.user(feedbackListParams.user ?: listOf()) + additionalQueryParams(feedbackListParams.additionalQueryParams) + additionalHeaders(feedbackListParams.additionalHeaders) } - fun hasScore(hasScore: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.hasScore = hasScore - } + fun hasComment(hasComment: Boolean) = apply { this.hasComment = hasComment } - fun key(key: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.key.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun hasScore(hasScore: Boolean) = apply { this.hasScore = hasScore } + + fun key(key: List) = apply { + this.key.clear() this.key.addAll(key) } - fun addKey(key: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.key.add(key) - } + fun addKey(key: String) = apply { this.key.add(key) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit - } + fun limit(limit: Long) = apply { this.limit = limit } - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset - } + fun offset(offset: Long) = apply { this.offset = offset } - fun run(run: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.run.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun run(run: List) = apply { + this.run.clear() this.run.addAll(run) } - fun addRun(run: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.run.add(run) - } + fun addRun(run: String) = apply { this.run.add(run) } - fun session(session: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.session.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun session(session: List) = apply { + this.session.clear() this.session.addAll(session) } - fun addSession(session: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.session.add(session) + fun addSession(session: String) = apply { this.session.add(session) } + + fun source(source: List) = apply { + this.source.clear() + this.source.addAll(source) } - fun source(source: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.source.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.source.addAll(source) - } + fun addSource(source: Source) = apply { this.source.add(source) } - fun addSource(source: SourceType) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.source.add(source) - } - - fun user(user: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.user.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun user(user: List) = apply { + this.user.clear() this.user.addAll(user) } - fun addUser(user: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.user.add(user) + fun addUser(user: String) = apply { this.user.add(user) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): FeedbackListParams = - FeedbackListParams( // templates/JavaSDK/entities/params.ts:683:22 - hasComment, // templates/JavaSDK/entities/params.ts:683:22 + FeedbackListParams( + hasComment, hasScore, if (key.size == 0) null else key.toUnmodifiable(), limit, @@ -314,73 +241,64 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - class SourceType + class Source @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SourceType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Source && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val API = SourceType(JsonField.of("api")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val API = Source(JsonField.of("api")) - @JvmField val MODEL = SourceType(JsonField.of("model")) + @JvmField val MODEL = Source(JsonField.of("model")) - @JvmField val APP = SourceType(JsonField.of("app")) + @JvmField val APP = Source(JsonField.of("app")) - @JvmStatic fun of(value: String) = SourceType(JsonField.of(value)) + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - API, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + API, MODEL, APP, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - API, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + API, MODEL, APP, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - API -> Value.API // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + API -> Value.API MODEL -> Value.MODEL APP -> Value.APP else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - API -> Known.API // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + API -> Known.API MODEL -> Known.MODEL APP -> Known.APP - else -> throw LangSmithInvalidDataException("Unknown SourceType: $value") + else -> throw LangSmithInvalidDataException("Unknown Source: $value") } fun asString(): String = _value().asStringOrThrow() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackRetrieveParams.kt index 3486a3c9..86a9f698 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val feedbackId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun feedbackId(): String = feedbackId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun feedbackId(): String = feedbackId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> feedbackId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> feedbackId else -> "" } } @@ -36,21 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackRetrieveParams && this.feedbackId == other.feedbackId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - feedbackId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + feedbackId, additionalQueryParams, additionalHeaders, ) @@ -61,96 +55,70 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var feedbackId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var feedbackId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackRetrieveParams: FeedbackRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.feedbackId = - feedbackRetrieveParams - .feedbackId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(feedbackRetrieveParams.additionalQueryParams) - additionalHeaders(feedbackRetrieveParams.additionalHeaders) - } - - fun feedbackId(feedbackId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackId = feedbackId + @JvmSynthetic + internal fun from(feedbackRetrieveParams: FeedbackRetrieveParams) = apply { + this.feedbackId = feedbackRetrieveParams.feedbackId + additionalQueryParams(feedbackRetrieveParams.additionalQueryParams) + additionalHeaders(feedbackRetrieveParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun feedbackId(feedbackId: String) = apply { this.feedbackId = feedbackId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): FeedbackRetrieveParams = - FeedbackRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(feedbackId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`feedbackId` is required but was not set" - }, + FeedbackRetrieveParams( + checkNotNull(feedbackId) { "`feedbackId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackSchema.kt index 1e2fbbc8..4cccd9e4 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.core.JsonGenerator @@ -29,16 +27,11 @@ import java.util.Objects import java.util.Optional /** Schema for getting feedback. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = FeedbackSchema.Builder::class) @NoAutoDetect class FeedbackSchema -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val createdAt: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val createdAt: JsonField, private val modifiedAt: JsonField, private val runId: JsonField, private val key: JsonField, @@ -51,8 +44,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -78,58 +70,34 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun feedbackSource(): Optional = Optional.ofNullable(feedbackSource.getNullable("feedback_source")) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _modifiedAt() = modifiedAt + @JsonProperty("modified_at") @ExcludeMissing fun _modifiedAt() = modifiedAt - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runId() = runId + @JsonProperty("run_id") @ExcludeMissing fun _runId() = runId - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _key() = key + @JsonProperty("key") @ExcludeMissing fun _key() = key - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _score() = score + @JsonProperty("score") @ExcludeMissing fun _score() = score - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _value() = value + @JsonProperty("value") @ExcludeMissing fun _value() = value - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _comment() = comment + @JsonProperty("comment") @ExcludeMissing fun _comment() = comment - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _correction() = correction + @JsonProperty("correction") @ExcludeMissing fun _correction() = correction - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id /** The feedback source loaded from the database. */ - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackSource() = feedbackSource + @JsonProperty("feedback_source") @ExcludeMissing fun _feedbackSource() = feedbackSource - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - createdAt() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): FeedbackSchema = apply { + if (!validated) { + createdAt() modifiedAt() runId() key() @@ -144,12 +112,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackSchema && this.createdAt == other.createdAt && this.modifiedAt == other.modifiedAt && this.runId == other.runId && @@ -163,15 +131,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - createdAt, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + createdAt, modifiedAt, runId, key, @@ -190,21 +154,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackSchema{createdAt=$createdAt, modifiedAt=$modifiedAt, runId=$runId, key=$key, score=$score, value=$value, comment=$comment, correction=$correction, id=$id, feedbackSource=$feedbackSource, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var createdAt: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var createdAt: JsonField = JsonMissing.of() private var modifiedAt: JsonField = JsonMissing.of() private var runId: JsonField = JsonMissing.of() private var key: JsonField = JsonMissing.of() @@ -216,141 +173,101 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var feedbackSource: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackSchema: FeedbackSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.createdAt = - feedbackSchema.createdAt // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.modifiedAt = feedbackSchema.modifiedAt - this.runId = feedbackSchema.runId - this.key = feedbackSchema.key - this.score = feedbackSchema.score - this.value = feedbackSchema.value - this.comment = feedbackSchema.comment - this.correction = feedbackSchema.correction - this.id = feedbackSchema.id - this.feedbackSource = feedbackSchema.feedbackSource - additionalProperties(feedbackSchema.additionalProperties) - } - - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - fun modifiedAt(modifiedAt: OffsetDateTime) = - modifiedAt(JsonField.of(modifiedAt)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("modified_at") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun modifiedAt(modifiedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.modifiedAt = modifiedAt - } - - fun runId(runId: String) = - runId(JsonField.of(runId)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun runId(runId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runId = runId - } - - fun key(key: String) = - key(JsonField.of(key)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("key") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun key(key: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.key = key + @JvmSynthetic + internal fun from(feedbackSchema: FeedbackSchema) = apply { + this.createdAt = feedbackSchema.createdAt + this.modifiedAt = feedbackSchema.modifiedAt + this.runId = feedbackSchema.runId + this.key = feedbackSchema.key + this.score = feedbackSchema.score + this.value = feedbackSchema.value + this.comment = feedbackSchema.comment + this.correction = feedbackSchema.correction + this.id = feedbackSchema.id + this.feedbackSource = feedbackSchema.feedbackSource + additionalProperties(feedbackSchema.additionalProperties) } - fun score(score: Score) = - score(JsonField.of(score)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun score(score: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.score = score + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + fun modifiedAt(modifiedAt: OffsetDateTime) = modifiedAt(JsonField.of(modifiedAt)) + + @JsonProperty("modified_at") + @ExcludeMissing + fun modifiedAt(modifiedAt: JsonField) = apply { + this.modifiedAt = modifiedAt } - fun value(value: Value) = - value(JsonField.of(value)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runId(runId: String) = runId(JsonField.of(runId)) - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_id") @ExcludeMissing - fun value(value: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value - } + fun runId(runId: JsonField) = apply { this.runId = runId } - fun comment(comment: String) = - comment(JsonField.of(comment)) // templates/JavaSDK/entities/objects.ts:252:20 + fun key(key: String) = key(JsonField.of(key)) - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("key") @ExcludeMissing - fun comment(comment: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.comment = comment - } + fun key(key: JsonField) = apply { this.key = key } - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun score(score: Score) = score(JsonField.of(score)) + + @JsonProperty("score") @ExcludeMissing - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.correction = correction - } + fun score(score: JsonField) = apply { this.score = score } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun value(value: Value) = value(JsonField.of(value)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("value") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id - } + fun value(value: JsonField) = apply { this.value = value } + + fun comment(comment: String) = comment(JsonField.of(comment)) + + @JsonProperty("comment") + @ExcludeMissing + fun comment(comment: JsonField) = apply { this.comment = comment } + + @JsonProperty("correction") + @ExcludeMissing + fun correction(correction: JsonValue) = apply { this.correction = correction } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } /** The feedback source loaded from the database. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun feedbackSource(feedbackSource: FeedbackSource) = feedbackSource(JsonField.of(feedbackSource)) /** The feedback source loaded from the database. */ - @JsonProperty("feedback_source") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_source") @ExcludeMissing - fun feedbackSource(feedbackSource: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackSource = feedbackSource - } + fun feedbackSource(feedbackSource: JsonField) = apply { + this.feedbackSource = feedbackSource + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackSchema = - FeedbackSchema( // templates/JavaSDK/entities/objects.ts:326:30 - createdAt, // templates/JavaSDK/entities/objects.ts:326:30 + FeedbackSchema( + createdAt, modifiedAt, runId, key, @@ -365,22 +282,17 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } /** The feedback source loaded from the database. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = FeedbackSource.Builder::class) @NoAutoDetect class FeedbackSource - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: JsonField, private val metadata: JsonValue, private val userId: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -388,29 +300,19 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun userId(): Optional = Optional.ofNullable(userId.getNullable("user_id")) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _type() = type + @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _metadata() = metadata + @JsonProperty("metadata") @ExcludeMissing fun _metadata() = metadata - @JsonProperty("user_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _userId() = userId + @JsonProperty("user_id") @ExcludeMissing fun _userId() = userId - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackSource = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - type() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): FeedbackSource = apply { + if (!validated) { + type() userId() validated = true } @@ -418,27 +320,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackSource && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackSource && this.type == other.type && this.metadata == other.metadata && this.userId == other.userId && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, metadata, userId, additionalProperties, @@ -450,86 +348,59 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackSource{type=$type, metadata=$metadata, userId=$userId, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: JsonField = JsonMissing.of() private var metadata: JsonValue = JsonMissing.of() private var userId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackSource: FeedbackSource) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackSource.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.metadata = feedbackSource.metadata - this.userId = feedbackSource.userId - additionalProperties(feedbackSource.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackSource: FeedbackSource) = apply { + this.type = feedbackSource.type + this.metadata = feedbackSource.metadata + this.userId = feedbackSource.userId + additionalProperties(feedbackSource.additionalProperties) + } - fun type(type: String) = - type(JsonField.of(type)) // templates/JavaSDK/entities/objects.ts:252:20 + fun type(type: String) = type(JsonField.of(type)) - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("type") @ExcludeMissing - fun type(type: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type - } + fun type(type: JsonField) = apply { this.type = type } - @JsonProperty("metadata") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("metadata") @ExcludeMissing - fun metadata(metadata: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.metadata = metadata - } + fun metadata(metadata: JsonValue) = apply { this.metadata = metadata } - fun userId(userId: String) = - userId(JsonField.of(userId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun userId(userId: String) = userId(JsonField.of(userId)) - @JsonProperty("user_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("user_id") @ExcludeMissing - fun userId(userId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.userId = userId - } + fun userId(userId: JsonField) = apply { this.userId = userId } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackSource = - FeedbackSource( // templates/JavaSDK/entities/objects.ts:326:30 - type, // templates/JavaSDK/entities/objects.ts:326:30 + FeedbackSource( + type, metadata, userId, additionalProperties.toUnmodifiable(), @@ -537,11 +408,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - @JsonDeserialize( - using = Score.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Score.Deserializer::class) @JsonSerialize(using = Score.Serializer::class) class Score private constructor( @@ -550,145 +417,102 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) else -> visitor.unknown(_json) } } - fun validate(): Score = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Score = apply { + if (!validated) { + if (double == null && boolean == null) { throw LangSmithInvalidDataException("Unknown Score: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Score && // templates/JavaSDK/entities/fields.ts:143:33 - this.double == other.double && - this.boolean == other.boolean + return other is Score && this.double == other.double && this.boolean == other.boolean } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(double, boolean) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Score{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Score{double=$double}" boolean != null -> "Score{boolean=$boolean}" _json != null -> "Score{_unknown=$_json}" else -> throw IllegalStateException("Invalid Score") } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Score(double = double) + @JvmStatic fun ofDouble(double: Double) = Score(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Score: $json") } } - class Deserializer : - BaseDeserializer( - Score::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Score::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Score { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(boolean = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Score { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(boolean = it, _json = json) + } return Score(_json = json) } } - class Serializer : - BaseSerializer(Score::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Score::class) { override fun serialize( value: Score, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Score") @@ -697,27 +521,20 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - @JsonDeserialize( - using = Value.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Value.Deserializer::class) @JsonSerialize(using = Value.Serializer::class) class Value - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val double: Double? = null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val double: Double? = null, private val boolean: Boolean? = null, private val string: String? = null, private val jsonValue: JsonValue? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) @@ -725,8 +542,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun jsonValue(): Optional = Optional.ofNullable(jsonValue) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null @@ -734,9 +550,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun isJsonValue(): Boolean = jsonValue != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") @@ -746,11 +560,9 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) string != null -> visitor.visitString(string) jsonValue != null -> visitor.visitJsonValue(jsonValue) @@ -758,48 +570,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - fun validate(): Value = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null && string == null && jsonValue == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Value = apply { + if (!validated) { + if (double == null && boolean == null && string == null && jsonValue == null) { throw LangSmithInvalidDataException("Unknown Value: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Value && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Value && this.double == other.double && this.boolean == other.boolean && this.string == other.string && this.jsonValue == other.jsonValue } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - double, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + double, boolean, string, jsonValue, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Value{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Value{double=$double}" boolean != null -> "Value{boolean=$boolean}" string != null -> "Value{string=$string}" jsonValue != null -> "Value{jsonValue=$jsonValue}" @@ -808,27 +611,20 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Value(double = double) + @JvmStatic fun ofDouble(double: Double) = Value(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofString(string: String) = Value(string = string) + @JvmStatic fun ofString(string: String) = Value(string = string) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) + @JvmStatic fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T @@ -836,64 +632,41 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun visitJsonValue(jsonValue: JsonValue): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Value: $json") } } - class Deserializer : - BaseDeserializer( - Value::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Value::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Value { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(jsonValue = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(boolean = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(string = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(jsonValue = it, _json = json) + } return Value(_json = json) } } - class Serializer : - BaseSerializer(Value::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Value::class) { override fun serialize( value: Value, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value.string != null -> generator.writeObject(value.string) value.jsonValue != null -> generator.writeObject(value.jsonValue) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackUpdateParams.kt index 7a2ebb46..e481d34e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/FeedbackUpdateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -29,12 +27,8 @@ import java.util.Objects import java.util.Optional class FeedbackUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val feedbackId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val feedbackId: String, private val comment: String?, private val correction: JsonValue?, private val feedbackConfig: FeedbackConfig?, @@ -45,8 +39,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun feedbackId(): String = feedbackId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun feedbackId(): String = feedbackId fun comment(): Optional = Optional.ofNullable(comment) @@ -58,11 +51,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun value(): Optional = Optional.ofNullable(value) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): FeedbackUpdateBody { // templates/JavaSDK/entities/params.ts:165:16 - return FeedbackUpdateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - comment, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): FeedbackUpdateBody { + return FeedbackUpdateBody( + comment, correction, feedbackConfig, score, @@ -71,30 +63,23 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> feedbackId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> feedbackId else -> "" } } /** Schema used for updating feedback */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = FeedbackUpdateBody.Builder::class) @NoAutoDetect class FeedbackUpdateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val comment: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val comment: String?, private val correction: JsonValue?, private val feedbackConfig: FeedbackConfig?, private val score: Score?, @@ -102,37 +87,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:113:14 - fun comment(): String? = comment + @JsonProperty("comment") fun comment(): String? = comment - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:113:14 - fun correction(): JsonValue? = correction + @JsonProperty("correction") fun correction(): JsonValue? = correction - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:113:14 - fun feedbackConfig(): FeedbackConfig? = feedbackConfig + @JsonProperty("feedback_config") fun feedbackConfig(): FeedbackConfig? = feedbackConfig - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:113:14 - fun score(): Score? = score + @JsonProperty("score") fun score(): Score? = score - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Value? = value + @JsonProperty("value") fun value(): Value? = value - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackUpdateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackUpdateBody && this.comment == other.comment && this.correction == other.correction && this.feedbackConfig == other.feedbackConfig && @@ -141,15 +119,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - comment, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + comment, correction, feedbackConfig, score, @@ -163,94 +137,61 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackUpdateBody{comment=$comment, correction=$correction, feedbackConfig=$feedbackConfig, score=$score, value=$value, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var comment: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var comment: String? = null private var correction: JsonValue? = null private var feedbackConfig: FeedbackConfig? = null private var score: Score? = null private var value: Value? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackUpdateBody: FeedbackUpdateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.comment = - feedbackUpdateBody - .comment // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.correction = feedbackUpdateBody.correction - this.feedbackConfig = feedbackUpdateBody.feedbackConfig - this.score = feedbackUpdateBody.score - this.value = feedbackUpdateBody.value - additionalProperties(feedbackUpdateBody.additionalProperties) - } - - @JsonProperty("comment") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun comment(comment: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.comment = comment + @JvmSynthetic + internal fun from(feedbackUpdateBody: FeedbackUpdateBody) = apply { + this.comment = feedbackUpdateBody.comment + this.correction = feedbackUpdateBody.correction + this.feedbackConfig = feedbackUpdateBody.feedbackConfig + this.score = feedbackUpdateBody.score + this.value = feedbackUpdateBody.value + additionalProperties(feedbackUpdateBody.additionalProperties) } - @JsonProperty("correction") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.correction = correction - } + @JsonProperty("comment") fun comment(comment: String) = apply { this.comment = comment } - @JsonProperty("feedback_config") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackConfig = feedbackConfig - } + @JsonProperty("correction") + fun correction(correction: JsonValue) = apply { this.correction = correction } - @JsonProperty("score") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun score(score: Score) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.score = score + @JsonProperty("feedback_config") + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig } - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Value) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + @JsonProperty("score") fun score(score: Score) = apply { this.score = score } + + @JsonProperty("value") fun value(value: Value) = apply { this.value = value } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackUpdateBody = - FeedbackUpdateBody( // templates/JavaSDK/entities/objects.ts:326:30 - comment, // templates/JavaSDK/entities/objects.ts:326:30 + FeedbackUpdateBody( + comment, correction, feedbackConfig, score, @@ -266,12 +207,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackUpdateParams && this.feedbackId == other.feedbackId && this.comment == other.comment && this.correction == other.correction && @@ -283,10 +224,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - feedbackId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + feedbackId, comment, correction, feedbackConfig, @@ -303,20 +243,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var feedbackId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var feedbackId: String? = null private var comment: String? = null private var correction: JsonValue? = null private var feedbackConfig: FeedbackConfig? = null @@ -326,149 +261,102 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(feedbackUpdateParams: FeedbackUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.feedbackId = - feedbackUpdateParams - .feedbackId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.comment = feedbackUpdateParams.comment - this.correction = feedbackUpdateParams.correction - this.feedbackConfig = feedbackUpdateParams.feedbackConfig - this.score = feedbackUpdateParams.score - this.value = feedbackUpdateParams.value - additionalQueryParams(feedbackUpdateParams.additionalQueryParams) - additionalHeaders(feedbackUpdateParams.additionalHeaders) - additionalBodyProperties(feedbackUpdateParams.additionalBodyProperties) - } - - fun feedbackId(feedbackId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackId = feedbackId + @JvmSynthetic + internal fun from(feedbackUpdateParams: FeedbackUpdateParams) = apply { + this.feedbackId = feedbackUpdateParams.feedbackId + this.comment = feedbackUpdateParams.comment + this.correction = feedbackUpdateParams.correction + this.feedbackConfig = feedbackUpdateParams.feedbackConfig + this.score = feedbackUpdateParams.score + this.value = feedbackUpdateParams.value + additionalQueryParams(feedbackUpdateParams.additionalQueryParams) + additionalHeaders(feedbackUpdateParams.additionalHeaders) + additionalBodyProperties(feedbackUpdateParams.additionalBodyProperties) } - fun comment(comment: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.comment = comment + fun feedbackId(feedbackId: String) = apply { this.feedbackId = feedbackId } + + fun comment(comment: String) = apply { this.comment = comment } + + fun correction(correction: JsonValue) = apply { this.correction = correction } + + fun feedbackConfig(feedbackConfig: FeedbackConfig) = apply { + this.feedbackConfig = feedbackConfig } - fun correction(correction: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.correction = correction - } + fun score(score: Score) = apply { this.score = score } - fun feedbackConfig(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.feedbackConfig = feedbackConfig - } + fun score(double: Double) = apply { this.score = Score.ofDouble(double) } - fun score(score: Score) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.score = score + fun score(boolean: Boolean) = apply { this.score = Score.ofBoolean(boolean) } + + fun value(value: Value) = apply { this.value = value } + + fun value(double: Double) = apply { this.value = Value.ofDouble(double) } + + fun value(boolean: Boolean) = apply { this.value = Value.ofBoolean(boolean) } + + fun value(string: String) = apply { this.value = Value.ofString(string) } + + fun value(jsonValue: JsonValue) = apply { this.value = Value.ofJsonValue(jsonValue) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun score(double: Double) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.score = Score.ofDouble(double) + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun score(boolean: Boolean) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.score = Score.ofBoolean(boolean) + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) } - fun value(value: Value) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.value = value + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) } - fun value(double: Double) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofDouble(double) - } - - fun value(boolean: Boolean) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofBoolean(boolean) - } - - fun value(string: String) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofString(string) - } - - fun value(jsonValue: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:659:30 - this.value = Value.ofJsonValue(jsonValue) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } - - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): FeedbackUpdateParams = - FeedbackUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(feedbackId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`feedbackId` is required but was not set" - }, + FeedbackUpdateParams( + checkNotNull(feedbackId) { "`feedbackId` is required but was not set" }, comment, correction, feedbackConfig, @@ -480,51 +368,40 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JsonDeserialize( - builder = FeedbackConfig.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackConfig.Builder::class) @NoAutoDetect class FeedbackConfig - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val type: Type?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val type: Type?, private val min: Double?, private val max: Double?, - private val categories: List?, + private val categories: List?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 /** Enum for feedback types. */ - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:113:14 - fun type(): Type? = type + @JsonProperty("type") fun type(): Type? = type - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:113:14 - fun min(): Double? = min + @JsonProperty("min") fun min(): Double? = min - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:113:14 - fun max(): Double? = max + @JsonProperty("max") fun max(): Double? = max - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:113:14 - fun categories(): List? = categories + @JsonProperty("categories") fun categories(): List? = categories - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackConfig && // templates/JavaSDK/entities/fields.ts:143:33 + return other is FeedbackConfig && this.type == other.type && this.min == other.min && this.max == other.max && @@ -532,15 +409,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - type, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + type, min, max, categories, @@ -553,88 +426,55 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "FeedbackConfig{type=$type, min=$min, max=$max, categories=$categories, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var type: Type? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var type: Type? = null private var min: Double? = null private var max: Double? = null - private var categories: List? = null + private var categories: List? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackConfig: FeedbackConfig) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.type = - feedbackConfig.type // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.min = feedbackConfig.min - this.max = feedbackConfig.max - this.categories = feedbackConfig.categories - additionalProperties(feedbackConfig.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackConfig: FeedbackConfig) = apply { + this.type = feedbackConfig.type + this.min = feedbackConfig.min + this.max = feedbackConfig.max + this.categories = feedbackConfig.categories + additionalProperties(feedbackConfig.additionalProperties) + } /** Enum for feedback types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("type") // templates/JavaSDK/entities/objects.ts:264:20 - fun type(type: Type) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.type = type + @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + + @JsonProperty("min") fun min(min: Double) = apply { this.min = min } + + @JsonProperty("max") fun max(max: Double) = apply { this.max = max } + + @JsonProperty("categories") + fun categories(categories: List) = apply { this.categories = categories } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("min") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun min(min: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.min = min + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - @JsonProperty("max") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun max(max: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.max = max + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("categories") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun categories(categories: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.categories = categories - } - - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } - fun build(): FeedbackConfig = - FeedbackConfig( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(type) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`type` is required but was not set" - }, + FeedbackConfig( + checkNotNull(type) { "`type` is required but was not set" }, min, max, categories?.toUnmodifiable(), @@ -646,35 +486,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 - // // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Type && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Type && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val CONTINUOUS = - Type(JsonField.of("continuous")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val CONTINUOUS = Type(JsonField.of("continuous")) @JvmField val CATEGORICAL = Type(JsonField.of("categorical")) @@ -683,34 +513,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + CONTINUOUS, CATEGORICAL, FREEFORM, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - CONTINUOUS, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + CONTINUOUS, CATEGORICAL, FREEFORM, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - CONTINUOUS -> Value.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Value.CONTINUOUS CATEGORICAL -> Value.CATEGORICAL FREEFORM -> Value.FREEFORM else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - CONTINUOUS -> Known.CONTINUOUS // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + CONTINUOUS -> Known.CONTINUOUS CATEGORICAL -> Known.CATEGORICAL FREEFORM -> Known.FREEFORM else -> throw LangSmithInvalidDataException("Unknown Type: $value") @@ -720,58 +546,43 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } /** Specific value and label pair for feedback */ - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - @JsonDeserialize(builder = FeedbackCategory.Builder::class) + @JsonDeserialize(builder = Category.Builder::class) @NoAutoDetect - class FeedbackCategory + class Category private constructor( private val value: Double?, private val label: String?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:113:14 - fun value(): Double? = value + @JsonProperty("value") fun value(): Double? = value - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:113:14 - fun label(): String? = label + @JsonProperty("label") fun label(): String? = label - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackCategory && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Category && this.value == other.value && this.label == other.label && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - value, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + value, label, additionalProperties, ) @@ -780,73 +591,48 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } override fun toString() = - "FeedbackCategory{value=$value, label=$label, additionalProperties=$additionalProperties}" + "Category{value=$value, label=$label, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var value: Double? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var value: Double? = null private var label: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackCategory: FeedbackCategory) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.value = - feedbackCategory - .value // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.label = feedbackCategory.label - additionalProperties(feedbackCategory.additionalProperties) - } - - @JsonProperty("value") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun value(value: Double) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.value = value + @JvmSynthetic + internal fun from(category: Category) = apply { + this.value = category.value + this.label = category.label + additionalProperties(category.additionalProperties) } - @JsonProperty("label") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun label(label: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.label = label + @JsonProperty("value") fun value(value: Double) = apply { this.value = value } + + @JsonProperty("label") fun label(label: String) = apply { this.label = label } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } - fun build(): FeedbackCategory = - FeedbackCategory( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(value) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`value` is required but was not set" - }, + fun build(): Category = + Category( + checkNotNull(value) { "`value` is required but was not set" }, label, additionalProperties.toUnmodifiable(), ) @@ -854,11 +640,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = Score.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Score.Deserializer::class) @JsonSerialize(using = Score.Serializer::class) class Score private constructor( @@ -867,145 +649,102 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) else -> visitor.unknown(_json) } } - fun validate(): Score = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Score = apply { + if (!validated) { + if (double == null && boolean == null) { throw LangSmithInvalidDataException("Unknown Score: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Score && // templates/JavaSDK/entities/fields.ts:143:33 - this.double == other.double && - this.boolean == other.boolean + return other is Score && this.double == other.double && this.boolean == other.boolean } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(double, boolean) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Score{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Score{double=$double}" boolean != null -> "Score{boolean=$boolean}" _json != null -> "Score{_unknown=$_json}" else -> throw IllegalStateException("Invalid Score") } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Score(double = double) + @JvmStatic fun ofDouble(double: Double) = Score(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Score(boolean = boolean) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Score: $json") } } - class Deserializer : - BaseDeserializer( - Score::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Score::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Score { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Score(boolean = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Score { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Score(boolean = it, _json = json) + } return Score(_json = json) } } - class Serializer : - BaseSerializer(Score::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Score::class) { override fun serialize( value: Score, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Score") @@ -1014,27 +753,20 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - @JsonDeserialize( - using = Value.Deserializer::class - ) // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + @JsonDeserialize(using = Value.Deserializer::class) @JsonSerialize(using = Value.Serializer::class) class Value - private constructor( // templates/JavaSDK/entities/unions.ts:68:13 - private val double: Double? = null, // templates/JavaSDK/entities/unions.ts:68:13 // - // templates/JavaSDK/entities/unions.ts:68:13 + private constructor( + private val double: Double? = null, private val boolean: Boolean? = null, private val string: String? = null, private val jsonValue: JsonValue? = null, private val _json: JsonValue? = null, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/unions.ts:68:13 + private var validated: Boolean = false - fun double(): Optional = - Optional.ofNullable(double) // templates/JavaSDK/entities/unions.ts:89:12 // - // templates/JavaSDK/entities/unions.ts:89:12 + fun double(): Optional = Optional.ofNullable(double) fun boolean(): Optional = Optional.ofNullable(boolean) @@ -1042,8 +774,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun jsonValue(): Optional = Optional.ofNullable(jsonValue) - fun isDouble(): Boolean = double != null // templates/JavaSDK/entities/unions.ts:104:12 // - // templates/JavaSDK/entities/unions.ts:104:12 + fun isDouble(): Boolean = double != null fun isBoolean(): Boolean = boolean != null @@ -1051,9 +782,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun isJsonValue(): Boolean = jsonValue != null - fun asDouble(): Double = - double.getOrThrow("double") // templates/JavaSDK/entities/unions.ts:113:12 // - // templates/JavaSDK/entities/unions.ts:113:12 + fun asDouble(): Double = double.getOrThrow("double") fun asBoolean(): Boolean = boolean.getOrThrow("boolean") @@ -1063,11 +792,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _json(): Optional = Optional.ofNullable(_json) - fun accept(visitor: Visitor): T { // templates/JavaSDK/entities/unions.ts:128:10 - return when { // templates/JavaSDK/entities/unions.ts:134:30 - double != null -> - visitor.visitDouble(double) // templates/JavaSDK/entities/unions.ts:134:30 // - // templates/JavaSDK/entities/unions.ts:134:30 + fun accept(visitor: Visitor): T { + return when { + double != null -> visitor.visitDouble(double) boolean != null -> visitor.visitBoolean(boolean) string != null -> visitor.visitString(string) jsonValue != null -> visitor.visitJsonValue(jsonValue) @@ -1075,48 +802,39 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - fun validate(): Value = apply { // templates/JavaSDK/entities/unions.ts:151:28 - if (!validated) { // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:151:28 // - // templates/JavaSDK/entities/unions.ts:151:28 - if ( - double == null && boolean == null && string == null && jsonValue == null - ) { // templates/JavaSDK/entities/unions.ts:157:24 // - // templates/JavaSDK/entities/unions.ts:154:20 // - // templates/JavaSDK/entities/unions.ts:154:20 + fun validate(): Value = apply { + if (!validated) { + if (double == null && boolean == null && string == null && jsonValue == null) { throw LangSmithInvalidDataException("Unknown Value: $_json") } validated = true } } - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Value && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Value && this.double == other.double && this.boolean == other.boolean && this.string == other.string && this.jsonValue == other.jsonValue } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - double, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + double, boolean, string, jsonValue, ) } - override fun toString(): String { // templates/JavaSDK/entities/unions.ts:181:10 - return when { // templates/JavaSDK/entities/unions.ts:188:16 - double != null -> - "Value{double=$double}" // templates/JavaSDK/entities/unions.ts:188:16 // - // templates/JavaSDK/entities/unions.ts:188:16 + override fun toString(): String { + return when { + double != null -> "Value{double=$double}" boolean != null -> "Value{boolean=$boolean}" string != null -> "Value{string=$string}" jsonValue != null -> "Value{jsonValue=$jsonValue}" @@ -1125,27 +843,20 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } } - companion object { // templates/JavaSDK/entities/unions.ts:201:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 // - // templates/JavaSDK/entities/unions.ts:201:10 - fun ofDouble(double: Double) = Value(double = double) + @JvmStatic fun ofDouble(double: Double) = Value(double = double) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) + @JvmStatic fun ofBoolean(boolean: Boolean) = Value(boolean = boolean) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofString(string: String) = Value(string = string) + @JvmStatic fun ofString(string: String) = Value(string = string) - @JvmStatic // templates/JavaSDK/entities/unions.ts:203:14 - fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) + @JvmStatic fun ofJsonValue(jsonValue: JsonValue) = Value(jsonValue = jsonValue) } - interface Visitor { // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 // - // templates/JavaSDK/entities/unions.ts:211:10 + interface Visitor { - fun visitDouble(double: Double): T // templates/JavaSDK/entities/unions.ts:211:10 + fun visitDouble(double: Double): T fun visitBoolean(boolean: Boolean): T @@ -1153,64 +864,41 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun visitJsonValue(jsonValue: JsonValue): T - fun unknown(json: JsonValue?): T { // templates/JavaSDK/entities/unions.ts:230:14 + fun unknown(json: JsonValue?): T { throw LangSmithInvalidDataException("Unknown Value: $json") } } - class Deserializer : - BaseDeserializer( - Value::class - ) { // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 // - // templates/JavaSDK/entities/unions.ts:240:10 + class Deserializer : BaseDeserializer(Value::class) { - override fun ObjectCodec.deserialize( - node: JsonNode - ): Value { // templates/JavaSDK/entities/unions.ts:244:14 // - // templates/JavaSDK/entities/unions.ts:240:10 - val json = - JsonValue.fromJsonNode(node) // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:251:22 // - // templates/JavaSDK/entities/unions.ts:250:28 - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(double = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(boolean = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(string = it, _json = json) - } - tryDeserialize(node, jacksonTypeRef()) - ?.let { // templates/JavaSDK/entities/unions.ts:254:34 - return Value(jsonValue = it, _json = json) - } + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(double = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(boolean = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(string = it, _json = json) + } + tryDeserialize(node, jacksonTypeRef())?.let { + return Value(jsonValue = it, _json = json) + } return Value(_json = json) } } - class Serializer : - BaseSerializer(Value::class) { // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 // - // templates/JavaSDK/entities/unions.ts:269:10 + class Serializer : BaseSerializer(Value::class) { override fun serialize( value: Value, generator: JsonGenerator, provider: SerializerProvider - ) { // templates/JavaSDK/entities/unions.ts:273:14 // - // templates/JavaSDK/entities/unions.ts:269:10 - when { // templates/JavaSDK/entities/unions.ts:278:24 - value.double != null -> - generator.writeObject( - value.double - ) // templates/JavaSDK/entities/unions.ts:278:24 // - // templates/JavaSDK/entities/unions.ts:278:24 + ) { + when { + value.double != null -> generator.writeObject(value.double) value.boolean != null -> generator.writeObject(value.boolean) value.string != null -> generator.writeObject(value.string) value.jsonValue != null -> generator.writeObject(value.jsonValue) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoGetResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoGetResponse.kt index f297d846..69168e59 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoGetResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoGetResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,22 +17,17 @@ import java.util.Objects import java.util.Optional /** The LangSmith server info. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = InfoGetResponse.Builder::class) @NoAutoDetect class InfoGetResponse -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val version: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val version: JsonField, private val licenseExpirationTime: JsonField, private val batchIngestConfig: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -47,30 +40,24 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun batchIngestConfig(): Optional = Optional.ofNullable(batchIngestConfig.getNullable("batch_ingest_config")) - @JsonProperty("version") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _version() = version + @JsonProperty("version") @ExcludeMissing fun _version() = version - @JsonProperty("license_expiration_time") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("license_expiration_time") @ExcludeMissing fun _licenseExpirationTime() = licenseExpirationTime /** Batch ingest config. */ - @JsonProperty("batch_ingest_config") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("batch_ingest_config") @ExcludeMissing fun _batchIngestConfig() = batchIngestConfig - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): InfoGetResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - version() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): InfoGetResponse = apply { + if (!validated) { + version() licenseExpirationTime() batchIngestConfig().map { it.validate() } validated = true @@ -79,27 +66,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is InfoGetResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is InfoGetResponse && this.version == other.version && this.licenseExpirationTime == other.licenseExpirationTime && this.batchIngestConfig == other.batchIngestConfig && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - version, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + version, licenseExpirationTime, batchIngestConfig, additionalProperties, @@ -111,92 +94,69 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "InfoGetResponse{version=$version, licenseExpirationTime=$licenseExpirationTime, batchIngestConfig=$batchIngestConfig, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var version: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var version: JsonField = JsonMissing.of() private var licenseExpirationTime: JsonField = JsonMissing.of() private var batchIngestConfig: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(infoGetResponse: InfoGetResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.version = - infoGetResponse.version // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.licenseExpirationTime = infoGetResponse.licenseExpirationTime - this.batchIngestConfig = infoGetResponse.batchIngestConfig - additionalProperties(infoGetResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(infoGetResponse: InfoGetResponse) = apply { + this.version = infoGetResponse.version + this.licenseExpirationTime = infoGetResponse.licenseExpirationTime + this.batchIngestConfig = infoGetResponse.batchIngestConfig + additionalProperties(infoGetResponse.additionalProperties) + } - fun version(version: String) = - version(JsonField.of(version)) // templates/JavaSDK/entities/objects.ts:252:20 + fun version(version: String) = version(JsonField.of(version)) - @JsonProperty("version") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("version") @ExcludeMissing - fun version(version: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.version = version - } + fun version(version: JsonField) = apply { this.version = version } fun licenseExpirationTime(licenseExpirationTime: OffsetDateTime) = - licenseExpirationTime( - JsonField.of(licenseExpirationTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + licenseExpirationTime(JsonField.of(licenseExpirationTime)) - @JsonProperty("license_expiration_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("license_expiration_time") @ExcludeMissing - fun licenseExpirationTime(licenseExpirationTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.licenseExpirationTime = licenseExpirationTime - } + fun licenseExpirationTime(licenseExpirationTime: JsonField) = apply { + this.licenseExpirationTime = licenseExpirationTime + } /** Batch ingest config. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun batchIngestConfig(batchIngestConfig: BatchIngestConfig) = batchIngestConfig(JsonField.of(batchIngestConfig)) /** Batch ingest config. */ - @JsonProperty("batch_ingest_config") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("batch_ingest_config") @ExcludeMissing - fun batchIngestConfig(batchIngestConfig: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.batchIngestConfig = batchIngestConfig - } + fun batchIngestConfig(batchIngestConfig: JsonField) = apply { + this.batchIngestConfig = batchIngestConfig + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): InfoGetResponse = - InfoGetResponse( // templates/JavaSDK/entities/objects.ts:326:30 - version, // templates/JavaSDK/entities/objects.ts:326:30 + InfoGetResponse( + version, licenseExpirationTime, batchIngestConfig, additionalProperties.toUnmodifiable(), @@ -204,24 +164,18 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } /** Batch ingest config. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = BatchIngestConfig.Builder::class) @NoAutoDetect class BatchIngestConfig - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val scaleUpQsizeTrigger: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val scaleUpQsizeTrigger: JsonField, private val scaleUpNthreadsLimit: JsonField, private val scaleDownNemptyTrigger: JsonField, private val sizeLimit: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -236,33 +190,27 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun sizeLimit(): Optional = Optional.ofNullable(sizeLimit.getNullable("size_limit")) - @JsonProperty("scale_up_qsize_trigger") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("scale_up_qsize_trigger") @ExcludeMissing fun _scaleUpQsizeTrigger() = scaleUpQsizeTrigger - @JsonProperty("scale_up_nthreads_limit") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("scale_up_nthreads_limit") @ExcludeMissing fun _scaleUpNthreadsLimit() = scaleUpNthreadsLimit - @JsonProperty("scale_down_nempty_trigger") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("scale_down_nempty_trigger") @ExcludeMissing fun _scaleDownNemptyTrigger() = scaleDownNemptyTrigger - @JsonProperty("size_limit") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sizeLimit() = sizeLimit + @JsonProperty("size_limit") @ExcludeMissing fun _sizeLimit() = sizeLimit - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): BatchIngestConfig = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - scaleUpQsizeTrigger() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): BatchIngestConfig = apply { + if (!validated) { + scaleUpQsizeTrigger() scaleUpNthreadsLimit() scaleDownNemptyTrigger() sizeLimit() @@ -272,12 +220,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is BatchIngestConfig && // templates/JavaSDK/entities/fields.ts:143:33 + return other is BatchIngestConfig && this.scaleUpQsizeTrigger == other.scaleUpQsizeTrigger && this.scaleUpNthreadsLimit == other.scaleUpNthreadsLimit && this.scaleDownNemptyTrigger == other.scaleDownNemptyTrigger && @@ -285,15 +233,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - scaleUpQsizeTrigger, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + scaleUpQsizeTrigger, scaleUpNthreadsLimit, scaleDownNemptyTrigger, sizeLimit, @@ -306,109 +250,78 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "BatchIngestConfig{scaleUpQsizeTrigger=$scaleUpQsizeTrigger, scaleUpNthreadsLimit=$scaleUpNthreadsLimit, scaleDownNemptyTrigger=$scaleDownNemptyTrigger, sizeLimit=$sizeLimit, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var scaleUpQsizeTrigger: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var scaleUpQsizeTrigger: JsonField = JsonMissing.of() private var scaleUpNthreadsLimit: JsonField = JsonMissing.of() private var scaleDownNemptyTrigger: JsonField = JsonMissing.of() private var sizeLimit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(batchIngestConfig: BatchIngestConfig) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.scaleUpQsizeTrigger = - batchIngestConfig - .scaleUpQsizeTrigger // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.scaleUpNthreadsLimit = batchIngestConfig.scaleUpNthreadsLimit - this.scaleDownNemptyTrigger = batchIngestConfig.scaleDownNemptyTrigger - this.sizeLimit = batchIngestConfig.sizeLimit - additionalProperties(batchIngestConfig.additionalProperties) - } + @JvmSynthetic + internal fun from(batchIngestConfig: BatchIngestConfig) = apply { + this.scaleUpQsizeTrigger = batchIngestConfig.scaleUpQsizeTrigger + this.scaleUpNthreadsLimit = batchIngestConfig.scaleUpNthreadsLimit + this.scaleDownNemptyTrigger = batchIngestConfig.scaleDownNemptyTrigger + this.sizeLimit = batchIngestConfig.sizeLimit + additionalProperties(batchIngestConfig.additionalProperties) + } fun scaleUpQsizeTrigger(scaleUpQsizeTrigger: Long) = - scaleUpQsizeTrigger( - JsonField.of(scaleUpQsizeTrigger) - ) // templates/JavaSDK/entities/objects.ts:252:20 + scaleUpQsizeTrigger(JsonField.of(scaleUpQsizeTrigger)) - @JsonProperty("scale_up_qsize_trigger") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("scale_up_qsize_trigger") @ExcludeMissing - fun scaleUpQsizeTrigger(scaleUpQsizeTrigger: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.scaleUpQsizeTrigger = scaleUpQsizeTrigger - } + fun scaleUpQsizeTrigger(scaleUpQsizeTrigger: JsonField) = apply { + this.scaleUpQsizeTrigger = scaleUpQsizeTrigger + } fun scaleUpNthreadsLimit(scaleUpNthreadsLimit: Long) = - scaleUpNthreadsLimit( - JsonField.of(scaleUpNthreadsLimit) - ) // templates/JavaSDK/entities/objects.ts:252:20 + scaleUpNthreadsLimit(JsonField.of(scaleUpNthreadsLimit)) - @JsonProperty("scale_up_nthreads_limit") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("scale_up_nthreads_limit") @ExcludeMissing - fun scaleUpNthreadsLimit(scaleUpNthreadsLimit: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.scaleUpNthreadsLimit = scaleUpNthreadsLimit - } + fun scaleUpNthreadsLimit(scaleUpNthreadsLimit: JsonField) = apply { + this.scaleUpNthreadsLimit = scaleUpNthreadsLimit + } fun scaleDownNemptyTrigger(scaleDownNemptyTrigger: Long) = - scaleDownNemptyTrigger( - JsonField.of(scaleDownNemptyTrigger) - ) // templates/JavaSDK/entities/objects.ts:252:20 + scaleDownNemptyTrigger(JsonField.of(scaleDownNemptyTrigger)) - @JsonProperty( - "scale_down_nempty_trigger" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("scale_down_nempty_trigger") @ExcludeMissing - fun scaleDownNemptyTrigger(scaleDownNemptyTrigger: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.scaleDownNemptyTrigger = scaleDownNemptyTrigger - } + fun scaleDownNemptyTrigger(scaleDownNemptyTrigger: JsonField) = apply { + this.scaleDownNemptyTrigger = scaleDownNemptyTrigger + } - fun sizeLimit(sizeLimit: Long) = - sizeLimit(JsonField.of(sizeLimit)) // templates/JavaSDK/entities/objects.ts:252:20 + fun sizeLimit(sizeLimit: Long) = sizeLimit(JsonField.of(sizeLimit)) - @JsonProperty("size_limit") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("size_limit") @ExcludeMissing - fun sizeLimit(sizeLimit: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sizeLimit = sizeLimit - } + fun sizeLimit(sizeLimit: JsonField) = apply { this.sizeLimit = sizeLimit } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): BatchIngestConfig = - BatchIngestConfig( // templates/JavaSDK/entities/objects.ts:326:30 - scaleUpQsizeTrigger, // templates/JavaSDK/entities/objects.ts:326:30 + BatchIngestConfig( + scaleUpQsizeTrigger, scaleUpNthreadsLimit, scaleDownNemptyTrigger, sizeLimit, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoRetrieveParams.kt index 615ecacf..b5acb999 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/InfoRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class InfoRetrieveParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is InfoRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is InfoRetrieveParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(infoRetrieveParams: InfoRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - infoRetrieveParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(infoRetrieveParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(infoRetrieveParams: InfoRetrieveParams) = apply { + additionalQueryParams(infoRetrieveParams.additionalQueryParams) + additionalHeaders(infoRetrieveParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): InfoRetrieveParams = InfoRetrieveParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponse.kt index bc05ccd6..7b7efa93 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,24 +15,17 @@ import com.langsmith.api.core.toUnmodifiable import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = ListPublicDatasetRunsResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = ListPublicDatasetRunsResponse.Builder::class) @NoAutoDetect class ListPublicDatasetRunsResponse -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val runs: - JsonField>, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val runs: JsonField>, private val cursors: JsonField, private val parsedQuery: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -45,60 +36,44 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun parsedQuery(): Optional = Optional.ofNullable(parsedQuery.getNullable("parsed_query")) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runs() = runs + @JsonProperty("runs") @ExcludeMissing fun _runs() = runs - @JsonProperty("cursors") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _cursors() = cursors + @JsonProperty("cursors") @ExcludeMissing fun _cursors() = cursors - @JsonProperty("parsed_query") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parsedQuery() = parsedQuery + @JsonProperty("parsed_query") @ExcludeMissing fun _parsedQuery() = parsedQuery - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ListPublicDatasetRunsResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - runs().forEach { it.validate() } // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - cursors().validate() - parsedQuery() - validated = true - } + fun validate(): ListPublicDatasetRunsResponse = apply { + if (!validated) { + runs().forEach { it.validate() } + cursors().validate() + parsedQuery() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - ListPublicDatasetRunsResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ListPublicDatasetRunsResponse && this.runs == other.runs && this.cursors == other.cursors && this.parsedQuery == other.parsedQuery && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - runs, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + runs, cursors, parsedQuery, additionalProperties, @@ -110,138 +85,100 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "ListPublicDatasetRunsResponse{runs=$runs, cursors=$cursors, parsedQuery=$parsedQuery, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var runs: JsonField> = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var runs: JsonField> = JsonMissing.of() private var cursors: JsonField = JsonMissing.of() private var parsedQuery: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(listPublicDatasetRunsResponse: ListPublicDatasetRunsResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.runs = - listPublicDatasetRunsResponse - .runs // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.cursors = listPublicDatasetRunsResponse.cursors - this.parsedQuery = listPublicDatasetRunsResponse.parsedQuery - additionalProperties(listPublicDatasetRunsResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(listPublicDatasetRunsResponse: ListPublicDatasetRunsResponse) = apply { + this.runs = listPublicDatasetRunsResponse.runs + this.cursors = listPublicDatasetRunsResponse.cursors + this.parsedQuery = listPublicDatasetRunsResponse.parsedQuery + additionalProperties(listPublicDatasetRunsResponse.additionalProperties) + } - fun runs(runs: List) = - runs(JsonField.of(runs)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runs(runs: List) = runs(JsonField.of(runs)) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("runs") @ExcludeMissing - fun runs(runs: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runs = runs - } + fun runs(runs: JsonField>) = apply { this.runs = runs } - fun cursors(cursors: Cursors) = - cursors(JsonField.of(cursors)) // templates/JavaSDK/entities/objects.ts:252:20 + fun cursors(cursors: Cursors) = cursors(JsonField.of(cursors)) - @JsonProperty("cursors") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("cursors") @ExcludeMissing - fun cursors(cursors: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.cursors = cursors - } + fun cursors(cursors: JsonField) = apply { this.cursors = cursors } - fun parsedQuery(parsedQuery: String) = - parsedQuery(JsonField.of(parsedQuery)) // templates/JavaSDK/entities/objects.ts:252:20 + fun parsedQuery(parsedQuery: String) = parsedQuery(JsonField.of(parsedQuery)) - @JsonProperty("parsed_query") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("parsed_query") @ExcludeMissing - fun parsedQuery(parsedQuery: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parsedQuery = parsedQuery - } + fun parsedQuery(parsedQuery: JsonField) = apply { this.parsedQuery = parsedQuery } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ListPublicDatasetRunsResponse = - ListPublicDatasetRunsResponse( // templates/JavaSDK/entities/objects.ts:326:30 - runs.map { it.toUnmodifiable() }, // templates/JavaSDK/entities/objects.ts:326:30 + ListPublicDatasetRunsResponse( + runs.map { it.toUnmodifiable() }, cursors, parsedQuery, additionalProperties.toUnmodifiable(), ) } - @JsonDeserialize( - builder = Cursors.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Cursors.Builder::class) @NoAutoDetect class Cursors private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Cursors = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): Cursors = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Cursors && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is Cursors && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -249,44 +186,33 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Cursors{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(cursors: Cursors) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(cursors.additionalProperties) - } + @JvmSynthetic + internal fun from(cursors: Cursors) = apply { + additionalProperties(cursors.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Cursors = Cursors(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicRunsResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicRunsResponse.kt index 0711f453..80a3a2db 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicRunsResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListPublicRunsResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,24 +15,17 @@ import com.langsmith.api.core.toUnmodifiable import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = ListPublicRunsResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = ListPublicRunsResponse.Builder::class) @NoAutoDetect class ListPublicRunsResponse -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val runs: - JsonField>, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val runs: JsonField>, private val cursors: JsonField, private val parsedQuery: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -45,29 +36,19 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun parsedQuery(): Optional = Optional.ofNullable(parsedQuery.getNullable("parsed_query")) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runs() = runs + @JsonProperty("runs") @ExcludeMissing fun _runs() = runs - @JsonProperty("cursors") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _cursors() = cursors + @JsonProperty("cursors") @ExcludeMissing fun _cursors() = cursors - @JsonProperty("parsed_query") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parsedQuery() = parsedQuery + @JsonProperty("parsed_query") @ExcludeMissing fun _parsedQuery() = parsedQuery - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ListPublicRunsResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - runs().forEach { it.validate() } // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): ListPublicRunsResponse = apply { + if (!validated) { + runs().forEach { it.validate() } cursors().validate() parsedQuery() validated = true @@ -76,27 +57,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ListPublicRunsResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ListPublicRunsResponse && this.runs == other.runs && this.cursors == other.cursors && this.parsedQuery == other.parsedQuery && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - runs, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + runs, cursors, parsedQuery, additionalProperties, @@ -108,137 +85,100 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "ListPublicRunsResponse{runs=$runs, cursors=$cursors, parsedQuery=$parsedQuery, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var runs: JsonField> = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var runs: JsonField> = JsonMissing.of() private var cursors: JsonField = JsonMissing.of() private var parsedQuery: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(listPublicRunsResponse: ListPublicRunsResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.runs = - listPublicRunsResponse.runs // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.cursors = listPublicRunsResponse.cursors - this.parsedQuery = listPublicRunsResponse.parsedQuery - additionalProperties(listPublicRunsResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(listPublicRunsResponse: ListPublicRunsResponse) = apply { + this.runs = listPublicRunsResponse.runs + this.cursors = listPublicRunsResponse.cursors + this.parsedQuery = listPublicRunsResponse.parsedQuery + additionalProperties(listPublicRunsResponse.additionalProperties) + } - fun runs(runs: List) = - runs(JsonField.of(runs)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runs(runs: List) = runs(JsonField.of(runs)) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("runs") @ExcludeMissing - fun runs(runs: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runs = runs - } + fun runs(runs: JsonField>) = apply { this.runs = runs } - fun cursors(cursors: Cursors) = - cursors(JsonField.of(cursors)) // templates/JavaSDK/entities/objects.ts:252:20 + fun cursors(cursors: Cursors) = cursors(JsonField.of(cursors)) - @JsonProperty("cursors") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("cursors") @ExcludeMissing - fun cursors(cursors: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.cursors = cursors - } + fun cursors(cursors: JsonField) = apply { this.cursors = cursors } - fun parsedQuery(parsedQuery: String) = - parsedQuery(JsonField.of(parsedQuery)) // templates/JavaSDK/entities/objects.ts:252:20 + fun parsedQuery(parsedQuery: String) = parsedQuery(JsonField.of(parsedQuery)) - @JsonProperty("parsed_query") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("parsed_query") @ExcludeMissing - fun parsedQuery(parsedQuery: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parsedQuery = parsedQuery - } + fun parsedQuery(parsedQuery: JsonField) = apply { this.parsedQuery = parsedQuery } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ListPublicRunsResponse = - ListPublicRunsResponse( // templates/JavaSDK/entities/objects.ts:326:30 - runs.map { it.toUnmodifiable() }, // templates/JavaSDK/entities/objects.ts:326:30 + ListPublicRunsResponse( + runs.map { it.toUnmodifiable() }, cursors, parsedQuery, additionalProperties.toUnmodifiable(), ) } - @JsonDeserialize( - builder = Cursors.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Cursors.Builder::class) @NoAutoDetect class Cursors private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Cursors = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): Cursors = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Cursors && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is Cursors && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -246,44 +186,33 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Cursors{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(cursors: Cursors) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(cursors.additionalProperties) - } + @JvmSynthetic + internal fun from(cursors: Cursors) = apply { + additionalProperties(cursors.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Cursors = Cursors(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListRunsResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListRunsResponse.kt index 5dd86982..491794be 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListRunsResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/ListRunsResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,23 +15,17 @@ import com.langsmith.api.core.toUnmodifiable import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = ListRunsResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = ListRunsResponse.Builder::class) @NoAutoDetect class ListRunsResponse -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val runs: JsonField>, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val runs: JsonField>, private val cursors: JsonField, private val parsedQuery: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -44,29 +36,19 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun parsedQuery(): Optional = Optional.ofNullable(parsedQuery.getNullable("parsed_query")) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runs() = runs + @JsonProperty("runs") @ExcludeMissing fun _runs() = runs - @JsonProperty("cursors") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _cursors() = cursors + @JsonProperty("cursors") @ExcludeMissing fun _cursors() = cursors - @JsonProperty("parsed_query") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parsedQuery() = parsedQuery + @JsonProperty("parsed_query") @ExcludeMissing fun _parsedQuery() = parsedQuery - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ListRunsResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - runs().forEach { it.validate() } // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): ListRunsResponse = apply { + if (!validated) { + runs().forEach { it.validate() } cursors().validate() parsedQuery() validated = true @@ -75,27 +57,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ListRunsResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ListRunsResponse && this.runs == other.runs && this.cursors == other.cursors && this.parsedQuery == other.parsedQuery && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - runs, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + runs, cursors, parsedQuery, additionalProperties, @@ -107,136 +85,100 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "ListRunsResponse{runs=$runs, cursors=$cursors, parsedQuery=$parsedQuery, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var runs: JsonField> = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var runs: JsonField> = JsonMissing.of() private var cursors: JsonField = JsonMissing.of() private var parsedQuery: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(listRunsResponse: ListRunsResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.runs = listRunsResponse.runs // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.cursors = listRunsResponse.cursors - this.parsedQuery = listRunsResponse.parsedQuery - additionalProperties(listRunsResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(listRunsResponse: ListRunsResponse) = apply { + this.runs = listRunsResponse.runs + this.cursors = listRunsResponse.cursors + this.parsedQuery = listRunsResponse.parsedQuery + additionalProperties(listRunsResponse.additionalProperties) + } - fun runs(runs: List) = - runs(JsonField.of(runs)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runs(runs: List) = runs(JsonField.of(runs)) - @JsonProperty("runs") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("runs") @ExcludeMissing - fun runs(runs: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runs = runs - } + fun runs(runs: JsonField>) = apply { this.runs = runs } - fun cursors(cursors: Cursors) = - cursors(JsonField.of(cursors)) // templates/JavaSDK/entities/objects.ts:252:20 + fun cursors(cursors: Cursors) = cursors(JsonField.of(cursors)) - @JsonProperty("cursors") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("cursors") @ExcludeMissing - fun cursors(cursors: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.cursors = cursors - } + fun cursors(cursors: JsonField) = apply { this.cursors = cursors } - fun parsedQuery(parsedQuery: String) = - parsedQuery(JsonField.of(parsedQuery)) // templates/JavaSDK/entities/objects.ts:252:20 + fun parsedQuery(parsedQuery: String) = parsedQuery(JsonField.of(parsedQuery)) - @JsonProperty("parsed_query") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("parsed_query") @ExcludeMissing - fun parsedQuery(parsedQuery: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parsedQuery = parsedQuery - } + fun parsedQuery(parsedQuery: JsonField) = apply { this.parsedQuery = parsedQuery } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): ListRunsResponse = - ListRunsResponse( // templates/JavaSDK/entities/objects.ts:326:30 - runs.map { it.toUnmodifiable() }, // templates/JavaSDK/entities/objects.ts:326:30 + ListRunsResponse( + runs.map { it.toUnmodifiable() }, cursors, parsedQuery, additionalProperties.toUnmodifiable(), ) } - @JsonDeserialize( - builder = Cursors.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Cursors.Builder::class) @NoAutoDetect class Cursors private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Cursors = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): Cursors = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Cursors && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is Cursors && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -244,44 +186,33 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Cursors{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(cursors: Cursors) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(cursors.additionalProperties) - } + @JvmSynthetic + internal fun from(cursors: Cursors) = apply { + additionalProperties(cursors.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Cursors = Cursors(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/MonitorResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/MonitorResponse.kt index 9c4c46b0..0a03000b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/MonitorResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/MonitorResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,60 +15,47 @@ import com.langsmith.api.core.toUnmodifiable import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = MonitorResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = MonitorResponse.Builder::class) @NoAutoDetect class MonitorResponse private constructor( - private val blocks: JsonField>, + private val blocks: JsonField>, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - fun blocks(): List = blocks.getRequired("blocks") + fun blocks(): List = blocks.getRequired("blocks") - @JsonProperty("blocks") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _blocks() = blocks + @JsonProperty("blocks") @ExcludeMissing fun _blocks() = blocks - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): MonitorResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - blocks().forEach { it.validate() } // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): MonitorResponse = apply { + if (!validated) { + blocks().forEach { it.validate() } validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is MonitorResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is MonitorResponse && this.blocks == other.blocks && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(blocks, additionalProperties) } return hashCode @@ -79,59 +64,41 @@ private constructor( override fun toString() = "MonitorResponse{blocks=$blocks, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var blocks: JsonField> = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var blocks: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(monitorResponse: MonitorResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.blocks = - monitorResponse.blocks // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(monitorResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(monitorResponse: MonitorResponse) = apply { + this.blocks = monitorResponse.blocks + additionalProperties(monitorResponse.additionalProperties) + } - fun blocks(blocks: List) = - blocks(JsonField.of(blocks)) // templates/JavaSDK/entities/objects.ts:252:20 + fun blocks(blocks: List) = blocks(JsonField.of(blocks)) - @JsonProperty("blocks") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("blocks") @ExcludeMissing - fun blocks(blocks: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.blocks = blocks - } + fun blocks(blocks: JsonField>) = apply { this.blocks = blocks } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): MonitorResponse = MonitorResponse( @@ -140,16 +107,11 @@ private constructor( ) } - @JsonDeserialize( - builder = MonitorBlock.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Block.Builder::class) @NoAutoDetect - class MonitorBlock - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val title: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + class Block + private constructor( + private val title: JsonField, private val section: JsonField, private val columns: JsonField>, private val subtitle: JsonField, @@ -160,8 +122,7 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -181,49 +142,29 @@ private constructor( fun toggleableMarks(): Optional = Optional.ofNullable(toggleableMarks.getNullable("toggleable_marks")) - @JsonProperty("title") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _title() = title + @JsonProperty("title") @ExcludeMissing fun _title() = title - @JsonProperty("section") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _section() = section + @JsonProperty("section") @ExcludeMissing fun _section() = section - @JsonProperty("columns") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _columns() = columns + @JsonProperty("columns") @ExcludeMissing fun _columns() = columns - @JsonProperty("subtitle") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _subtitle() = subtitle + @JsonProperty("subtitle") @ExcludeMissing fun _subtitle() = subtitle - @JsonProperty("rows") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _rows() = rows + @JsonProperty("rows") @ExcludeMissing fun _rows() = rows - @JsonProperty("chart_spec") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _chartSpec() = chartSpec + @JsonProperty("chart_spec") @ExcludeMissing fun _chartSpec() = chartSpec - @JsonProperty("click_target") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _clickTarget() = clickTarget + @JsonProperty("click_target") @ExcludeMissing fun _clickTarget() = clickTarget - @JsonProperty("toggleable_marks") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _toggleableMarks() = toggleableMarks + @JsonProperty("toggleable_marks") @ExcludeMissing fun _toggleableMarks() = toggleableMarks - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): MonitorBlock = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - title() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Block = apply { + if (!validated) { + title() section() columns() subtitle() @@ -236,12 +177,12 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is MonitorBlock && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Block && this.title == other.title && this.section == other.section && this.columns == other.columns && @@ -253,15 +194,11 @@ private constructor( this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - title, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + title, section, columns, subtitle, @@ -276,23 +213,16 @@ private constructor( } override fun toString() = - "MonitorBlock{title=$title, section=$section, columns=$columns, subtitle=$subtitle, rows=$rows, chartSpec=$chartSpec, clickTarget=$clickTarget, toggleableMarks=$toggleableMarks, additionalProperties=$additionalProperties}" + "Block{title=$title, section=$section, columns=$columns, subtitle=$subtitle, rows=$rows, chartSpec=$chartSpec, clickTarget=$clickTarget, toggleableMarks=$toggleableMarks, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var title: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var title: JsonField = JsonMissing.of() private var section: JsonField = JsonMissing.of() private var columns: JsonField> = JsonMissing.of() private var subtitle: JsonField = JsonMissing.of() @@ -302,126 +232,87 @@ private constructor( private var toggleableMarks: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(monitorBlock: MonitorBlock) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.title = - monitorBlock.title // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.section = monitorBlock.section - this.columns = monitorBlock.columns - this.subtitle = monitorBlock.subtitle - this.rows = monitorBlock.rows - this.chartSpec = monitorBlock.chartSpec - this.clickTarget = monitorBlock.clickTarget - this.toggleableMarks = monitorBlock.toggleableMarks - additionalProperties(monitorBlock.additionalProperties) - } + @JvmSynthetic + internal fun from(block: Block) = apply { + this.title = block.title + this.section = block.section + this.columns = block.columns + this.subtitle = block.subtitle + this.rows = block.rows + this.chartSpec = block.chartSpec + this.clickTarget = block.clickTarget + this.toggleableMarks = block.toggleableMarks + additionalProperties(block.additionalProperties) + } - fun title(title: String) = - title(JsonField.of(title)) // templates/JavaSDK/entities/objects.ts:252:20 + fun title(title: String) = title(JsonField.of(title)) - @JsonProperty("title") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("title") @ExcludeMissing - fun title(title: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.title = title - } + fun title(title: JsonField) = apply { this.title = title } - fun section(section: String) = - section(JsonField.of(section)) // templates/JavaSDK/entities/objects.ts:252:20 + fun section(section: String) = section(JsonField.of(section)) - @JsonProperty("section") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("section") @ExcludeMissing - fun section(section: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.section = section - } + fun section(section: JsonField) = apply { this.section = section } - fun columns(columns: List) = - columns(JsonField.of(columns)) // templates/JavaSDK/entities/objects.ts:252:20 + fun columns(columns: List) = columns(JsonField.of(columns)) - @JsonProperty("columns") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("columns") @ExcludeMissing - fun columns(columns: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.columns = columns - } + fun columns(columns: JsonField>) = apply { this.columns = columns } - fun subtitle(subtitle: String) = - subtitle(JsonField.of(subtitle)) // templates/JavaSDK/entities/objects.ts:252:20 + fun subtitle(subtitle: String) = subtitle(JsonField.of(subtitle)) - @JsonProperty("subtitle") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("subtitle") @ExcludeMissing - fun subtitle(subtitle: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.subtitle = subtitle - } + fun subtitle(subtitle: JsonField) = apply { this.subtitle = subtitle } - fun rows(rows: List>) = - rows(JsonField.of(rows)) // templates/JavaSDK/entities/objects.ts:252:20 + fun rows(rows: List>) = rows(JsonField.of(rows)) - @JsonProperty("rows") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("rows") @ExcludeMissing - fun rows(rows: JsonField>>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.rows = rows - } + fun rows(rows: JsonField>>) = apply { this.rows = rows } - @JsonProperty("chart_spec") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("chart_spec") @ExcludeMissing - fun chartSpec(chartSpec: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.chartSpec = chartSpec - } + fun chartSpec(chartSpec: JsonValue) = apply { this.chartSpec = chartSpec } - fun clickTarget(clickTarget: String) = - clickTarget( - JsonField.of(clickTarget) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun clickTarget(clickTarget: String) = clickTarget(JsonField.of(clickTarget)) - @JsonProperty("click_target") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("click_target") @ExcludeMissing - fun clickTarget(clickTarget: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.clickTarget = clickTarget - } + fun clickTarget(clickTarget: JsonField) = apply { + this.clickTarget = clickTarget + } fun toggleableMarks(toggleableMarks: ToggleableMarks) = - toggleableMarks( - JsonField.of(toggleableMarks) - ) // templates/JavaSDK/entities/objects.ts:252:20 + toggleableMarks(JsonField.of(toggleableMarks)) - @JsonProperty("toggleable_marks") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("toggleable_marks") @ExcludeMissing - fun toggleableMarks(toggleableMarks: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.toggleableMarks = toggleableMarks - } + fun toggleableMarks(toggleableMarks: JsonField) = apply { + this.toggleableMarks = toggleableMarks + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } - fun build(): MonitorBlock = - MonitorBlock( // templates/JavaSDK/entities/objects.ts:326:30 - title, // templates/JavaSDK/entities/objects.ts:326:30 + fun build(): Block = + Block( + title, section, columns.map { it.toUnmodifiable() }, subtitle, @@ -433,55 +324,40 @@ private constructor( ) } - @JsonDeserialize( - builder = ToggleableMarks.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = ToggleableMarks.Builder::class) @NoAutoDetect class ToggleableMarks private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): ToggleableMarks = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): ToggleableMarks = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is ToggleableMarks && // templates/JavaSDK/entities/fields.ts:143:33 + return other is ToggleableMarks && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -489,42 +365,32 @@ private constructor( override fun toString() = "ToggleableMarks{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(toggleableMarks: ToggleableMarks) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(toggleableMarks.additionalProperties) - } + @JvmSynthetic + internal fun from(toggleableMarks: ToggleableMarks) = apply { + additionalProperties(toggleableMarks.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveParams.kt index e4a6629e..d89e0944 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class OkRetrieveParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is OkRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is OkRetrieveParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(okRetrieveParams: OkRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - okRetrieveParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(okRetrieveParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(okRetrieveParams: OkRetrieveParams) = apply { + additionalQueryParams(okRetrieveParams.additionalQueryParams) + additionalHeaders(okRetrieveParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): OkRetrieveParams = OkRetrieveParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveResponse.kt index 885a0eeb..c7e43af5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/OkRetrieveResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = OkRetrieveResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = OkRetrieveResponse.Builder::class) @NoAutoDetect class OkRetrieveResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): OkRetrieveResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): OkRetrieveResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is OkRetrieveResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is OkRetrieveResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "OkRetrieveResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(okRetrieveResponse: OkRetrieveResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(okRetrieveResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(okRetrieveResponse: OkRetrieveResponse) = apply { + additionalProperties(okRetrieveResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): OkRetrieveResponse = OkRetrieveResponse(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PendingIdentity.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PendingIdentity.kt index 6ee13e1d..fd829bb0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PendingIdentity.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PendingIdentity.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,16 +16,11 @@ import java.time.OffsetDateTime import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = PendingIdentity.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = PendingIdentity.Builder::class) @NoAutoDetect class PendingIdentity -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val email: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val email: JsonField, private val readOnly: JsonField, private val id: JsonField, private val tenantId: JsonField, @@ -36,8 +29,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -54,41 +46,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - @JsonProperty("email") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _email() = email + @JsonProperty("email") @ExcludeMissing fun _email() = email - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _readOnly() = readOnly + @JsonProperty("read_only") @ExcludeMissing fun _readOnly() = readOnly - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _organizationId() = organizationId + @JsonProperty("organization_id") @ExcludeMissing fun _organizationId() = organizationId - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): PendingIdentity = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - email() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): PendingIdentity = apply { + if (!validated) { + email() readOnly() id() tenantId() @@ -100,12 +76,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is PendingIdentity && // templates/JavaSDK/entities/fields.ts:143:33 + return other is PendingIdentity && this.email == other.email && this.readOnly == other.readOnly && this.id == other.id && @@ -115,15 +91,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - email, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + email, readOnly, id, tenantId, @@ -138,21 +110,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "PendingIdentity{email=$email, readOnly=$readOnly, id=$id, tenantId=$tenantId, organizationId=$organizationId, createdAt=$createdAt, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var email: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var email: JsonField = JsonMissing.of() private var readOnly: JsonField = JsonMissing.of() private var id: JsonField = JsonMissing.of() private var tenantId: JsonField = JsonMissing.of() @@ -160,101 +125,70 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var createdAt: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(pendingIdentity: PendingIdentity) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.email = - pendingIdentity.email // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.readOnly = pendingIdentity.readOnly - this.id = pendingIdentity.id - this.tenantId = pendingIdentity.tenantId - this.organizationId = pendingIdentity.organizationId - this.createdAt = pendingIdentity.createdAt - additionalProperties(pendingIdentity.additionalProperties) - } - - fun email(email: String) = - email(JsonField.of(email)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("email") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun email(email: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.email = email - } - - fun readOnly(readOnly: Boolean) = - readOnly(JsonField.of(readOnly)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun readOnly(readOnly: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(pendingIdentity: PendingIdentity) = apply { + this.email = pendingIdentity.email + this.readOnly = pendingIdentity.readOnly + this.id = pendingIdentity.id + this.tenantId = pendingIdentity.tenantId + this.organizationId = pendingIdentity.organizationId + this.createdAt = pendingIdentity.createdAt + additionalProperties(pendingIdentity.additionalProperties) } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun email(email: String) = email(JsonField.of(email)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("email") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun email(email: JsonField) = apply { this.email = email } - fun organizationId(organizationId: String) = - organizationId( - JsonField.of(organizationId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun readOnly(readOnly: Boolean) = readOnly(JsonField.of(readOnly)) - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("read_only") @ExcludeMissing - fun organizationId(organizationId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.organizationId = organizationId - } + fun readOnly(readOnly: JsonField) = apply { this.readOnly = readOnly } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) + + @JsonProperty("tenant_id") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId)) - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("organization_id") + @ExcludeMissing + fun organizationId(organizationId: JsonField) = apply { + this.organizationId = organizationId + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + @JsonProperty("created_at") + @ExcludeMissing + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): PendingIdentity = - PendingIdentity( // templates/JavaSDK/entities/objects.ts:326:30 - email, // templates/JavaSDK/entities/objects.ts:326:30 + PendingIdentity( + email, readOnly, id, tenantId, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParams.kt index eee9d125..86c93860 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -13,12 +13,8 @@ import java.util.Objects import java.util.Optional class PublicDatasetFeedbackRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val shareToken: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val shareToken: String, private val hasComment: Boolean?, private val hasScore: Boolean?, private val key: List?, @@ -26,14 +22,13 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val offset: Long?, private val run: List?, private val session: List?, - private val source: List?, + private val source: List?, private val user: List?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun shareToken(): String = shareToken // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun shareToken(): String = shareToken fun hasComment(): Optional = Optional.ofNullable(hasComment) @@ -49,54 +44,31 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun session(): Optional> = Optional.ofNullable(session) - fun source(): Optional> = Optional.ofNullable(source) + fun source(): Optional> = Optional.ofNullable(source) fun user(): Optional> = Optional.ofNullable(user) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.hasComment?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("has_comment", listOf(it.toString())) - } - this.hasScore?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("has_score", listOf(it.toString())) - } - this.key?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("key", listOf(it.joinToString(separator = ","))) - } - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } - this.run?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("run", listOf(it.joinToString(separator = ","))) - } - this.session?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("session", listOf(it.joinToString(separator = ","))) - } - this.source?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("source", listOf(it.joinToString(separator = ","))) - } - this.user?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("user", listOf(it.joinToString(separator = ","))) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.hasComment?.let { params.put("has_comment", listOf(it.toString())) } + this.hasScore?.let { params.put("has_score", listOf(it.toString())) } + this.key?.let { params.put("key", listOf(it.joinToString(separator = ","))) } + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } + this.run?.let { params.put("run", listOf(it.joinToString(separator = ","))) } + this.session?.let { params.put("session", listOf(it.joinToString(separator = ","))) } + this.source?.let { params.put("source", listOf(it.joinToString(separator = ","))) } + this.user?.let { params.put("user", listOf(it.joinToString(separator = ","))) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> shareToken // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> shareToken else -> "" } } @@ -105,13 +77,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - PublicDatasetFeedbackRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is PublicDatasetFeedbackRetrieveParams && this.shareToken == other.shareToken && this.hasComment == other.hasComment && this.hasScore == other.hasScore && @@ -126,10 +97,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - shareToken, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + shareToken, hasComment, hasScore, key, @@ -149,20 +119,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var shareToken: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var shareToken: String? = null private var hasComment: Boolean? = null private var hasScore: Boolean? = null private var key: MutableList = mutableListOf() @@ -170,19 +135,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var offset: Long? = null private var run: MutableList = mutableListOf() private var session: MutableList = mutableListOf() - private var source: MutableList = mutableListOf() + private var source: MutableList = mutableListOf() private var user: MutableList = mutableListOf() private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 + @JvmSynthetic internal fun from( publicDatasetFeedbackRetrieveParams: PublicDatasetFeedbackRetrieveParams - ) = apply { // templates/JavaSDK/entities/params.ts:257:34 - this.shareToken = - publicDatasetFeedbackRetrieveParams - .shareToken // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 + ) = apply { + this.shareToken = publicDatasetFeedbackRetrieveParams.shareToken this.hasComment = publicDatasetFeedbackRetrieveParams.hasComment this.hasScore = publicDatasetFeedbackRetrieveParams.hasScore this.key(publicDatasetFeedbackRetrieveParams.key ?: listOf()) @@ -196,135 +158,94 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // additionalHeaders(publicDatasetFeedbackRetrieveParams.additionalHeaders) } - fun shareToken(shareToken: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.shareToken = shareToken - } + fun shareToken(shareToken: String) = apply { this.shareToken = shareToken } - fun hasComment(hasComment: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.hasComment = hasComment - } + fun hasComment(hasComment: Boolean) = apply { this.hasComment = hasComment } - fun hasScore(hasScore: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.hasScore = hasScore - } + fun hasScore(hasScore: Boolean) = apply { this.hasScore = hasScore } - fun key(key: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.key.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun key(key: List) = apply { + this.key.clear() this.key.addAll(key) } - fun addKey(key: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.key.add(key) - } + fun addKey(key: String) = apply { this.key.add(key) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit - } + fun limit(limit: Long) = apply { this.limit = limit } - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset - } + fun offset(offset: Long) = apply { this.offset = offset } - fun run(run: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.run.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun run(run: List) = apply { + this.run.clear() this.run.addAll(run) } - fun addRun(run: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.run.add(run) - } + fun addRun(run: String) = apply { this.run.add(run) } - fun session(session: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.session.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun session(session: List) = apply { + this.session.clear() this.session.addAll(session) } - fun addSession(session: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.session.add(session) + fun addSession(session: String) = apply { this.session.add(session) } + + fun source(source: List) = apply { + this.source.clear() + this.source.addAll(source) } - fun source(source: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.source.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.source.addAll(source) - } + fun addSource(source: Source) = apply { this.source.add(source) } - fun addSource(source: SourceType) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.source.add(source) - } - - fun user(user: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.user.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun user(user: List) = apply { + this.user.clear() this.user.addAll(user) } - fun addUser(user: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.user.add(user) + fun addUser(user: String) = apply { this.user.add(user) } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): PublicDatasetFeedbackRetrieveParams = - PublicDatasetFeedbackRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(shareToken) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`shareToken` is required but was not set" - }, + PublicDatasetFeedbackRetrieveParams( + checkNotNull(shareToken) { "`shareToken` is required but was not set" }, hasComment, hasScore, if (key.size == 0) null else key.toUnmodifiable(), @@ -339,73 +260,64 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - class SourceType + class Source @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SourceType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Source && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val API = SourceType(JsonField.of("api")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val API = Source(JsonField.of("api")) - @JvmField val MODEL = SourceType(JsonField.of("model")) + @JvmField val MODEL = Source(JsonField.of("model")) - @JvmField val APP = SourceType(JsonField.of("app")) + @JvmField val APP = Source(JsonField.of("app")) - @JvmStatic fun of(value: String) = SourceType(JsonField.of(value)) + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - API, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + API, MODEL, APP, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - API, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + API, MODEL, APP, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - API -> Value.API // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + API -> Value.API MODEL -> Value.MODEL APP -> Value.APP else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - API -> Known.API // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + API -> Known.API MODEL -> Known.MODEL APP -> Known.APP - else -> throw LangSmithInvalidDataException("Unknown SourceType: $value") + else -> throw LangSmithInvalidDataException("Unknown Source: $value") } fun asString(): String = _value().asStringOrThrow() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetListParams.kt index 605dbe83..bdfe5dae 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -9,48 +9,34 @@ import java.util.Objects import java.util.Optional class PublicDatasetListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val shareToken: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val shareToken: String, private val limit: Long?, private val offset: Long?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun shareToken(): String = shareToken // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun shareToken(): String = shareToken fun limit(): Optional = Optional.ofNullable(limit) fun offset(): Optional = Optional.ofNullable(offset) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> shareToken // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> shareToken else -> "" } } @@ -59,12 +45,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is PublicDatasetListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is PublicDatasetListParams && this.shareToken == other.shareToken && this.limit == other.limit && this.offset == other.offset && @@ -72,10 +58,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - shareToken, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + shareToken, limit, offset, additionalQueryParams, @@ -88,108 +73,78 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var shareToken: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var shareToken: String? = null private var limit: Long? = null private var offset: Long? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(publicDatasetListParams: PublicDatasetListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.shareToken = - publicDatasetListParams - .shareToken // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.limit = publicDatasetListParams.limit - this.offset = publicDatasetListParams.offset - additionalQueryParams(publicDatasetListParams.additionalQueryParams) - additionalHeaders(publicDatasetListParams.additionalHeaders) - } - - fun shareToken(shareToken: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.shareToken = shareToken + @JvmSynthetic + internal fun from(publicDatasetListParams: PublicDatasetListParams) = apply { + this.shareToken = publicDatasetListParams.shareToken + this.limit = publicDatasetListParams.limit + this.offset = publicDatasetListParams.offset + additionalQueryParams(publicDatasetListParams.additionalQueryParams) + additionalHeaders(publicDatasetListParams.additionalHeaders) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit + fun shareToken(shareToken: String) = apply { this.shareToken = shareToken } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): PublicDatasetListParams = - PublicDatasetListParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(shareToken) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`shareToken` is required but was not set" - }, + PublicDatasetListParams( + checkNotNull(shareToken) { "`shareToken` is required but was not set" }, limit, offset, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParams.kt index f84895c2..ef08471c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,12 +19,8 @@ import java.util.Objects import java.util.Optional class PublicDatasetRunQueryCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val shareToken: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val shareToken: String, private val id: List?, private val cursor: String?, private val endTime: OffsetDateTime?, @@ -39,7 +33,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val query: String?, private val referenceExample: List?, private val runType: RunType?, - private val select: List?, + private val select: List?, private val session: List?, private val startTime: OffsetDateTime?, private val trace: String?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): List? = id + @JsonProperty("id") fun id(): List? = id - @JsonProperty("cursor") // templates/JavaSDK/entities/objects.ts:113:14 - fun cursor(): String? = cursor + @JsonProperty("cursor") fun cursor(): String? = cursor - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun endTime(): OffsetDateTime? = endTime + @JsonProperty("end_time") fun endTime(): OffsetDateTime? = endTime - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:113:14 - fun error(): Boolean? = error + @JsonProperty("error") fun error(): Boolean? = error - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:113:14 - fun executionOrder(): Long? = executionOrder + @JsonProperty("execution_order") fun executionOrder(): Long? = executionOrder - @JsonProperty("filter") // templates/JavaSDK/entities/objects.ts:113:14 - fun filter(): String? = filter + @JsonProperty("filter") fun filter(): String? = filter - @JsonProperty("is_root") // templates/JavaSDK/entities/objects.ts:113:14 - fun isRoot(): Boolean? = isRoot + @JsonProperty("is_root") fun isRoot(): Boolean? = isRoot - @JsonProperty("limit") // templates/JavaSDK/entities/objects.ts:113:14 - fun limit(): Long? = limit + @JsonProperty("limit") fun limit(): Long? = limit - @JsonProperty("parent_run") // templates/JavaSDK/entities/objects.ts:113:14 - fun parentRun(): String? = parentRun + @JsonProperty("parent_run") fun parentRun(): String? = parentRun - @JsonProperty("query") // templates/JavaSDK/entities/objects.ts:113:14 - fun query(): String? = query + @JsonProperty("query") fun query(): String? = query - @JsonProperty("reference_example") // templates/JavaSDK/entities/objects.ts:113:14 - fun referenceExample(): List? = referenceExample + @JsonProperty("reference_example") fun referenceExample(): List? = referenceExample /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:113:14 - fun runType(): RunType? = runType + @JsonProperty("run_type") fun runType(): RunType? = runType - @JsonProperty("select") // templates/JavaSDK/entities/objects.ts:113:14 - fun select(): List? = select + @JsonProperty("select") fun select(): List? = null private var session: List? = null private var startTime: OffsetDateTime? = null private var trace: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(publicDatasetRunQueryCreateBody: PublicDatasetRunQueryCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.id = - publicDatasetRunQueryCreateBody - .id // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 + apply { + this.id = publicDatasetRunQueryCreateBody.id this.cursor = publicDatasetRunQueryCreateBody.cursor this.endTime = publicDatasetRunQueryCreateBody.endTime this.error = publicDatasetRunQueryCreateBody.error @@ -324,132 +276,68 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // additionalProperties(publicDatasetRunQueryCreateBody.additionalProperties) } - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: List) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JsonProperty("id") fun id(id: List) = apply { this.id = id } + + @JsonProperty("cursor") fun cursor(cursor: String) = apply { this.cursor = cursor } + + @JsonProperty("end_time") + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + @JsonProperty("error") fun error(error: Boolean) = apply { this.error = error } + + @JsonProperty("execution_order") + fun executionOrder(executionOrder: Long) = apply { + this.executionOrder = executionOrder } - @JsonProperty("cursor") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun cursor(cursor: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.cursor = cursor + @JsonProperty("filter") fun filter(filter: String) = apply { this.filter = filter } + + @JsonProperty("is_root") fun isRoot(isRoot: Boolean) = apply { this.isRoot = isRoot } + + @JsonProperty("limit") fun limit(limit: Long) = apply { this.limit = limit } + + @JsonProperty("parent_run") + fun parentRun(parentRun: String) = apply { this.parentRun = parentRun } + + @JsonProperty("query") fun query(query: String) = apply { this.query = query } + + @JsonProperty("reference_example") + fun referenceExample(referenceExample: List) = apply { + this.referenceExample = referenceExample } - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } - - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun error(error: Boolean) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.error = error - } - - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun executionOrder(executionOrder: Long) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.executionOrder = executionOrder - } - - @JsonProperty("filter") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun filter(filter: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.filter = filter - } - - @JsonProperty("is_root") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun isRoot(isRoot: Boolean) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.isRoot = isRoot - } - - @JsonProperty("limit") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.limit = limit - } - - @JsonProperty("parent_run") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun parentRun(parentRun: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRun = parentRun - } - - @JsonProperty("query") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun query(query: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.query = query - } - - @JsonProperty("reference_example") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun referenceExample(referenceExample: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceExample = referenceExample - } - /** Enum for run types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:264:20 - fun runType(runType: RunType) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runType = runType + @JsonProperty("run_type") + fun runType(runType: RunType) = apply { this.runType = runType } + + @JsonProperty("select") + fun select(select: List = mutableListOf() private var session: MutableList = mutableListOf() private var startTime: OffsetDateTime? = null private var trace: String? = null @@ -570,13 +451,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 + @JvmSynthetic internal fun from(publicDatasetRunQueryCreateParams: PublicDatasetRunQueryCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.shareToken = - publicDatasetRunQueryCreateParams - .shareToken // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 + apply { + this.shareToken = publicDatasetRunQueryCreateParams.shareToken this.id(publicDatasetRunQueryCreateParams.id ?: listOf()) this.cursor = publicDatasetRunQueryCreateParams.cursor this.endTime = publicDatasetRunQueryCreateParams.endTime @@ -600,180 +478,120 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // additionalBodyProperties(publicDatasetRunQueryCreateParams.additionalBodyProperties) } - fun shareToken(shareToken: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.shareToken = shareToken - } + fun shareToken(shareToken: String) = apply { this.shareToken = shareToken } - fun id(id: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.id.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun id(id: List) = apply { + this.id.clear() this.id.addAll(id) } - fun addId(id: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.id.add(id) + fun addId(id: String) = apply { this.id.add(id) } + + fun cursor(cursor: String) = apply { this.cursor = cursor } + + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + fun error(error: Boolean) = apply { this.error = error } + + fun executionOrder(executionOrder: Long) = apply { this.executionOrder = executionOrder } + + fun filter(filter: String) = apply { this.filter = filter } + + fun isRoot(isRoot: Boolean) = apply { this.isRoot = isRoot } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun parentRun(parentRun: String) = apply { this.parentRun = parentRun } + + fun query(query: String) = apply { this.query = query } + + fun referenceExample(referenceExample: List) = apply { + this.referenceExample.clear() + this.referenceExample.addAll(referenceExample) } - fun cursor(cursor: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.cursor = cursor + fun addReferenceExample(referenceExample: String) = apply { + this.referenceExample.add(referenceExample) } - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.endTime = endTime - } - - fun error(error: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.error = error - } - - fun executionOrder(executionOrder: Long) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.executionOrder = executionOrder - } - - fun filter(filter: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.filter = filter - } - - fun isRoot(isRoot: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.isRoot = isRoot - } - - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit - } - - fun parentRun(parentRun: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.parentRun = parentRun - } - - fun query(query: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.query = query - } - - fun referenceExample(referenceExample: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.referenceExample.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.referenceExample.addAll(referenceExample) - } - - fun addReferenceExample(referenceExample: String) = - apply { // templates/JavaSDK/entities/params.ts:620:26 - this.referenceExample.add(referenceExample) - } - /** Enum for run types. */ - fun runType(runType: RunType) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runType = runType - } + fun runType(runType: RunType) = apply { this.runType = runType } - fun select(select: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.select.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun select(select: List?, private val session: List?, private val startTime: OffsetDateTime?, private val trace: String?, @@ -47,9 +41,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun id(): Optional> = - Optional.ofNullable(id) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): Optional> = Optional.ofNullable(id) fun cursor(): Optional = Optional.ofNullable(cursor) @@ -73,7 +65,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun runType(): Optional = Optional.ofNullable(runType) - fun select(): Optional> = Optional.ofNullable(select) + fun select(): Optional> = Optional.ofNullable(select) fun session(): Optional> = Optional.ofNullable(session) @@ -81,11 +73,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun trace(): Optional = Optional.ofNullable(trace) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): RunQueryCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return RunQueryCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - id, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): RunQueryCreateBody { + return RunQueryCreateBody( + id, cursor, endTime, error, @@ -105,22 +96,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Query params for run endpoints. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = RunQueryCreateBody.Builder::class) @NoAutoDetect class RunQueryCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val id: List?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val id: List?, private val cursor: String?, private val endTime: OffsetDateTime?, private val error: Boolean?, @@ -132,78 +117,60 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val query: String?, private val referenceExample: List?, private val runType: RunType?, - private val select: List?, + private val select: List? = select - @JsonProperty("session") // templates/JavaSDK/entities/objects.ts:113:14 - fun session(): List? = session + @JsonProperty("session") fun session(): List? = session - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun startTime(): OffsetDateTime? = startTime + @JsonProperty("start_time") fun startTime(): OffsetDateTime? = startTime - @JsonProperty("trace") // templates/JavaSDK/entities/objects.ts:113:14 - fun trace(): String? = trace + @JsonProperty("trace") fun trace(): String? = trace - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunQueryCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunQueryCreateBody && this.id == other.id && this.cursor == other.cursor && this.endTime == other.endTime && @@ -223,15 +190,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - id, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + id, cursor, endTime, error, @@ -256,20 +219,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "RunQueryCreateBody{id=$id, cursor=$cursor, endTime=$endTime, error=$error, executionOrder=$executionOrder, filter=$filter, isRoot=$isRoot, limit=$limit, parentRun=$parentRun, query=$query, referenceExample=$referenceExample, runType=$runType, select=$select, session=$session, startTime=$startTime, trace=$trace, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var id: List? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var id: List? = null private var cursor: String? = null private var endTime: OffsetDateTime? = null private var error: Boolean? = null @@ -281,162 +238,95 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var query: String? = null private var referenceExample: List? = null private var runType: RunType? = null - private var select: List? = null + private var select: List) = apply { this.select = select } + + @JsonProperty("session") + fun session(session: List) = apply { this.session = session } + + @JsonProperty("start_time") + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } + + @JsonProperty("trace") fun trace(trace: String) = apply { this.trace = trace } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("select") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun select(select: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.select = select - } - - @JsonProperty("session") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun session(session: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.session = session - } - - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } - - @JsonProperty("trace") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun trace(trace: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.trace = trace + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunQueryCreateBody = - RunQueryCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - id?.toUnmodifiable(), // templates/JavaSDK/entities/objects.ts:326:30 + RunQueryCreateBody( + id?.toUnmodifiable(), cursor, endTime, error, @@ -463,12 +353,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunQueryCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunQueryCreateParams && this.id == other.id && this.cursor == other.cursor && this.endTime == other.endTime && @@ -490,10 +380,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, cursor, endTime, error, @@ -520,21 +409,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: MutableList = mutableListOf() private var cursor: String? = null private var endTime: OffsetDateTime? = null private var error: Boolean? = null @@ -546,7 +429,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var query: String? = null private var referenceExample: MutableList = mutableListOf() private var runType: RunType? = null - private var select: MutableList = mutableListOf() + private var select: MutableList) = apply { + this.select.clear() this.select.addAll(select) } - fun addSelect(select: RunSelect) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.select.add(select) - } + fun addSelect(select: Select) = apply { this.select.add(select) } - fun session(session: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.session.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun session(session: List) = apply { + this.session.clear() this.session.addAll(session) } - fun addSession(session: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.session.add(session) + fun addSession(session: String) = apply { this.session.add(session) } + + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } + + fun trace(trace: String) = apply { this.trace = trace } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.startTime = startTime - } - - fun trace(trace: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.trace = trace + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): RunQueryCreateParams = - RunQueryCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - if (id.size == 0) null - else id.toUnmodifiable(), // templates/JavaSDK/entities/params.ts:683:22 + RunQueryCreateParams( + if (id.size == 0) null else id.toUnmodifiable(), cursor, endTime, error, @@ -774,30 +597,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is RunType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val TOOL = RunType(JsonField.of("tool")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val TOOL = RunType(JsonField.of("tool")) @JvmField val CHAIN = RunType(JsonField.of("chain")) @@ -814,9 +632,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = RunType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - TOOL, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + TOOL, CHAIN, LLM, RETRIEVER, @@ -825,9 +642,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // PARSER, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - TOOL, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + TOOL, CHAIN, LLM, RETRIEVER, @@ -838,9 +654,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - TOOL -> Value.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Value.TOOL CHAIN -> Value.CHAIN LLM -> Value.LLM RETRIEVER -> Value.RETRIEVER @@ -851,9 +666,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - TOOL -> Known.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Known.TOOL CHAIN -> Known.CHAIN LLM -> Known.LLM RETRIEVER -> Known.RETRIEVER @@ -866,111 +680,105 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun asString(): String = _value().asStringOrThrow() } - class RunSelect + class Select @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunSelect && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is Select && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val ID = RunSelect(JsonField.of("id")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val ID = Select(JsonField.of("id")) - @JvmField val NAME = RunSelect(JsonField.of("name")) + @JvmField val NAME = Select(JsonField.of("name")) - @JvmField val RUN_TYPE = RunSelect(JsonField.of("run_type")) + @JvmField val RUN_TYPE = Select(JsonField.of("run_type")) - @JvmField val START_TIME = RunSelect(JsonField.of("start_time")) + @JvmField val START_TIME = Select(JsonField.of("start_time")) - @JvmField val END_TIME = RunSelect(JsonField.of("end_time")) + @JvmField val END_TIME = Select(JsonField.of("end_time")) - @JvmField val STATUS = RunSelect(JsonField.of("status")) + @JvmField val STATUS = Select(JsonField.of("status")) - @JvmField val ERROR = RunSelect(JsonField.of("error")) + @JvmField val ERROR = Select(JsonField.of("error")) - @JvmField val EXTRA = RunSelect(JsonField.of("extra")) + @JvmField val EXTRA = Select(JsonField.of("extra")) - @JvmField val EVENTS = RunSelect(JsonField.of("events")) + @JvmField val EVENTS = Select(JsonField.of("events")) - @JvmField val INPUTS = RunSelect(JsonField.of("inputs")) + @JvmField val INPUTS = Select(JsonField.of("inputs")) - @JvmField val INPUTS_S3_URLS = RunSelect(JsonField.of("inputs_s3_urls")) + @JvmField val INPUTS_S3_URLS = Select(JsonField.of("inputs_s3_urls")) - @JvmField val OUTPUTS = RunSelect(JsonField.of("outputs")) + @JvmField val OUTPUTS = Select(JsonField.of("outputs")) - @JvmField val OUTPUTS_S3_URLS = RunSelect(JsonField.of("outputs_s3_urls")) + @JvmField val OUTPUTS_S3_URLS = Select(JsonField.of("outputs_s3_urls")) - @JvmField val PARENT_RUN_ID = RunSelect(JsonField.of("parent_run_id")) + @JvmField val PARENT_RUN_ID = Select(JsonField.of("parent_run_id")) - @JvmField val MANIFEST_ID = RunSelect(JsonField.of("manifest_id")) + @JvmField val MANIFEST_ID = Select(JsonField.of("manifest_id")) - @JvmField val MANIFEST_S3_ID = RunSelect(JsonField.of("manifest_s3_id")) + @JvmField val MANIFEST_S3_ID = Select(JsonField.of("manifest_s3_id")) - @JvmField val SESSION_ID = RunSelect(JsonField.of("session_id")) + @JvmField val SESSION_ID = Select(JsonField.of("session_id")) - @JvmField val SERIALIZED = RunSelect(JsonField.of("serialized")) + @JvmField val SERIALIZED = Select(JsonField.of("serialized")) - @JvmField val REFERENCE_EXAMPLE_ID = RunSelect(JsonField.of("reference_example_id")) + @JvmField val REFERENCE_EXAMPLE_ID = Select(JsonField.of("reference_example_id")) - @JvmField val TOTAL_TOKENS = RunSelect(JsonField.of("total_tokens")) + @JvmField val TOTAL_TOKENS = Select(JsonField.of("total_tokens")) - @JvmField val PROMPT_TOKENS = RunSelect(JsonField.of("prompt_tokens")) + @JvmField val PROMPT_TOKENS = Select(JsonField.of("prompt_tokens")) - @JvmField val COMPLETION_TOKENS = RunSelect(JsonField.of("completion_tokens")) + @JvmField val COMPLETION_TOKENS = Select(JsonField.of("completion_tokens")) - @JvmField val TOTAL_COST = RunSelect(JsonField.of("total_cost")) + @JvmField val TOTAL_COST = Select(JsonField.of("total_cost")) - @JvmField val PROMPT_COST = RunSelect(JsonField.of("prompt_cost")) + @JvmField val PROMPT_COST = Select(JsonField.of("prompt_cost")) - @JvmField val COMPLETION_COST = RunSelect(JsonField.of("completion_cost")) + @JvmField val COMPLETION_COST = Select(JsonField.of("completion_cost")) - @JvmField val FIRST_TOKEN_TIME = RunSelect(JsonField.of("first_token_time")) + @JvmField val FIRST_TOKEN_TIME = Select(JsonField.of("first_token_time")) - @JvmField val TRACE_ID = RunSelect(JsonField.of("trace_id")) + @JvmField val TRACE_ID = Select(JsonField.of("trace_id")) - @JvmField val DOTTED_ORDER = RunSelect(JsonField.of("dotted_order")) + @JvmField val DOTTED_ORDER = Select(JsonField.of("dotted_order")) - @JvmField val LAST_QUEUED_AT = RunSelect(JsonField.of("last_queued_at")) + @JvmField val LAST_QUEUED_AT = Select(JsonField.of("last_queued_at")) - @JvmField val FEEDBACK_STATS = RunSelect(JsonField.of("feedback_stats")) + @JvmField val FEEDBACK_STATS = Select(JsonField.of("feedback_stats")) - @JvmField val CHILD_RUN_IDS = RunSelect(JsonField.of("child_run_ids")) + @JvmField val CHILD_RUN_IDS = Select(JsonField.of("child_run_ids")) - @JvmField val PARENT_RUN_IDS = RunSelect(JsonField.of("parent_run_ids")) + @JvmField val PARENT_RUN_IDS = Select(JsonField.of("parent_run_ids")) - @JvmField val TAGS = RunSelect(JsonField.of("tags")) + @JvmField val TAGS = Select(JsonField.of("tags")) - @JvmField val IN_DATASET = RunSelect(JsonField.of("in_dataset")) + @JvmField val IN_DATASET = Select(JsonField.of("in_dataset")) - @JvmField val APP_PATH = RunSelect(JsonField.of("app_path")) + @JvmField val APP_PATH = Select(JsonField.of("app_path")) - @JvmField val SHARE_TOKEN = RunSelect(JsonField.of("share_token")) + @JvmField val SHARE_TOKEN = Select(JsonField.of("share_token")) - @JvmStatic fun of(value: String) = RunSelect(JsonField.of(value)) + @JvmStatic fun of(value: String) = Select(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - ID, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + ID, NAME, RUN_TYPE, START_TIME, @@ -1008,9 +816,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // SHARE_TOKEN, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - ID, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + ID, NAME, RUN_TYPE, START_TIME, @@ -1050,9 +857,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - ID -> Value.ID // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + ID -> Value.ID NAME -> Value.NAME RUN_TYPE -> Value.RUN_TYPE START_TIME -> Value.START_TIME @@ -1092,9 +898,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - ID -> Known.ID // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + ID -> Known.ID NAME -> Known.NAME RUN_TYPE -> Known.RUN_TYPE START_TIME -> Known.START_TIME @@ -1130,7 +935,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // IN_DATASET -> Known.IN_DATASET APP_PATH -> Known.APP_PATH SHARE_TOKEN -> Known.SHARE_TOKEN - else -> throw LangSmithInvalidDataException("Unknown RunSelect: $value") + else -> throw LangSmithInvalidDataException("Unknown Select: $value") } fun asString(): String = _value().asStringOrThrow() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunRetrieveParams.kt index 6e3033d0..b68c3c1c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val runId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun runId(): String = runId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun runId(): String = runId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> runId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> runId else -> "" } } @@ -36,21 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunRetrieveParams && this.runId == other.runId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + runId, additionalQueryParams, additionalHeaders, ) @@ -61,95 +55,70 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var runId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var runId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(runRetrieveParams: RunRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.runId = - runRetrieveParams.runId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(runRetrieveParams.additionalQueryParams) - additionalHeaders(runRetrieveParams.additionalHeaders) - } - - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + @JvmSynthetic + internal fun from(runRetrieveParams: RunRetrieveParams) = apply { + this.runId = runRetrieveParams.runId + additionalQueryParams(runRetrieveParams.additionalQueryParams) + additionalHeaders(runRetrieveParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun runId(runId: String) = apply { this.runId = runId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): RunRetrieveParams = - RunRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`runId` is required but was not set" - }, + RunRetrieveParams( + checkNotNull(runId) { "`runId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchema.kt index 8c31199c..a2598ba1 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,15 +19,11 @@ import java.util.Objects import java.util.Optional /** Run schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = RunSchema.Builder::class) @NoAutoDetect class RunSchema -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val name: JsonField, private val inputs: JsonValue, private val runType: JsonField, private val startTime: JsonField, @@ -70,8 +64,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -154,170 +147,94 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun shareToken(): Optional = Optional.ofNullable(shareToken.getNullable("share_token")) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputs() = inputs + @JsonProperty("inputs") @ExcludeMissing fun _inputs() = inputs /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runType() = runType + @JsonProperty("run_type") @ExcludeMissing fun _runType() = runType - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _startTime() = startTime + @JsonProperty("start_time") @ExcludeMissing fun _startTime() = startTime - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _endTime() = endTime + @JsonProperty("end_time") @ExcludeMissing fun _endTime() = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _extra() = extra + @JsonProperty("extra") @ExcludeMissing fun _extra() = extra - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _error() = error + @JsonProperty("error") @ExcludeMissing fun _error() = error - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _executionOrder() = executionOrder + @JsonProperty("execution_order") @ExcludeMissing fun _executionOrder() = executionOrder - @JsonProperty("serialized") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _serialized() = serialized + @JsonProperty("serialized") @ExcludeMissing fun _serialized() = serialized - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputs() = outputs + @JsonProperty("outputs") @ExcludeMissing fun _outputs() = outputs - @JsonProperty("parent_run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parentRunId() = parentRunId + @JsonProperty("parent_run_id") @ExcludeMissing fun _parentRunId() = parentRunId - @JsonProperty("manifest_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _manifestId() = manifestId + @JsonProperty("manifest_id") @ExcludeMissing fun _manifestId() = manifestId - @JsonProperty("manifest_s3_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _manifestS3Id() = manifestS3Id + @JsonProperty("manifest_s3_id") @ExcludeMissing fun _manifestS3Id() = manifestS3Id - @JsonProperty("events") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _events() = events + @JsonProperty("events") @ExcludeMissing fun _events() = events - @JsonProperty("tags") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tags() = tags + @JsonProperty("tags") @ExcludeMissing fun _tags() = tags - @JsonProperty("inputs_s3_urls") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputsS3Urls() = inputsS3Urls + @JsonProperty("inputs_s3_urls") @ExcludeMissing fun _inputsS3Urls() = inputsS3Urls - @JsonProperty("outputs_s3_urls") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputsS3Urls() = outputsS3Urls + @JsonProperty("outputs_s3_urls") @ExcludeMissing fun _outputsS3Urls() = outputsS3Urls - @JsonProperty("trace_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _traceId() = traceId + @JsonProperty("trace_id") @ExcludeMissing fun _traceId() = traceId - @JsonProperty("dotted_order") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _dottedOrder() = dottedOrder + @JsonProperty("dotted_order") @ExcludeMissing fun _dottedOrder() = dottedOrder - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("status") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _status() = status + @JsonProperty("status") @ExcludeMissing fun _status() = status - @JsonProperty("child_run_ids") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _childRunIds() = childRunIds + @JsonProperty("child_run_ids") @ExcludeMissing fun _childRunIds() = childRunIds - @JsonProperty("direct_child_run_ids") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("direct_child_run_ids") @ExcludeMissing fun _directChildRunIds() = directChildRunIds - @JsonProperty("parent_run_ids") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parentRunIds() = parentRunIds + @JsonProperty("parent_run_ids") @ExcludeMissing fun _parentRunIds() = parentRunIds - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackStats() = feedbackStats + @JsonProperty("feedback_stats") @ExcludeMissing fun _feedbackStats() = feedbackStats - @JsonProperty("reference_example_id") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("reference_example_id") @ExcludeMissing fun _referenceExampleId() = referenceExampleId - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalTokens() = totalTokens + @JsonProperty("total_tokens") @ExcludeMissing fun _totalTokens() = totalTokens - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptTokens() = promptTokens + @JsonProperty("prompt_tokens") @ExcludeMissing fun _promptTokens() = promptTokens - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionTokens() = completionTokens + @JsonProperty("completion_tokens") @ExcludeMissing fun _completionTokens() = completionTokens - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalCost() = totalCost + @JsonProperty("total_cost") @ExcludeMissing fun _totalCost() = totalCost - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptCost() = promptCost + @JsonProperty("prompt_cost") @ExcludeMissing fun _promptCost() = promptCost - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionCost() = completionCost + @JsonProperty("completion_cost") @ExcludeMissing fun _completionCost() = completionCost - @JsonProperty("first_token_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _firstTokenTime() = firstTokenTime + @JsonProperty("first_token_time") @ExcludeMissing fun _firstTokenTime() = firstTokenTime - @JsonProperty("session_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sessionId() = sessionId + @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId - @JsonProperty("app_path") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _appPath() = appPath + @JsonProperty("app_path") @ExcludeMissing fun _appPath() = appPath - @JsonProperty("last_queued_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _lastQueuedAt() = lastQueuedAt + @JsonProperty("last_queued_at") @ExcludeMissing fun _lastQueuedAt() = lastQueuedAt - @JsonProperty("in_dataset") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inDataset() = inDataset + @JsonProperty("in_dataset") @ExcludeMissing fun _inDataset() = inDataset - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _shareToken() = shareToken + @JsonProperty("share_token") @ExcludeMissing fun _shareToken() = shareToken - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): RunSchema = apply { + if (!validated) { + name() runType() startTime() endTime() @@ -355,12 +272,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunSchema && this.name == other.name && this.inputs == other.inputs && this.runType == other.runType && @@ -402,15 +319,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, inputs, runType, startTime, @@ -457,21 +370,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "RunSchema{name=$name, inputs=$inputs, runType=$runType, startTime=$startTime, endTime=$endTime, extra=$extra, error=$error, executionOrder=$executionOrder, serialized=$serialized, outputs=$outputs, parentRunId=$parentRunId, manifestId=$manifestId, manifestS3Id=$manifestS3Id, events=$events, tags=$tags, inputsS3Urls=$inputsS3Urls, outputsS3Urls=$outputsS3Urls, traceId=$traceId, dottedOrder=$dottedOrder, id=$id, status=$status, childRunIds=$childRunIds, directChildRunIds=$directChildRunIds, parentRunIds=$parentRunIds, feedbackStats=$feedbackStats, referenceExampleId=$referenceExampleId, totalTokens=$totalTokens, promptTokens=$promptTokens, completionTokens=$completionTokens, totalCost=$totalCost, promptCost=$promptCost, completionCost=$completionCost, firstTokenTime=$firstTokenTime, sessionId=$sessionId, appPath=$appPath, lastQueuedAt=$lastQueuedAt, inDataset=$inDataset, shareToken=$shareToken, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var inputs: JsonValue = JsonMissing.of() private var runType: JsonField = JsonMissing.of() private var startTime: JsonField = JsonMissing.of() @@ -511,450 +417,308 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var shareToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runSchema: RunSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = runSchema.name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.inputs = runSchema.inputs - this.runType = runSchema.runType - this.startTime = runSchema.startTime - this.endTime = runSchema.endTime - this.extra = runSchema.extra - this.error = runSchema.error - this.executionOrder = runSchema.executionOrder - this.serialized = runSchema.serialized - this.outputs = runSchema.outputs - this.parentRunId = runSchema.parentRunId - this.manifestId = runSchema.manifestId - this.manifestS3Id = runSchema.manifestS3Id - this.events = runSchema.events - this.tags = runSchema.tags - this.inputsS3Urls = runSchema.inputsS3Urls - this.outputsS3Urls = runSchema.outputsS3Urls - this.traceId = runSchema.traceId - this.dottedOrder = runSchema.dottedOrder - this.id = runSchema.id - this.status = runSchema.status - this.childRunIds = runSchema.childRunIds - this.directChildRunIds = runSchema.directChildRunIds - this.parentRunIds = runSchema.parentRunIds - this.feedbackStats = runSchema.feedbackStats - this.referenceExampleId = runSchema.referenceExampleId - this.totalTokens = runSchema.totalTokens - this.promptTokens = runSchema.promptTokens - this.completionTokens = runSchema.completionTokens - this.totalCost = runSchema.totalCost - this.promptCost = runSchema.promptCost - this.completionCost = runSchema.completionCost - this.firstTokenTime = runSchema.firstTokenTime - this.sessionId = runSchema.sessionId - this.appPath = runSchema.appPath - this.lastQueuedAt = runSchema.lastQueuedAt - this.inDataset = runSchema.inDataset - this.shareToken = runSchema.shareToken - additionalProperties(runSchema.additionalProperties) - } - - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JvmSynthetic + internal fun from(runSchema: RunSchema) = apply { + this.name = runSchema.name + this.inputs = runSchema.inputs + this.runType = runSchema.runType + this.startTime = runSchema.startTime + this.endTime = runSchema.endTime + this.extra = runSchema.extra + this.error = runSchema.error + this.executionOrder = runSchema.executionOrder + this.serialized = runSchema.serialized + this.outputs = runSchema.outputs + this.parentRunId = runSchema.parentRunId + this.manifestId = runSchema.manifestId + this.manifestS3Id = runSchema.manifestS3Id + this.events = runSchema.events + this.tags = runSchema.tags + this.inputsS3Urls = runSchema.inputsS3Urls + this.outputsS3Urls = runSchema.outputsS3Urls + this.traceId = runSchema.traceId + this.dottedOrder = runSchema.dottedOrder + this.id = runSchema.id + this.status = runSchema.status + this.childRunIds = runSchema.childRunIds + this.directChildRunIds = runSchema.directChildRunIds + this.parentRunIds = runSchema.parentRunIds + this.feedbackStats = runSchema.feedbackStats + this.referenceExampleId = runSchema.referenceExampleId + this.totalTokens = runSchema.totalTokens + this.promptTokens = runSchema.promptTokens + this.completionTokens = runSchema.completionTokens + this.totalCost = runSchema.totalCost + this.promptCost = runSchema.promptCost + this.completionCost = runSchema.completionCost + this.firstTokenTime = runSchema.firstTokenTime + this.sessionId = runSchema.sessionId + this.appPath = runSchema.appPath + this.lastQueuedAt = runSchema.lastQueuedAt + this.inDataset = runSchema.inDataset + this.shareToken = runSchema.shareToken + additionalProperties(runSchema.additionalProperties) } - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") @ExcludeMissing - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs - } + fun name(name: JsonField) = apply { this.name = name } + + @JsonProperty("inputs") + @ExcludeMissing + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } /** Enum for run types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun runType(runType: RunType) = runType(JsonField.of(runType)) /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_type") @ExcludeMissing - fun runType(runType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runType = runType - } + fun runType(runType: JsonField) = apply { this.runType = runType } - fun startTime(startTime: OffsetDateTime) = - startTime(JsonField.of(startTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun startTime(startTime: OffsetDateTime) = startTime(JsonField.of(startTime)) - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("start_time") @ExcludeMissing - fun startTime(startTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } + fun startTime(startTime: JsonField) = apply { this.startTime = startTime } - fun endTime(endTime: OffsetDateTime) = - endTime(JsonField.of(endTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun endTime(endTime: OffsetDateTime) = endTime(JsonField.of(endTime)) - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("end_time") @ExcludeMissing - fun endTime(endTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } + fun endTime(endTime: JsonField) = apply { this.endTime = endTime } - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("extra") @ExcludeMissing - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra + fun extra(extra: JsonValue) = apply { this.extra = extra } + + fun error(error: String) = error(JsonField.of(error)) + + @JsonProperty("error") + @ExcludeMissing + fun error(error: JsonField) = apply { this.error = error } + + fun executionOrder(executionOrder: Long) = executionOrder(JsonField.of(executionOrder)) + + @JsonProperty("execution_order") + @ExcludeMissing + fun executionOrder(executionOrder: JsonField) = apply { + this.executionOrder = executionOrder } - fun error(error: String) = - error(JsonField.of(error)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("serialized") @ExcludeMissing - fun error(error: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.error = error - } + fun serialized(serialized: JsonValue) = apply { this.serialized = serialized } - fun executionOrder(executionOrder: Long) = - executionOrder( - JsonField.of(executionOrder) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("outputs") @ExcludeMissing - fun executionOrder(executionOrder: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.executionOrder = executionOrder - } + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - @JsonProperty("serialized") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - @ExcludeMissing - fun serialized(serialized: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.serialized = serialized - } + fun parentRunId(parentRunId: String) = parentRunId(JsonField.of(parentRunId)) - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("parent_run_id") @ExcludeMissing - fun outputs(outputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs + fun parentRunId(parentRunId: JsonField) = apply { this.parentRunId = parentRunId } + + fun manifestId(manifestId: String) = manifestId(JsonField.of(manifestId)) + + @JsonProperty("manifest_id") + @ExcludeMissing + fun manifestId(manifestId: JsonField) = apply { this.manifestId = manifestId } + + fun manifestS3Id(manifestS3Id: String) = manifestS3Id(JsonField.of(manifestS3Id)) + + @JsonProperty("manifest_s3_id") + @ExcludeMissing + fun manifestS3Id(manifestS3Id: JsonField) = apply { + this.manifestS3Id = manifestS3Id } - fun parentRunId(parentRunId: String) = - parentRunId(JsonField.of(parentRunId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun events(events: List) = events(JsonField.of(events)) - @JsonProperty("parent_run_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("events") @ExcludeMissing - fun parentRunId(parentRunId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRunId = parentRunId - } + fun events(events: JsonField>) = apply { this.events = events } - fun manifestId(manifestId: String) = - manifestId(JsonField.of(manifestId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tags(tags: List) = tags(JsonField.of(tags)) - @JsonProperty("manifest_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tags") @ExcludeMissing - fun manifestId(manifestId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.manifestId = manifestId - } + fun tags(tags: JsonField>) = apply { this.tags = tags } - fun manifestS3Id(manifestS3Id: String) = - manifestS3Id(JsonField.of(manifestS3Id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("manifest_s3_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("inputs_s3_urls") @ExcludeMissing - fun manifestS3Id(manifestS3Id: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.manifestS3Id = manifestS3Id - } + fun inputsS3Urls(inputsS3Urls: JsonValue) = apply { this.inputsS3Urls = inputsS3Urls } - fun events(events: List) = - events(JsonField.of(events)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("events") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("outputs_s3_urls") @ExcludeMissing - fun events(events: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.events = events - } + fun outputsS3Urls(outputsS3Urls: JsonValue) = apply { this.outputsS3Urls = outputsS3Urls } - fun tags(tags: List) = - tags(JsonField.of(tags)) // templates/JavaSDK/entities/objects.ts:252:20 + fun traceId(traceId: String) = traceId(JsonField.of(traceId)) - @JsonProperty("tags") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("trace_id") @ExcludeMissing - fun tags(tags: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tags = tags - } + fun traceId(traceId: JsonField) = apply { this.traceId = traceId } - @JsonProperty("inputs_s3_urls") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun dottedOrder(dottedOrder: String) = dottedOrder(JsonField.of(dottedOrder)) + + @JsonProperty("dotted_order") @ExcludeMissing - fun inputsS3Urls(inputsS3Urls: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputsS3Urls = inputsS3Urls - } + fun dottedOrder(dottedOrder: JsonField) = apply { this.dottedOrder = dottedOrder } - @JsonProperty("outputs_s3_urls") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun status(status: String) = status(JsonField.of(status)) + + @JsonProperty("status") @ExcludeMissing - fun outputsS3Urls(outputsS3Urls: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputsS3Urls = outputsS3Urls - } + fun status(status: JsonField) = apply { this.status = status } - fun traceId(traceId: String) = - traceId(JsonField.of(traceId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun childRunIds(childRunIds: List) = childRunIds(JsonField.of(childRunIds)) - @JsonProperty("trace_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("child_run_ids") @ExcludeMissing - fun traceId(traceId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.traceId = traceId - } - - fun dottedOrder(dottedOrder: String) = - dottedOrder(JsonField.of(dottedOrder)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("dotted_order") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun dottedOrder(dottedOrder: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dottedOrder = dottedOrder - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun childRunIds(childRunIds: JsonField>) = apply { + this.childRunIds = childRunIds } - fun status(status: String) = - status(JsonField.of(status)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("status") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun status(status: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.status = status - } - - fun childRunIds(childRunIds: List) = - childRunIds(JsonField.of(childRunIds)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("child_run_ids") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun childRunIds(childRunIds: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.childRunIds = childRunIds - } - fun directChildRunIds(directChildRunIds: List) = - directChildRunIds( - JsonField.of(directChildRunIds) - ) // templates/JavaSDK/entities/objects.ts:252:20 + directChildRunIds(JsonField.of(directChildRunIds)) - @JsonProperty("direct_child_run_ids") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("direct_child_run_ids") @ExcludeMissing - fun directChildRunIds(directChildRunIds: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.directChildRunIds = directChildRunIds - } + fun directChildRunIds(directChildRunIds: JsonField>) = apply { + this.directChildRunIds = directChildRunIds + } - fun parentRunIds(parentRunIds: List) = - parentRunIds(JsonField.of(parentRunIds)) // templates/JavaSDK/entities/objects.ts:252:20 + fun parentRunIds(parentRunIds: List) = parentRunIds(JsonField.of(parentRunIds)) - @JsonProperty("parent_run_ids") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("parent_run_ids") @ExcludeMissing - fun parentRunIds(parentRunIds: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRunIds = parentRunIds - } + fun parentRunIds(parentRunIds: JsonField>) = apply { + this.parentRunIds = parentRunIds + } - fun feedbackStats(feedbackStats: FeedbackStats) = - feedbackStats( - JsonField.of(feedbackStats) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun feedbackStats(feedbackStats: FeedbackStats) = feedbackStats(JsonField.of(feedbackStats)) - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_stats") @ExcludeMissing - fun feedbackStats(feedbackStats: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackStats = feedbackStats - } + fun feedbackStats(feedbackStats: JsonField) = apply { + this.feedbackStats = feedbackStats + } fun referenceExampleId(referenceExampleId: String) = - referenceExampleId( - JsonField.of(referenceExampleId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + referenceExampleId(JsonField.of(referenceExampleId)) - @JsonProperty("reference_example_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("reference_example_id") @ExcludeMissing - fun referenceExampleId(referenceExampleId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceExampleId = referenceExampleId - } + fun referenceExampleId(referenceExampleId: JsonField) = apply { + this.referenceExampleId = referenceExampleId + } - fun totalTokens(totalTokens: Long) = - totalTokens(JsonField.of(totalTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalTokens(totalTokens: Long) = totalTokens(JsonField.of(totalTokens)) - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_tokens") @ExcludeMissing - fun totalTokens(totalTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalTokens = totalTokens - } + fun totalTokens(totalTokens: JsonField) = apply { this.totalTokens = totalTokens } - fun promptTokens(promptTokens: Long) = - promptTokens(JsonField.of(promptTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptTokens(promptTokens: Long) = promptTokens(JsonField.of(promptTokens)) - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_tokens") @ExcludeMissing - fun promptTokens(promptTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptTokens = promptTokens - } + fun promptTokens(promptTokens: JsonField) = apply { this.promptTokens = promptTokens } fun completionTokens(completionTokens: Long) = - completionTokens( - JsonField.of(completionTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + completionTokens(JsonField.of(completionTokens)) - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_tokens") @ExcludeMissing - fun completionTokens(completionTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionTokens = completionTokens - } + fun completionTokens(completionTokens: JsonField) = apply { + this.completionTokens = completionTokens + } - fun totalCost(totalCost: Double) = - totalCost(JsonField.of(totalCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalCost(totalCost: Double) = totalCost(JsonField.of(totalCost)) - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_cost") @ExcludeMissing - fun totalCost(totalCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalCost = totalCost - } + fun totalCost(totalCost: JsonField) = apply { this.totalCost = totalCost } - fun promptCost(promptCost: Double) = - promptCost(JsonField.of(promptCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptCost(promptCost: Double) = promptCost(JsonField.of(promptCost)) - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_cost") @ExcludeMissing - fun promptCost(promptCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptCost = promptCost - } + fun promptCost(promptCost: JsonField) = apply { this.promptCost = promptCost } - fun completionCost(completionCost: Double) = - completionCost( - JsonField.of(completionCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun completionCost(completionCost: Double) = completionCost(JsonField.of(completionCost)) - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_cost") @ExcludeMissing - fun completionCost(completionCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionCost = completionCost - } + fun completionCost(completionCost: JsonField) = apply { + this.completionCost = completionCost + } fun firstTokenTime(firstTokenTime: OffsetDateTime) = - firstTokenTime( - JsonField.of(firstTokenTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + firstTokenTime(JsonField.of(firstTokenTime)) - @JsonProperty("first_token_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("first_token_time") @ExcludeMissing - fun firstTokenTime(firstTokenTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.firstTokenTime = firstTokenTime - } + fun firstTokenTime(firstTokenTime: JsonField) = apply { + this.firstTokenTime = firstTokenTime + } - fun sessionId(sessionId: String) = - sessionId(JsonField.of(sessionId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) - @JsonProperty("session_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("session_id") @ExcludeMissing - fun sessionId(sessionId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sessionId = sessionId - } + fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } - fun appPath(appPath: String) = - appPath(JsonField.of(appPath)) // templates/JavaSDK/entities/objects.ts:252:20 + fun appPath(appPath: String) = appPath(JsonField.of(appPath)) - @JsonProperty("app_path") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("app_path") @ExcludeMissing - fun appPath(appPath: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.appPath = appPath - } + fun appPath(appPath: JsonField) = apply { this.appPath = appPath } - fun lastQueuedAt(lastQueuedAt: OffsetDateTime) = - lastQueuedAt(JsonField.of(lastQueuedAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun lastQueuedAt(lastQueuedAt: OffsetDateTime) = lastQueuedAt(JsonField.of(lastQueuedAt)) - @JsonProperty("last_queued_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_queued_at") @ExcludeMissing - fun lastQueuedAt(lastQueuedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastQueuedAt = lastQueuedAt - } + fun lastQueuedAt(lastQueuedAt: JsonField) = apply { + this.lastQueuedAt = lastQueuedAt + } - fun inDataset(inDataset: Boolean) = - inDataset(JsonField.of(inDataset)) // templates/JavaSDK/entities/objects.ts:252:20 + fun inDataset(inDataset: Boolean) = inDataset(JsonField.of(inDataset)) - @JsonProperty("in_dataset") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("in_dataset") @ExcludeMissing - fun inDataset(inDataset: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inDataset = inDataset - } + fun inDataset(inDataset: JsonField) = apply { this.inDataset = inDataset } - fun shareToken(shareToken: String) = - shareToken(JsonField.of(shareToken)) // templates/JavaSDK/entities/objects.ts:252:20 + fun shareToken(shareToken: String) = shareToken(JsonField.of(shareToken)) - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("share_token") @ExcludeMissing - fun shareToken(shareToken: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.shareToken = shareToken - } + fun shareToken(shareToken: JsonField) = apply { this.shareToken = shareToken } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunSchema = - RunSchema( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + RunSchema( + name, inputs, runType, startTime, @@ -1000,30 +764,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is RunType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val TOOL = RunType(JsonField.of("tool")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val TOOL = RunType(JsonField.of("tool")) @JvmField val CHAIN = RunType(JsonField.of("chain")) @@ -1040,9 +799,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = RunType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - TOOL, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + TOOL, CHAIN, LLM, RETRIEVER, @@ -1051,9 +809,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 PARSER, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - TOOL, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + TOOL, CHAIN, LLM, RETRIEVER, @@ -1064,9 +821,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - TOOL -> Value.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Value.TOOL CHAIN -> Value.CHAIN LLM -> Value.LLM RETRIEVER -> Value.RETRIEVER @@ -1077,9 +833,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - TOOL -> Known.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Known.TOOL CHAIN -> Known.CHAIN LLM -> Known.LLM RETRIEVER -> Known.RETRIEVER @@ -1092,50 +847,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun asString(): String = _value().asStringOrThrow() } - @JsonDeserialize( - builder = FeedbackStats.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackStats.Builder::class) @NoAutoDetect class FeedbackStats private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackStats = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): FeedbackStats = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackStats && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is FeedbackStats && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -1143,44 +887,33 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackStats{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackStats: FeedbackStats) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(feedbackStats.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackStats: FeedbackStats) = apply { + additionalProperties(feedbackStats.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackStats = FeedbackStats(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfo.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfo.kt index 6ed238ae..57e1a036 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfo.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfo.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,15 +19,11 @@ import java.util.Objects import java.util.Optional /** Run schema with annotation queue info. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = RunSchemaWithAnnotationQueueInfo.Builder::class) @NoAutoDetect class RunSchemaWithAnnotationQueueInfo -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val name: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val name: JsonField, private val inputs: JsonValue, private val runType: JsonField, private val startTime: JsonField, @@ -72,8 +66,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -161,225 +154,143 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun addedAt(): Optional = Optional.ofNullable(addedAt.getNullable("added_at")) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputs() = inputs + @JsonProperty("inputs") @ExcludeMissing fun _inputs() = inputs /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runType() = runType + @JsonProperty("run_type") @ExcludeMissing fun _runType() = runType - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _startTime() = startTime + @JsonProperty("start_time") @ExcludeMissing fun _startTime() = startTime - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _endTime() = endTime + @JsonProperty("end_time") @ExcludeMissing fun _endTime() = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _extra() = extra + @JsonProperty("extra") @ExcludeMissing fun _extra() = extra - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _error() = error + @JsonProperty("error") @ExcludeMissing fun _error() = error - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _executionOrder() = executionOrder + @JsonProperty("execution_order") @ExcludeMissing fun _executionOrder() = executionOrder - @JsonProperty("serialized") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _serialized() = serialized + @JsonProperty("serialized") @ExcludeMissing fun _serialized() = serialized - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputs() = outputs + @JsonProperty("outputs") @ExcludeMissing fun _outputs() = outputs - @JsonProperty("parent_run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parentRunId() = parentRunId + @JsonProperty("parent_run_id") @ExcludeMissing fun _parentRunId() = parentRunId - @JsonProperty("manifest_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _manifestId() = manifestId + @JsonProperty("manifest_id") @ExcludeMissing fun _manifestId() = manifestId - @JsonProperty("manifest_s3_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _manifestS3Id() = manifestS3Id + @JsonProperty("manifest_s3_id") @ExcludeMissing fun _manifestS3Id() = manifestS3Id - @JsonProperty("events") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _events() = events + @JsonProperty("events") @ExcludeMissing fun _events() = events - @JsonProperty("tags") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tags() = tags + @JsonProperty("tags") @ExcludeMissing fun _tags() = tags - @JsonProperty("inputs_s3_urls") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inputsS3Urls() = inputsS3Urls + @JsonProperty("inputs_s3_urls") @ExcludeMissing fun _inputsS3Urls() = inputsS3Urls - @JsonProperty("outputs_s3_urls") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _outputsS3Urls() = outputsS3Urls + @JsonProperty("outputs_s3_urls") @ExcludeMissing fun _outputsS3Urls() = outputsS3Urls - @JsonProperty("trace_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _traceId() = traceId + @JsonProperty("trace_id") @ExcludeMissing fun _traceId() = traceId - @JsonProperty("dotted_order") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _dottedOrder() = dottedOrder + @JsonProperty("dotted_order") @ExcludeMissing fun _dottedOrder() = dottedOrder - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("status") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _status() = status + @JsonProperty("status") @ExcludeMissing fun _status() = status - @JsonProperty("child_run_ids") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _childRunIds() = childRunIds + @JsonProperty("child_run_ids") @ExcludeMissing fun _childRunIds() = childRunIds - @JsonProperty("direct_child_run_ids") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("direct_child_run_ids") @ExcludeMissing fun _directChildRunIds() = directChildRunIds - @JsonProperty("parent_run_ids") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _parentRunIds() = parentRunIds + @JsonProperty("parent_run_ids") @ExcludeMissing fun _parentRunIds() = parentRunIds - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackStats() = feedbackStats + @JsonProperty("feedback_stats") @ExcludeMissing fun _feedbackStats() = feedbackStats - @JsonProperty("reference_example_id") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("reference_example_id") @ExcludeMissing fun _referenceExampleId() = referenceExampleId - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalTokens() = totalTokens + @JsonProperty("total_tokens") @ExcludeMissing fun _totalTokens() = totalTokens - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptTokens() = promptTokens + @JsonProperty("prompt_tokens") @ExcludeMissing fun _promptTokens() = promptTokens - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionTokens() = completionTokens + @JsonProperty("completion_tokens") @ExcludeMissing fun _completionTokens() = completionTokens - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalCost() = totalCost + @JsonProperty("total_cost") @ExcludeMissing fun _totalCost() = totalCost - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptCost() = promptCost + @JsonProperty("prompt_cost") @ExcludeMissing fun _promptCost() = promptCost - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionCost() = completionCost + @JsonProperty("completion_cost") @ExcludeMissing fun _completionCost() = completionCost - @JsonProperty("first_token_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _firstTokenTime() = firstTokenTime + @JsonProperty("first_token_time") @ExcludeMissing fun _firstTokenTime() = firstTokenTime - @JsonProperty("session_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _sessionId() = sessionId + @JsonProperty("session_id") @ExcludeMissing fun _sessionId() = sessionId - @JsonProperty("app_path") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _appPath() = appPath + @JsonProperty("app_path") @ExcludeMissing fun _appPath() = appPath - @JsonProperty("last_queued_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _lastQueuedAt() = lastQueuedAt + @JsonProperty("last_queued_at") @ExcludeMissing fun _lastQueuedAt() = lastQueuedAt - @JsonProperty("in_dataset") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inDataset() = inDataset + @JsonProperty("in_dataset") @ExcludeMissing fun _inDataset() = inDataset - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _shareToken() = shareToken + @JsonProperty("share_token") @ExcludeMissing fun _shareToken() = shareToken - @JsonProperty("last_reviewed_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _lastReviewedTime() = lastReviewedTime + @JsonProperty("last_reviewed_time") @ExcludeMissing fun _lastReviewedTime() = lastReviewedTime - @JsonProperty("added_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _addedAt() = addedAt + @JsonProperty("added_at") @ExcludeMissing fun _addedAt() = addedAt - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunSchemaWithAnnotationQueueInfo = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - name() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - runType() - startTime() - endTime() - error() - executionOrder() - parentRunId() - manifestId() - manifestS3Id() - events() - tags() - traceId() - dottedOrder() - id() - status() - childRunIds() - directChildRunIds() - parentRunIds() - feedbackStats().map { it.validate() } - referenceExampleId() - totalTokens() - promptTokens() - completionTokens() - totalCost() - promptCost() - completionCost() - firstTokenTime() - sessionId() - appPath() - lastQueuedAt() - inDataset() - shareToken() - lastReviewedTime() - addedAt() - validated = true - } + fun validate(): RunSchemaWithAnnotationQueueInfo = apply { + if (!validated) { + name() + runType() + startTime() + endTime() + error() + executionOrder() + parentRunId() + manifestId() + manifestS3Id() + events() + tags() + traceId() + dottedOrder() + id() + status() + childRunIds() + directChildRunIds() + parentRunIds() + feedbackStats().map { it.validate() } + referenceExampleId() + totalTokens() + promptTokens() + completionTokens() + totalCost() + promptCost() + completionCost() + firstTokenTime() + sessionId() + appPath() + lastQueuedAt() + inDataset() + shareToken() + lastReviewedTime() + addedAt() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - RunSchemaWithAnnotationQueueInfo && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunSchemaWithAnnotationQueueInfo && this.name == other.name && this.inputs == other.inputs && this.runType == other.runType && @@ -423,15 +334,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - name, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + name, inputs, runType, startTime, @@ -480,21 +387,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "RunSchemaWithAnnotationQueueInfo{name=$name, inputs=$inputs, runType=$runType, startTime=$startTime, endTime=$endTime, extra=$extra, error=$error, executionOrder=$executionOrder, serialized=$serialized, outputs=$outputs, parentRunId=$parentRunId, manifestId=$manifestId, manifestS3Id=$manifestS3Id, events=$events, tags=$tags, inputsS3Urls=$inputsS3Urls, outputsS3Urls=$outputsS3Urls, traceId=$traceId, dottedOrder=$dottedOrder, id=$id, status=$status, childRunIds=$childRunIds, directChildRunIds=$directChildRunIds, parentRunIds=$parentRunIds, feedbackStats=$feedbackStats, referenceExampleId=$referenceExampleId, totalTokens=$totalTokens, promptTokens=$promptTokens, completionTokens=$completionTokens, totalCost=$totalCost, promptCost=$promptCost, completionCost=$completionCost, firstTokenTime=$firstTokenTime, sessionId=$sessionId, appPath=$appPath, lastQueuedAt=$lastQueuedAt, inDataset=$inDataset, shareToken=$shareToken, lastReviewedTime=$lastReviewedTime, addedAt=$addedAt, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var name: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var name: JsonField = JsonMissing.of() private var inputs: JsonValue = JsonMissing.of() private var runType: JsonField = JsonMissing.of() private var startTime: JsonField = JsonMissing.of() @@ -536,13 +436,10 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var addedAt: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(runSchemaWithAnnotationQueueInfo: RunSchemaWithAnnotationQueueInfo) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.name = - runSchemaWithAnnotationQueueInfo - .name // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 + apply { + this.name = runSchemaWithAnnotationQueueInfo.name this.inputs = runSchemaWithAnnotationQueueInfo.inputs this.runType = runSchemaWithAnnotationQueueInfo.runType this.startTime = runSchemaWithAnnotationQueueInfo.startTime @@ -585,427 +482,280 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 additionalProperties(runSchemaWithAnnotationQueueInfo.additionalProperties) } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name - } + fun name(name: JsonField) = apply { this.name = name } - @JsonProperty("inputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("inputs") @ExcludeMissing - fun inputs(inputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputs = inputs - } + fun inputs(inputs: JsonValue) = apply { this.inputs = inputs } /** Enum for run types. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun runType(runType: RunType) = runType(JsonField.of(runType)) /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_type") @ExcludeMissing - fun runType(runType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runType = runType - } + fun runType(runType: JsonField) = apply { this.runType = runType } - fun startTime(startTime: OffsetDateTime) = - startTime(JsonField.of(startTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun startTime(startTime: OffsetDateTime) = startTime(JsonField.of(startTime)) - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("start_time") @ExcludeMissing - fun startTime(startTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } + fun startTime(startTime: JsonField) = apply { this.startTime = startTime } - fun endTime(endTime: OffsetDateTime) = - endTime(JsonField.of(endTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun endTime(endTime: OffsetDateTime) = endTime(JsonField.of(endTime)) - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("end_time") @ExcludeMissing - fun endTime(endTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } + fun endTime(endTime: JsonField) = apply { this.endTime = endTime } - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("extra") @ExcludeMissing - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra + fun extra(extra: JsonValue) = apply { this.extra = extra } + + fun error(error: String) = error(JsonField.of(error)) + + @JsonProperty("error") + @ExcludeMissing + fun error(error: JsonField) = apply { this.error = error } + + fun executionOrder(executionOrder: Long) = executionOrder(JsonField.of(executionOrder)) + + @JsonProperty("execution_order") + @ExcludeMissing + fun executionOrder(executionOrder: JsonField) = apply { + this.executionOrder = executionOrder } - fun error(error: String) = - error(JsonField.of(error)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("serialized") @ExcludeMissing - fun error(error: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.error = error - } + fun serialized(serialized: JsonValue) = apply { this.serialized = serialized } - fun executionOrder(executionOrder: Long) = - executionOrder( - JsonField.of(executionOrder) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("outputs") @ExcludeMissing - fun executionOrder(executionOrder: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.executionOrder = executionOrder - } + fun outputs(outputs: JsonValue) = apply { this.outputs = outputs } - @JsonProperty("serialized") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - @ExcludeMissing - fun serialized(serialized: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.serialized = serialized - } + fun parentRunId(parentRunId: String) = parentRunId(JsonField.of(parentRunId)) - @JsonProperty("outputs") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("parent_run_id") @ExcludeMissing - fun outputs(outputs: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputs = outputs + fun parentRunId(parentRunId: JsonField) = apply { this.parentRunId = parentRunId } + + fun manifestId(manifestId: String) = manifestId(JsonField.of(manifestId)) + + @JsonProperty("manifest_id") + @ExcludeMissing + fun manifestId(manifestId: JsonField) = apply { this.manifestId = manifestId } + + fun manifestS3Id(manifestS3Id: String) = manifestS3Id(JsonField.of(manifestS3Id)) + + @JsonProperty("manifest_s3_id") + @ExcludeMissing + fun manifestS3Id(manifestS3Id: JsonField) = apply { + this.manifestS3Id = manifestS3Id } - fun parentRunId(parentRunId: String) = - parentRunId(JsonField.of(parentRunId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun events(events: List) = events(JsonField.of(events)) - @JsonProperty("parent_run_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("events") @ExcludeMissing - fun parentRunId(parentRunId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRunId = parentRunId - } + fun events(events: JsonField>) = apply { this.events = events } - fun manifestId(manifestId: String) = - manifestId(JsonField.of(manifestId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tags(tags: List) = tags(JsonField.of(tags)) - @JsonProperty("manifest_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tags") @ExcludeMissing - fun manifestId(manifestId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.manifestId = manifestId - } + fun tags(tags: JsonField>) = apply { this.tags = tags } - fun manifestS3Id(manifestS3Id: String) = - manifestS3Id(JsonField.of(manifestS3Id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("manifest_s3_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("inputs_s3_urls") @ExcludeMissing - fun manifestS3Id(manifestS3Id: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.manifestS3Id = manifestS3Id - } + fun inputsS3Urls(inputsS3Urls: JsonValue) = apply { this.inputsS3Urls = inputsS3Urls } - fun events(events: List) = - events(JsonField.of(events)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("events") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("outputs_s3_urls") @ExcludeMissing - fun events(events: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.events = events - } + fun outputsS3Urls(outputsS3Urls: JsonValue) = apply { this.outputsS3Urls = outputsS3Urls } - fun tags(tags: List) = - tags(JsonField.of(tags)) // templates/JavaSDK/entities/objects.ts:252:20 + fun traceId(traceId: String) = traceId(JsonField.of(traceId)) - @JsonProperty("tags") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("trace_id") @ExcludeMissing - fun tags(tags: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tags = tags - } + fun traceId(traceId: JsonField) = apply { this.traceId = traceId } - @JsonProperty("inputs_s3_urls") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun dottedOrder(dottedOrder: String) = dottedOrder(JsonField.of(dottedOrder)) + + @JsonProperty("dotted_order") @ExcludeMissing - fun inputsS3Urls(inputsS3Urls: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inputsS3Urls = inputsS3Urls - } + fun dottedOrder(dottedOrder: JsonField) = apply { this.dottedOrder = dottedOrder } - @JsonProperty("outputs_s3_urls") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun status(status: String) = status(JsonField.of(status)) + + @JsonProperty("status") @ExcludeMissing - fun outputsS3Urls(outputsS3Urls: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.outputsS3Urls = outputsS3Urls - } + fun status(status: JsonField) = apply { this.status = status } - fun traceId(traceId: String) = - traceId(JsonField.of(traceId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun childRunIds(childRunIds: List) = childRunIds(JsonField.of(childRunIds)) - @JsonProperty("trace_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("child_run_ids") @ExcludeMissing - fun traceId(traceId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.traceId = traceId - } - - fun dottedOrder(dottedOrder: String) = - dottedOrder(JsonField.of(dottedOrder)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("dotted_order") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun dottedOrder(dottedOrder: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.dottedOrder = dottedOrder - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun childRunIds(childRunIds: JsonField>) = apply { + this.childRunIds = childRunIds } - fun status(status: String) = - status(JsonField.of(status)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("status") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun status(status: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.status = status - } - - fun childRunIds(childRunIds: List) = - childRunIds(JsonField.of(childRunIds)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("child_run_ids") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun childRunIds(childRunIds: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.childRunIds = childRunIds - } - fun directChildRunIds(directChildRunIds: List) = - directChildRunIds( - JsonField.of(directChildRunIds) - ) // templates/JavaSDK/entities/objects.ts:252:20 + directChildRunIds(JsonField.of(directChildRunIds)) - @JsonProperty("direct_child_run_ids") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("direct_child_run_ids") @ExcludeMissing - fun directChildRunIds(directChildRunIds: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.directChildRunIds = directChildRunIds - } + fun directChildRunIds(directChildRunIds: JsonField>) = apply { + this.directChildRunIds = directChildRunIds + } - fun parentRunIds(parentRunIds: List) = - parentRunIds(JsonField.of(parentRunIds)) // templates/JavaSDK/entities/objects.ts:252:20 + fun parentRunIds(parentRunIds: List) = parentRunIds(JsonField.of(parentRunIds)) - @JsonProperty("parent_run_ids") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("parent_run_ids") @ExcludeMissing - fun parentRunIds(parentRunIds: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRunIds = parentRunIds - } + fun parentRunIds(parentRunIds: JsonField>) = apply { + this.parentRunIds = parentRunIds + } - fun feedbackStats(feedbackStats: FeedbackStats) = - feedbackStats( - JsonField.of(feedbackStats) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun feedbackStats(feedbackStats: FeedbackStats) = feedbackStats(JsonField.of(feedbackStats)) - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("feedback_stats") @ExcludeMissing - fun feedbackStats(feedbackStats: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackStats = feedbackStats - } + fun feedbackStats(feedbackStats: JsonField) = apply { + this.feedbackStats = feedbackStats + } fun referenceExampleId(referenceExampleId: String) = - referenceExampleId( - JsonField.of(referenceExampleId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + referenceExampleId(JsonField.of(referenceExampleId)) - @JsonProperty("reference_example_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("reference_example_id") @ExcludeMissing - fun referenceExampleId(referenceExampleId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceExampleId = referenceExampleId - } + fun referenceExampleId(referenceExampleId: JsonField) = apply { + this.referenceExampleId = referenceExampleId + } - fun totalTokens(totalTokens: Long) = - totalTokens(JsonField.of(totalTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalTokens(totalTokens: Long) = totalTokens(JsonField.of(totalTokens)) - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_tokens") @ExcludeMissing - fun totalTokens(totalTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalTokens = totalTokens - } + fun totalTokens(totalTokens: JsonField) = apply { this.totalTokens = totalTokens } - fun promptTokens(promptTokens: Long) = - promptTokens(JsonField.of(promptTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptTokens(promptTokens: Long) = promptTokens(JsonField.of(promptTokens)) - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_tokens") @ExcludeMissing - fun promptTokens(promptTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptTokens = promptTokens - } + fun promptTokens(promptTokens: JsonField) = apply { this.promptTokens = promptTokens } fun completionTokens(completionTokens: Long) = - completionTokens( - JsonField.of(completionTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + completionTokens(JsonField.of(completionTokens)) - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_tokens") @ExcludeMissing - fun completionTokens(completionTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionTokens = completionTokens - } + fun completionTokens(completionTokens: JsonField) = apply { + this.completionTokens = completionTokens + } - fun totalCost(totalCost: Double) = - totalCost(JsonField.of(totalCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalCost(totalCost: Double) = totalCost(JsonField.of(totalCost)) - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_cost") @ExcludeMissing - fun totalCost(totalCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalCost = totalCost - } + fun totalCost(totalCost: JsonField) = apply { this.totalCost = totalCost } - fun promptCost(promptCost: Double) = - promptCost(JsonField.of(promptCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptCost(promptCost: Double) = promptCost(JsonField.of(promptCost)) - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_cost") @ExcludeMissing - fun promptCost(promptCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptCost = promptCost - } + fun promptCost(promptCost: JsonField) = apply { this.promptCost = promptCost } - fun completionCost(completionCost: Double) = - completionCost( - JsonField.of(completionCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun completionCost(completionCost: Double) = completionCost(JsonField.of(completionCost)) - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_cost") @ExcludeMissing - fun completionCost(completionCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionCost = completionCost - } + fun completionCost(completionCost: JsonField) = apply { + this.completionCost = completionCost + } fun firstTokenTime(firstTokenTime: OffsetDateTime) = - firstTokenTime( - JsonField.of(firstTokenTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + firstTokenTime(JsonField.of(firstTokenTime)) - @JsonProperty("first_token_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("first_token_time") @ExcludeMissing - fun firstTokenTime(firstTokenTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.firstTokenTime = firstTokenTime - } + fun firstTokenTime(firstTokenTime: JsonField) = apply { + this.firstTokenTime = firstTokenTime + } - fun sessionId(sessionId: String) = - sessionId(JsonField.of(sessionId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun sessionId(sessionId: String) = sessionId(JsonField.of(sessionId)) - @JsonProperty("session_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("session_id") @ExcludeMissing - fun sessionId(sessionId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.sessionId = sessionId - } + fun sessionId(sessionId: JsonField) = apply { this.sessionId = sessionId } - fun appPath(appPath: String) = - appPath(JsonField.of(appPath)) // templates/JavaSDK/entities/objects.ts:252:20 + fun appPath(appPath: String) = appPath(JsonField.of(appPath)) - @JsonProperty("app_path") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("app_path") @ExcludeMissing - fun appPath(appPath: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.appPath = appPath - } + fun appPath(appPath: JsonField) = apply { this.appPath = appPath } - fun lastQueuedAt(lastQueuedAt: OffsetDateTime) = - lastQueuedAt(JsonField.of(lastQueuedAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun lastQueuedAt(lastQueuedAt: OffsetDateTime) = lastQueuedAt(JsonField.of(lastQueuedAt)) - @JsonProperty("last_queued_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_queued_at") @ExcludeMissing - fun lastQueuedAt(lastQueuedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastQueuedAt = lastQueuedAt - } + fun lastQueuedAt(lastQueuedAt: JsonField) = apply { + this.lastQueuedAt = lastQueuedAt + } - fun inDataset(inDataset: Boolean) = - inDataset(JsonField.of(inDataset)) // templates/JavaSDK/entities/objects.ts:252:20 + fun inDataset(inDataset: Boolean) = inDataset(JsonField.of(inDataset)) - @JsonProperty("in_dataset") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("in_dataset") @ExcludeMissing - fun inDataset(inDataset: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inDataset = inDataset - } + fun inDataset(inDataset: JsonField) = apply { this.inDataset = inDataset } - fun shareToken(shareToken: String) = - shareToken(JsonField.of(shareToken)) // templates/JavaSDK/entities/objects.ts:252:20 + fun shareToken(shareToken: String) = shareToken(JsonField.of(shareToken)) - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("share_token") @ExcludeMissing - fun shareToken(shareToken: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.shareToken = shareToken - } + fun shareToken(shareToken: JsonField) = apply { this.shareToken = shareToken } fun lastReviewedTime(lastReviewedTime: OffsetDateTime) = - lastReviewedTime( - JsonField.of(lastReviewedTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + lastReviewedTime(JsonField.of(lastReviewedTime)) - @JsonProperty("last_reviewed_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_reviewed_time") @ExcludeMissing - fun lastReviewedTime(lastReviewedTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastReviewedTime = lastReviewedTime - } + fun lastReviewedTime(lastReviewedTime: JsonField) = apply { + this.lastReviewedTime = lastReviewedTime + } - fun addedAt(addedAt: OffsetDateTime) = - addedAt(JsonField.of(addedAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun addedAt(addedAt: OffsetDateTime) = addedAt(JsonField.of(addedAt)) - @JsonProperty("added_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("added_at") @ExcludeMissing - fun addedAt(addedAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.addedAt = addedAt - } + fun addedAt(addedAt: JsonField) = apply { this.addedAt = addedAt } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunSchemaWithAnnotationQueueInfo = - RunSchemaWithAnnotationQueueInfo( // templates/JavaSDK/entities/objects.ts:326:30 - name, // templates/JavaSDK/entities/objects.ts:326:30 + RunSchemaWithAnnotationQueueInfo( + name, inputs, runType, startTime, @@ -1053,30 +803,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is RunType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val TOOL = RunType(JsonField.of("tool")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val TOOL = RunType(JsonField.of("tool")) @JvmField val CHAIN = RunType(JsonField.of("chain")) @@ -1093,9 +838,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = RunType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - TOOL, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + TOOL, CHAIN, LLM, RETRIEVER, @@ -1104,9 +848,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 PARSER, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - TOOL, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + TOOL, CHAIN, LLM, RETRIEVER, @@ -1117,9 +860,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - TOOL -> Value.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Value.TOOL CHAIN -> Value.CHAIN LLM -> Value.LLM RETRIEVER -> Value.RETRIEVER @@ -1130,9 +872,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - TOOL -> Known.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Known.TOOL CHAIN -> Known.CHAIN LLM -> Known.LLM RETRIEVER -> Known.RETRIEVER @@ -1145,50 +886,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun asString(): String = _value().asStringOrThrow() } - @JsonDeserialize( - builder = FeedbackStats.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = FeedbackStats.Builder::class) @NoAutoDetect class FeedbackStats private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): FeedbackStats = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): FeedbackStats = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is FeedbackStats && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is FeedbackStats && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -1196,44 +926,33 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "FeedbackStats{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(feedbackStats: FeedbackStats) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(feedbackStats.additionalProperties) - } + @JvmSynthetic + internal fun from(feedbackStats: FeedbackStats) = apply { + additionalProperties(feedbackStats.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): FeedbackStats = FeedbackStats(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteParams.kt index c3c26e89..0d002754 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class RunShareDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val runId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val runId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun runId(): String = runId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun runId(): String = runId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> runId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> runId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunShareDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunShareDeleteParams && this.runId == other.runId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + runId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,115 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var runId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var runId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(runShareDeleteParams: RunShareDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.runId = - runShareDeleteParams.runId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(runShareDeleteParams.additionalQueryParams) - additionalHeaders(runShareDeleteParams.additionalHeaders) - additionalBodyProperties(runShareDeleteParams.additionalBodyProperties) - } - - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + @JvmSynthetic + internal fun from(runShareDeleteParams: RunShareDeleteParams) = apply { + this.runId = runShareDeleteParams.runId + additionalQueryParams(runShareDeleteParams.additionalQueryParams) + additionalHeaders(runShareDeleteParams.additionalHeaders) + additionalBodyProperties(runShareDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun runId(runId: String) = apply { this.runId = runId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): RunShareDeleteParams = - RunShareDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`runId` is required but was not set" - }, + RunShareDeleteParams( + checkNotNull(runId) { "`runId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteResponse.kt index 26028bdd..d9aaba64 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = RunShareDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = RunShareDeleteResponse.Builder::class) @NoAutoDetect class RunShareDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunShareDeleteResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): RunShareDeleteResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunShareDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunShareDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "RunShareDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runShareDeleteResponse: RunShareDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(runShareDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(runShareDeleteResponse: RunShareDeleteResponse) = apply { + additionalProperties(runShareDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunShareDeleteResponse = RunShareDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareRetrieveParams.kt index 1fd68304..925699c1 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -12,22 +12,17 @@ constructor( private val runId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - fun runId(): String = runId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun runId(): String = runId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> runId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> runId else -> "" } } @@ -36,21 +31,20 @@ constructor( fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunShareRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunShareRetrieveParams && this.runId == other.runId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + runId, additionalQueryParams, additionalHeaders, ) @@ -61,95 +55,70 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var runId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var runId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(runShareRetrieveParams: RunShareRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.runId = - runShareRetrieveParams.runId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(runShareRetrieveParams.additionalQueryParams) - additionalHeaders(runShareRetrieveParams.additionalHeaders) - } - - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + @JvmSynthetic + internal fun from(runShareRetrieveParams: RunShareRetrieveParams) = apply { + this.runId = runShareRetrieveParams.runId + additionalQueryParams(runShareRetrieveParams.additionalQueryParams) + additionalHeaders(runShareRetrieveParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun runId(runId: String) = apply { this.runId = runId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): RunShareRetrieveParams = - RunShareRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`runId` is required but was not set" - }, + RunShareRetrieveParams( + checkNotNull(runId) { "`runId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareSchema.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareSchema.kt index c82c3089..905c9585 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareSchema.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareSchema.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -16,11 +14,7 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = RunShareSchema.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = RunShareSchema.Builder::class) @NoAutoDetect class RunShareSchema private constructor( @@ -29,8 +23,7 @@ private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -38,25 +31,17 @@ private constructor( fun shareToken(): String = shareToken.getRequired("share_token") - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runId() = runId + @JsonProperty("run_id") @ExcludeMissing fun _runId() = runId - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _shareToken() = shareToken + @JsonProperty("share_token") @ExcludeMissing fun _shareToken() = shareToken - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunShareSchema = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - runId() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): RunShareSchema = apply { + if (!validated) { + runId() shareToken() validated = true } @@ -64,26 +49,22 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunShareSchema && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunShareSchema && this.runId == other.runId && this.shareToken == other.shareToken && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + runId, shareToken, additionalProperties, ) @@ -94,74 +75,53 @@ private constructor( override fun toString() = "RunShareSchema{runId=$runId, shareToken=$shareToken, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var runId: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var runId: JsonField = JsonMissing.of() private var shareToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runShareSchema: RunShareSchema) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.runId = runShareSchema.runId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.shareToken = runShareSchema.shareToken - additionalProperties(runShareSchema.additionalProperties) - } + @JvmSynthetic + internal fun from(runShareSchema: RunShareSchema) = apply { + this.runId = runShareSchema.runId + this.shareToken = runShareSchema.shareToken + additionalProperties(runShareSchema.additionalProperties) + } - fun runId(runId: String) = - runId(JsonField.of(runId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runId(runId: String) = runId(JsonField.of(runId)) - @JsonProperty("run_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_id") @ExcludeMissing - fun runId(runId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runId = runId - } + fun runId(runId: JsonField) = apply { this.runId = runId } - fun shareToken(shareToken: String) = - shareToken(JsonField.of(shareToken)) // templates/JavaSDK/entities/objects.ts:252:20 + fun shareToken(shareToken: String) = shareToken(JsonField.of(shareToken)) - @JsonProperty("share_token") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("share_token") @ExcludeMissing - fun shareToken(shareToken: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.shareToken = shareToken - } + fun shareToken(shareToken: JsonField) = apply { this.shareToken = shareToken } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunShareSchema = - RunShareSchema( // templates/JavaSDK/entities/objects.ts:326:30 - runId, // templates/JavaSDK/entities/objects.ts:326:30 + RunShareSchema( + runId, shareToken, additionalProperties.toUnmodifiable(), ) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareUpdateParams.kt index 58c9db49..7c2f7477 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunShareUpdateParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class RunShareUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val runId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val runId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun runId(): String = runId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun runId(): String = runId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> runId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> runId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunShareUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunShareUpdateParams && this.runId == other.runId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + runId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,115 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var runId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var runId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(runShareUpdateParams: RunShareUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.runId = - runShareUpdateParams.runId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(runShareUpdateParams.additionalQueryParams) - additionalHeaders(runShareUpdateParams.additionalHeaders) - additionalBodyProperties(runShareUpdateParams.additionalBodyProperties) - } - - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + @JvmSynthetic + internal fun from(runShareUpdateParams: RunShareUpdateParams) = apply { + this.runId = runShareUpdateParams.runId + additionalQueryParams(runShareUpdateParams.additionalQueryParams) + additionalHeaders(runShareUpdateParams.additionalHeaders) + additionalBodyProperties(runShareUpdateParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun runId(runId: String) = apply { this.runId = runId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): RunShareUpdateParams = - RunShareUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`runId` is required but was not set" - }, + RunShareUpdateParams( + checkNotNull(runId) { "`runId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStatCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStatCreateParams.kt index f8e3e61e..8b15cdf4 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStatCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStatCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -21,12 +19,8 @@ import java.util.Objects import java.util.Optional class RunStatCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val id: List?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val id: List?, private val endTime: OffsetDateTime?, private val error: Boolean?, private val executionOrder: Long?, @@ -44,9 +38,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun id(): Optional> = - Optional.ofNullable(id) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): Optional> = Optional.ofNullable(id) fun endTime(): Optional = Optional.ofNullable(endTime) @@ -72,11 +64,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun trace(): Optional = Optional.ofNullable(trace) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): RunStatCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return RunStatCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - id, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): RunStatCreateBody { + return RunStatCreateBody( + id, endTime, error, executionOrder, @@ -93,22 +84,16 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Query params for run endpoints. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = RunStatCreateBody.Builder::class) @NoAutoDetect class RunStatCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val id: List?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val id: List?, private val endTime: OffsetDateTime?, private val error: Boolean?, private val executionOrder: Long?, @@ -124,62 +109,47 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): List? = id + @JsonProperty("id") fun id(): List? = id - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun endTime(): OffsetDateTime? = endTime + @JsonProperty("end_time") fun endTime(): OffsetDateTime? = endTime - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:113:14 - fun error(): Boolean? = error + @JsonProperty("error") fun error(): Boolean? = error - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:113:14 - fun executionOrder(): Long? = executionOrder + @JsonProperty("execution_order") fun executionOrder(): Long? = executionOrder - @JsonProperty("filter") // templates/JavaSDK/entities/objects.ts:113:14 - fun filter(): String? = filter + @JsonProperty("filter") fun filter(): String? = filter - @JsonProperty("is_root") // templates/JavaSDK/entities/objects.ts:113:14 - fun isRoot(): Boolean? = isRoot + @JsonProperty("is_root") fun isRoot(): Boolean? = isRoot - @JsonProperty("parent_run") // templates/JavaSDK/entities/objects.ts:113:14 - fun parentRun(): String? = parentRun + @JsonProperty("parent_run") fun parentRun(): String? = parentRun - @JsonProperty("query") // templates/JavaSDK/entities/objects.ts:113:14 - fun query(): String? = query + @JsonProperty("query") fun query(): String? = query - @JsonProperty("reference_example") // templates/JavaSDK/entities/objects.ts:113:14 - fun referenceExample(): List? = referenceExample + @JsonProperty("reference_example") fun referenceExample(): List? = referenceExample /** Enum for run types. */ - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:113:14 - fun runType(): RunType? = runType + @JsonProperty("run_type") fun runType(): RunType? = runType - @JsonProperty("session") // templates/JavaSDK/entities/objects.ts:113:14 - fun session(): List? = session + @JsonProperty("session") fun session(): List? = session - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun startTime(): OffsetDateTime? = startTime + @JsonProperty("start_time") fun startTime(): OffsetDateTime? = startTime - @JsonProperty("trace") // templates/JavaSDK/entities/objects.ts:113:14 - fun trace(): String? = trace + @JsonProperty("trace") fun trace(): String? = trace - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunStatCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunStatCreateBody && this.id == other.id && this.endTime == other.endTime && this.error == other.error && @@ -196,15 +166,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - id, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + id, endTime, error, executionOrder, @@ -226,20 +192,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "RunStatCreateBody{id=$id, endTime=$endTime, error=$error, executionOrder=$executionOrder, filter=$filter, isRoot=$isRoot, parentRun=$parentRun, query=$query, referenceExample=$referenceExample, runType=$runType, session=$session, startTime=$startTime, trace=$trace, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var id: List? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var id: List? = null private var endTime: OffsetDateTime? = null private var error: Boolean? = null private var executionOrder: Long? = null @@ -254,134 +214,79 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var trace: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runStatCreateBody: RunStatCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.id = - runStatCreateBody.id // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.endTime = runStatCreateBody.endTime - this.error = runStatCreateBody.error - this.executionOrder = runStatCreateBody.executionOrder - this.filter = runStatCreateBody.filter - this.isRoot = runStatCreateBody.isRoot - this.parentRun = runStatCreateBody.parentRun - this.query = runStatCreateBody.query - this.referenceExample = runStatCreateBody.referenceExample - this.runType = runStatCreateBody.runType - this.session = runStatCreateBody.session - this.startTime = runStatCreateBody.startTime - this.trace = runStatCreateBody.trace - additionalProperties(runStatCreateBody.additionalProperties) - } - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: List) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(runStatCreateBody: RunStatCreateBody) = apply { + this.id = runStatCreateBody.id + this.endTime = runStatCreateBody.endTime + this.error = runStatCreateBody.error + this.executionOrder = runStatCreateBody.executionOrder + this.filter = runStatCreateBody.filter + this.isRoot = runStatCreateBody.isRoot + this.parentRun = runStatCreateBody.parentRun + this.query = runStatCreateBody.query + this.referenceExample = runStatCreateBody.referenceExample + this.runType = runStatCreateBody.runType + this.session = runStatCreateBody.session + this.startTime = runStatCreateBody.startTime + this.trace = runStatCreateBody.trace + additionalProperties(runStatCreateBody.additionalProperties) } - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } + @JsonProperty("id") fun id(id: List) = apply { this.id = id } - @JsonProperty("error") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun error(error: Boolean) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.error = error + @JsonProperty("end_time") + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + @JsonProperty("error") fun error(error: Boolean) = apply { this.error = error } + + @JsonProperty("execution_order") + fun executionOrder(executionOrder: Long) = apply { + this.executionOrder = executionOrder } - @JsonProperty("execution_order") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun executionOrder(executionOrder: Long) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.executionOrder = executionOrder - } + @JsonProperty("filter") fun filter(filter: String) = apply { this.filter = filter } - @JsonProperty("filter") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun filter(filter: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.filter = filter + @JsonProperty("is_root") fun isRoot(isRoot: Boolean) = apply { this.isRoot = isRoot } + + @JsonProperty("parent_run") + fun parentRun(parentRun: String) = apply { this.parentRun = parentRun } + + @JsonProperty("query") fun query(query: String) = apply { this.query = query } + + @JsonProperty("reference_example") + fun referenceExample(referenceExample: List) = apply { + this.referenceExample = referenceExample } - @JsonProperty("is_root") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun isRoot(isRoot: Boolean) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.isRoot = isRoot - } - - @JsonProperty("parent_run") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun parentRun(parentRun: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.parentRun = parentRun - } - - @JsonProperty("query") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun query(query: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.query = query - } - - @JsonProperty("reference_example") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun referenceExample(referenceExample: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceExample = referenceExample - } - /** Enum for run types. */ - // templates/JavaSDK/entities/objects.ts:252:20 - @JsonProperty("run_type") // templates/JavaSDK/entities/objects.ts:264:20 - fun runType(runType: RunType) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runType = runType + @JsonProperty("run_type") + fun runType(runType: RunType) = apply { this.runType = runType } + + @JsonProperty("session") + fun session(session: List) = apply { this.session = session } + + @JsonProperty("start_time") + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } + + @JsonProperty("trace") fun trace(trace: String) = apply { this.trace = trace } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("session") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun session(session: List) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.session = session - } - - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } - - @JsonProperty("trace") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun trace(trace: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.trace = trace + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunStatCreateBody = - RunStatCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - id?.toUnmodifiable(), // templates/JavaSDK/entities/objects.ts:326:30 + RunStatCreateBody( + id?.toUnmodifiable(), endTime, error, executionOrder, @@ -405,12 +310,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunStatCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunStatCreateParams && this.id == other.id && this.endTime == other.endTime && this.error == other.error && @@ -429,10 +334,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, endTime, error, executionOrder, @@ -456,21 +360,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: MutableList = mutableListOf() private var endTime: OffsetDateTime? = null private var error: Boolean? = null private var executionOrder: Long? = null @@ -487,180 +385,127 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(runStatCreateParams: RunStatCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.id( - runStatCreateParams.id ?: listOf() - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.endTime = runStatCreateParams.endTime - this.error = runStatCreateParams.error - this.executionOrder = runStatCreateParams.executionOrder - this.filter = runStatCreateParams.filter - this.isRoot = runStatCreateParams.isRoot - this.parentRun = runStatCreateParams.parentRun - this.query = runStatCreateParams.query - this.referenceExample(runStatCreateParams.referenceExample ?: listOf()) - this.runType = runStatCreateParams.runType - this.session(runStatCreateParams.session ?: listOf()) - this.startTime = runStatCreateParams.startTime - this.trace = runStatCreateParams.trace - additionalQueryParams(runStatCreateParams.additionalQueryParams) - additionalHeaders(runStatCreateParams.additionalHeaders) - additionalBodyProperties(runStatCreateParams.additionalBodyProperties) - } + @JvmSynthetic + internal fun from(runStatCreateParams: RunStatCreateParams) = apply { + this.id(runStatCreateParams.id ?: listOf()) + this.endTime = runStatCreateParams.endTime + this.error = runStatCreateParams.error + this.executionOrder = runStatCreateParams.executionOrder + this.filter = runStatCreateParams.filter + this.isRoot = runStatCreateParams.isRoot + this.parentRun = runStatCreateParams.parentRun + this.query = runStatCreateParams.query + this.referenceExample(runStatCreateParams.referenceExample ?: listOf()) + this.runType = runStatCreateParams.runType + this.session(runStatCreateParams.session ?: listOf()) + this.startTime = runStatCreateParams.startTime + this.trace = runStatCreateParams.trace + additionalQueryParams(runStatCreateParams.additionalQueryParams) + additionalHeaders(runStatCreateParams.additionalHeaders) + additionalBodyProperties(runStatCreateParams.additionalBodyProperties) + } - fun id(id: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.id.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun id(id: List) = apply { + this.id.clear() this.id.addAll(id) } - fun addId(id: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.id.add(id) + fun addId(id: String) = apply { this.id.add(id) } + + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + fun error(error: Boolean) = apply { this.error = error } + + fun executionOrder(executionOrder: Long) = apply { this.executionOrder = executionOrder } + + fun filter(filter: String) = apply { this.filter = filter } + + fun isRoot(isRoot: Boolean) = apply { this.isRoot = isRoot } + + fun parentRun(parentRun: String) = apply { this.parentRun = parentRun } + + fun query(query: String) = apply { this.query = query } + + fun referenceExample(referenceExample: List) = apply { + this.referenceExample.clear() + this.referenceExample.addAll(referenceExample) } - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.endTime = endTime - } - - fun error(error: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.error = error + fun addReferenceExample(referenceExample: String) = apply { + this.referenceExample.add(referenceExample) } - fun executionOrder(executionOrder: Long) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.executionOrder = executionOrder - } - - fun filter(filter: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.filter = filter - } - - fun isRoot(isRoot: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.isRoot = isRoot - } - - fun parentRun(parentRun: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.parentRun = parentRun - } - - fun query(query: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.query = query - } - - fun referenceExample(referenceExample: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.referenceExample.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.referenceExample.addAll(referenceExample) - } - - fun addReferenceExample(referenceExample: String) = - apply { // templates/JavaSDK/entities/params.ts:620:26 - this.referenceExample.add(referenceExample) - } - /** Enum for run types. */ - fun runType(runType: RunType) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runType = runType - } + fun runType(runType: RunType) = apply { this.runType = runType } - fun session(session: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.session.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun session(session: List) = apply { + this.session.clear() this.session.addAll(session) } - fun addSession(session: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.session.add(session) + fun addSession(session: String) = apply { this.session.add(session) } + + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } + + fun trace(trace: String) = apply { this.trace = trace } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.startTime = startTime - } - - fun trace(trace: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.trace = trace + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): RunStatCreateParams = - RunStatCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - if (id.size == 0) null - else id.toUnmodifiable(), // templates/JavaSDK/entities/params.ts:683:22 + RunStatCreateParams( + if (id.size == 0) null else id.toUnmodifiable(), endTime, error, executionOrder, @@ -683,30 +528,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is RunType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val TOOL = RunType(JsonField.of("tool")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val TOOL = RunType(JsonField.of("tool")) @JvmField val CHAIN = RunType(JsonField.of("chain")) @@ -723,9 +563,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = RunType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - TOOL, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + TOOL, CHAIN, LLM, RETRIEVER, @@ -734,9 +573,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // PARSER, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - TOOL, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + TOOL, CHAIN, LLM, RETRIEVER, @@ -747,9 +585,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - TOOL -> Value.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Value.TOOL CHAIN -> Value.CHAIN LLM -> Value.LLM RETRIEVER -> Value.RETRIEVER @@ -760,9 +597,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - TOOL -> Known.TOOL // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + TOOL -> Known.TOOL CHAIN -> Known.CHAIN LLM -> Known.LLM RETRIEVER -> Known.RETRIEVER diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStats.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStats.kt index 09b2d253..214d9495 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStats.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunStats.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,16 +16,11 @@ import java.time.OffsetDateTime import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = RunStats.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = RunStats.Builder::class) @NoAutoDetect class RunStats -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val runCount: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val runCount: JsonField, private val latencyP50: JsonField, private val latencyP99: JsonField, private val firstTokenP50: JsonField, @@ -47,8 +40,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -93,85 +85,47 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun completionCost(): Optional = Optional.ofNullable(completionCost.getNullable("completion_cost")) - @JsonProperty("run_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runCount() = runCount + @JsonProperty("run_count") @ExcludeMissing fun _runCount() = runCount - @JsonProperty("latency_p50") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _latencyP50() = latencyP50 + @JsonProperty("latency_p50") @ExcludeMissing fun _latencyP50() = latencyP50 - @JsonProperty("latency_p99") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _latencyP99() = latencyP99 + @JsonProperty("latency_p99") @ExcludeMissing fun _latencyP99() = latencyP99 - @JsonProperty("first_token_p50") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _firstTokenP50() = firstTokenP50 + @JsonProperty("first_token_p50") @ExcludeMissing fun _firstTokenP50() = firstTokenP50 - @JsonProperty("first_token_p99") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _firstTokenP99() = firstTokenP99 + @JsonProperty("first_token_p99") @ExcludeMissing fun _firstTokenP99() = firstTokenP99 - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalTokens() = totalTokens + @JsonProperty("total_tokens") @ExcludeMissing fun _totalTokens() = totalTokens - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptTokens() = promptTokens + @JsonProperty("prompt_tokens") @ExcludeMissing fun _promptTokens() = promptTokens - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionTokens() = completionTokens + @JsonProperty("completion_tokens") @ExcludeMissing fun _completionTokens() = completionTokens - @JsonProperty("median_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _medianTokens() = medianTokens + @JsonProperty("median_tokens") @ExcludeMissing fun _medianTokens() = medianTokens - @JsonProperty("last_run_start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _lastRunStartTime() = lastRunStartTime + @JsonProperty("last_run_start_time") @ExcludeMissing fun _lastRunStartTime() = lastRunStartTime - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackStats() = feedbackStats + @JsonProperty("feedback_stats") @ExcludeMissing fun _feedbackStats() = feedbackStats - @JsonProperty("run_facets") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runFacets() = runFacets + @JsonProperty("run_facets") @ExcludeMissing fun _runFacets() = runFacets - @JsonProperty("error_rate") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _errorRate() = errorRate + @JsonProperty("error_rate") @ExcludeMissing fun _errorRate() = errorRate - @JsonProperty("streaming_rate") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _streamingRate() = streamingRate + @JsonProperty("streaming_rate") @ExcludeMissing fun _streamingRate() = streamingRate - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalCost() = totalCost + @JsonProperty("total_cost") @ExcludeMissing fun _totalCost() = totalCost - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptCost() = promptCost + @JsonProperty("prompt_cost") @ExcludeMissing fun _promptCost() = promptCost - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionCost() = completionCost + @JsonProperty("completion_cost") @ExcludeMissing fun _completionCost() = completionCost - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunStats = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - runCount() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): RunStats = apply { + if (!validated) { + runCount() latencyP50() latencyP99() firstTokenP50() @@ -193,12 +147,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunStats && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunStats && this.runCount == other.runCount && this.latencyP50 == other.latencyP50 && this.latencyP99 == other.latencyP99 && @@ -219,15 +173,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - runCount, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + runCount, latencyP50, latencyP99, firstTokenP50, @@ -253,21 +203,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "RunStats{runCount=$runCount, latencyP50=$latencyP50, latencyP99=$latencyP99, firstTokenP50=$firstTokenP50, firstTokenP99=$firstTokenP99, totalTokens=$totalTokens, promptTokens=$promptTokens, completionTokens=$completionTokens, medianTokens=$medianTokens, lastRunStartTime=$lastRunStartTime, feedbackStats=$feedbackStats, runFacets=$runFacets, errorRate=$errorRate, streamingRate=$streamingRate, totalCost=$totalCost, promptCost=$promptCost, completionCost=$completionCost, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var runCount: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var runCount: JsonField = JsonMissing.of() private var latencyP50: JsonField = JsonMissing.of() private var latencyP99: JsonField = JsonMissing.of() private var firstTokenP50: JsonField = JsonMissing.of() @@ -286,231 +229,159 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var completionCost: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runStats: RunStats) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.runCount = runStats.runCount // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.latencyP50 = runStats.latencyP50 - this.latencyP99 = runStats.latencyP99 - this.firstTokenP50 = runStats.firstTokenP50 - this.firstTokenP99 = runStats.firstTokenP99 - this.totalTokens = runStats.totalTokens - this.promptTokens = runStats.promptTokens - this.completionTokens = runStats.completionTokens - this.medianTokens = runStats.medianTokens - this.lastRunStartTime = runStats.lastRunStartTime - this.feedbackStats = runStats.feedbackStats - this.runFacets = runStats.runFacets - this.errorRate = runStats.errorRate - this.streamingRate = runStats.streamingRate - this.totalCost = runStats.totalCost - this.promptCost = runStats.promptCost - this.completionCost = runStats.completionCost - additionalProperties(runStats.additionalProperties) - } + @JvmSynthetic + internal fun from(runStats: RunStats) = apply { + this.runCount = runStats.runCount + this.latencyP50 = runStats.latencyP50 + this.latencyP99 = runStats.latencyP99 + this.firstTokenP50 = runStats.firstTokenP50 + this.firstTokenP99 = runStats.firstTokenP99 + this.totalTokens = runStats.totalTokens + this.promptTokens = runStats.promptTokens + this.completionTokens = runStats.completionTokens + this.medianTokens = runStats.medianTokens + this.lastRunStartTime = runStats.lastRunStartTime + this.feedbackStats = runStats.feedbackStats + this.runFacets = runStats.runFacets + this.errorRate = runStats.errorRate + this.streamingRate = runStats.streamingRate + this.totalCost = runStats.totalCost + this.promptCost = runStats.promptCost + this.completionCost = runStats.completionCost + additionalProperties(runStats.additionalProperties) + } - fun runCount(runCount: Long) = - runCount(JsonField.of(runCount)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runCount(runCount: Long) = runCount(JsonField.of(runCount)) - @JsonProperty("run_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_count") @ExcludeMissing - fun runCount(runCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runCount = runCount - } + fun runCount(runCount: JsonField) = apply { this.runCount = runCount } - fun latencyP50(latencyP50: Double) = - latencyP50(JsonField.of(latencyP50)) // templates/JavaSDK/entities/objects.ts:252:20 + fun latencyP50(latencyP50: Double) = latencyP50(JsonField.of(latencyP50)) - @JsonProperty("latency_p50") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("latency_p50") @ExcludeMissing - fun latencyP50(latencyP50: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.latencyP50 = latencyP50 - } + fun latencyP50(latencyP50: JsonField) = apply { this.latencyP50 = latencyP50 } - fun latencyP99(latencyP99: Double) = - latencyP99(JsonField.of(latencyP99)) // templates/JavaSDK/entities/objects.ts:252:20 + fun latencyP99(latencyP99: Double) = latencyP99(JsonField.of(latencyP99)) - @JsonProperty("latency_p99") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("latency_p99") @ExcludeMissing - fun latencyP99(latencyP99: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.latencyP99 = latencyP99 - } + fun latencyP99(latencyP99: JsonField) = apply { this.latencyP99 = latencyP99 } - fun firstTokenP50(firstTokenP50: Double) = - firstTokenP50( - JsonField.of(firstTokenP50) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun firstTokenP50(firstTokenP50: Double) = firstTokenP50(JsonField.of(firstTokenP50)) - @JsonProperty("first_token_p50") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("first_token_p50") @ExcludeMissing - fun firstTokenP50(firstTokenP50: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.firstTokenP50 = firstTokenP50 - } + fun firstTokenP50(firstTokenP50: JsonField) = apply { + this.firstTokenP50 = firstTokenP50 + } - fun firstTokenP99(firstTokenP99: Double) = - firstTokenP99( - JsonField.of(firstTokenP99) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun firstTokenP99(firstTokenP99: Double) = firstTokenP99(JsonField.of(firstTokenP99)) - @JsonProperty("first_token_p99") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("first_token_p99") @ExcludeMissing - fun firstTokenP99(firstTokenP99: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.firstTokenP99 = firstTokenP99 - } + fun firstTokenP99(firstTokenP99: JsonField) = apply { + this.firstTokenP99 = firstTokenP99 + } - fun totalTokens(totalTokens: Long) = - totalTokens(JsonField.of(totalTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalTokens(totalTokens: Long) = totalTokens(JsonField.of(totalTokens)) - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_tokens") @ExcludeMissing - fun totalTokens(totalTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalTokens = totalTokens - } + fun totalTokens(totalTokens: JsonField) = apply { this.totalTokens = totalTokens } - fun promptTokens(promptTokens: Long) = - promptTokens(JsonField.of(promptTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptTokens(promptTokens: Long) = promptTokens(JsonField.of(promptTokens)) - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_tokens") @ExcludeMissing - fun promptTokens(promptTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptTokens = promptTokens - } + fun promptTokens(promptTokens: JsonField) = apply { this.promptTokens = promptTokens } fun completionTokens(completionTokens: Long) = - completionTokens( - JsonField.of(completionTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + completionTokens(JsonField.of(completionTokens)) - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_tokens") @ExcludeMissing - fun completionTokens(completionTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionTokens = completionTokens - } + fun completionTokens(completionTokens: JsonField) = apply { + this.completionTokens = completionTokens + } - fun medianTokens(medianTokens: Long) = - medianTokens(JsonField.of(medianTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun medianTokens(medianTokens: Long) = medianTokens(JsonField.of(medianTokens)) - @JsonProperty("median_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("median_tokens") @ExcludeMissing - fun medianTokens(medianTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.medianTokens = medianTokens - } + fun medianTokens(medianTokens: JsonField) = apply { this.medianTokens = medianTokens } fun lastRunStartTime(lastRunStartTime: OffsetDateTime) = - lastRunStartTime( - JsonField.of(lastRunStartTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + lastRunStartTime(JsonField.of(lastRunStartTime)) - @JsonProperty("last_run_start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_run_start_time") @ExcludeMissing - fun lastRunStartTime(lastRunStartTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastRunStartTime = lastRunStartTime - } + fun lastRunStartTime(lastRunStartTime: JsonField) = apply { + this.lastRunStartTime = lastRunStartTime + } - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("feedback_stats") @ExcludeMissing - fun feedbackStats(feedbackStats: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackStats = feedbackStats - } + fun feedbackStats(feedbackStats: JsonValue) = apply { this.feedbackStats = feedbackStats } - fun runFacets(runFacets: List) = - runFacets(JsonField.of(runFacets)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runFacets(runFacets: List) = runFacets(JsonField.of(runFacets)) - @JsonProperty("run_facets") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_facets") @ExcludeMissing - fun runFacets(runFacets: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runFacets = runFacets - } + fun runFacets(runFacets: JsonField>) = apply { this.runFacets = runFacets } - fun errorRate(errorRate: Double) = - errorRate(JsonField.of(errorRate)) // templates/JavaSDK/entities/objects.ts:252:20 + fun errorRate(errorRate: Double) = errorRate(JsonField.of(errorRate)) - @JsonProperty("error_rate") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("error_rate") @ExcludeMissing - fun errorRate(errorRate: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.errorRate = errorRate - } + fun errorRate(errorRate: JsonField) = apply { this.errorRate = errorRate } - fun streamingRate(streamingRate: Double) = - streamingRate( - JsonField.of(streamingRate) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun streamingRate(streamingRate: Double) = streamingRate(JsonField.of(streamingRate)) - @JsonProperty("streaming_rate") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("streaming_rate") @ExcludeMissing - fun streamingRate(streamingRate: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.streamingRate = streamingRate - } + fun streamingRate(streamingRate: JsonField) = apply { + this.streamingRate = streamingRate + } - fun totalCost(totalCost: Double) = - totalCost(JsonField.of(totalCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalCost(totalCost: Double) = totalCost(JsonField.of(totalCost)) - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_cost") @ExcludeMissing - fun totalCost(totalCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalCost = totalCost - } + fun totalCost(totalCost: JsonField) = apply { this.totalCost = totalCost } - fun promptCost(promptCost: Double) = - promptCost(JsonField.of(promptCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptCost(promptCost: Double) = promptCost(JsonField.of(promptCost)) - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_cost") @ExcludeMissing - fun promptCost(promptCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptCost = promptCost - } + fun promptCost(promptCost: JsonField) = apply { this.promptCost = promptCost } - fun completionCost(completionCost: Double) = - completionCost( - JsonField.of(completionCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun completionCost(completionCost: Double) = completionCost(JsonField.of(completionCost)) - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_cost") @ExcludeMissing - fun completionCost(completionCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionCost = completionCost - } + fun completionCost(completionCost: JsonField) = apply { + this.completionCost = completionCost + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunStats = - RunStats( // templates/JavaSDK/entities/objects.ts:326:30 - runCount, // templates/JavaSDK/entities/objects.ts:326:30 + RunStats( + runCount, latencyP50, latencyP99, firstTokenP50, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateParams.kt index 67ff2de9..b738fa0b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class RunUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val runId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val runId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun runId(): String = runId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun runId(): String = runId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> runId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> runId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is RunUpdateParams && this.runId == other.runId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - runId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + runId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,114 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var runId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var runId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(runUpdateParams: RunUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.runId = runUpdateParams.runId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(runUpdateParams.additionalQueryParams) - additionalHeaders(runUpdateParams.additionalHeaders) - additionalBodyProperties(runUpdateParams.additionalBodyProperties) - } - - fun runId(runId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.runId = runId + @JvmSynthetic + internal fun from(runUpdateParams: RunUpdateParams) = apply { + this.runId = runUpdateParams.runId + additionalQueryParams(runUpdateParams.additionalQueryParams) + additionalHeaders(runUpdateParams.additionalHeaders) + additionalBodyProperties(runUpdateParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun runId(runId: String) = apply { this.runId = runId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): RunUpdateParams = - RunUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(runId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`runId` is required but was not set" - }, + RunUpdateParams( + checkNotNull(runId) { "`runId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateResponse.kt index b9fd7cf5..b94a5fab 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/RunUpdateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,39 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = RunUpdateResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = RunUpdateResponse.Builder::class) @NoAutoDetect class RunUpdateResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): RunUpdateResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): RunUpdateResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is RunUpdateResponse && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is RunUpdateResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +51,33 @@ private constructor( override fun toString() = "RunUpdateResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(runUpdateResponse: RunUpdateResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(runUpdateResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(runUpdateResponse: RunUpdateResponse) = apply { + additionalProperties(runUpdateResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): RunUpdateResponse = RunUpdateResponse(additionalProperties.toUnmodifiable()) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionCreateParams.kt index 587e4ce0..2132d624 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,12 +16,8 @@ import java.util.Objects import java.util.Optional class SessionCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val id: String?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val id: String?, private val defaultDatasetId: String?, private val description: String?, private val endTime: OffsetDateTime?, @@ -37,9 +31,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun id(): Optional = - Optional.ofNullable(id) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): Optional = Optional.ofNullable(id) fun defaultDatasetId(): Optional = Optional.ofNullable(defaultDatasetId) @@ -57,11 +49,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun upsert(): Optional = Optional.ofNullable(upsert) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): SessionCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return SessionCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - id, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): SessionCreateBody { + return SessionCreateBody( + id, defaultDatasetId, description, endTime, @@ -73,32 +64,22 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.upsert?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("upsert", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.upsert?.let { params.put("upsert", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Create class for TracerSession. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = SessionCreateBody.Builder::class) @NoAutoDetect class SessionCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val id: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val id: String?, private val defaultDatasetId: String?, private val description: String?, private val endTime: OffsetDateTime?, @@ -109,46 +90,36 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun defaultDatasetId(): String? = defaultDatasetId + @JsonProperty("default_dataset_id") fun defaultDatasetId(): String? = defaultDatasetId - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun endTime(): OffsetDateTime? = endTime + @JsonProperty("end_time") fun endTime(): OffsetDateTime? = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:113:14 - fun extra(): JsonValue? = extra + @JsonProperty("extra") fun extra(): JsonValue? = extra - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonProperty("reference_dataset_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun referenceDatasetId(): String? = referenceDatasetId + @JsonProperty("reference_dataset_id") fun referenceDatasetId(): String? = referenceDatasetId - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun startTime(): OffsetDateTime? = startTime + @JsonProperty("start_time") fun startTime(): OffsetDateTime? = startTime - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionCreateBody && this.id == other.id && this.defaultDatasetId == other.defaultDatasetId && this.description == other.description && @@ -160,15 +131,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - id, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + id, defaultDatasetId, description, endTime, @@ -185,20 +152,14 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "SessionCreateBody{id=$id, defaultDatasetId=$defaultDatasetId, description=$description, endTime=$endTime, extra=$extra, name=$name, referenceDatasetId=$referenceDatasetId, startTime=$startTime, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var id: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var id: String? = null private var defaultDatasetId: String? = null private var description: String? = null private var endTime: OffsetDateTime? = null @@ -208,97 +169,61 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var startTime: OffsetDateTime? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(sessionCreateBody: SessionCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.id = - sessionCreateBody.id // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.defaultDatasetId = sessionCreateBody.defaultDatasetId - this.description = sessionCreateBody.description - this.endTime = sessionCreateBody.endTime - this.extra = sessionCreateBody.extra - this.name = sessionCreateBody.name - this.referenceDatasetId = sessionCreateBody.referenceDatasetId - this.startTime = sessionCreateBody.startTime - additionalProperties(sessionCreateBody.additionalProperties) - } - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(sessionCreateBody: SessionCreateBody) = apply { + this.id = sessionCreateBody.id + this.defaultDatasetId = sessionCreateBody.defaultDatasetId + this.description = sessionCreateBody.description + this.endTime = sessionCreateBody.endTime + this.extra = sessionCreateBody.extra + this.name = sessionCreateBody.name + this.referenceDatasetId = sessionCreateBody.referenceDatasetId + this.startTime = sessionCreateBody.startTime + additionalProperties(sessionCreateBody.additionalProperties) } - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun defaultDatasetId(defaultDatasetId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.defaultDatasetId = defaultDatasetId - } + @JsonProperty("id") fun id(id: String) = apply { this.id = id } - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } - - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } - - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra + @JsonProperty("default_dataset_id") + fun defaultDatasetId(defaultDatasetId: String) = apply { + this.defaultDatasetId = defaultDatasetId } - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } + + @JsonProperty("end_time") + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + @JsonProperty("extra") fun extra(extra: JsonValue) = apply { this.extra = extra } + + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + @JsonProperty("reference_dataset_id") + fun referenceDatasetId(referenceDatasetId: String) = apply { + this.referenceDatasetId = referenceDatasetId } - @JsonProperty("reference_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun referenceDatasetId(referenceDatasetId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceDatasetId = referenceDatasetId - } + @JsonProperty("start_time") + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): SessionCreateBody = - SessionCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - id, // templates/JavaSDK/entities/objects.ts:326:30 + SessionCreateBody( + id, defaultDatasetId, description, endTime, @@ -317,12 +242,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionCreateParams && this.id == other.id && this.defaultDatasetId == other.defaultDatasetId && this.description == other.description && @@ -337,10 +262,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, defaultDatasetId, description, endTime, @@ -360,20 +284,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: String? = null private var defaultDatasetId: String? = null private var description: String? = null private var endTime: OffsetDateTime? = null @@ -386,138 +305,101 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(sessionCreateParams: SessionCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.id = sessionCreateParams.id // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.defaultDatasetId = sessionCreateParams.defaultDatasetId - this.description = sessionCreateParams.description - this.endTime = sessionCreateParams.endTime - this.extra = sessionCreateParams.extra - this.name = sessionCreateParams.name - this.referenceDatasetId = sessionCreateParams.referenceDatasetId - this.startTime = sessionCreateParams.startTime - this.upsert = sessionCreateParams.upsert - additionalQueryParams(sessionCreateParams.additionalQueryParams) - additionalHeaders(sessionCreateParams.additionalHeaders) - additionalBodyProperties(sessionCreateParams.additionalBodyProperties) - } - - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id + @JvmSynthetic + internal fun from(sessionCreateParams: SessionCreateParams) = apply { + this.id = sessionCreateParams.id + this.defaultDatasetId = sessionCreateParams.defaultDatasetId + this.description = sessionCreateParams.description + this.endTime = sessionCreateParams.endTime + this.extra = sessionCreateParams.extra + this.name = sessionCreateParams.name + this.referenceDatasetId = sessionCreateParams.referenceDatasetId + this.startTime = sessionCreateParams.startTime + this.upsert = sessionCreateParams.upsert + additionalQueryParams(sessionCreateParams.additionalQueryParams) + additionalHeaders(sessionCreateParams.additionalHeaders) + additionalBodyProperties(sessionCreateParams.additionalBodyProperties) } - fun defaultDatasetId(defaultDatasetId: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.defaultDatasetId = defaultDatasetId - } + fun id(id: String) = apply { this.id = id } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } - - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.endTime = endTime - } - - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.extra = extra + fun defaultDatasetId(defaultDatasetId: String) = apply { + this.defaultDatasetId = defaultDatasetId } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun description(description: String) = apply { this.description = description } + + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + fun extra(extra: JsonValue) = apply { this.extra = extra } + + fun name(name: String) = apply { this.name = name } + + fun referenceDatasetId(referenceDatasetId: String) = apply { + this.referenceDatasetId = referenceDatasetId } - fun referenceDatasetId(referenceDatasetId: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.referenceDatasetId = referenceDatasetId - } + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.startTime = startTime - } + fun upsert(upsert: Boolean) = apply { this.upsert = upsert } - fun upsert(upsert: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.upsert = upsert + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): SessionCreateParams = - SessionCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - id, // templates/JavaSDK/entities/params.ts:683:22 + SessionCreateParams( + id, defaultDatasetId, description, endTime, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteParams.kt index 3f25b982..2e3bcd6f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,41 +10,29 @@ import java.util.Objects import java.util.Optional class SessionDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val sessionIds: List, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val sessionIds: List, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun sessionIds(): List = sessionIds // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun sessionIds(): List = sessionIds - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.sessionIds.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("session_ids", listOf(it.joinToString(separator = ","))) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.sessionIds.let { params.put("session_ids", listOf(it.joinToString(separator = ","))) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams @@ -52,22 +40,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionDeleteParams && this.sessionIds == other.sessionIds && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - sessionIds, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + sessionIds, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -79,124 +66,91 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var sessionIds: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var sessionIds: MutableList = mutableListOf() private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(sessionDeleteParams: SessionDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.sessionIds( - sessionDeleteParams.sessionIds - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(sessionDeleteParams.additionalQueryParams) - additionalHeaders(sessionDeleteParams.additionalHeaders) - additionalBodyProperties(sessionDeleteParams.additionalBodyProperties) - } - - fun sessionIds(sessionIds: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.sessionIds.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.sessionIds.addAll(sessionIds) - } - - fun addSessionId(sessionId: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.sessionIds.add(sessionId) + @JvmSynthetic + internal fun from(sessionDeleteParams: SessionDeleteParams) = apply { + this.sessionIds(sessionDeleteParams.sessionIds) + additionalQueryParams(sessionDeleteParams.additionalQueryParams) + additionalHeaders(sessionDeleteParams.additionalHeaders) + additionalBodyProperties(sessionDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun sessionIds(sessionIds: List) = apply { + this.sessionIds.clear() + this.sessionIds.addAll(sessionIds) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun addSessionId(sessionId: String) = apply { this.sessionIds.add(sessionId) } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): SessionDeleteParams = - SessionDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(sessionIds) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`sessionIds` is required but was not set" - } + SessionDeleteParams( + checkNotNull(sessionIds) { "`sessionIds` is required but was not set" } .toUnmodifiable(), additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteResponse.kt index 53688e96..785613a6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,50 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = SessionDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = SessionDeleteResponse.Builder::class) @NoAutoDetect class SessionDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): SessionDeleteResponse = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): SessionDeleteResponse = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -64,43 +52,33 @@ private constructor( override fun toString() = "SessionDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(sessionDeleteResponse: SessionDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(sessionDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(sessionDeleteResponse: SessionDeleteResponse) = apply { + additionalProperties(sessionDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): SessionDeleteResponse = SessionDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionListParams.kt index 8093d7ab..482bbc90 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -13,12 +13,8 @@ import java.util.Objects import java.util.Optional class SessionListParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val id: List?, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val id: List?, private val facets: Boolean?, private val limit: Long?, private val name: String?, @@ -33,9 +29,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalHeaders: Map>, ) { - fun id(): Optional> = - Optional.ofNullable(id) // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): Optional> = Optional.ofNullable(id) fun facets(): Optional = Optional.ofNullable(facets) @@ -57,62 +51,38 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun sortByFeedbackKey(): Optional = Optional.ofNullable(sortByFeedbackKey) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.id?.let { // templates/JavaSDK/entities/objects.ts:392:21 - params.put("id", listOf(it.joinToString(separator = ","))) - } - this.facets?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("facets", listOf(it.toString())) - } - this.limit?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("limit", listOf(it.toString())) - } - this.name?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("name", listOf(it.toString())) - } - this.nameContains?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("name_contains", listOf(it.toString())) - } - this.offset?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("offset", listOf(it.toString())) - } - this.referenceDataset?.let { // templates/JavaSDK/entities/objects.ts:392:21 + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.id?.let { params.put("id", listOf(it.joinToString(separator = ","))) } + this.facets?.let { params.put("facets", listOf(it.toString())) } + this.limit?.let { params.put("limit", listOf(it.toString())) } + this.name?.let { params.put("name", listOf(it.toString())) } + this.nameContains?.let { params.put("name_contains", listOf(it.toString())) } + this.offset?.let { params.put("offset", listOf(it.toString())) } + this.referenceDataset?.let { params.put("reference_dataset", listOf(it.joinToString(separator = ","))) } - this.referenceFree?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("reference_free", listOf(it.toString())) - } - this.sortBy?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("sort_by", listOf(it.toString())) - } - this.sortByDesc?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("sort_by_desc", listOf(it.toString())) - } - this.sortByFeedbackKey?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("sort_by_feedback_key", listOf(it.toString())) - } + this.referenceFree?.let { params.put("reference_free", listOf(it.toString())) } + this.sortBy?.let { params.put("sort_by", listOf(it.toString())) } + this.sortByDesc?.let { params.put("sort_by_desc", listOf(it.toString())) } + this.sortByFeedbackKey?.let { params.put("sort_by_feedback_key", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionListParams && this.id == other.id && this.facets == other.facets && this.limit == other.limit && @@ -128,10 +98,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, facets, limit, name, @@ -152,21 +121,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: MutableList = - mutableListOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: MutableList = mutableListOf() private var facets: Boolean? = null private var limit: Long? = null private var name: String? = null @@ -180,145 +143,103 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(sessionListParams: SessionListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.id( - sessionListParams.id ?: listOf() - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.facets = sessionListParams.facets - this.limit = sessionListParams.limit - this.name = sessionListParams.name - this.nameContains = sessionListParams.nameContains - this.offset = sessionListParams.offset - this.referenceDataset(sessionListParams.referenceDataset ?: listOf()) - this.referenceFree = sessionListParams.referenceFree - this.sortBy = sessionListParams.sortBy - this.sortByDesc = sessionListParams.sortByDesc - this.sortByFeedbackKey = sessionListParams.sortByFeedbackKey - additionalQueryParams(sessionListParams.additionalQueryParams) - additionalHeaders(sessionListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(sessionListParams: SessionListParams) = apply { + this.id(sessionListParams.id ?: listOf()) + this.facets = sessionListParams.facets + this.limit = sessionListParams.limit + this.name = sessionListParams.name + this.nameContains = sessionListParams.nameContains + this.offset = sessionListParams.offset + this.referenceDataset(sessionListParams.referenceDataset ?: listOf()) + this.referenceFree = sessionListParams.referenceFree + this.sortBy = sessionListParams.sortBy + this.sortByDesc = sessionListParams.sortByDesc + this.sortByFeedbackKey = sessionListParams.sortByFeedbackKey + additionalQueryParams(sessionListParams.additionalQueryParams) + additionalHeaders(sessionListParams.additionalHeaders) + } - fun id(id: List) = apply { // templates/JavaSDK/entities/params.ts:609:26 - this.id.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 + fun id(id: List) = apply { + this.id.clear() this.id.addAll(id) } - fun addId(id: String) = apply { // templates/JavaSDK/entities/params.ts:620:26 - this.id.add(id) + fun addId(id: String) = apply { this.id.add(id) } + + fun facets(facets: Boolean) = apply { this.facets = facets } + + fun limit(limit: Long) = apply { this.limit = limit } + + fun name(name: String) = apply { this.name = name } + + fun nameContains(nameContains: String) = apply { this.nameContains = nameContains } + + fun offset(offset: Long) = apply { this.offset = offset } + + fun referenceDataset(referenceDataset: List) = apply { + this.referenceDataset.clear() + this.referenceDataset.addAll(referenceDataset) } - fun facets(facets: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.facets = facets + fun addReferenceDataset(referenceDataset: String) = apply { + this.referenceDataset.add(referenceDataset) } - fun limit(limit: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.limit = limit - } - - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name - } - - fun nameContains(nameContains: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.nameContains = nameContains - } - - fun offset(offset: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.offset = offset - } - - fun referenceDataset(referenceDataset: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.referenceDataset.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.referenceDataset.addAll(referenceDataset) - } - - fun addReferenceDataset(referenceDataset: String) = - apply { // templates/JavaSDK/entities/params.ts:620:26 - this.referenceDataset.add(referenceDataset) - } - - fun referenceFree(referenceFree: Boolean) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.referenceFree = referenceFree - } + fun referenceFree(referenceFree: Boolean) = apply { this.referenceFree = referenceFree } /** An enumeration. */ - fun sortBy(sortBy: SortBy) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sortBy = sortBy + fun sortBy(sortBy: SortBy) = apply { this.sortBy = sortBy } + + fun sortByDesc(sortByDesc: Boolean) = apply { this.sortByDesc = sortByDesc } + + fun sortByFeedbackKey(sortByFeedbackKey: String) = apply { + this.sortByFeedbackKey = sortByFeedbackKey } - fun sortByDesc(sortByDesc: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sortByDesc = sortByDesc + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun sortByFeedbackKey(sortByFeedbackKey: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sortByFeedbackKey = sortByFeedbackKey - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): SessionListParams = - SessionListParams( // templates/JavaSDK/entities/params.ts:683:22 - if (id.size == 0) null - else id.toUnmodifiable(), // templates/JavaSDK/entities/params.ts:683:22 + SessionListParams( + if (id.size == 0) null else id.toUnmodifiable(), facets, limit, name, @@ -338,30 +259,25 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SortBy && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is SortBy && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val NAME = SortBy(JsonField.of("name")) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val NAME = SortBy(JsonField.of("name")) @JvmField val START_TIME = SortBy(JsonField.of("start_time")) @@ -378,9 +294,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // @JvmStatic fun of(value: String) = SortBy(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - NAME, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + NAME, START_TIME, LAST_RUN_START_TIME, LATENCY_P50, @@ -389,9 +304,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // FEEDBACK, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - NAME, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + NAME, START_TIME, LAST_RUN_START_TIME, LATENCY_P50, @@ -402,9 +316,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - NAME -> Value.NAME // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + NAME -> Value.NAME START_TIME -> Value.START_TIME LAST_RUN_START_TIME -> Value.LAST_RUN_START_TIME LATENCY_P50 -> Value.LATENCY_P50 @@ -415,9 +328,8 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - NAME -> Known.NAME // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + NAME -> Known.NAME START_TIME -> Known.START_TIME LAST_RUN_START_TIME -> Known.LAST_RUN_START_TIME LATENCY_P50 -> Known.LATENCY_P50 diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParams.kt index fc970e7f..53d6dc5e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,12 +10,8 @@ import java.util.Objects import java.util.Optional class SessionMetadataRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val sessionId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val sessionId: String, private val k: Long?, private val metadataKeys: List?, private val startTime: OffsetDateTime?, @@ -23,8 +19,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalHeaders: Map>, ) { - fun sessionId(): String = sessionId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun sessionId(): String = sessionId fun k(): Optional = Optional.ofNullable(k) @@ -32,32 +27,23 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun startTime(): Optional = Optional.ofNullable(startTime) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.k?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("k", listOf(it.toString())) - } - this.metadataKeys?.let { // templates/JavaSDK/entities/objects.ts:392:21 + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.k?.let { params.put("k", listOf(it.toString())) } + this.metadataKeys?.let { params.put("metadata_keys", listOf(it.joinToString(separator = ","))) } - this.startTime?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("start_time", listOf(it.toString())) - } + this.startTime?.let { params.put("start_time", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> sessionId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> sessionId else -> "" } } @@ -66,13 +52,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - SessionMetadataRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionMetadataRetrieveParams && this.sessionId == other.sessionId && this.k == other.k && this.metadataKeys == other.metadataKeys && @@ -81,10 +66,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - sessionId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + sessionId, k, metadataKeys, startTime, @@ -98,123 +82,87 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var sessionId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var sessionId: String? = null private var k: Long? = null private var metadataKeys: MutableList = mutableListOf() private var startTime: OffsetDateTime? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(sessionMetadataRetrieveParams: SessionMetadataRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.sessionId = - sessionMetadataRetrieveParams - .sessionId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.k = sessionMetadataRetrieveParams.k - this.metadataKeys(sessionMetadataRetrieveParams.metadataKeys ?: listOf()) - this.startTime = sessionMetadataRetrieveParams.startTime - additionalQueryParams(sessionMetadataRetrieveParams.additionalQueryParams) - additionalHeaders(sessionMetadataRetrieveParams.additionalHeaders) - } - - fun sessionId(sessionId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sessionId = sessionId + @JvmSynthetic + internal fun from(sessionMetadataRetrieveParams: SessionMetadataRetrieveParams) = apply { + this.sessionId = sessionMetadataRetrieveParams.sessionId + this.k = sessionMetadataRetrieveParams.k + this.metadataKeys(sessionMetadataRetrieveParams.metadataKeys ?: listOf()) + this.startTime = sessionMetadataRetrieveParams.startTime + additionalQueryParams(sessionMetadataRetrieveParams.additionalQueryParams) + additionalHeaders(sessionMetadataRetrieveParams.additionalHeaders) } - fun k(k: Long) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.k = k + fun sessionId(sessionId: String) = apply { this.sessionId = sessionId } + + fun k(k: Long) = apply { this.k = k } + + fun metadataKeys(metadataKeys: List) = apply { + this.metadataKeys.clear() + this.metadataKeys.addAll(metadataKeys) } - fun metadataKeys(metadataKeys: List) = - apply { // templates/JavaSDK/entities/params.ts:609:26 - this.metadataKeys.clear() // templates/JavaSDK/entities/params.ts:609:26 // - // templates/JavaSDK/entities/params.ts:609:26 - this.metadataKeys.addAll(metadataKeys) - } + fun addMetadataKey(metadataKey: String) = apply { this.metadataKeys.add(metadataKey) } - fun addMetadataKey(metadataKey: String) = - apply { // templates/JavaSDK/entities/params.ts:620:26 - this.metadataKeys.add(metadataKey) - } + fun startTime(startTime: OffsetDateTime) = apply { this.startTime = startTime } - fun startTime(startTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.startTime = startTime - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): SessionMetadataRetrieveParams = - SessionMetadataRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(sessionId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`sessionId` is required but was not set" - }, + SessionMetadataRetrieveParams( + checkNotNull(sessionId) { "`sessionId` is required but was not set" }, k, if (metadataKeys.size == 0) null else metadataKeys.toUnmodifiable(), startTime, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionRetrieveParams.kt index f20fc201..127c51f6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -9,42 +9,30 @@ import java.util.Objects import java.util.Optional class SessionRetrieveParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val sessionId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val sessionId: String, private val includeStats: Boolean?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun sessionId(): String = sessionId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun sessionId(): String = sessionId fun includeStats(): Optional = Optional.ofNullable(includeStats) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): - Map> { // templates/JavaSDK/entities/params.ts:201:14 - val params = - mutableMapOf>() // templates/JavaSDK/entities/params.ts:210:30 // - // templates/JavaSDK/entities/params.ts:210:30 - this.includeStats?.let { // templates/JavaSDK/entities/objects.ts:462:15 - params.put("include_stats", listOf(it.toString())) - } + @JvmSynthetic + internal fun getQueryParams(): Map> { + val params = mutableMapOf>() + this.includeStats?.let { params.put("include_stats", listOf(it.toString())) } params.putAll(additionalQueryParams) return params.toUnmodifiable() } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> sessionId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> sessionId else -> "" } } @@ -53,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionRetrieveParams && this.sessionId == other.sessionId && this.includeStats == other.includeStats && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - sessionId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + sessionId, includeStats, additionalQueryParams, additionalHeaders, @@ -80,103 +67,74 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var sessionId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var sessionId: String? = null private var includeStats: Boolean? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(sessionRetrieveParams: SessionRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.sessionId = - sessionRetrieveParams - .sessionId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.includeStats = sessionRetrieveParams.includeStats - additionalQueryParams(sessionRetrieveParams.additionalQueryParams) - additionalHeaders(sessionRetrieveParams.additionalHeaders) - } - - fun sessionId(sessionId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sessionId = sessionId + @JvmSynthetic + internal fun from(sessionRetrieveParams: SessionRetrieveParams) = apply { + this.sessionId = sessionRetrieveParams.sessionId + this.includeStats = sessionRetrieveParams.includeStats + additionalQueryParams(sessionRetrieveParams.additionalQueryParams) + additionalHeaders(sessionRetrieveParams.additionalHeaders) } - fun includeStats(includeStats: Boolean) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.includeStats = includeStats - } + fun sessionId(sessionId: String) = apply { this.sessionId = sessionId } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun includeStats(includeStats: Boolean) = apply { this.includeStats = includeStats } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): SessionRetrieveParams = - SessionRetrieveParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(sessionId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`sessionId` is required but was not set" - }, + SessionRetrieveParams( + checkNotNull(sessionId) { "`sessionId` is required but was not set" }, includeStats, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionUpdateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionUpdateParams.kt index fb826634..43f3fb66 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionUpdateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/SessionUpdateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -18,12 +16,8 @@ import java.util.Objects import java.util.Optional class SessionUpdateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val sessionId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val sessionId: String, private val defaultDatasetId: String?, private val description: String?, private val endTime: OffsetDateTime?, @@ -34,8 +28,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun sessionId(): String = sessionId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun sessionId(): String = sessionId fun defaultDatasetId(): Optional = Optional.ofNullable(defaultDatasetId) @@ -47,11 +40,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun name(): Optional = Optional.ofNullable(name) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): SessionUpdateBody { // templates/JavaSDK/entities/params.ts:165:16 - return SessionUpdateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - defaultDatasetId, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): SessionUpdateBody { + return SessionUpdateBody( + defaultDatasetId, description, endTime, extra, @@ -60,30 +52,23 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> sessionId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> sessionId else -> "" } } /** Update class for TracerSession. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = SessionUpdateBody.Builder::class) @NoAutoDetect class SessionUpdateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val defaultDatasetId: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val defaultDatasetId: String?, private val description: String?, private val endTime: OffsetDateTime?, private val extra: JsonValue?, @@ -91,37 +76,30 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun defaultDatasetId(): String? = defaultDatasetId + @JsonProperty("default_dataset_id") fun defaultDatasetId(): String? = defaultDatasetId - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:113:14 - fun description(): String? = description + @JsonProperty("description") fun description(): String? = description - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:113:14 - fun endTime(): OffsetDateTime? = endTime + @JsonProperty("end_time") fun endTime(): OffsetDateTime? = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:113:14 - fun extra(): JsonValue? = extra + @JsonProperty("extra") fun extra(): JsonValue? = extra - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:113:14 - fun name(): String? = name + @JsonProperty("name") fun name(): String? = name - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionUpdateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionUpdateBody && this.defaultDatasetId == other.defaultDatasetId && this.description == other.description && this.endTime == other.endTime && @@ -130,15 +108,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - defaultDatasetId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + defaultDatasetId, description, endTime, extra, @@ -152,96 +126,62 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "SessionUpdateBody{defaultDatasetId=$defaultDatasetId, description=$description, endTime=$endTime, extra=$extra, name=$name, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var defaultDatasetId: String? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var defaultDatasetId: String? = null private var description: String? = null private var endTime: OffsetDateTime? = null private var extra: JsonValue? = null private var name: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(sessionUpdateBody: SessionUpdateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.defaultDatasetId = - sessionUpdateBody - .defaultDatasetId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.description = sessionUpdateBody.description - this.endTime = sessionUpdateBody.endTime - this.extra = sessionUpdateBody.extra - this.name = sessionUpdateBody.name - additionalProperties(sessionUpdateBody.additionalProperties) - } - - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun defaultDatasetId(defaultDatasetId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.defaultDatasetId = defaultDatasetId - } - - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun description(description: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } - - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } - - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra + @JvmSynthetic + internal fun from(sessionUpdateBody: SessionUpdateBody) = apply { + this.defaultDatasetId = sessionUpdateBody.defaultDatasetId + this.description = sessionUpdateBody.description + this.endTime = sessionUpdateBody.endTime + this.extra = sessionUpdateBody.extra + this.name = sessionUpdateBody.name + additionalProperties(sessionUpdateBody.additionalProperties) } - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun name(name: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name + @JsonProperty("default_dataset_id") + fun defaultDatasetId(defaultDatasetId: String) = apply { + this.defaultDatasetId = defaultDatasetId } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("description") + fun description(description: String) = apply { this.description = description } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("end_time") + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("extra") fun extra(extra: JsonValue) = apply { this.extra = extra } + + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): SessionUpdateBody = - SessionUpdateBody( // templates/JavaSDK/entities/objects.ts:326:30 - defaultDatasetId, // templates/JavaSDK/entities/objects.ts:326:30 + SessionUpdateBody( + defaultDatasetId, description, endTime, extra, @@ -257,12 +197,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is SessionUpdateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is SessionUpdateParams && this.sessionId == other.sessionId && this.defaultDatasetId == other.defaultDatasetId && this.description == other.description && @@ -274,10 +214,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - sessionId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + sessionId, defaultDatasetId, description, endTime, @@ -294,20 +233,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var sessionId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var sessionId: String? = null private var defaultDatasetId: String? = null private var description: String? = null private var endTime: OffsetDateTime? = null @@ -317,125 +251,90 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(sessionUpdateParams: SessionUpdateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.sessionId = - sessionUpdateParams.sessionId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.defaultDatasetId = sessionUpdateParams.defaultDatasetId - this.description = sessionUpdateParams.description - this.endTime = sessionUpdateParams.endTime - this.extra = sessionUpdateParams.extra - this.name = sessionUpdateParams.name - additionalQueryParams(sessionUpdateParams.additionalQueryParams) - additionalHeaders(sessionUpdateParams.additionalHeaders) - additionalBodyProperties(sessionUpdateParams.additionalBodyProperties) - } - - fun sessionId(sessionId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.sessionId = sessionId + @JvmSynthetic + internal fun from(sessionUpdateParams: SessionUpdateParams) = apply { + this.sessionId = sessionUpdateParams.sessionId + this.defaultDatasetId = sessionUpdateParams.defaultDatasetId + this.description = sessionUpdateParams.description + this.endTime = sessionUpdateParams.endTime + this.extra = sessionUpdateParams.extra + this.name = sessionUpdateParams.name + additionalQueryParams(sessionUpdateParams.additionalQueryParams) + additionalHeaders(sessionUpdateParams.additionalHeaders) + additionalBodyProperties(sessionUpdateParams.additionalBodyProperties) } - fun defaultDatasetId(defaultDatasetId: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.defaultDatasetId = defaultDatasetId - } + fun sessionId(sessionId: String) = apply { this.sessionId = sessionId } - fun description(description: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.description = description - } - - fun endTime(endTime: OffsetDateTime) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.endTime = endTime - } - - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.extra = extra + fun defaultDatasetId(defaultDatasetId: String) = apply { + this.defaultDatasetId = defaultDatasetId } - fun name(name: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.name = name + fun description(description: String) = apply { this.description = description } + + fun endTime(endTime: OffsetDateTime) = apply { this.endTime = endTime } + + fun extra(extra: JsonValue) = apply { this.extra = extra } + + fun name(name: String) = apply { this.name = name } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): SessionUpdateParams = - SessionUpdateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(sessionId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`sessionId` is required but was not set" - }, + SessionUpdateParams( + checkNotNull(sessionId) { "`sessionId` is required but was not set" }, defaultDatasetId, description, endTime, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Tenant.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Tenant.kt index 6e8204aa..f3d29f58 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Tenant.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/Tenant.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,15 +17,11 @@ import java.util.Objects import java.util.Optional /** Tenant schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = Tenant.Builder::class) @NoAutoDetect class Tenant -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val id: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val id: JsonField, private val organizationId: JsonField, private val createdAt: JsonField, private val displayName: JsonField, @@ -36,8 +30,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -61,21 +54,13 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun tenantHandle(): Optional = Optional.ofNullable(tenantHandle.getNullable("tenant_handle")) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _organizationId() = organizationId + @JsonProperty("organization_id") @ExcludeMissing fun _organizationId() = organizationId - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("display_name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _displayName() = displayName + @JsonProperty("display_name") @ExcludeMissing fun _displayName() = displayName /** * Base class for settings, allowing values to be overridden by environment variables. @@ -83,25 +68,17 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. */ - @JsonProperty("config") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _config() = config + @JsonProperty("config") @ExcludeMissing fun _config() = config - @JsonProperty("tenant_handle") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantHandle() = tenantHandle + @JsonProperty("tenant_handle") @ExcludeMissing fun _tenantHandle() = tenantHandle - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Tenant = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - id() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Tenant = apply { + if (!validated) { + id() organizationId() createdAt() displayName() @@ -113,12 +90,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Tenant && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Tenant && this.id == other.id && this.organizationId == other.organizationId && this.createdAt == other.createdAt && @@ -128,15 +105,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - id, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + id, organizationId, createdAt, displayName, @@ -151,21 +124,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Tenant{id=$id, organizationId=$organizationId, createdAt=$createdAt, displayName=$displayName, config=$config, tenantHandle=$tenantHandle, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var id: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var id: JsonField = JsonMissing.of() private var organizationId: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var displayName: JsonField = JsonMissing.of() @@ -173,10 +139,9 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var tenantHandle: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenant: Tenant) = apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.id = tenant.id // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 + @JvmSynthetic + internal fun from(tenant: Tenant) = apply { + this.id = tenant.id this.organizationId = tenant.organizationId this.createdAt = tenant.createdAt this.displayName = tenant.displayName @@ -185,49 +150,32 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 additionalProperties(tenant.additionalProperties) } - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId)) + + @JsonProperty("organization_id") @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun organizationId(organizationId: JsonField) = apply { + this.organizationId = organizationId } - fun organizationId(organizationId: String) = - organizationId( - JsonField.of(organizationId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun organizationId(organizationId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.organizationId = organizationId - } + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun displayName(displayName: String) = displayName(JsonField.of(displayName)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("display_name") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } - - fun displayName(displayName: String) = - displayName(JsonField.of(displayName)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("display_name") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun displayName(displayName: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.displayName = displayName - } + fun displayName(displayName: JsonField) = apply { this.displayName = displayName } /** - * // templates/JavaSDK/entities/objects.ts:252:20 Base class for settings, allowing values - * to be overridden by environment variables. + * Base class for settings, allowing values to be overridden by environment variables. * * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. @@ -240,44 +188,35 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. */ - @JsonProperty("config") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("config") @ExcludeMissing - fun config(config: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.config = config - } + fun config(config: JsonField) = apply { this.config = config } - fun tenantHandle(tenantHandle: String) = - tenantHandle(JsonField.of(tenantHandle)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantHandle(tenantHandle: String) = tenantHandle(JsonField.of(tenantHandle)) - @JsonProperty("tenant_handle") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_handle") @ExcludeMissing - fun tenantHandle(tenantHandle: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantHandle = tenantHandle - } + fun tenantHandle(tenantHandle: JsonField) = apply { + this.tenantHandle = tenantHandle + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Tenant = - Tenant( // templates/JavaSDK/entities/objects.ts:326:30 - id, // templates/JavaSDK/entities/objects.ts:326:30 + Tenant( + id, organizationId, createdAt, displayName, @@ -288,11 +227,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } /** - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - * // templates/JavaSDK/entities/objects.ts:76:13 Base class for settings, allowing values to be - * overridden by environment variables. + * Base class for settings, allowing values to be overridden by environment variables. * * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. @@ -300,10 +235,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = Config.Builder::class) @NoAutoDetect class Config - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val isPersonal: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val isPersonal: JsonField, private val maxIdentities: JsonField, private val maxHourlyTracingRequests: JsonField, private val maxHourlyTracingBytes: JsonField, @@ -312,8 +245,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -336,43 +268,31 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun flags(): Optional = Optional.ofNullable(flags.getNullable("flags")) - @JsonProperty("is_personal") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _isPersonal() = isPersonal + @JsonProperty("is_personal") @ExcludeMissing fun _isPersonal() = isPersonal - @JsonProperty("max_identities") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _maxIdentities() = maxIdentities + @JsonProperty("max_identities") @ExcludeMissing fun _maxIdentities() = maxIdentities - @JsonProperty("max_hourly_tracing_requests") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("max_hourly_tracing_requests") @ExcludeMissing fun _maxHourlyTracingRequests() = maxHourlyTracingRequests - @JsonProperty("max_hourly_tracing_bytes") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("max_hourly_tracing_bytes") @ExcludeMissing fun _maxHourlyTracingBytes() = maxHourlyTracingBytes - @JsonProperty( - "max_monthly_total_unique_traces" - ) // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("max_monthly_total_unique_traces") @ExcludeMissing fun _maxMonthlyTotalUniqueTraces() = maxMonthlyTotalUniqueTraces - @JsonProperty("flags") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _flags() = flags + @JsonProperty("flags") @ExcludeMissing fun _flags() = flags - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Config = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - isPersonal() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Config = apply { + if (!validated) { + isPersonal() maxIdentities() maxHourlyTracingRequests() maxHourlyTracingBytes() @@ -384,12 +304,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Config && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Config && this.isPersonal == other.isPersonal && this.maxIdentities == other.maxIdentities && this.maxHourlyTracingRequests == other.maxHourlyTracingRequests && @@ -399,15 +319,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - isPersonal, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + isPersonal, maxIdentities, maxHourlyTracingRequests, maxHourlyTracingBytes, @@ -422,21 +338,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Config{isPersonal=$isPersonal, maxIdentities=$maxIdentities, maxHourlyTracingRequests=$maxHourlyTracingRequests, maxHourlyTracingBytes=$maxHourlyTracingBytes, maxMonthlyTotalUniqueTraces=$maxMonthlyTotalUniqueTraces, flags=$flags, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var isPersonal: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var isPersonal: JsonField = JsonMissing.of() private var maxIdentities: JsonField = JsonMissing.of() private var maxHourlyTracingRequests: JsonField = JsonMissing.of() private var maxHourlyTracingBytes: JsonField = JsonMissing.of() @@ -444,116 +353,81 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var flags: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(config: Config) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.isPersonal = - config.isPersonal // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.maxIdentities = config.maxIdentities - this.maxHourlyTracingRequests = config.maxHourlyTracingRequests - this.maxHourlyTracingBytes = config.maxHourlyTracingBytes - this.maxMonthlyTotalUniqueTraces = config.maxMonthlyTotalUniqueTraces - this.flags = config.flags - additionalProperties(config.additionalProperties) - } + @JvmSynthetic + internal fun from(config: Config) = apply { + this.isPersonal = config.isPersonal + this.maxIdentities = config.maxIdentities + this.maxHourlyTracingRequests = config.maxHourlyTracingRequests + this.maxHourlyTracingBytes = config.maxHourlyTracingBytes + this.maxMonthlyTotalUniqueTraces = config.maxMonthlyTotalUniqueTraces + this.flags = config.flags + additionalProperties(config.additionalProperties) + } - fun isPersonal(isPersonal: Boolean) = - isPersonal(JsonField.of(isPersonal)) // templates/JavaSDK/entities/objects.ts:252:20 + fun isPersonal(isPersonal: Boolean) = isPersonal(JsonField.of(isPersonal)) - @JsonProperty("is_personal") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("is_personal") @ExcludeMissing - fun isPersonal(isPersonal: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.isPersonal = isPersonal - } + fun isPersonal(isPersonal: JsonField) = apply { this.isPersonal = isPersonal } - fun maxIdentities(maxIdentities: Long) = - maxIdentities( - JsonField.of(maxIdentities) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun maxIdentities(maxIdentities: Long) = maxIdentities(JsonField.of(maxIdentities)) - @JsonProperty("max_identities") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_identities") @ExcludeMissing - fun maxIdentities(maxIdentities: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxIdentities = maxIdentities - } + fun maxIdentities(maxIdentities: JsonField) = apply { + this.maxIdentities = maxIdentities + } fun maxHourlyTracingRequests(maxHourlyTracingRequests: Long) = - maxHourlyTracingRequests( - JsonField.of(maxHourlyTracingRequests) - ) // templates/JavaSDK/entities/objects.ts:252:20 + maxHourlyTracingRequests(JsonField.of(maxHourlyTracingRequests)) - @JsonProperty( - "max_hourly_tracing_requests" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_hourly_tracing_requests") @ExcludeMissing - fun maxHourlyTracingRequests(maxHourlyTracingRequests: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxHourlyTracingRequests = maxHourlyTracingRequests - } + fun maxHourlyTracingRequests(maxHourlyTracingRequests: JsonField) = apply { + this.maxHourlyTracingRequests = maxHourlyTracingRequests + } fun maxHourlyTracingBytes(maxHourlyTracingBytes: Long) = - maxHourlyTracingBytes( - JsonField.of(maxHourlyTracingBytes) - ) // templates/JavaSDK/entities/objects.ts:252:20 + maxHourlyTracingBytes(JsonField.of(maxHourlyTracingBytes)) - @JsonProperty( - "max_hourly_tracing_bytes" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_hourly_tracing_bytes") @ExcludeMissing - fun maxHourlyTracingBytes(maxHourlyTracingBytes: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxHourlyTracingBytes = maxHourlyTracingBytes - } + fun maxHourlyTracingBytes(maxHourlyTracingBytes: JsonField) = apply { + this.maxHourlyTracingBytes = maxHourlyTracingBytes + } fun maxMonthlyTotalUniqueTraces(maxMonthlyTotalUniqueTraces: Long) = - maxMonthlyTotalUniqueTraces( - JsonField.of(maxMonthlyTotalUniqueTraces) - ) // templates/JavaSDK/entities/objects.ts:252:20 + maxMonthlyTotalUniqueTraces(JsonField.of(maxMonthlyTotalUniqueTraces)) - @JsonProperty( - "max_monthly_total_unique_traces" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_monthly_total_unique_traces") @ExcludeMissing - fun maxMonthlyTotalUniqueTraces(maxMonthlyTotalUniqueTraces: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxMonthlyTotalUniqueTraces = maxMonthlyTotalUniqueTraces - } + fun maxMonthlyTotalUniqueTraces(maxMonthlyTotalUniqueTraces: JsonField) = apply { + this.maxMonthlyTotalUniqueTraces = maxMonthlyTotalUniqueTraces + } - fun flags(flags: Flags) = - flags(JsonField.of(flags)) // templates/JavaSDK/entities/objects.ts:252:20 + fun flags(flags: Flags) = flags(JsonField.of(flags)) - @JsonProperty("flags") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("flags") @ExcludeMissing - fun flags(flags: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.flags = flags - } + fun flags(flags: JsonField) = apply { this.flags = flags } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Config = - Config( // templates/JavaSDK/entities/objects.ts:326:30 - isPersonal, // templates/JavaSDK/entities/objects.ts:326:30 + Config( + isPersonal, maxIdentities, maxHourlyTracingRequests, maxHourlyTracingBytes, @@ -563,54 +437,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 ) } - @JsonDeserialize( - builder = Flags.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Flags.Builder::class) @NoAutoDetect class Flags private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Flags = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): Flags = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Flags && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is Flags && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -618,42 +477,32 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Flags{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(flags: Flags) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(flags.additionalProperties) - } + @JvmSynthetic + internal fun from(flags: Flags) = apply { + additionalProperties(flags.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCreateParams.kt index 17cfd96f..1ccf6b5e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,12 +15,8 @@ import java.util.Objects import java.util.Optional class TenantCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val displayName: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val displayName: String, private val id: String?, private val organizationId: String?, private val tenantHandle: String?, @@ -31,8 +25,7 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalBodyProperties: Map, ) { - fun displayName(): String = displayName // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun displayName(): String = displayName fun id(): Optional = Optional.ofNullable(id) @@ -40,11 +33,10 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun tenantHandle(): Optional = Optional.ofNullable(tenantHandle) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): TenantCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return TenantCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - displayName, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): TenantCreateBody { + return TenantCreateBody( + displayName, id, organizationId, tenantHandle, @@ -52,56 +44,44 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders /** Creation model for the tenant. */ - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = TenantCreateBody.Builder::class) @NoAutoDetect class TenantCreateBody - internal constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val displayName: String?, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + internal constructor( + private val displayName: String?, private val id: String?, private val organizationId: String?, private val tenantHandle: String?, private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("display_name") // templates/JavaSDK/entities/objects.ts:113:14 - fun displayName(): String? = displayName + @JsonProperty("display_name") fun displayName(): String? = displayName - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:113:14 - fun id(): String? = id + @JsonProperty("id") fun id(): String? = id - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:113:14 - fun organizationId(): String? = organizationId + @JsonProperty("organization_id") fun organizationId(): String? = organizationId - @JsonProperty("tenant_handle") // templates/JavaSDK/entities/objects.ts:113:14 - fun tenantHandle(): String? = tenantHandle + @JsonProperty("tenant_handle") fun tenantHandle(): String? = tenantHandle - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantCreateBody && this.displayName == other.displayName && this.id == other.id && this.organizationId == other.organizationId && @@ -109,15 +89,11 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - displayName, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + displayName, id, organizationId, tenantHandle, @@ -130,91 +106,58 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "TenantCreateBody{displayName=$displayName, id=$id, organizationId=$organizationId, tenantHandle=$tenantHandle, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var displayName: String? = - null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var displayName: String? = null private var id: String? = null private var organizationId: String? = null private var tenantHandle: String? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantCreateBody: TenantCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.displayName = - tenantCreateBody - .displayName // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.id = tenantCreateBody.id - this.organizationId = tenantCreateBody.organizationId - this.tenantHandle = tenantCreateBody.tenantHandle - additionalProperties(tenantCreateBody.additionalProperties) - } - - @JsonProperty("display_name") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun displayName(displayName: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.displayName = displayName - } - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun id(id: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(tenantCreateBody: TenantCreateBody) = apply { + this.displayName = tenantCreateBody.displayName + this.id = tenantCreateBody.id + this.organizationId = tenantCreateBody.organizationId + this.tenantHandle = tenantCreateBody.tenantHandle + additionalProperties(tenantCreateBody.additionalProperties) } - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun organizationId(organizationId: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.organizationId = organizationId - } + @JsonProperty("display_name") + fun displayName(displayName: String) = apply { this.displayName = displayName } - @JsonProperty("tenant_handle") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun tenantHandle(tenantHandle: String) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantHandle = tenantHandle - } + @JsonProperty("id") fun id(id: String) = apply { this.id = id } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + @JsonProperty("organization_id") + fun organizationId(organizationId: String) = apply { + this.organizationId = organizationId + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonProperty("tenant_handle") + fun tenantHandle(tenantHandle: String) = apply { this.tenantHandle = tenantHandle } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantCreateBody = - TenantCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(displayName) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`displayName` is required but was not set" - }, + TenantCreateBody( + checkNotNull(displayName) { "`displayName` is required but was not set" }, id, organizationId, tenantHandle, @@ -229,12 +172,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantCreateParams && this.displayName == other.displayName && this.id == other.id && this.organizationId == other.organizationId && @@ -244,10 +187,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - displayName, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + displayName, id, organizationId, tenantHandle, @@ -262,20 +204,15 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var displayName: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var displayName: String? = null private var id: String? = null private var organizationId: String? = null private var tenantHandle: String? = null @@ -283,115 +220,82 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantCreateParams: TenantCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.displayName = - tenantCreateParams.displayName // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - this.id = tenantCreateParams.id - this.organizationId = tenantCreateParams.organizationId - this.tenantHandle = tenantCreateParams.tenantHandle - additionalQueryParams(tenantCreateParams.additionalQueryParams) - additionalHeaders(tenantCreateParams.additionalHeaders) - additionalBodyProperties(tenantCreateParams.additionalBodyProperties) - } - - fun displayName(displayName: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.displayName = displayName - } - - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id + @JvmSynthetic + internal fun from(tenantCreateParams: TenantCreateParams) = apply { + this.displayName = tenantCreateParams.displayName + this.id = tenantCreateParams.id + this.organizationId = tenantCreateParams.organizationId + this.tenantHandle = tenantCreateParams.tenantHandle + additionalQueryParams(tenantCreateParams.additionalQueryParams) + additionalHeaders(tenantCreateParams.additionalHeaders) + additionalBodyProperties(tenantCreateParams.additionalBodyProperties) } - fun organizationId(organizationId: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.organizationId = organizationId - } + fun displayName(displayName: String) = apply { this.displayName = displayName } - fun tenantHandle(tenantHandle: String) = - apply { // templates/JavaSDK/entities/params.ts:634:26 - this.tenantHandle = tenantHandle - } + fun id(id: String) = apply { this.id = id } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun organizationId(organizationId: String) = apply { this.organizationId = organizationId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun tenantHandle(tenantHandle: String) = apply { this.tenantHandle = tenantHandle } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): TenantCreateParams = - TenantCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(displayName) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`displayName` is required but was not set" - }, + TenantCreateParams( + checkNotNull(displayName) { "`displayName` is required but was not set" }, id, organizationId, tenantHandle, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParams.kt index 2c93fa88..3b43addf 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParams.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,45 +15,32 @@ import java.util.Objects import java.util.Optional class TenantCurrentMembersCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val email: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val email: String, private val readOnly: Boolean?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun email(): String = email // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun email(): String = email fun readOnly(): Optional = Optional.ofNullable(readOnly) - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - TenantCurrentMembersCreateBody { // templates/JavaSDK/entities/params.ts:165:16 - return TenantCurrentMembersCreateBody( // templates/JavaSDK/entities/params.ts:180:26 // - // templates/JavaSDK/entities/params.ts:179:24 - email, // templates/JavaSDK/entities/params.ts:180:26 + @JvmSynthetic + internal fun getBody(): TenantCurrentMembersCreateBody { + return TenantCurrentMembersCreateBody( + email, readOnly, additionalBodyProperties, ) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - @JsonDeserialize( - builder = TenantCurrentMembersCreateBody.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = TenantCurrentMembersCreateBody.Builder::class) @NoAutoDetect class TenantCurrentMembersCreateBody internal constructor( @@ -64,43 +49,34 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // private val additionalProperties: Map, ) { - private var hashCode: Int = 0 // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var hashCode: Int = 0 - @JsonProperty("email") // templates/JavaSDK/entities/objects.ts:113:14 - fun email(): String? = email + @JsonProperty("email") fun email(): String? = email - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:113:14 - fun readOnly(): Boolean? = readOnly + @JsonProperty("read_only") fun readOnly(): Boolean? = readOnly - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantCurrentMembersCreateBody && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantCurrentMembersCreateBody && this.email == other.email && this.readOnly == other.readOnly && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - email, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + email, readOnly, additionalProperties, ) @@ -111,72 +87,47 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // override fun toString() = "TenantCurrentMembersCreateBody{email=$email, readOnly=$readOnly, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var email: String? = null // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var email: String? = null private var readOnly: Boolean? = null private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(tenantCurrentMembersCreateBody: TenantCurrentMembersCreateBody) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.email = - tenantCurrentMembersCreateBody - .email // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 + apply { + this.email = tenantCurrentMembersCreateBody.email this.readOnly = tenantCurrentMembersCreateBody.readOnly additionalProperties(tenantCurrentMembersCreateBody.additionalProperties) } - @JsonProperty("email") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun email(email: String) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.email = email + @JsonProperty("email") fun email(email: String) = apply { this.email = email } + + @JsonProperty("read_only") + fun readOnly(readOnly: Boolean) = apply { this.readOnly = readOnly } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) } - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - fun readOnly(readOnly: Boolean) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } - - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantCurrentMembersCreateBody = - TenantCurrentMembersCreateBody( // templates/JavaSDK/entities/objects.ts:326:30 - checkNotNull(email) { // templates/JavaSDK/entities/objects.ts:358:13 // - // templates/JavaSDK/entities/objects.ts:326:30 - "`email` is required but was not set" - }, + TenantCurrentMembersCreateBody( + checkNotNull(email) { "`email` is required but was not set" }, readOnly, additionalProperties.toUnmodifiable(), ) @@ -189,13 +140,12 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantCurrentMembersCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantCurrentMembersCreateParams && this.email == other.email && this.readOnly == other.readOnly && this.additionalQueryParams == other.additionalQueryParams && @@ -203,10 +153,9 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - email, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + email, readOnly, additionalQueryParams, additionalHeaders, @@ -219,122 +168,91 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var email: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var email: String? = null private var readOnly: Boolean? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 + @JvmSynthetic internal fun from(tenantCurrentMembersCreateParams: TenantCurrentMembersCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.email = - tenantCurrentMembersCreateParams - .email // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 + apply { + this.email = tenantCurrentMembersCreateParams.email this.readOnly = tenantCurrentMembersCreateParams.readOnly additionalQueryParams(tenantCurrentMembersCreateParams.additionalQueryParams) additionalHeaders(tenantCurrentMembersCreateParams.additionalHeaders) additionalBodyProperties(tenantCurrentMembersCreateParams.additionalBodyProperties) } - fun email(email: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.email = email + fun email(email: String) = apply { this.email = email } + + fun readOnly(readOnly: Boolean) = apply { this.readOnly = readOnly } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun readOnly(readOnly: Boolean) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.readOnly = readOnly + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): TenantCurrentMembersCreateParams = - TenantCurrentMembersCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(email) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`email` is required but was not set" - }, + TenantCurrentMembersCreateParams( + checkNotNull(email) { "`email` is required but was not set" }, readOnly, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersListParams.kt index f775cb91..06fd5c65 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentMembersListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,33 +11,27 @@ class TenantCurrentMembersListParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantCurrentMembersListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantCurrentMembersListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -46,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantCurrentMembersListParams: TenantCurrentMembersListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - tenantCurrentMembersListParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(tenantCurrentMembersListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(tenantCurrentMembersListParams: TenantCurrentMembersListParams) = apply { + additionalQueryParams(tenantCurrentMembersListParams.additionalQueryParams) + additionalHeaders(tenantCurrentMembersListParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): TenantCurrentMembersListParams = TenantCurrentMembersListParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParams.kt index c850abb4..06097182 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,33 +11,27 @@ class TenantCurrentStatsRetrieveParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantCurrentStatsRetrieveParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantCurrentStatsRetrieveParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -46,85 +40,64 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 + @JvmSynthetic internal fun from(tenantCurrentStatsRetrieveParams: TenantCurrentStatsRetrieveParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - tenantCurrentStatsRetrieveParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 + apply { + additionalQueryParams(tenantCurrentStatsRetrieveParams.additionalQueryParams) additionalHeaders(tenantCurrentStatsRetrieveParams.additionalHeaders) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): TenantCurrentStatsRetrieveParams = TenantCurrentStatsRetrieveParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantForUser.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantForUser.kt index 5c431808..0b808104 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantForUser.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantForUser.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,15 +17,11 @@ import java.util.Objects import java.util.Optional /** Tenant schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = TenantForUser.Builder::class) @NoAutoDetect class TenantForUser -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val id: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val id: JsonField, private val organizationId: JsonField, private val createdAt: JsonField, private val displayName: JsonField, @@ -37,8 +31,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -64,21 +57,13 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun readOnly(): Optional = Optional.ofNullable(readOnly.getNullable("read_only")) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _organizationId() = organizationId + @JsonProperty("organization_id") @ExcludeMissing fun _organizationId() = organizationId - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("display_name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _displayName() = displayName + @JsonProperty("display_name") @ExcludeMissing fun _displayName() = displayName /** * Base class for settings, allowing values to be overridden by environment variables. @@ -86,29 +71,19 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. */ - @JsonProperty("config") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _config() = config + @JsonProperty("config") @ExcludeMissing fun _config() = config - @JsonProperty("tenant_handle") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantHandle() = tenantHandle + @JsonProperty("tenant_handle") @ExcludeMissing fun _tenantHandle() = tenantHandle - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _readOnly() = readOnly + @JsonProperty("read_only") @ExcludeMissing fun _readOnly() = readOnly - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantForUser = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - id() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): TenantForUser = apply { + if (!validated) { + id() organizationId() createdAt() displayName() @@ -121,12 +96,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantForUser && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantForUser && this.id == other.id && this.organizationId == other.organizationId && this.createdAt == other.createdAt && @@ -137,15 +112,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - id, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + id, organizationId, createdAt, displayName, @@ -161,21 +132,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "TenantForUser{id=$id, organizationId=$organizationId, createdAt=$createdAt, displayName=$displayName, config=$config, tenantHandle=$tenantHandle, readOnly=$readOnly, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var id: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var id: JsonField = JsonMissing.of() private var organizationId: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var displayName: JsonField = JsonMissing.of() @@ -184,63 +148,44 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var readOnly: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantForUser: TenantForUser) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.id = tenantForUser.id // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.organizationId = tenantForUser.organizationId - this.createdAt = tenantForUser.createdAt - this.displayName = tenantForUser.displayName - this.config = tenantForUser.config - this.tenantHandle = tenantForUser.tenantHandle - this.readOnly = tenantForUser.readOnly - additionalProperties(tenantForUser.additionalProperties) - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(tenantForUser: TenantForUser) = apply { + this.id = tenantForUser.id + this.organizationId = tenantForUser.organizationId + this.createdAt = tenantForUser.createdAt + this.displayName = tenantForUser.displayName + this.config = tenantForUser.config + this.tenantHandle = tenantForUser.tenantHandle + this.readOnly = tenantForUser.readOnly + additionalProperties(tenantForUser.additionalProperties) } - fun organizationId(organizationId: String) = - organizationId( - JsonField.of(organizationId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId)) + + @JsonProperty("organization_id") @ExcludeMissing - fun organizationId(organizationId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.organizationId = organizationId - } + fun organizationId(organizationId: JsonField) = apply { + this.organizationId = organizationId + } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - fun displayName(displayName: String) = - displayName(JsonField.of(displayName)) // templates/JavaSDK/entities/objects.ts:252:20 + fun displayName(displayName: String) = displayName(JsonField.of(displayName)) - @JsonProperty("display_name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("display_name") @ExcludeMissing - fun displayName(displayName: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.displayName = displayName - } + fun displayName(displayName: JsonField) = apply { this.displayName = displayName } /** - * // templates/JavaSDK/entities/objects.ts:252:20 Base class for settings, allowing values - * to be overridden by environment variables. + * Base class for settings, allowing values to be overridden by environment variables. * * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. @@ -253,54 +198,41 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. */ - @JsonProperty("config") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("config") @ExcludeMissing - fun config(config: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.config = config - } + fun config(config: JsonField) = apply { this.config = config } - fun tenantHandle(tenantHandle: String) = - tenantHandle(JsonField.of(tenantHandle)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantHandle(tenantHandle: String) = tenantHandle(JsonField.of(tenantHandle)) - @JsonProperty("tenant_handle") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_handle") @ExcludeMissing - fun tenantHandle(tenantHandle: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantHandle = tenantHandle - } + fun tenantHandle(tenantHandle: JsonField) = apply { + this.tenantHandle = tenantHandle + } - fun readOnly(readOnly: Boolean) = - readOnly(JsonField.of(readOnly)) // templates/JavaSDK/entities/objects.ts:252:20 + fun readOnly(readOnly: Boolean) = readOnly(JsonField.of(readOnly)) - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("read_only") @ExcludeMissing - fun readOnly(readOnly: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } + fun readOnly(readOnly: JsonField) = apply { this.readOnly = readOnly } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantForUser = - TenantForUser( // templates/JavaSDK/entities/objects.ts:326:30 - id, // templates/JavaSDK/entities/objects.ts:326:30 + TenantForUser( + id, organizationId, createdAt, displayName, @@ -312,11 +244,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } /** - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - * // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - * // templates/JavaSDK/entities/objects.ts:76:13 Base class for settings, allowing values to be - * overridden by environment variables. + * Base class for settings, allowing values to be overridden by environment variables. * * This is useful in production for secrets you do not wish to save in code, it plays nicely * with docker(-compose), Heroku and any 12 factor app design. @@ -324,10 +252,8 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = Config.Builder::class) @NoAutoDetect class Config - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val isPersonal: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + private constructor( + private val isPersonal: JsonField, private val maxIdentities: JsonField, private val maxHourlyTracingRequests: JsonField, private val maxHourlyTracingBytes: JsonField, @@ -336,8 +262,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -360,43 +285,31 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun flags(): Optional = Optional.ofNullable(flags.getNullable("flags")) - @JsonProperty("is_personal") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _isPersonal() = isPersonal + @JsonProperty("is_personal") @ExcludeMissing fun _isPersonal() = isPersonal - @JsonProperty("max_identities") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _maxIdentities() = maxIdentities + @JsonProperty("max_identities") @ExcludeMissing fun _maxIdentities() = maxIdentities - @JsonProperty("max_hourly_tracing_requests") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("max_hourly_tracing_requests") @ExcludeMissing fun _maxHourlyTracingRequests() = maxHourlyTracingRequests - @JsonProperty("max_hourly_tracing_bytes") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("max_hourly_tracing_bytes") @ExcludeMissing fun _maxHourlyTracingBytes() = maxHourlyTracingBytes - @JsonProperty( - "max_monthly_total_unique_traces" - ) // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("max_monthly_total_unique_traces") @ExcludeMissing fun _maxMonthlyTotalUniqueTraces() = maxMonthlyTotalUniqueTraces - @JsonProperty("flags") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _flags() = flags + @JsonProperty("flags") @ExcludeMissing fun _flags() = flags - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Config = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - isPersonal() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): Config = apply { + if (!validated) { + isPersonal() maxIdentities() maxHourlyTracingRequests() maxHourlyTracingBytes() @@ -408,12 +321,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Config && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Config && this.isPersonal == other.isPersonal && this.maxIdentities == other.maxIdentities && this.maxHourlyTracingRequests == other.maxHourlyTracingRequests && @@ -423,15 +336,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - isPersonal, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + isPersonal, maxIdentities, maxHourlyTracingRequests, maxHourlyTracingBytes, @@ -446,21 +355,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Config{isPersonal=$isPersonal, maxIdentities=$maxIdentities, maxHourlyTracingRequests=$maxHourlyTracingRequests, maxHourlyTracingBytes=$maxHourlyTracingBytes, maxMonthlyTotalUniqueTraces=$maxMonthlyTotalUniqueTraces, flags=$flags, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var isPersonal: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var isPersonal: JsonField = JsonMissing.of() private var maxIdentities: JsonField = JsonMissing.of() private var maxHourlyTracingRequests: JsonField = JsonMissing.of() private var maxHourlyTracingBytes: JsonField = JsonMissing.of() @@ -468,116 +370,81 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var flags: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(config: Config) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.isPersonal = - config.isPersonal // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.maxIdentities = config.maxIdentities - this.maxHourlyTracingRequests = config.maxHourlyTracingRequests - this.maxHourlyTracingBytes = config.maxHourlyTracingBytes - this.maxMonthlyTotalUniqueTraces = config.maxMonthlyTotalUniqueTraces - this.flags = config.flags - additionalProperties(config.additionalProperties) - } + @JvmSynthetic + internal fun from(config: Config) = apply { + this.isPersonal = config.isPersonal + this.maxIdentities = config.maxIdentities + this.maxHourlyTracingRequests = config.maxHourlyTracingRequests + this.maxHourlyTracingBytes = config.maxHourlyTracingBytes + this.maxMonthlyTotalUniqueTraces = config.maxMonthlyTotalUniqueTraces + this.flags = config.flags + additionalProperties(config.additionalProperties) + } - fun isPersonal(isPersonal: Boolean) = - isPersonal(JsonField.of(isPersonal)) // templates/JavaSDK/entities/objects.ts:252:20 + fun isPersonal(isPersonal: Boolean) = isPersonal(JsonField.of(isPersonal)) - @JsonProperty("is_personal") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("is_personal") @ExcludeMissing - fun isPersonal(isPersonal: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.isPersonal = isPersonal - } + fun isPersonal(isPersonal: JsonField) = apply { this.isPersonal = isPersonal } - fun maxIdentities(maxIdentities: Long) = - maxIdentities( - JsonField.of(maxIdentities) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun maxIdentities(maxIdentities: Long) = maxIdentities(JsonField.of(maxIdentities)) - @JsonProperty("max_identities") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_identities") @ExcludeMissing - fun maxIdentities(maxIdentities: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxIdentities = maxIdentities - } + fun maxIdentities(maxIdentities: JsonField) = apply { + this.maxIdentities = maxIdentities + } fun maxHourlyTracingRequests(maxHourlyTracingRequests: Long) = - maxHourlyTracingRequests( - JsonField.of(maxHourlyTracingRequests) - ) // templates/JavaSDK/entities/objects.ts:252:20 + maxHourlyTracingRequests(JsonField.of(maxHourlyTracingRequests)) - @JsonProperty( - "max_hourly_tracing_requests" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_hourly_tracing_requests") @ExcludeMissing - fun maxHourlyTracingRequests(maxHourlyTracingRequests: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxHourlyTracingRequests = maxHourlyTracingRequests - } + fun maxHourlyTracingRequests(maxHourlyTracingRequests: JsonField) = apply { + this.maxHourlyTracingRequests = maxHourlyTracingRequests + } fun maxHourlyTracingBytes(maxHourlyTracingBytes: Long) = - maxHourlyTracingBytes( - JsonField.of(maxHourlyTracingBytes) - ) // templates/JavaSDK/entities/objects.ts:252:20 + maxHourlyTracingBytes(JsonField.of(maxHourlyTracingBytes)) - @JsonProperty( - "max_hourly_tracing_bytes" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_hourly_tracing_bytes") @ExcludeMissing - fun maxHourlyTracingBytes(maxHourlyTracingBytes: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxHourlyTracingBytes = maxHourlyTracingBytes - } + fun maxHourlyTracingBytes(maxHourlyTracingBytes: JsonField) = apply { + this.maxHourlyTracingBytes = maxHourlyTracingBytes + } fun maxMonthlyTotalUniqueTraces(maxMonthlyTotalUniqueTraces: Long) = - maxMonthlyTotalUniqueTraces( - JsonField.of(maxMonthlyTotalUniqueTraces) - ) // templates/JavaSDK/entities/objects.ts:252:20 + maxMonthlyTotalUniqueTraces(JsonField.of(maxMonthlyTotalUniqueTraces)) - @JsonProperty( - "max_monthly_total_unique_traces" - ) // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("max_monthly_total_unique_traces") @ExcludeMissing - fun maxMonthlyTotalUniqueTraces(maxMonthlyTotalUniqueTraces: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.maxMonthlyTotalUniqueTraces = maxMonthlyTotalUniqueTraces - } + fun maxMonthlyTotalUniqueTraces(maxMonthlyTotalUniqueTraces: JsonField) = apply { + this.maxMonthlyTotalUniqueTraces = maxMonthlyTotalUniqueTraces + } - fun flags(flags: Flags) = - flags(JsonField.of(flags)) // templates/JavaSDK/entities/objects.ts:252:20 + fun flags(flags: Flags) = flags(JsonField.of(flags)) - @JsonProperty("flags") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("flags") @ExcludeMissing - fun flags(flags: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.flags = flags - } + fun flags(flags: JsonField) = apply { this.flags = flags } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): Config = - Config( // templates/JavaSDK/entities/objects.ts:326:30 - isPersonal, // templates/JavaSDK/entities/objects.ts:326:30 + Config( + isPersonal, maxIdentities, maxHourlyTracingRequests, maxHourlyTracingBytes, @@ -587,54 +454,39 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 ) } - @JsonDeserialize( - builder = Flags.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Flags.Builder::class) @NoAutoDetect class Flags private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Flags = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 + fun validate(): Flags = apply { + if (!validated) { validated = true } } fun toBuilder() = Builder().from(this) - override fun equals( - other: Any? - ): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is Flags && // templates/JavaSDK/entities/fields.ts:143:33 - this.additionalProperties == other.additionalProperties + return other is Flags && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -642,42 +494,32 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "Flags{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(flags: Flags) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(flags.additionalProperties) - } + @JvmSynthetic + internal fun from(flags: Flags) = apply { + additionalProperties(flags.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 + apply { this.additionalProperties.putAll(additionalProperties) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantListParams.kt index 510cd035..603d9213 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class TenantListParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantListParams: TenantListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - tenantListParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(tenantListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(tenantListParams: TenantListParams) = apply { + additionalQueryParams(tenantListParams.additionalQueryParams) + additionalHeaders(tenantListParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): TenantListParams = TenantListParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteParams.kt index fa856e92..08bab092 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class TenantMemberDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val identityId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val identityId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun identityId(): String = identityId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun identityId(): String = identityId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> identityId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> identityId else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantMemberDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantMemberDeleteParams && this.identityId == other.identityId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - identityId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + identityId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,116 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var identityId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var identityId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantMemberDeleteParams: TenantMemberDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.identityId = - tenantMemberDeleteParams - .identityId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(tenantMemberDeleteParams.additionalQueryParams) - additionalHeaders(tenantMemberDeleteParams.additionalHeaders) - additionalBodyProperties(tenantMemberDeleteParams.additionalBodyProperties) - } - - fun identityId(identityId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.identityId = identityId + @JvmSynthetic + internal fun from(tenantMemberDeleteParams: TenantMemberDeleteParams) = apply { + this.identityId = tenantMemberDeleteParams.identityId + additionalQueryParams(tenantMemberDeleteParams.additionalQueryParams) + additionalHeaders(tenantMemberDeleteParams.additionalHeaders) + additionalBodyProperties(tenantMemberDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun identityId(identityId: String) = apply { this.identityId = identityId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): TenantMemberDeleteParams = - TenantMemberDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(identityId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`identityId` is required but was not set" - }, + TenantMemberDeleteParams( + checkNotNull(identityId) { "`identityId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteResponse.kt index c7777b67..40c78fb2 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,51 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = TenantMemberDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = TenantMemberDeleteResponse.Builder::class) @NoAutoDetect class TenantMemberDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantMemberDeleteResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): TenantMemberDeleteResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantMemberDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantMemberDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -66,43 +53,33 @@ private constructor( override fun toString() = "TenantMemberDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantMemberDeleteResponse: TenantMemberDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(tenantMemberDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(tenantMemberDeleteResponse: TenantMemberDeleteResponse) = apply { + additionalProperties(tenantMemberDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantMemberDeleteResponse = TenantMemberDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParams.kt index a476b713..3aa97e31 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class TenantMemberPendingDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val identityId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val identityId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun identityId(): String = identityId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun identityId(): String = identityId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> identityId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> identityId else -> "" } } @@ -50,23 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantMemberPendingDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantMemberPendingDeleteParams && this.identityId == other.identityId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - identityId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + identityId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -78,116 +67,87 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var identityId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var identityId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 + @JvmSynthetic internal fun from(tenantMemberPendingDeleteParams: TenantMemberPendingDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.identityId = - tenantMemberPendingDeleteParams - .identityId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 + apply { + this.identityId = tenantMemberPendingDeleteParams.identityId additionalQueryParams(tenantMemberPendingDeleteParams.additionalQueryParams) additionalHeaders(tenantMemberPendingDeleteParams.additionalHeaders) additionalBodyProperties(tenantMemberPendingDeleteParams.additionalBodyProperties) } - fun identityId(identityId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.identityId = identityId + fun identityId(identityId: String) = apply { this.identityId = identityId } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } - - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): TenantMemberPendingDeleteParams = - TenantMemberPendingDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(identityId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`identityId` is required but was not set" - }, + TenantMemberPendingDeleteParams( + checkNotNull(identityId) { "`identityId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteResponse.kt index 70d35ad1..614f3fec 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = TenantMemberPendingDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = TenantMemberPendingDeleteResponse.Builder::class) @NoAutoDetect class TenantMemberPendingDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantMemberPendingDeleteResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): TenantMemberPendingDeleteResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantMemberPendingDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantMemberPendingDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,34 @@ private constructor( override fun toString() = "TenantMemberPendingDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(tenantMemberPendingDeleteResponse: TenantMemberPendingDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 + apply { additionalProperties(tenantMemberPendingDeleteResponse.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantMemberPendingDeleteResponse = TenantMemberPendingDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMembers.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMembers.kt index 7a9d4a0c..19961bf9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMembers.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantMembers.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,54 +17,39 @@ import java.util.Objects import java.util.Optional /** Tenant members schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = TenantMembers.Builder::class) @NoAutoDetect class TenantMembers -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val tenantId: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 - private val members: JsonField>, +private constructor( + private val tenantId: JsonField, + private val members: JsonField>, private val pending: JsonField>, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 fun tenantId(): String = tenantId.getRequired("tenant_id") - fun members(): List = members.getRequired("members") + fun members(): List = members.getRequired("members") fun pending(): List = pending.getRequired("pending") - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("members") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _members() = members + @JsonProperty("members") @ExcludeMissing fun _members() = members - @JsonProperty("pending") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _pending() = pending + @JsonProperty("pending") @ExcludeMissing fun _pending() = pending - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantMembers = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - tenantId() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): TenantMembers = apply { + if (!validated) { + tenantId() members().forEach { it.validate() } pending().forEach { it.validate() } validated = true @@ -75,27 +58,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantMembers && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantMembers && this.tenantId == other.tenantId && this.members == other.members && this.pending == other.pending && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - tenantId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + tenantId, members, pending, additionalProperties, @@ -107,103 +86,72 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "TenantMembers{tenantId=$tenantId, members=$members, pending=$pending, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var tenantId: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 - private var members: JsonField> = JsonMissing.of() + private var tenantId: JsonField = JsonMissing.of() + private var members: JsonField> = JsonMissing.of() private var pending: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantMembers: TenantMembers) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.tenantId = - tenantMembers.tenantId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.members = tenantMembers.members - this.pending = tenantMembers.pending - additionalProperties(tenantMembers.additionalProperties) - } + @JvmSynthetic + internal fun from(tenantMembers: TenantMembers) = apply { + this.tenantId = tenantMembers.tenantId + this.members = tenantMembers.members + this.pending = tenantMembers.pending + additionalProperties(tenantMembers.additionalProperties) + } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_id") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } - fun members(members: List) = - members(JsonField.of(members)) // templates/JavaSDK/entities/objects.ts:252:20 + fun members(members: List) = members(JsonField.of(members)) - @JsonProperty("members") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("members") @ExcludeMissing - fun members(members: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.members = members - } + fun members(members: JsonField>) = apply { this.members = members } - fun pending(pending: List) = - pending(JsonField.of(pending)) // templates/JavaSDK/entities/objects.ts:252:20 + fun pending(pending: List) = pending(JsonField.of(pending)) - @JsonProperty("pending") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("pending") @ExcludeMissing - fun pending(pending: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.pending = pending - } + fun pending(pending: JsonField>) = apply { this.pending = pending } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantMembers = - TenantMembers( // templates/JavaSDK/entities/objects.ts:326:30 - tenantId, // templates/JavaSDK/entities/objects.ts:326:30 + TenantMembers( + tenantId, members.map { it.toUnmodifiable() }, pending.map { it.toUnmodifiable() }, additionalProperties.toUnmodifiable(), ) } - @JsonDeserialize( - builder = TenantMemberIdentity.Builder::class - ) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 - // // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 + @JsonDeserialize(builder = Member.Builder::class) @NoAutoDetect - class TenantMemberIdentity - private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val id: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 + class Member + private constructor( + private val id: JsonField, private val tenantId: JsonField, private val organizationId: JsonField, private val createdAt: JsonField, @@ -215,8 +163,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -239,74 +186,51 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun avatarUrl(): Optional = Optional.ofNullable(avatarUrl.getNullable("avatar_url")) - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _organizationId() = organizationId + @JsonProperty("organization_id") @ExcludeMissing fun _organizationId() = organizationId - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _createdAt() = createdAt + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - @JsonProperty("user_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _userId() = userId + @JsonProperty("user_id") @ExcludeMissing fun _userId() = userId - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _readOnly() = readOnly + @JsonProperty("read_only") @ExcludeMissing fun _readOnly() = readOnly - @JsonProperty("email") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _email() = email + @JsonProperty("email") @ExcludeMissing fun _email() = email - @JsonProperty("full_name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _fullName() = fullName + @JsonProperty("full_name") @ExcludeMissing fun _fullName() = fullName - @JsonProperty("avatar_url") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _avatarUrl() = avatarUrl + @JsonProperty("avatar_url") @ExcludeMissing fun _avatarUrl() = avatarUrl - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantMemberIdentity = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - id() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - tenantId() - organizationId() - createdAt() - userId() - readOnly() - email() - fullName() - avatarUrl() - validated = true - } + fun validate(): Member = apply { + if (!validated) { + id() + tenantId() + organizationId() + createdAt() + userId() + readOnly() + email() + fullName() + avatarUrl() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantMemberIdentity && // templates/JavaSDK/entities/fields.ts:143:33 + return other is Member && this.id == other.id && this.tenantId == other.tenantId && this.organizationId == other.organizationId && @@ -319,15 +243,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - id, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + id, tenantId, organizationId, createdAt, @@ -343,23 +263,16 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 } override fun toString() = - "TenantMemberIdentity{id=$id, tenantId=$tenantId, organizationId=$organizationId, createdAt=$createdAt, userId=$userId, readOnly=$readOnly, email=$email, fullName=$fullName, avatarUrl=$avatarUrl, additionalProperties=$additionalProperties}" + "Member{id=$id, tenantId=$tenantId, organizationId=$organizationId, createdAt=$createdAt, userId=$userId, readOnly=$readOnly, email=$email, fullName=$fullName, avatarUrl=$avatarUrl, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var id: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var id: JsonField = JsonMissing.of() private var tenantId: JsonField = JsonMissing.of() private var organizationId: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() @@ -370,136 +283,96 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var avatarUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantMemberIdentity: TenantMemberIdentity) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.id = - tenantMemberIdentity.id // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.tenantId = tenantMemberIdentity.tenantId - this.organizationId = tenantMemberIdentity.organizationId - this.createdAt = tenantMemberIdentity.createdAt - this.userId = tenantMemberIdentity.userId - this.readOnly = tenantMemberIdentity.readOnly - this.email = tenantMemberIdentity.email - this.fullName = tenantMemberIdentity.fullName - this.avatarUrl = tenantMemberIdentity.avatarUrl - additionalProperties(tenantMemberIdentity.additionalProperties) - } - - fun id(id: String) = - id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + @JvmSynthetic + internal fun from(member: Member) = apply { + this.id = member.id + this.tenantId = member.tenantId + this.organizationId = member.organizationId + this.createdAt = member.createdAt + this.userId = member.userId + this.readOnly = member.readOnly + this.email = member.email + this.fullName = member.fullName + this.avatarUrl = member.avatarUrl + additionalProperties(member.additionalProperties) } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun id(id: JsonField) = apply { this.id = id } + + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) + + @JsonProperty("tenant_id") + @ExcludeMissing + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } fun organizationId(organizationId: String) = - organizationId( - JsonField.of(organizationId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + organizationId(JsonField.of(organizationId)) - @JsonProperty("organization_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("organization_id") @ExcludeMissing - fun organizationId(organizationId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.organizationId = organizationId - } + fun organizationId(organizationId: JsonField) = apply { + this.organizationId = organizationId + } - fun createdAt(createdAt: OffsetDateTime) = - createdAt(JsonField.of(createdAt)) // templates/JavaSDK/entities/objects.ts:252:20 + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JsonProperty("created_at") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("created_at") @ExcludeMissing - fun createdAt(createdAt: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.createdAt = createdAt - } + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt + } - fun userId(userId: String) = - userId(JsonField.of(userId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun userId(userId: String) = userId(JsonField.of(userId)) - @JsonProperty("user_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("user_id") @ExcludeMissing - fun userId(userId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.userId = userId - } + fun userId(userId: JsonField) = apply { this.userId = userId } - fun readOnly(readOnly: Boolean) = - readOnly(JsonField.of(readOnly)) // templates/JavaSDK/entities/objects.ts:252:20 + fun readOnly(readOnly: Boolean) = readOnly(JsonField.of(readOnly)) - @JsonProperty("read_only") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("read_only") @ExcludeMissing - fun readOnly(readOnly: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.readOnly = readOnly - } + fun readOnly(readOnly: JsonField) = apply { this.readOnly = readOnly } - fun email(email: String) = - email(JsonField.of(email)) // templates/JavaSDK/entities/objects.ts:252:20 + fun email(email: String) = email(JsonField.of(email)) - @JsonProperty("email") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("email") @ExcludeMissing - fun email(email: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.email = email - } + fun email(email: JsonField) = apply { this.email = email } - fun fullName(fullName: String) = - fullName(JsonField.of(fullName)) // templates/JavaSDK/entities/objects.ts:252:20 + fun fullName(fullName: String) = fullName(JsonField.of(fullName)) - @JsonProperty("full_name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("full_name") @ExcludeMissing - fun fullName(fullName: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.fullName = fullName - } + fun fullName(fullName: JsonField) = apply { this.fullName = fullName } - fun avatarUrl(avatarUrl: String) = - avatarUrl(JsonField.of(avatarUrl)) // templates/JavaSDK/entities/objects.ts:252:20 + fun avatarUrl(avatarUrl: String) = avatarUrl(JsonField.of(avatarUrl)) - @JsonProperty("avatar_url") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("avatar_url") @ExcludeMissing - fun avatarUrl(avatarUrl: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.avatarUrl = avatarUrl - } + fun avatarUrl(avatarUrl: JsonField) = apply { this.avatarUrl = avatarUrl } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties - .clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } - fun build(): TenantMemberIdentity = - TenantMemberIdentity( // templates/JavaSDK/entities/objects.ts:326:30 - id, // templates/JavaSDK/entities/objects.ts:326:30 + fun build(): Member = + Member( + id, tenantId, organizationId, createdAt, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParams.kt index e08da6d4..a6ae501b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class TenantPendingClaimCreateParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val tenantId: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val tenantId: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun tenantId(): String = tenantId // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun tenantId(): String = tenantId - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> tenantId // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> tenantId else -> "" } } @@ -50,23 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantPendingClaimCreateParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantPendingClaimCreateParams && this.tenantId == other.tenantId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - tenantId, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + tenantId, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -78,116 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var tenantId: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var tenantId: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantPendingClaimCreateParams: TenantPendingClaimCreateParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.tenantId = - tenantPendingClaimCreateParams - .tenantId // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(tenantPendingClaimCreateParams.additionalQueryParams) - additionalHeaders(tenantPendingClaimCreateParams.additionalHeaders) - additionalBodyProperties(tenantPendingClaimCreateParams.additionalBodyProperties) - } - - fun tenantId(tenantId: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.tenantId = tenantId + @JvmSynthetic + internal fun from(tenantPendingClaimCreateParams: TenantPendingClaimCreateParams) = apply { + this.tenantId = tenantPendingClaimCreateParams.tenantId + additionalQueryParams(tenantPendingClaimCreateParams.additionalQueryParams) + additionalHeaders(tenantPendingClaimCreateParams.additionalHeaders) + additionalBodyProperties(tenantPendingClaimCreateParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun tenantId(tenantId: String) = apply { this.tenantId = tenantId } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): TenantPendingClaimCreateParams = - TenantPendingClaimCreateParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(tenantId) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`tenantId` is required but was not set" - }, + TenantPendingClaimCreateParams( + checkNotNull(tenantId) { "`tenantId` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateResponse.kt index 8c0a440b..79f0b829 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingClaimCreateResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = TenantPendingClaimCreateResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = TenantPendingClaimCreateResponse.Builder::class) @NoAutoDetect class TenantPendingClaimCreateResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantPendingClaimCreateResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): TenantPendingClaimCreateResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantPendingClaimCreateResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantPendingClaimCreateResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,34 @@ private constructor( override fun toString() = "TenantPendingClaimCreateResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(tenantPendingClaimCreateResponse: TenantPendingClaimCreateResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 + apply { additionalProperties(tenantPendingClaimCreateResponse.additionalProperties) } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantPendingClaimCreateResponse = TenantPendingClaimCreateResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteParams.kt index e6cbd4a3..2980f90c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -10,36 +10,27 @@ import java.util.Objects import java.util.Optional class TenantPendingDeleteParams -constructor( // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 - private val id: String, // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +constructor( + private val id: String, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, ) { - fun id(): String = id // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 + fun id(): String = id - @JvmSynthetic // templates/JavaSDK/entities/params.ts:165:16 - internal fun getBody(): - Optional> { // templates/JavaSDK/entities/params.ts:165:16 + @JvmSynthetic + internal fun getBody(): Optional> { return Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) } - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders - fun getPathParam(index: Int): String { // templates/JavaSDK/entities/params.ts:555:13 - return when (index) { // templates/JavaSDK/entities/params.ts:560:26 - 0 -> id // templates/JavaSDK/entities/params.ts:560:26 // - // templates/JavaSDK/entities/params.ts:560:26 + fun getPathParam(index: Int): String { + return when (index) { + 0 -> id else -> "" } } @@ -50,22 +41,21 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun _additionalBodyProperties(): Map = additionalBodyProperties - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantPendingDeleteParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantPendingDeleteParams && this.id == other.id && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - return Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:181:14 - id, // templates/JavaSDK/entities/fields.ts:163:19 + override fun hashCode(): Int { + return Objects.hash( + id, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -77,115 +67,86 @@ constructor( // templates/JavaSDK/entities/params.ts:131:13 // fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var id: String? = null // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var id: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantPendingDeleteParams: TenantPendingDeleteParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - this.id = - tenantPendingDeleteParams.id // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams(tenantPendingDeleteParams.additionalQueryParams) - additionalHeaders(tenantPendingDeleteParams.additionalHeaders) - additionalBodyProperties(tenantPendingDeleteParams.additionalBodyProperties) - } - - fun id(id: String) = apply { // templates/JavaSDK/entities/params.ts:634:26 - this.id = id + @JvmSynthetic + internal fun from(tenantPendingDeleteParams: TenantPendingDeleteParams) = apply { + this.id = tenantPendingDeleteParams.id + additionalQueryParams(tenantPendingDeleteParams.additionalQueryParams) + additionalHeaders(tenantPendingDeleteParams.additionalHeaders) + additionalBodyProperties(tenantPendingDeleteParams.additionalBodyProperties) } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun id(id: String) = apply { this.id = id } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } - fun additionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties - .clear() // templates/JavaSDK/entities/params.ts:809:28 // - // templates/JavaSDK/entities/params.ts:809:28 - this.additionalBodyProperties.putAll(additionalBodyProperties) - } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } - fun putAdditionalBodyProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/params.ts:822:28 - this.additionalBodyProperties.put(key, value) - } + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { // templates/JavaSDK/entities/params.ts:832:28 + apply { this.additionalBodyProperties.putAll(additionalBodyProperties) } fun build(): TenantPendingDeleteParams = - TenantPendingDeleteParams( // templates/JavaSDK/entities/params.ts:683:22 - checkNotNull(id) { // templates/JavaSDK/entities/params.ts:844:13 // - // templates/JavaSDK/entities/params.ts:683:22 - "`id` is required but was not set" - }, + TenantPendingDeleteParams( + checkNotNull(id) { "`id` is required but was not set" }, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteResponse.kt index 3ae3c601..18e88b6c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingDeleteResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = TenantPendingDeleteResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = TenantPendingDeleteResponse.Builder::class) @NoAutoDetect class TenantPendingDeleteResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantPendingDeleteResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): TenantPendingDeleteResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TenantPendingDeleteResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantPendingDeleteResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,33 @@ private constructor( override fun toString() = "TenantPendingDeleteResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantPendingDeleteResponse: TenantPendingDeleteResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(tenantPendingDeleteResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(tenantPendingDeleteResponse: TenantPendingDeleteResponse) = apply { + additionalProperties(tenantPendingDeleteResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantPendingDeleteResponse = TenantPendingDeleteResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingListParams.kt index 540109f5..293e42ef 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantPendingListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class TenantPendingListParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantPendingListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantPendingListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantPendingListParams: TenantPendingListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - tenantPendingListParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(tenantPendingListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(tenantPendingListParams: TenantPendingListParams) = apply { + additionalQueryParams(tenantPendingListParams.additionalQueryParams) + additionalHeaders(tenantPendingListParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): TenantPendingListParams = TenantPendingListParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStats.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStats.kt index 7cdae918..d4677097 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStats.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStats.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -17,15 +15,11 @@ import com.langsmith.api.core.toUnmodifiable import java.util.Objects /** Stats for a tenant. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = TenantStats.Builder::class) @NoAutoDetect class TenantStats -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val tenantId: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val tenantId: JsonField, private val datasetCount: JsonField, private val tracerSessionCount: JsonField, private val repoCount: JsonField, @@ -33,8 +27,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -48,37 +41,27 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun annotationQueueCount(): Long = annotationQueueCount.getRequired("annotation_queue_count") - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("dataset_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _datasetCount() = datasetCount + @JsonProperty("dataset_count") @ExcludeMissing fun _datasetCount() = datasetCount - @JsonProperty("tracer_session_count") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("tracer_session_count") @ExcludeMissing fun _tracerSessionCount() = tracerSessionCount - @JsonProperty("repo_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _repoCount() = repoCount + @JsonProperty("repo_count") @ExcludeMissing fun _repoCount() = repoCount - @JsonProperty("annotation_queue_count") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("annotation_queue_count") @ExcludeMissing fun _annotationQueueCount() = annotationQueueCount - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantStats = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - tenantId() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): TenantStats = apply { + if (!validated) { + tenantId() datasetCount() tracerSessionCount() repoCount() @@ -89,12 +72,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantStats && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantStats && this.tenantId == other.tenantId && this.datasetCount == other.datasetCount && this.tracerSessionCount == other.tracerSessionCount && @@ -103,15 +86,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - tenantId, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + tenantId, datasetCount, tracerSessionCount, repoCount, @@ -125,115 +104,83 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "TenantStats{tenantId=$tenantId, datasetCount=$datasetCount, tracerSessionCount=$tracerSessionCount, repoCount=$repoCount, annotationQueueCount=$annotationQueueCount, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var tenantId: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var tenantId: JsonField = JsonMissing.of() private var datasetCount: JsonField = JsonMissing.of() private var tracerSessionCount: JsonField = JsonMissing.of() private var repoCount: JsonField = JsonMissing.of() private var annotationQueueCount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantStats: TenantStats) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.tenantId = - tenantStats.tenantId // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.datasetCount = tenantStats.datasetCount - this.tracerSessionCount = tenantStats.tracerSessionCount - this.repoCount = tenantStats.repoCount - this.annotationQueueCount = tenantStats.annotationQueueCount - additionalProperties(tenantStats.additionalProperties) - } + @JvmSynthetic + internal fun from(tenantStats: TenantStats) = apply { + this.tenantId = tenantStats.tenantId + this.datasetCount = tenantStats.datasetCount + this.tracerSessionCount = tenantStats.tracerSessionCount + this.repoCount = tenantStats.repoCount + this.annotationQueueCount = tenantStats.annotationQueueCount + additionalProperties(tenantStats.additionalProperties) + } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_id") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } - fun datasetCount(datasetCount: Long) = - datasetCount(JsonField.of(datasetCount)) // templates/JavaSDK/entities/objects.ts:252:20 + fun datasetCount(datasetCount: Long) = datasetCount(JsonField.of(datasetCount)) - @JsonProperty("dataset_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("dataset_count") @ExcludeMissing - fun datasetCount(datasetCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.datasetCount = datasetCount - } + fun datasetCount(datasetCount: JsonField) = apply { this.datasetCount = datasetCount } fun tracerSessionCount(tracerSessionCount: Long) = - tracerSessionCount( - JsonField.of(tracerSessionCount) - ) // templates/JavaSDK/entities/objects.ts:252:20 + tracerSessionCount(JsonField.of(tracerSessionCount)) - @JsonProperty("tracer_session_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tracer_session_count") @ExcludeMissing - fun tracerSessionCount(tracerSessionCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tracerSessionCount = tracerSessionCount - } + fun tracerSessionCount(tracerSessionCount: JsonField) = apply { + this.tracerSessionCount = tracerSessionCount + } - fun repoCount(repoCount: Long) = - repoCount(JsonField.of(repoCount)) // templates/JavaSDK/entities/objects.ts:252:20 + fun repoCount(repoCount: Long) = repoCount(JsonField.of(repoCount)) - @JsonProperty("repo_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("repo_count") @ExcludeMissing - fun repoCount(repoCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.repoCount = repoCount - } + fun repoCount(repoCount: JsonField) = apply { this.repoCount = repoCount } fun annotationQueueCount(annotationQueueCount: Long) = - annotationQueueCount( - JsonField.of(annotationQueueCount) - ) // templates/JavaSDK/entities/objects.ts:252:20 + annotationQueueCount(JsonField.of(annotationQueueCount)) - @JsonProperty("annotation_queue_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("annotation_queue_count") @ExcludeMissing - fun annotationQueueCount(annotationQueueCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.annotationQueueCount = annotationQueueCount - } + fun annotationQueueCount(annotationQueueCount: JsonField) = apply { + this.annotationQueueCount = annotationQueueCount + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantStats = - TenantStats( // templates/JavaSDK/entities/objects.ts:326:30 - tenantId, // templates/JavaSDK/entities/objects.ts:326:30 + TenantStats( + tenantId, datasetCount, tracerSessionCount, repoCount, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStatsListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStatsListParams.kt index 5dcc4095..add15fc0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStatsListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantStatsListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class TenantStatsListParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantStatsListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantStatsListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantStatsListParams: TenantStatsListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - tenantStatsListParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(tenantStatsListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(tenantStatsListParams: TenantStatsListParams) = apply { + additionalQueryParams(tenantStatsListParams.additionalQueryParams) + additionalHeaders(tenantStatsListParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): TenantStatsListParams = TenantStatsListParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitInfo.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitInfo.kt index 8e7ae61a..586d7974 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitInfo.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitInfo.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty @@ -19,23 +17,17 @@ import com.langsmith.api.errors.LangSmithInvalidDataException import java.util.Objects import java.util.Optional -@JsonDeserialize( - builder = TenantUsageLimitInfo.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = TenantUsageLimitInfo.Builder::class) @NoAutoDetect class TenantUsageLimitInfo -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val inRejectSet: JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val inRejectSet: JsonField, private val usageLimitType: JsonField, private val tenantLimit: JsonField, private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -47,30 +39,20 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun tenantLimit(): Optional = Optional.ofNullable(tenantLimit.getNullable("tenant_limit")) - @JsonProperty("in_reject_set") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _inRejectSet() = inRejectSet + @JsonProperty("in_reject_set") @ExcludeMissing fun _inRejectSet() = inRejectSet /** An enumeration. */ - @JsonProperty("usage_limit_type") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _usageLimitType() = usageLimitType + @JsonProperty("usage_limit_type") @ExcludeMissing fun _usageLimitType() = usageLimitType - @JsonProperty("tenant_limit") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantLimit() = tenantLimit + @JsonProperty("tenant_limit") @ExcludeMissing fun _tenantLimit() = tenantLimit - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TenantUsageLimitInfo = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - inRejectSet() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): TenantUsageLimitInfo = apply { + if (!validated) { + inRejectSet() usageLimitType() tenantLimit() validated = true @@ -79,27 +61,23 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantUsageLimitInfo && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantUsageLimitInfo && this.inRejectSet == other.inRejectSet && this.usageLimitType == other.usageLimitType && this.tenantLimit == other.tenantLimit && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - inRejectSet, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + inRejectSet, usageLimitType, tenantLimit, additionalProperties, @@ -111,91 +89,66 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "TenantUsageLimitInfo{inRejectSet=$inRejectSet, usageLimitType=$usageLimitType, tenantLimit=$tenantLimit, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var inRejectSet: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var inRejectSet: JsonField = JsonMissing.of() private var usageLimitType: JsonField = JsonMissing.of() private var tenantLimit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tenantUsageLimitInfo: TenantUsageLimitInfo) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.inRejectSet = - tenantUsageLimitInfo - .inRejectSet // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.usageLimitType = tenantUsageLimitInfo.usageLimitType - this.tenantLimit = tenantUsageLimitInfo.tenantLimit - additionalProperties(tenantUsageLimitInfo.additionalProperties) - } + @JvmSynthetic + internal fun from(tenantUsageLimitInfo: TenantUsageLimitInfo) = apply { + this.inRejectSet = tenantUsageLimitInfo.inRejectSet + this.usageLimitType = tenantUsageLimitInfo.usageLimitType + this.tenantLimit = tenantUsageLimitInfo.tenantLimit + additionalProperties(tenantUsageLimitInfo.additionalProperties) + } - fun inRejectSet(inRejectSet: Boolean) = - inRejectSet(JsonField.of(inRejectSet)) // templates/JavaSDK/entities/objects.ts:252:20 + fun inRejectSet(inRejectSet: Boolean) = inRejectSet(JsonField.of(inRejectSet)) - @JsonProperty("in_reject_set") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("in_reject_set") @ExcludeMissing - fun inRejectSet(inRejectSet: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.inRejectSet = inRejectSet - } + fun inRejectSet(inRejectSet: JsonField) = apply { this.inRejectSet = inRejectSet } /** An enumeration. */ - // templates/JavaSDK/entities/objects.ts:252:20 fun usageLimitType(usageLimitType: UsageLimitType) = usageLimitType(JsonField.of(usageLimitType)) /** An enumeration. */ - @JsonProperty("usage_limit_type") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("usage_limit_type") @ExcludeMissing - fun usageLimitType(usageLimitType: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.usageLimitType = usageLimitType - } + fun usageLimitType(usageLimitType: JsonField) = apply { + this.usageLimitType = usageLimitType + } - fun tenantLimit(tenantLimit: Long) = - tenantLimit(JsonField.of(tenantLimit)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantLimit(tenantLimit: Long) = tenantLimit(JsonField.of(tenantLimit)) - @JsonProperty("tenant_limit") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_limit") @ExcludeMissing - fun tenantLimit(tenantLimit: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantLimit = tenantLimit - } + fun tenantLimit(tenantLimit: JsonField) = apply { this.tenantLimit = tenantLimit } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TenantUsageLimitInfo = - TenantUsageLimitInfo( // templates/JavaSDK/entities/objects.ts:326:30 - inRejectSet, // templates/JavaSDK/entities/objects.ts:326:30 + TenantUsageLimitInfo( + inRejectSet, usageLimitType, tenantLimit, additionalProperties.toUnmodifiable(), @@ -206,33 +159,25 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JsonCreator private constructor( private val value: JsonField, - ) { // templates/JavaSDK/entities/enums.ts:56:13 // templates/JavaSDK/entities/enums.ts:56:13 // - // templates/JavaSDK/entities/enums.ts:56:13 + ) { - @com.fasterxml.jackson.annotation.JsonValue // templates/JavaSDK/entities/enums.ts:62:10 // - // templates/JavaSDK/entities/enums.ts:56:13 - fun _value(): JsonField = value + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is UsageLimitType && // templates/JavaSDK/entities/fields.ts:143:33 - this.value == other.value + return other is UsageLimitType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() - companion object { // templates/JavaSDK/entities/enums.ts:71:10 + companion object { - @JvmField - val PAYLOAD_SIZE = - UsageLimitType( - JsonField.of("payload_size") - ) // templates/JavaSDK/entities/enums.ts:71:10 + @JvmField val PAYLOAD_SIZE = UsageLimitType(JsonField.of("payload_size")) @JvmField val REQUEST_COUNT = UsageLimitType(JsonField.of("request_count")) @@ -241,34 +186,30 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 @JvmStatic fun of(value: String) = UsageLimitType(JsonField.of(value)) } - enum class Known { // templates/JavaSDK/entities/enums.ts:78:10 - PAYLOAD_SIZE, // templates/JavaSDK/entities/enums.ts:78:10 // - // templates/JavaSDK/entities/enums.ts:78:10 + enum class Known { + PAYLOAD_SIZE, REQUEST_COUNT, TOTAL_UNIQUE_TRACES, } - enum class Value { // templates/JavaSDK/entities/enums.ts:82:10 - PAYLOAD_SIZE, // templates/JavaSDK/entities/enums.ts:82:10 // - // templates/JavaSDK/entities/enums.ts:82:10 + enum class Value { + PAYLOAD_SIZE, REQUEST_COUNT, TOTAL_UNIQUE_TRACES, _UNKNOWN, } fun value(): Value = - when (this) { // templates/JavaSDK/entities/enums.ts:91:29 - PAYLOAD_SIZE -> Value.PAYLOAD_SIZE // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + PAYLOAD_SIZE -> Value.PAYLOAD_SIZE REQUEST_COUNT -> Value.REQUEST_COUNT TOTAL_UNIQUE_TRACES -> Value.TOTAL_UNIQUE_TRACES else -> Value._UNKNOWN } fun known(): Known = - when (this) { // templates/JavaSDK/entities/enums.ts:104:29 - PAYLOAD_SIZE -> Known.PAYLOAD_SIZE // templates/JavaSDK/entities/enums.ts:54:10 // - // templates/JavaSDK/entities/enums.ts:54:10 + when (this) { + PAYLOAD_SIZE -> Known.PAYLOAD_SIZE REQUEST_COUNT -> Known.REQUEST_COUNT TOTAL_UNIQUE_TRACES -> Known.TOTAL_UNIQUE_TRACES else -> throw LangSmithInvalidDataException("Unknown UsageLimitType: $value") diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitListParams.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitListParams.kt index f576a52f..44e5d158 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TenantUsageLimitListParams.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -11,32 +11,27 @@ class TenantUsageLimitListParams constructor( private val additionalQueryParams: Map>, private val additionalHeaders: Map>, -) { // templates/JavaSDK/entities/params.ts:131:13 // templates/JavaSDK/entities/params.ts:131:13 // - // templates/JavaSDK/entities/params.ts:131:13 +) { - @JvmSynthetic // templates/JavaSDK/entities/params.ts:201:14 // - // templates/JavaSDK/entities/params.ts:145:14 // - // templates/JavaSDK/entities/params.ts:131:13 - internal fun getQueryParams(): Map> = additionalQueryParams + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams - @JvmSynthetic // templates/JavaSDK/entities/params.ts:540:6 - internal fun getHeaders(): Map> = additionalHeaders + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders fun _additionalQueryParams(): Map> = additionalQueryParams fun _additionalHeaders(): Map> = additionalHeaders - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TenantUsageLimitListParams && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TenantUsageLimitListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 + override fun hashCode(): Int { return Objects.hash(additionalQueryParams, additionalHeaders) } @@ -45,85 +40,63 @@ constructor( fun toBuilder() = Builder().from(this) - companion object { // templates/JavaSDK/entities/builders.ts:8:8 + companion object { - @JvmStatic // templates/JavaSDK/entities/builders.ts:9:10 // - // templates/JavaSDK/entities/builders.ts:8:8 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - @NoAutoDetect // templates/JavaSDK/entities/params.ts:235:14 // - // templates/JavaSDK/entities/params.ts:235:14 - class Builder { // templates/JavaSDK/entities/params.ts:235:14 + @NoAutoDetect + class Builder { - private var additionalQueryParams: MutableMap> = - mutableMapOf() // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:238:20 // - // templates/JavaSDK/entities/params.ts:235:14 + private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/params.ts:251:18 - internal fun from(tenantUsageLimitListParams: TenantUsageLimitListParams) = - apply { // templates/JavaSDK/entities/params.ts:257:34 - additionalQueryParams( - tenantUsageLimitListParams.additionalQueryParams - ) // templates/JavaSDK/entities/params.ts:257:34 // - // templates/JavaSDK/entities/params.ts:257:34 - additionalHeaders(tenantUsageLimitListParams.additionalHeaders) - } + @JvmSynthetic + internal fun from(tenantUsageLimitListParams: TenantUsageLimitListParams) = apply { + additionalQueryParams(tenantUsageLimitListParams.additionalQueryParams) + additionalHeaders(tenantUsageLimitListParams.additionalHeaders) + } - fun additionalQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:703:24 - this.additionalQueryParams.clear() // templates/JavaSDK/entities/params.ts:703:24 // - // templates/JavaSDK/entities/params.ts:703:24 - putAllQueryParams(additionalQueryParams) - } + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } - fun putQueryParam(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:713:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) - } + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } - fun putQueryParams(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:723:24 - this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) - } + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } - fun putAllQueryParams(additionalQueryParams: Map>) = - apply { // templates/JavaSDK/entities/params.ts:733:24 - additionalQueryParams.forEach(this::putQueryParams) - } + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } - fun removeQueryParam(name: String) = apply { // templates/JavaSDK/entities/params.ts:743:24 + fun removeQueryParam(name: String) = apply { this.additionalQueryParams.put(name, mutableListOf()) } - fun additionalHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:755:24 - this.additionalHeaders.clear() // templates/JavaSDK/entities/params.ts:755:24 // - // templates/JavaSDK/entities/params.ts:755:24 - putAllHeaders(additionalHeaders) - } - - fun putHeader(name: String, value: String) = - apply { // templates/JavaSDK/entities/params.ts:765:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) - } - - fun putHeaders(name: String, values: Iterable) = - apply { // templates/JavaSDK/entities/params.ts:775:24 - this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) - } - - fun putAllHeaders(additionalHeaders: Map>) = - apply { // templates/JavaSDK/entities/params.ts:785:24 - additionalHeaders.forEach(this::putHeaders) - } - - fun removeHeader(name: String) = apply { // templates/JavaSDK/entities/params.ts:795:24 - this.additionalHeaders.put(name, mutableListOf()) + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) } + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + fun build(): TenantUsageLimitListParams = TenantUsageLimitListParams( additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSession.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSession.kt index ea6a6851..5030c808 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSession.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSession.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,16 +17,11 @@ import java.util.Objects import java.util.Optional /** TracerSession schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = TracerSession.Builder::class) @NoAutoDetect class TracerSession -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val startTime: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val startTime: JsonField, private val endTime: JsonField, private val extra: JsonValue, private val name: JsonField, @@ -58,8 +51,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -127,125 +119,71 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun testRunNumber(): Optional = Optional.ofNullable(testRunNumber.getNullable("test_run_number")) - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _startTime() = startTime + @JsonProperty("start_time") @ExcludeMissing fun _startTime() = startTime - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _endTime() = endTime + @JsonProperty("end_time") @ExcludeMissing fun _endTime() = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _extra() = extra + @JsonProperty("extra") @ExcludeMissing fun _extra() = extra - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _description() = description + @JsonProperty("description") @ExcludeMissing fun _description() = description - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _defaultDatasetId() = defaultDatasetId + @JsonProperty("default_dataset_id") @ExcludeMissing fun _defaultDatasetId() = defaultDatasetId - @JsonProperty("reference_dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("reference_dataset_id") @ExcludeMissing fun _referenceDatasetId() = referenceDatasetId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("run_count") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runCount() = runCount + @JsonProperty("run_count") @ExcludeMissing fun _runCount() = runCount - @JsonProperty("latency_p50") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _latencyP50() = latencyP50 + @JsonProperty("latency_p50") @ExcludeMissing fun _latencyP50() = latencyP50 - @JsonProperty("latency_p99") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _latencyP99() = latencyP99 + @JsonProperty("latency_p99") @ExcludeMissing fun _latencyP99() = latencyP99 - @JsonProperty("first_token_p50") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _firstTokenP50() = firstTokenP50 + @JsonProperty("first_token_p50") @ExcludeMissing fun _firstTokenP50() = firstTokenP50 - @JsonProperty("first_token_p99") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _firstTokenP99() = firstTokenP99 + @JsonProperty("first_token_p99") @ExcludeMissing fun _firstTokenP99() = firstTokenP99 - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalTokens() = totalTokens + @JsonProperty("total_tokens") @ExcludeMissing fun _totalTokens() = totalTokens - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptTokens() = promptTokens + @JsonProperty("prompt_tokens") @ExcludeMissing fun _promptTokens() = promptTokens - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionTokens() = completionTokens + @JsonProperty("completion_tokens") @ExcludeMissing fun _completionTokens() = completionTokens - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _totalCost() = totalCost + @JsonProperty("total_cost") @ExcludeMissing fun _totalCost() = totalCost - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _promptCost() = promptCost + @JsonProperty("prompt_cost") @ExcludeMissing fun _promptCost() = promptCost - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _completionCost() = completionCost + @JsonProperty("completion_cost") @ExcludeMissing fun _completionCost() = completionCost - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("last_run_start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _lastRunStartTime() = lastRunStartTime + @JsonProperty("last_run_start_time") @ExcludeMissing fun _lastRunStartTime() = lastRunStartTime - @JsonProperty("last_run_start_time_live") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("last_run_start_time_live") @ExcludeMissing fun _lastRunStartTimeLive() = lastRunStartTimeLive - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _feedbackStats() = feedbackStats + @JsonProperty("feedback_stats") @ExcludeMissing fun _feedbackStats() = feedbackStats - @JsonProperty("run_facets") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _runFacets() = runFacets + @JsonProperty("run_facets") @ExcludeMissing fun _runFacets() = runFacets - @JsonProperty("error_rate") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _errorRate() = errorRate + @JsonProperty("error_rate") @ExcludeMissing fun _errorRate() = errorRate - @JsonProperty("streaming_rate") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _streamingRate() = streamingRate + @JsonProperty("streaming_rate") @ExcludeMissing fun _streamingRate() = streamingRate - @JsonProperty("test_run_number") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _testRunNumber() = testRunNumber + @JsonProperty("test_run_number") @ExcludeMissing fun _testRunNumber() = testRunNumber - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TracerSession = apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - startTime() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 + fun validate(): TracerSession = apply { + if (!validated) { + startTime() endTime() name() description() @@ -276,12 +214,12 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is TracerSession && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TracerSession && this.startTime == other.startTime && this.endTime == other.endTime && this.extra == other.extra && @@ -312,15 +250,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - startTime, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + startTime, endTime, extra, name, @@ -356,21 +290,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "TracerSession{startTime=$startTime, endTime=$endTime, extra=$extra, name=$name, description=$description, defaultDatasetId=$defaultDatasetId, referenceDatasetId=$referenceDatasetId, id=$id, runCount=$runCount, latencyP50=$latencyP50, latencyP99=$latencyP99, firstTokenP50=$firstTokenP50, firstTokenP99=$firstTokenP99, totalTokens=$totalTokens, promptTokens=$promptTokens, completionTokens=$completionTokens, totalCost=$totalCost, promptCost=$promptCost, completionCost=$completionCost, tenantId=$tenantId, lastRunStartTime=$lastRunStartTime, lastRunStartTimeLive=$lastRunStartTimeLive, feedbackStats=$feedbackStats, runFacets=$runFacets, errorRate=$errorRate, streamingRate=$streamingRate, testRunNumber=$testRunNumber, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var startTime: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var startTime: JsonField = JsonMissing.of() private var endTime: JsonField = JsonMissing.of() private var extra: JsonValue = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -399,344 +326,236 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var testRunNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tracerSession: TracerSession) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.startTime = - tracerSession.startTime // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 - this.endTime = tracerSession.endTime - this.extra = tracerSession.extra - this.name = tracerSession.name - this.description = tracerSession.description - this.defaultDatasetId = tracerSession.defaultDatasetId - this.referenceDatasetId = tracerSession.referenceDatasetId - this.id = tracerSession.id - this.runCount = tracerSession.runCount - this.latencyP50 = tracerSession.latencyP50 - this.latencyP99 = tracerSession.latencyP99 - this.firstTokenP50 = tracerSession.firstTokenP50 - this.firstTokenP99 = tracerSession.firstTokenP99 - this.totalTokens = tracerSession.totalTokens - this.promptTokens = tracerSession.promptTokens - this.completionTokens = tracerSession.completionTokens - this.totalCost = tracerSession.totalCost - this.promptCost = tracerSession.promptCost - this.completionCost = tracerSession.completionCost - this.tenantId = tracerSession.tenantId - this.lastRunStartTime = tracerSession.lastRunStartTime - this.lastRunStartTimeLive = tracerSession.lastRunStartTimeLive - this.feedbackStats = tracerSession.feedbackStats - this.runFacets = tracerSession.runFacets - this.errorRate = tracerSession.errorRate - this.streamingRate = tracerSession.streamingRate - this.testRunNumber = tracerSession.testRunNumber - additionalProperties(tracerSession.additionalProperties) - } - - fun startTime(startTime: OffsetDateTime) = - startTime(JsonField.of(startTime)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun startTime(startTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } - - fun endTime(endTime: OffsetDateTime) = - endTime(JsonField.of(endTime)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun endTime(endTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } - - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 - @ExcludeMissing - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra + @JvmSynthetic + internal fun from(tracerSession: TracerSession) = apply { + this.startTime = tracerSession.startTime + this.endTime = tracerSession.endTime + this.extra = tracerSession.extra + this.name = tracerSession.name + this.description = tracerSession.description + this.defaultDatasetId = tracerSession.defaultDatasetId + this.referenceDatasetId = tracerSession.referenceDatasetId + this.id = tracerSession.id + this.runCount = tracerSession.runCount + this.latencyP50 = tracerSession.latencyP50 + this.latencyP99 = tracerSession.latencyP99 + this.firstTokenP50 = tracerSession.firstTokenP50 + this.firstTokenP99 = tracerSession.firstTokenP99 + this.totalTokens = tracerSession.totalTokens + this.promptTokens = tracerSession.promptTokens + this.completionTokens = tracerSession.completionTokens + this.totalCost = tracerSession.totalCost + this.promptCost = tracerSession.promptCost + this.completionCost = tracerSession.completionCost + this.tenantId = tracerSession.tenantId + this.lastRunStartTime = tracerSession.lastRunStartTime + this.lastRunStartTimeLive = tracerSession.lastRunStartTimeLive + this.feedbackStats = tracerSession.feedbackStats + this.runFacets = tracerSession.runFacets + this.errorRate = tracerSession.errorRate + this.streamingRate = tracerSession.streamingRate + this.testRunNumber = tracerSession.testRunNumber + additionalProperties(tracerSession.additionalProperties) } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 + fun startTime(startTime: OffsetDateTime) = startTime(JsonField.of(startTime)) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("start_time") @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name - } + fun startTime(startTime: JsonField) = apply { this.startTime = startTime } - fun description(description: String) = - description(JsonField.of(description)) // templates/JavaSDK/entities/objects.ts:252:20 + fun endTime(endTime: OffsetDateTime) = endTime(JsonField.of(endTime)) - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("end_time") @ExcludeMissing - fun description(description: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + fun endTime(endTime: JsonField) = apply { this.endTime = endTime } + + @JsonProperty("extra") + @ExcludeMissing + fun extra(extra: JsonValue) = apply { this.extra = extra } + + fun name(name: String) = name(JsonField.of(name)) + + @JsonProperty("name") + @ExcludeMissing + fun name(name: JsonField) = apply { this.name = name } + + fun description(description: String) = description(JsonField.of(description)) + + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { this.description = description } fun defaultDatasetId(defaultDatasetId: String) = - defaultDatasetId( - JsonField.of(defaultDatasetId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + defaultDatasetId(JsonField.of(defaultDatasetId)) - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("default_dataset_id") @ExcludeMissing - fun defaultDatasetId(defaultDatasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.defaultDatasetId = defaultDatasetId - } - - fun referenceDatasetId(referenceDatasetId: String) = - referenceDatasetId( - JsonField.of(referenceDatasetId) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("reference_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun referenceDatasetId(referenceDatasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceDatasetId = referenceDatasetId - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun defaultDatasetId(defaultDatasetId: JsonField) = apply { + this.defaultDatasetId = defaultDatasetId } - fun runCount(runCount: Long) = - runCount(JsonField.of(runCount)) // templates/JavaSDK/entities/objects.ts:252:20 + fun referenceDatasetId(referenceDatasetId: String) = + referenceDatasetId(JsonField.of(referenceDatasetId)) - @JsonProperty("run_count") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("reference_dataset_id") @ExcludeMissing - fun runCount(runCount: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runCount = runCount - } + fun referenceDatasetId(referenceDatasetId: JsonField) = apply { + this.referenceDatasetId = referenceDatasetId + } - fun latencyP50(latencyP50: Double) = - latencyP50(JsonField.of(latencyP50)) // templates/JavaSDK/entities/objects.ts:252:20 + fun id(id: String) = id(JsonField.of(id)) - @JsonProperty("latency_p50") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun runCount(runCount: Long) = runCount(JsonField.of(runCount)) + + @JsonProperty("run_count") @ExcludeMissing - fun latencyP50(latencyP50: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.latencyP50 = latencyP50 - } + fun runCount(runCount: JsonField) = apply { this.runCount = runCount } - fun latencyP99(latencyP99: Double) = - latencyP99(JsonField.of(latencyP99)) // templates/JavaSDK/entities/objects.ts:252:20 + fun latencyP50(latencyP50: Double) = latencyP50(JsonField.of(latencyP50)) - @JsonProperty("latency_p99") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("latency_p50") @ExcludeMissing - fun latencyP99(latencyP99: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.latencyP99 = latencyP99 - } + fun latencyP50(latencyP50: JsonField) = apply { this.latencyP50 = latencyP50 } - fun firstTokenP50(firstTokenP50: Double) = - firstTokenP50( - JsonField.of(firstTokenP50) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun latencyP99(latencyP99: Double) = latencyP99(JsonField.of(latencyP99)) - @JsonProperty("first_token_p50") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("latency_p99") @ExcludeMissing - fun firstTokenP50(firstTokenP50: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.firstTokenP50 = firstTokenP50 - } + fun latencyP99(latencyP99: JsonField) = apply { this.latencyP99 = latencyP99 } - fun firstTokenP99(firstTokenP99: Double) = - firstTokenP99( - JsonField.of(firstTokenP99) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun firstTokenP50(firstTokenP50: Double) = firstTokenP50(JsonField.of(firstTokenP50)) - @JsonProperty("first_token_p99") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("first_token_p50") @ExcludeMissing - fun firstTokenP99(firstTokenP99: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.firstTokenP99 = firstTokenP99 - } + fun firstTokenP50(firstTokenP50: JsonField) = apply { + this.firstTokenP50 = firstTokenP50 + } - fun totalTokens(totalTokens: Long) = - totalTokens(JsonField.of(totalTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun firstTokenP99(firstTokenP99: Double) = firstTokenP99(JsonField.of(firstTokenP99)) - @JsonProperty("total_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("first_token_p99") @ExcludeMissing - fun totalTokens(totalTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalTokens = totalTokens - } + fun firstTokenP99(firstTokenP99: JsonField) = apply { + this.firstTokenP99 = firstTokenP99 + } - fun promptTokens(promptTokens: Long) = - promptTokens(JsonField.of(promptTokens)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalTokens(totalTokens: Long) = totalTokens(JsonField.of(totalTokens)) - @JsonProperty("prompt_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_tokens") @ExcludeMissing - fun promptTokens(promptTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptTokens = promptTokens - } + fun totalTokens(totalTokens: JsonField) = apply { this.totalTokens = totalTokens } + + fun promptTokens(promptTokens: Long) = promptTokens(JsonField.of(promptTokens)) + + @JsonProperty("prompt_tokens") + @ExcludeMissing + fun promptTokens(promptTokens: JsonField) = apply { this.promptTokens = promptTokens } fun completionTokens(completionTokens: Long) = - completionTokens( - JsonField.of(completionTokens) - ) // templates/JavaSDK/entities/objects.ts:252:20 + completionTokens(JsonField.of(completionTokens)) - @JsonProperty("completion_tokens") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_tokens") @ExcludeMissing - fun completionTokens(completionTokens: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionTokens = completionTokens - } + fun completionTokens(completionTokens: JsonField) = apply { + this.completionTokens = completionTokens + } - fun totalCost(totalCost: Double) = - totalCost(JsonField.of(totalCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun totalCost(totalCost: Double) = totalCost(JsonField.of(totalCost)) - @JsonProperty("total_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("total_cost") @ExcludeMissing - fun totalCost(totalCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.totalCost = totalCost - } + fun totalCost(totalCost: JsonField) = apply { this.totalCost = totalCost } - fun promptCost(promptCost: Double) = - promptCost(JsonField.of(promptCost)) // templates/JavaSDK/entities/objects.ts:252:20 + fun promptCost(promptCost: Double) = promptCost(JsonField.of(promptCost)) - @JsonProperty("prompt_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("prompt_cost") @ExcludeMissing - fun promptCost(promptCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.promptCost = promptCost - } + fun promptCost(promptCost: JsonField) = apply { this.promptCost = promptCost } - fun completionCost(completionCost: Double) = - completionCost( - JsonField.of(completionCost) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun completionCost(completionCost: Double) = completionCost(JsonField.of(completionCost)) - @JsonProperty("completion_cost") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("completion_cost") @ExcludeMissing - fun completionCost(completionCost: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.completionCost = completionCost - } + fun completionCost(completionCost: JsonField) = apply { + this.completionCost = completionCost + } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("tenant_id") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } fun lastRunStartTime(lastRunStartTime: OffsetDateTime) = - lastRunStartTime( - JsonField.of(lastRunStartTime) - ) // templates/JavaSDK/entities/objects.ts:252:20 + lastRunStartTime(JsonField.of(lastRunStartTime)) - @JsonProperty("last_run_start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_run_start_time") @ExcludeMissing - fun lastRunStartTime(lastRunStartTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastRunStartTime = lastRunStartTime - } + fun lastRunStartTime(lastRunStartTime: JsonField) = apply { + this.lastRunStartTime = lastRunStartTime + } fun lastRunStartTimeLive(lastRunStartTimeLive: OffsetDateTime) = - lastRunStartTimeLive( - JsonField.of(lastRunStartTimeLive) - ) // templates/JavaSDK/entities/objects.ts:252:20 + lastRunStartTimeLive(JsonField.of(lastRunStartTimeLive)) - @JsonProperty("last_run_start_time_live") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_run_start_time_live") @ExcludeMissing - fun lastRunStartTimeLive(lastRunStartTimeLive: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastRunStartTimeLive = lastRunStartTimeLive - } + fun lastRunStartTimeLive(lastRunStartTimeLive: JsonField) = apply { + this.lastRunStartTimeLive = lastRunStartTimeLive + } - @JsonProperty("feedback_stats") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("feedback_stats") @ExcludeMissing - fun feedbackStats(feedbackStats: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.feedbackStats = feedbackStats - } + fun feedbackStats(feedbackStats: JsonValue) = apply { this.feedbackStats = feedbackStats } - fun runFacets(runFacets: List) = - runFacets(JsonField.of(runFacets)) // templates/JavaSDK/entities/objects.ts:252:20 + fun runFacets(runFacets: List) = runFacets(JsonField.of(runFacets)) - @JsonProperty("run_facets") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("run_facets") @ExcludeMissing - fun runFacets(runFacets: JsonField>) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.runFacets = runFacets - } + fun runFacets(runFacets: JsonField>) = apply { this.runFacets = runFacets } - fun errorRate(errorRate: Double) = - errorRate(JsonField.of(errorRate)) // templates/JavaSDK/entities/objects.ts:252:20 + fun errorRate(errorRate: Double) = errorRate(JsonField.of(errorRate)) - @JsonProperty("error_rate") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("error_rate") @ExcludeMissing - fun errorRate(errorRate: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.errorRate = errorRate - } + fun errorRate(errorRate: JsonField) = apply { this.errorRate = errorRate } - fun streamingRate(streamingRate: Double) = - streamingRate( - JsonField.of(streamingRate) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun streamingRate(streamingRate: Double) = streamingRate(JsonField.of(streamingRate)) - @JsonProperty("streaming_rate") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("streaming_rate") @ExcludeMissing - fun streamingRate(streamingRate: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.streamingRate = streamingRate - } + fun streamingRate(streamingRate: JsonField) = apply { + this.streamingRate = streamingRate + } - fun testRunNumber(testRunNumber: Long) = - testRunNumber( - JsonField.of(testRunNumber) - ) // templates/JavaSDK/entities/objects.ts:252:20 + fun testRunNumber(testRunNumber: Long) = testRunNumber(JsonField.of(testRunNumber)) - @JsonProperty("test_run_number") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("test_run_number") @ExcludeMissing - fun testRunNumber(testRunNumber: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.testRunNumber = testRunNumber - } + fun testRunNumber(testRunNumber: JsonField) = apply { + this.testRunNumber = testRunNumber + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TracerSession = - TracerSession( // templates/JavaSDK/entities/objects.ts:326:30 - startTime, // templates/JavaSDK/entities/objects.ts:326:30 + TracerSession( + startTime, endTime, extra, name, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionMetadataResponse.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionMetadataResponse.kt index a609b16c..001a2d69 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionMetadataResponse.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionMetadataResponse.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.langsmith.api.core.ExcludeMissing @@ -13,52 +11,40 @@ import com.langsmith.api.core.NoAutoDetect import com.langsmith.api.core.toUnmodifiable import java.util.Objects -@JsonDeserialize( - builder = TracerSessionMetadataResponse.Builder::class -) // templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 +@JsonDeserialize(builder = TracerSessionMetadataResponse.Builder::class) @NoAutoDetect class TracerSessionMetadataResponse private constructor( private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TracerSessionMetadataResponse = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - validated = true - } + fun validate(): TracerSessionMetadataResponse = apply { + if (!validated) { + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TracerSessionMetadataResponse && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TracerSessionMetadataResponse && this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = Objects.hash(additionalProperties) } return hashCode @@ -67,43 +53,33 @@ private constructor( override fun toString() = "TracerSessionMetadataResponse{additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var additionalProperties: MutableMap = - mutableMapOf() // templates/JavaSDK/entities/objects.ts:224:10 + private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 - internal fun from(tracerSessionMetadataResponse: TracerSessionMetadataResponse) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - additionalProperties(tracerSessionMetadataResponse.additionalProperties) - } + @JvmSynthetic + internal fun from(tracerSessionMetadataResponse: TracerSessionMetadataResponse) = apply { + additionalProperties(tracerSessionMetadataResponse.additionalProperties) + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TracerSessionMetadataResponse = TracerSessionMetadataResponse(additionalProperties.toUnmodifiable()) diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFields.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFields.kt index 8fc0c696..8fcdcd54 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFields.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFields.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.annotation.JsonAnyGetter // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize @@ -19,16 +17,11 @@ import java.util.Objects import java.util.Optional /** TracerSession schema. */ -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 // templates/JavaSDK/entities/objects.ts:76:13 // -// templates/JavaSDK/entities/objects.ts:76:13 @JsonDeserialize(builder = TracerSessionWithoutVirtualFields.Builder::class) @NoAutoDetect class TracerSessionWithoutVirtualFields -private constructor( // templates/JavaSDK/entities/objects.ts:76:13 - private val startTime: - JsonField, // templates/JavaSDK/entities/objects.ts:76:13 // - // templates/JavaSDK/entities/objects.ts:76:13 +private constructor( + private val startTime: JsonField, private val endTime: JsonField, private val extra: JsonValue, private val name: JsonField, @@ -41,8 +34,7 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private val additionalProperties: Map, ) { - private var validated: Boolean = false // templates/JavaSDK/entities/objects.ts:94:14 // - // templates/JavaSDK/entities/objects.ts:76:13 + private var validated: Boolean = false private var hashCode: Int = 0 @@ -69,79 +61,57 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 fun lastRunStartTimeLive(): Optional = Optional.ofNullable(lastRunStartTimeLive.getNullable("last_run_start_time_live")) - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _startTime() = startTime + @JsonProperty("start_time") @ExcludeMissing fun _startTime() = startTime - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _endTime() = endTime + @JsonProperty("end_time") @ExcludeMissing fun _endTime() = endTime - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _extra() = extra + @JsonProperty("extra") @ExcludeMissing fun _extra() = extra - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _name() = name + @JsonProperty("name") @ExcludeMissing fun _name() = name - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _description() = description + @JsonProperty("description") @ExcludeMissing fun _description() = description - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _defaultDatasetId() = defaultDatasetId + @JsonProperty("default_dataset_id") @ExcludeMissing fun _defaultDatasetId() = defaultDatasetId - @JsonProperty("reference_dataset_id") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("reference_dataset_id") @ExcludeMissing fun _referenceDatasetId() = referenceDatasetId - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _id() = id + @JsonProperty("id") @ExcludeMissing fun _id() = id - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:166:16 - @ExcludeMissing - fun _tenantId() = tenantId + @JsonProperty("tenant_id") @ExcludeMissing fun _tenantId() = tenantId - @JsonProperty("last_run_start_time_live") // templates/JavaSDK/entities/objects.ts:166:16 + @JsonProperty("last_run_start_time_live") @ExcludeMissing fun _lastRunStartTimeLive() = lastRunStartTimeLive - @JsonAnyGetter // templates/JavaSDK/entities/objects.ts:180:12 // - // templates/JavaSDK/entities/objects.ts:180:12 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): TracerSessionWithoutVirtualFields = - apply { // templates/JavaSDK/entities/objects.ts:198:28 - if (!validated) { // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:198:28 // - // templates/JavaSDK/entities/objects.ts:198:28 - startTime() // templates/JavaSDK/entities/objects.ts:201:20 // - // templates/JavaSDK/entities/objects.ts:201:20 - endTime() - name() - description() - defaultDatasetId() - referenceDatasetId() - id() - tenantId() - lastRunStartTimeLive() - validated = true - } + fun validate(): TracerSessionWithoutVirtualFields = apply { + if (!validated) { + startTime() + endTime() + name() + description() + defaultDatasetId() + referenceDatasetId() + id() + tenantId() + lastRunStartTimeLive() + validated = true } + } fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { // templates/JavaSDK/entities/fields.ts:131:6 - if (this === other) { // templates/JavaSDK/entities/fields.ts:137:19 + override fun equals(other: Any?): Boolean { + if (this === other) { return true } - return other is - TracerSessionWithoutVirtualFields && // templates/JavaSDK/entities/fields.ts:143:33 + return other is TracerSessionWithoutVirtualFields && this.startTime == other.startTime && this.endTime == other.endTime && this.extra == other.extra && @@ -155,15 +125,11 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 this.additionalProperties == other.additionalProperties } - override fun hashCode(): Int { // templates/JavaSDK/entities/fields.ts:167:13 - if (hashCode == 0) { // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:174:16 // - // templates/JavaSDK/entities/fields.ts:174:16 + override fun hashCode(): Int { + if (hashCode == 0) { hashCode = - Objects.hash( // templates/JavaSDK/entities/fields.ts:163:19 // - // templates/JavaSDK/entities/fields.ts:175:16 // - // templates/JavaSDK/entities/fields.ts:175:16 - startTime, // templates/JavaSDK/entities/fields.ts:163:19 + Objects.hash( + startTime, endTime, extra, name, @@ -182,21 +148,14 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 override fun toString() = "TracerSessionWithoutVirtualFields{startTime=$startTime, endTime=$endTime, extra=$extra, name=$name, description=$description, defaultDatasetId=$defaultDatasetId, referenceDatasetId=$referenceDatasetId, id=$id, tenantId=$tenantId, lastRunStartTimeLive=$lastRunStartTimeLive, additionalProperties=$additionalProperties}" - companion object { // templates/JavaSDK/entities/objects.ts:217:10 + companion object { - @JvmStatic // templates/JavaSDK/entities/objects.ts:218:12 // - // templates/JavaSDK/entities/objects.ts:217:10 - fun builder() = Builder() + @JvmStatic fun builder() = Builder() } - class Builder { // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 // - // templates/JavaSDK/entities/objects.ts:224:10 + class Builder { - private var startTime: JsonField = - JsonMissing.of() // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:226:16 // - // templates/JavaSDK/entities/objects.ts:224:10 + private var startTime: JsonField = JsonMissing.of() private var endTime: JsonField = JsonMissing.of() private var extra: JsonValue = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -208,13 +167,10 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 private var lastRunStartTimeLive: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() - @JvmSynthetic // templates/JavaSDK/entities/objects.ts:234:14 + @JvmSynthetic internal fun from(tracerSessionWithoutVirtualFields: TracerSessionWithoutVirtualFields) = - apply { // templates/JavaSDK/entities/objects.ts:240:30 - this.startTime = - tracerSessionWithoutVirtualFields - .startTime // templates/JavaSDK/entities/objects.ts:240:30 // - // templates/JavaSDK/entities/objects.ts:240:30 + apply { + this.startTime = tracerSessionWithoutVirtualFields.startTime this.endTime = tracerSessionWithoutVirtualFields.endTime this.extra = tracerSessionWithoutVirtualFields.extra this.name = tracerSessionWithoutVirtualFields.name @@ -227,127 +183,88 @@ private constructor( // templates/JavaSDK/entities/objects.ts:76:13 additionalProperties(tracerSessionWithoutVirtualFields.additionalProperties) } - fun startTime(startTime: OffsetDateTime) = - startTime(JsonField.of(startTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun startTime(startTime: OffsetDateTime) = startTime(JsonField.of(startTime)) - @JsonProperty("start_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("start_time") @ExcludeMissing - fun startTime(startTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.startTime = startTime - } + fun startTime(startTime: JsonField) = apply { this.startTime = startTime } - fun endTime(endTime: OffsetDateTime) = - endTime(JsonField.of(endTime)) // templates/JavaSDK/entities/objects.ts:252:20 + fun endTime(endTime: OffsetDateTime) = endTime(JsonField.of(endTime)) - @JsonProperty("end_time") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("end_time") @ExcludeMissing - fun endTime(endTime: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.endTime = endTime - } + fun endTime(endTime: JsonField) = apply { this.endTime = endTime } - @JsonProperty("extra") // templates/JavaSDK/entities/objects.ts:264:20 // - // templates/JavaSDK/entities/objects.ts:252:20 + @JsonProperty("extra") @ExcludeMissing - fun extra(extra: JsonValue) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.extra = extra - } + fun extra(extra: JsonValue) = apply { this.extra = extra } - fun name(name: String) = - name(JsonField.of(name)) // templates/JavaSDK/entities/objects.ts:252:20 + fun name(name: String) = name(JsonField.of(name)) - @JsonProperty("name") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("name") @ExcludeMissing - fun name(name: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.name = name - } + fun name(name: JsonField) = apply { this.name = name } - fun description(description: String) = - description(JsonField.of(description)) // templates/JavaSDK/entities/objects.ts:252:20 + fun description(description: String) = description(JsonField.of(description)) - @JsonProperty("description") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("description") @ExcludeMissing - fun description(description: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.description = description - } + fun description(description: JsonField) = apply { this.description = description } fun defaultDatasetId(defaultDatasetId: String) = - defaultDatasetId( - JsonField.of(defaultDatasetId) - ) // templates/JavaSDK/entities/objects.ts:252:20 + defaultDatasetId(JsonField.of(defaultDatasetId)) - @JsonProperty("default_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("default_dataset_id") @ExcludeMissing - fun defaultDatasetId(defaultDatasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.defaultDatasetId = defaultDatasetId - } - - fun referenceDatasetId(referenceDatasetId: String) = - referenceDatasetId( - JsonField.of(referenceDatasetId) - ) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("reference_dataset_id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun referenceDatasetId(referenceDatasetId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.referenceDatasetId = referenceDatasetId - } - - fun id(id: String) = id(JsonField.of(id)) // templates/JavaSDK/entities/objects.ts:252:20 - - @JsonProperty("id") // templates/JavaSDK/entities/objects.ts:264:20 - @ExcludeMissing - fun id(id: JsonField) = apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.id = id + fun defaultDatasetId(defaultDatasetId: JsonField) = apply { + this.defaultDatasetId = defaultDatasetId } - fun tenantId(tenantId: String) = - tenantId(JsonField.of(tenantId)) // templates/JavaSDK/entities/objects.ts:252:20 + fun referenceDatasetId(referenceDatasetId: String) = + referenceDatasetId(JsonField.of(referenceDatasetId)) - @JsonProperty("tenant_id") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("reference_dataset_id") @ExcludeMissing - fun tenantId(tenantId: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.tenantId = tenantId - } + fun referenceDatasetId(referenceDatasetId: JsonField) = apply { + this.referenceDatasetId = referenceDatasetId + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id } + + fun tenantId(tenantId: String) = tenantId(JsonField.of(tenantId)) + + @JsonProperty("tenant_id") + @ExcludeMissing + fun tenantId(tenantId: JsonField) = apply { this.tenantId = tenantId } fun lastRunStartTimeLive(lastRunStartTimeLive: OffsetDateTime) = - lastRunStartTimeLive( - JsonField.of(lastRunStartTimeLive) - ) // templates/JavaSDK/entities/objects.ts:252:20 + lastRunStartTimeLive(JsonField.of(lastRunStartTimeLive)) - @JsonProperty("last_run_start_time_live") // templates/JavaSDK/entities/objects.ts:264:20 + @JsonProperty("last_run_start_time_live") @ExcludeMissing - fun lastRunStartTimeLive(lastRunStartTimeLive: JsonField) = - apply { // templates/JavaSDK/entities/objects.ts:275:36 - this.lastRunStartTimeLive = lastRunStartTimeLive - } + fun lastRunStartTimeLive(lastRunStartTimeLive: JsonField) = apply { + this.lastRunStartTimeLive = lastRunStartTimeLive + } - fun additionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.clear() // templates/JavaSDK/entities/objects.ts:290:30 // - // templates/JavaSDK/entities/objects.ts:290:30 - this.additionalProperties.putAll(additionalProperties) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnySetter // templates/JavaSDK/entities/objects.ts:299:14 - fun putAdditionalProperty(key: String, value: JsonValue) = - apply { // templates/JavaSDK/entities/objects.ts:304:30 - this.additionalProperties.put(key, value) - } + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { // templates/JavaSDK/entities/objects.ts:316:30 - this.additionalProperties.putAll(additionalProperties) - } + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } fun build(): TracerSessionWithoutVirtualFields = - TracerSessionWithoutVirtualFields( // templates/JavaSDK/entities/objects.ts:326:30 - startTime, // templates/JavaSDK/entities/objects.ts:326:30 + TracerSessionWithoutVirtualFields( + startTime, endTime, extra, name, diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsync.kt index 6c69b541..ffe44347 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -18,44 +18,42 @@ import com.langsmith.api.services.async.annotationQueues.QueueServiceAsync import com.langsmith.api.services.async.annotationQueues.RunServiceAsync import java.util.concurrent.CompletableFuture -interface AnnotationQueueServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface AnnotationQueueServiceAsync { - fun runs(): RunServiceAsync // templates/JavaSDK/services.ts:55:15 + fun runs(): RunServiceAsync fun queues(): QueueServiceAsync /** Create Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: AnnotationQueueCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Update Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: AnnotationQueueUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get Annotation Queues */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: AnnotationQueueListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: AnnotationQueueDeleteParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get Size From Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun sizeRetrieve( params: AnnotationQueueSizeRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsyncImpl.kt index f048c251..fe26e906 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/AnnotationQueueServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -30,12 +30,9 @@ import java.util.concurrent.CompletableFuture class AnnotationQueueServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : AnnotationQueueServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : AnnotationQueueServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val runs: RunServiceAsync by lazy { RunServiceAsyncImpl(clientOptions) } @@ -45,29 +42,17 @@ constructor( override fun queues(): QueueServiceAsync = queues - private val createHandler: - Handler< - AnnotationQueueSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create Annotation Queue */ override fun create( params: AnnotationQueueCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("annotation-queues") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -75,31 +60,18 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - AnnotationQueueUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -107,18 +79,10 @@ constructor( override fun update( params: AnnotationQueueUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("annotation-queues", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -126,21 +90,12 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + -> + response.use { updateHandler.handle(it) } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -148,49 +103,28 @@ constructor( override fun list( params: AnnotationQueueListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - AnnotationQueueDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -198,46 +132,23 @@ constructor( override fun delete( params: AnnotationQueueDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("annotation-queues", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } - private val sizeRetrieveHandler: - Handler< - AnnotationQueueSizeSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val sizeRetrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -245,38 +156,21 @@ constructor( override fun sizeRetrieve( params: AnnotationQueueSizeRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues", params.getPathParam(0), "size") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - sizeRetrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { sizeRetrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsync.kt index ef6c5c58..83fd9bfe 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -12,27 +12,24 @@ import com.langsmith.api.models.ApiKeyGetResponse import com.langsmith.api.models.ApiKeyRetrieveParams import java.util.concurrent.CompletableFuture -interface ApiKeyServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ApiKeyServiceAsync { /** Generate an api key for the user */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ApiKeyCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get the current tenant's API keys */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: ApiKeyRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete an api key for the user */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: ApiKeyDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsyncImpl.kt index 3f63884f..bff05806 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ApiKeyServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -22,36 +22,21 @@ import java.util.concurrent.CompletableFuture class ApiKeyServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : ApiKeyServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ApiKeyServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - ApiKeyCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Generate an api key for the user */ override fun create( params: ApiKeyCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("api-key") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -59,31 +44,18 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -91,94 +63,50 @@ constructor( override fun retrieve( params: ApiKeyRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("api-key") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - ApiKeyGetResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete an api key for the user */ override fun delete( params: ApiKeyDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("api-key", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { deleteHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsync.kt index a9e5dcd4..a0fbcda9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -21,11 +21,9 @@ import com.langsmith.api.services.async.datasets.RunServiceAsync import com.langsmith.api.services.async.datasets.ShareServiceAsync import java.util.concurrent.CompletableFuture -interface DatasetServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface DatasetServiceAsync { - fun openai(): OpenAIServiceAsync // templates/JavaSDK/services.ts:55:15 + fun openai(): OpenAIServiceAsync fun openaiFt(): OpenAIFtServiceAsync @@ -36,42 +34,42 @@ interface DatasetServiceAsync { // templates/JavaSDK/services.ts:55:15 // fun share(): ShareServiceAsync /** Create a new dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: DatasetCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get a specific dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Update a specific dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: DatasetUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get all datasets by query params and owner. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: DatasetListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete a specific dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: DatasetDeleteParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Create a new dataset from a CSV file. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun upload( params: DatasetUploadParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsyncImpl.kt index 9cc3d3e9..bbc1de79 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/DatasetServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -36,12 +36,9 @@ import java.util.concurrent.CompletableFuture class DatasetServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : DatasetServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : DatasetServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val openai: OpenAIServiceAsync by lazy { OpenAIServiceAsyncImpl(clientOptions) } @@ -63,29 +60,17 @@ constructor( override fun share(): ShareServiceAsync = share - private val createHandler: - Handler< - Dataset - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new dataset. */ override fun create( params: DatasetCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("datasets") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -93,98 +78,56 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - Dataset - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific dataset. */ override fun retrieve( params: DatasetRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - DatasetSchemaForUpdate - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Update a specific dataset. */ override fun update( params: DatasetUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("datasets", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -192,144 +135,79 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all datasets by query params and owner. */ override fun list( params: DatasetListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - DatasetDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a specific dataset. */ override fun delete( params: DatasetDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("datasets", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } - private val uploadHandler: - Handler< - Dataset - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val uploadHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new dataset from a CSV file. */ override fun upload( params: DatasetUploadParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("datasets", "upload") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -337,20 +215,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - uploadHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { uploadHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsync.kt index 1658c661..e50eabea 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -17,44 +17,42 @@ import com.langsmith.api.services.async.examples.BulkServiceAsync import com.langsmith.api.services.async.examples.UploadServiceAsync import java.util.concurrent.CompletableFuture -interface ExampleServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ExampleServiceAsync { - fun bulk(): BulkServiceAsync // templates/JavaSDK/services.ts:55:15 + fun bulk(): BulkServiceAsync fun upload(): UploadServiceAsync /** Create a new example. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ExampleCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get a specific example. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: ExampleRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Update a specific example. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: ExampleUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get all examples by query params */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: ExampleListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete a specific set of examples. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: ExampleDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsyncImpl.kt index 0a422e06..76a127ef 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/ExampleServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -29,12 +29,9 @@ import java.util.concurrent.CompletableFuture class ExampleServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : ExampleServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ExampleServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val bulk: BulkServiceAsync by lazy { BulkServiceAsyncImpl(clientOptions) } @@ -44,29 +41,17 @@ constructor( override fun upload(): UploadServiceAsync = upload - private val createHandler: - Handler< - Example - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new example. */ override fun create( params: ExampleCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("examples") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -74,98 +59,56 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - Example - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific example. */ override fun retrieve( params: ExampleRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("examples", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - ExampleUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Update a specific example. */ override fun update( params: ExampleUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("examples", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -173,108 +116,59 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + -> + response.use { updateHandler.handle(it) } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all examples by query params */ override fun list( params: ExampleListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("examples") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - ExampleDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a specific set of examples. */ override fun delete( params: ExampleDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("examples") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsync.kt index bc4d641e..805345dd 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -10,20 +10,17 @@ import com.langsmith.api.models.FeedbackConfigListParams import com.langsmith.api.models.FeedbackConfigSchema import java.util.concurrent.CompletableFuture -interface FeedbackConfigServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackConfigServiceAsync { /** Create Feedback Config Endpoint */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: FeedbackConfigCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** List Feedback Configs Endpoint */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: FeedbackConfigListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsyncImpl.kt index 8b2749d8..e5bed050 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackConfigServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -20,36 +20,21 @@ import java.util.concurrent.CompletableFuture class FeedbackConfigServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : FeedbackConfigServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : FeedbackConfigServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - FeedbackConfigSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create Feedback Config Endpoint */ override fun create( params: FeedbackConfigCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("feedback-configs", "") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -57,31 +42,18 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -89,38 +61,21 @@ constructor( override fun list( params: FeedbackConfigListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("feedback-configs", "") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsync.kt index 7512a279..555bcfd2 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -15,41 +15,38 @@ import com.langsmith.api.models.FeedbackSchema import com.langsmith.api.models.FeedbackUpdateParams import java.util.concurrent.CompletableFuture -interface FeedbackServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackServiceAsync { /** Create a new feedback. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: FeedbackCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get a specific feedback. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: FeedbackRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Replace an existing feedback entry with a new, modified entry. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: FeedbackUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** List all Feedback by query params. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: FeedbackListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete a feedback. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: FeedbackDeleteParams, requestOptions: RequestOptions = RequestOptions.none() @@ -61,7 +58,7 @@ interface FeedbackServiceAsync { // templates/JavaSDK/services.ts:55:15 // * This method is invoked under the assumption that the run is already visible in the app, thus * already present in DB */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun eager( params: FeedbackEagerParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsyncImpl.kt index 22f41cb9..0b81031c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/FeedbackServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -25,36 +25,21 @@ import java.util.concurrent.CompletableFuture class FeedbackServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : FeedbackServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : FeedbackServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new feedback. */ override fun create( params: FeedbackCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("feedback") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -62,98 +47,56 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific feedback. */ override fun retrieve( params: FeedbackRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("feedback", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Replace an existing feedback entry with a new, modified entry. */ override fun update( params: FeedbackUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("feedback", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -161,126 +104,69 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** List all Feedback by query params. */ override fun list( params: FeedbackListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("feedback") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - FeedbackDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a feedback. */ override fun delete( params: FeedbackDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("feedback", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } - private val eagerHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val eagerHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** @@ -292,18 +178,10 @@ constructor( override fun eager( params: FeedbackEagerParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("feedback", "eager") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -311,20 +189,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - eagerHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { eagerHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsync.kt index 33247212..c83e5630 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.InfoGetResponse import com.langsmith.api.models.InfoRetrieveParams import java.util.concurrent.CompletableFuture -interface InfoServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface InfoServiceAsync { /** Get information about the current deployment of LangSmith. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: InfoRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsyncImpl.kt index e0aa65e0..b20555fc 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/InfoServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -18,55 +18,32 @@ import java.util.concurrent.CompletableFuture class InfoServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : InfoServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : InfoServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - InfoGetResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get information about the current deployment of LangSmith. */ override fun retrieve( params: InfoRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("info") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsync.kt index 8db19058..cc44d5e3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.OkRetrieveParams import com.langsmith.api.models.OkRetrieveResponse import java.util.concurrent.CompletableFuture -interface OkServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface OkServiceAsync { /** Ok */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: OkRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsyncImpl.kt index 12ee44d3..7111a89c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/OkServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -18,48 +18,29 @@ import java.util.concurrent.CompletableFuture class OkServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : OkServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : OkServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - OkRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Ok */ override fun retrieve( params: OkRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("ok") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsync.kt index c98cee63..451d6d83 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -10,11 +10,9 @@ import com.langsmith.api.services.async.public_.FeedbackServiceAsync import com.langsmith.api.services.async.public_.LatestRunServiceAsync import com.langsmith.api.services.async.public_.RunServiceAsync -interface PublicServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface PublicServiceAsync { - fun runs(): RunServiceAsync // templates/JavaSDK/services.ts:55:15 + fun runs(): RunServiceAsync fun latestRun(): LatestRunServiceAsync diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsyncImpl.kt index 0c03fd2a..fea259e9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/PublicServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -20,12 +20,9 @@ import com.langsmith.api.services.errorHandler class PublicServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : PublicServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : PublicServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val runs: RunServiceAsync by lazy { RunServiceAsyncImpl(clientOptions) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsync.kt index d4518c55..25c6838b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.RunManifestRetrieveParams import com.langsmith.api.models.RunManifestSchema import java.util.concurrent.CompletableFuture -interface RunManifestServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface RunManifestServiceAsync { /** Get a specific run manifest. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: RunManifestRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsyncImpl.kt index 149359e0..16602c69 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunManifestServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -18,56 +18,32 @@ import java.util.concurrent.CompletableFuture class RunManifestServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : RunManifestServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : RunManifestServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - RunManifestSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific run manifest. */ override fun retrieve( params: RunManifestRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("run-manifests", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsync.kt index 108ad1a1..2112e421 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -20,11 +20,9 @@ import com.langsmith.api.services.async.runs.ShareServiceAsync import com.langsmith.api.services.async.runs.StatServiceAsync import java.util.concurrent.CompletableFuture -interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface RunServiceAsync { - fun share(): ShareServiceAsync // templates/JavaSDK/services.ts:55:15 + fun share(): ShareServiceAsync fun query(): QueryServiceAsync @@ -35,28 +33,28 @@ interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // fun monitor(): MonitorServiceAsync /** Create a new run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get a specific run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: RunRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Update a run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: RunUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Batch ingest runs. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun batch( params: RunBatchParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsyncImpl.kt index f0d222f2..e122b5a9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/RunServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -35,11 +35,9 @@ import java.util.concurrent.CompletableFuture class RunServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : RunServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : RunServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val share: ShareServiceAsync by lazy { ShareServiceAsyncImpl(clientOptions) } @@ -63,190 +61,100 @@ constructor( override fun monitor(): MonitorServiceAsync = monitor - private val createHandler: - Handler< - RunCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new run. */ override fun create( params: RunCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } + -> + response.use { createHandler.handle(it) } } } - private val retrieveHandler: - Handler< - RunSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific run. */ override fun retrieve( params: RunRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("runs", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - RunUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Update a run. */ override fun update( params: RunUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("runs", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + -> + response.use { updateHandler.handle(it) } } } - private val batchHandler: - Handler< - RunBatchResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val batchHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Batch ingest runs. */ override fun batch( params: RunBatchParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "batch") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - batchHandler.handle(it) - } + -> + response.use { batchHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsync.kt index a82805fe..908d398c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -16,42 +16,40 @@ import com.langsmith.api.models.TracerSessionWithoutVirtualFields import com.langsmith.api.services.async.sessions.MetadataServiceAsync import java.util.concurrent.CompletableFuture -interface SessionServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface SessionServiceAsync { - fun metadata(): MetadataServiceAsync // templates/JavaSDK/services.ts:55:15 + fun metadata(): MetadataServiceAsync /** Create a new session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: SessionCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get a specific session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: SessionRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Create a new session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: SessionUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get all sessions. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: SessionListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete a specific session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: SessionDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsyncImpl.kt index 1fa91f65..bf32f96a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/SessionServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -27,22 +27,15 @@ import java.util.concurrent.CompletableFuture class SessionServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : SessionServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : SessionServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val metadata: MetadataServiceAsync by lazy { MetadataServiceAsyncImpl(clientOptions) } override fun metadata(): MetadataServiceAsync = metadata - private val createHandler: - Handler< - TracerSessionWithoutVirtualFields - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -50,20 +43,10 @@ constructor( override fun create( params: SessionCreateParams, requestOptions: RequestOptions - ): CompletableFuture< - TracerSessionWithoutVirtualFields - > { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("sessions") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -71,80 +54,46 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - TracerSession - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific session. */ override fun retrieve( params: SessionRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("sessions", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - TracerSessionWithoutVirtualFields - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -152,20 +101,10 @@ constructor( override fun update( params: SessionUpdateParams, requestOptions: RequestOptions - ): CompletableFuture< - TracerSessionWithoutVirtualFields - > { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("sessions", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -173,118 +112,65 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all sessions. */ override fun list( params: SessionListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("sessions") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - SessionDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a specific session. */ override fun delete( params: SessionDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("sessions") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsync.kt index 7d5858a7..7fb3cfa1 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -20,11 +20,9 @@ import com.langsmith.api.services.async.tenants.PendingServiceAsync import com.langsmith.api.services.async.tenants.UsageLimitServiceAsync import java.util.concurrent.CompletableFuture -interface TenantServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface TenantServiceAsync { - fun pending(): PendingServiceAsync // templates/JavaSDK/services.ts:55:15 + fun pending(): PendingServiceAsync fun current(): CurrentServiceAsync @@ -33,35 +31,35 @@ interface TenantServiceAsync { // templates/JavaSDK/services.ts:55:15 // fun usageLimits(): UsageLimitServiceAsync /** Create a new tenant. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: TenantCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get all tenants visible to this auth */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: TenantListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete Pending Tenant Invite */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun pendingDelete( params: TenantPendingDeleteParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get all tenants visible to this auth */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun pendingList( params: TenantPendingListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Get Current Tenant Stats */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun statsList( params: TenantStatsListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsyncImpl.kt index 29764ac0..53b31ef3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/TenantServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async @@ -34,12 +34,9 @@ import java.util.concurrent.CompletableFuture class TenantServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : TenantServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : TenantServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val pending: PendingServiceAsync by lazy { PendingServiceAsyncImpl(clientOptions) } @@ -59,29 +56,17 @@ constructor( override fun usageLimits(): UsageLimitServiceAsync = usageLimits - private val createHandler: - Handler< - Tenant - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new tenant. */ override fun create( params: TenantCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("tenants") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -89,80 +74,46 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all tenants visible to this auth */ override fun list( params: TenantListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val pendingDeleteHandler: - Handler< - TenantPendingDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val pendingDeleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -170,133 +121,72 @@ constructor( override fun pendingDelete( params: TenantPendingDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("tenants", "pending", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - pendingDeleteHandler.handle(it) - } + -> + response.use { pendingDeleteHandler.handle(it) } } } - private val pendingListHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val pendingListHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all tenants visible to this auth */ override fun pendingList( params: TenantPendingListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "pending") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - pendingListHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { pendingListHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val statsListHandler: - Handler< - TenantStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val statsListHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Stats */ override fun statsList( params: TenantStatsListParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "stats") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - statsListHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { statsListHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsync.kt index 4a769c94..672cdcd3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.AnnotationQueueQueueListParams import com.langsmith.api.models.AnnotationQueueSchema import java.util.concurrent.CompletableFuture -interface QueueServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueueServiceAsync { /** Get Annotation Queues For Run */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: AnnotationQueueQueueListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsyncImpl.kt index 7242f9fa..74b61d59 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/QueueServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.annotationQueues @@ -18,18 +18,11 @@ import java.util.concurrent.CompletableFuture class QueueServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : QueueServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : QueueServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -37,38 +30,21 @@ constructor( override fun list( params: AnnotationQueueQueueListParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues", params.getPathParam(0), "queues") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsync.kt index 190f45ef..a0a16ae7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -15,34 +15,31 @@ import com.langsmith.api.models.AnnotationQueueRunUpdateResponse import com.langsmith.api.models.RunSchemaWithAnnotationQueueInfo import java.util.concurrent.CompletableFuture -interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface RunServiceAsync { /** Add Runs To Annotation Queue */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: AnnotationQueueRunCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Update Run In Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: AnnotationQueueRunUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get Runs From Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: AnnotationQueueRunListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture> /** Delete Run From Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: AnnotationQueueRunDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsyncImpl.kt index 3d989f13..630a1282 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/annotationQueues/RunServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.annotationQueues @@ -25,17 +25,11 @@ import java.util.concurrent.CompletableFuture class RunServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : RunServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : RunServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -43,18 +37,10 @@ constructor( override fun create( params: AnnotationQueueRunCreateParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("annotation-queues", params.getPathParam(0), "runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -62,31 +48,18 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val updateHandler: - Handler< - AnnotationQueueRunUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -94,18 +67,10 @@ constructor( override fun update( params: AnnotationQueueRunUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments( "annotation-queues", params.getPathParam(0), @@ -118,21 +83,12 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + -> + response.use { updateHandler.handle(it) } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -140,51 +96,28 @@ constructor( override fun list( params: AnnotationQueueRunListParams, requestOptions: RequestOptions - ): CompletableFuture< - List - > { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues", params.getPathParam(0), "runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - AnnotationQueueRunDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -192,18 +125,10 @@ constructor( override fun delete( params: AnnotationQueueRunDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments( "annotation-queues", params.getPathParam(0), @@ -213,22 +138,11 @@ constructor( .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsync.kt index 0033f31b..56dbf52b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.DatasetCsvRetrieveParams import com.langsmith.api.models.DatasetCsvRetrieveResponse import java.util.concurrent.CompletableFuture -interface CsvServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface CsvServiceAsync { /** Download a dataset as CSV format. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetCsvRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsyncImpl.kt index 4a868415..9e178bf0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/CsvServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.datasets @@ -18,17 +18,11 @@ import java.util.concurrent.CompletableFuture class CsvServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : CsvServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : CsvServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetCsvRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -36,31 +30,18 @@ constructor( override fun retrieve( params: DatasetCsvRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "csv") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsync.kt index 480ae40f..b3abf83e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.DatasetOpenAIFtRetrieveParams import com.langsmith.api.models.DatasetOpenAIFtRetrieveResponse import java.util.concurrent.CompletableFuture -interface OpenAIFtServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface OpenAIFtServiceAsync { /** Download a dataset as OpenAI Jsonl format. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetOpenAIFtRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsyncImpl.kt index 0e7f0735..fe06956f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIFtServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.datasets @@ -18,18 +18,11 @@ import java.util.concurrent.CompletableFuture class OpenAIFtServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : OpenAIFtServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : OpenAIFtServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetOpenAIFtRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -37,31 +30,18 @@ constructor( override fun retrieve( params: DatasetOpenAIFtRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "openai_ft") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsync.kt index 46b79859..967d59f7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.DatasetOpenAIRetrieveParams import com.langsmith.api.models.DatasetOpenAIRetrieveResponse import java.util.concurrent.CompletableFuture -interface OpenAIServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface OpenAIServiceAsync { /** Download a dataset as OpenAI Evals Jsonl format. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetOpenAIRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsyncImpl.kt index 01006a9a..2529c8d3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/OpenAIServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.datasets @@ -18,18 +18,11 @@ import java.util.concurrent.CompletableFuture class OpenAIServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : OpenAIServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : OpenAIServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetOpenAIRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -37,31 +30,18 @@ constructor( override fun retrieve( params: DatasetOpenAIRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "openai") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsync.kt index 3ff5ac5f..575d8ad2 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,15 +9,13 @@ import com.langsmith.api.models.DatasetRunCreateParams import com.langsmith.api.models.DatasetRunCreateResponse import java.util.concurrent.CompletableFuture -interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface RunServiceAsync { /** - * // templates/JavaSDK/services.ts:55:15 Fetch examples for a dataset, and fetch the runs for - * each example if they are associated with the given session_ids. + * Fetch examples for a dataset, and fetch the runs for each example if they are associated with + * the given session_ids. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: DatasetRunCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsyncImpl.kt index 8950d6a2..5f68d5c7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/RunServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.datasets @@ -19,17 +19,11 @@ import java.util.concurrent.CompletableFuture class RunServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : RunServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : RunServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - DatasetRunCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -40,18 +34,10 @@ constructor( override fun create( params: DatasetRunCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("datasets", params.getPathParam(0), "runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -59,20 +45,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsync.kt index 466885c2..0958e2fd 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -10,20 +10,17 @@ import com.langsmith.api.models.DatasetShareSchema import com.langsmith.api.models.DatasetShareUpdateParams import java.util.concurrent.CompletableFuture -interface ShareServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ShareServiceAsync { /** Get the state of sharing of a run. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetShareRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Share a dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: DatasetShareUpdateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsyncImpl.kt index 9c6d693a..051076b9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/datasets/ShareServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.datasets @@ -20,112 +20,61 @@ import java.util.concurrent.CompletableFuture class ShareServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : ShareServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ShareServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get the state of sharing of a run. */ override fun retrieve( params: DatasetShareRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - DatasetShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Share a dataset. */ override fun update( params: DatasetShareUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PUT - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PUT) .addPathSegments("datasets", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsync.kt index 8df5c696..5bcb7c52 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.Example import com.langsmith.api.models.ExampleBulkCreateParams import java.util.concurrent.CompletableFuture -interface BulkServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface BulkServiceAsync { /** Create a new example. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ExampleBulkCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsyncImpl.kt index 54cce700..79d1a59d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/BulkServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.examples @@ -19,35 +19,21 @@ import java.util.concurrent.CompletableFuture class BulkServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : BulkServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : BulkServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new example. */ override fun create( params: ExampleBulkCreateParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("examples", "bulk") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -55,20 +41,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsync.kt index 7991c4d9..cad95ec5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.Example import com.langsmith.api.models.ExampleUploadCreateParams import java.util.concurrent.CompletableFuture -interface UploadServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface UploadServiceAsync { /** Create a new example. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ExampleUploadCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsyncImpl.kt index d9b36b83..b647dd68 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/examples/UploadServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.examples @@ -19,36 +19,21 @@ import java.util.concurrent.CompletableFuture class UploadServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : UploadServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : UploadServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new example. */ override fun create( params: ExampleUploadCreateParams, requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture> { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("examples", "upload", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -56,20 +41,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/DatasetServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/DatasetServiceAsync.kt new file mode 100644 index 00000000..2344c16b --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/DatasetServiceAsync.kt @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.DatasetPublicSchema +import com.langsmith.api.models.PublicDatasetListParams +import com.langsmith.api.services.async.public.datasets.FeedbackServiceAsync +import com.langsmith.api.services.async.public.datasets.RunServiceAsync +import com.langsmith.api.services.async.public.datasets.SessionServiceAsync +import java.util.concurrent.CompletableFuture + +interface DatasetServiceAsync { + + fun sessions(): SessionServiceAsync + + fun runs(): RunServiceAsync + + fun feedback(): FeedbackServiceAsync + + /** Get dataset by ids or the shared dataset if not specifed. */ + @JvmOverloads + fun list( + params: PublicDatasetListParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/DatasetServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/DatasetServiceAsyncImpl.kt new file mode 100644 index 00000000..42274851 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/DatasetServiceAsyncImpl.kt @@ -0,0 +1,70 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.DatasetPublicSchema +import com.langsmith.api.models.PublicDatasetListParams +import com.langsmith.api.services.async.public.datasets.FeedbackServiceAsync +import com.langsmith.api.services.async.public.datasets.FeedbackServiceAsyncImpl +import com.langsmith.api.services.async.public.datasets.RunServiceAsync +import com.langsmith.api.services.async.public.datasets.RunServiceAsyncImpl +import com.langsmith.api.services.async.public.datasets.SessionServiceAsync +import com.langsmith.api.services.async.public.datasets.SessionServiceAsyncImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class DatasetServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : DatasetServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val sessions: SessionServiceAsync by lazy { SessionServiceAsyncImpl(clientOptions) } + + private val runs: RunServiceAsync by lazy { RunServiceAsyncImpl(clientOptions) } + + private val feedback: FeedbackServiceAsync by lazy { FeedbackServiceAsyncImpl(clientOptions) } + + override fun sessions(): SessionServiceAsync = sessions + + override fun runs(): RunServiceAsync = runs + + override fun feedback(): FeedbackServiceAsync = feedback + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get dataset by ids or the shared dataset if not specifed. */ + override fun list( + params: PublicDatasetListParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "datasets") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/ExampleServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/ExampleServiceAsync.kt new file mode 100644 index 00000000..63ee0728 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/ExampleServiceAsync.kt @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.Example +import com.langsmith.api.models.PublicExampleListParams +import com.langsmith.api.services.async.public.examples.RunServiceAsync +import java.util.concurrent.CompletableFuture + +interface ExampleServiceAsync { + + fun runs(): RunServiceAsync + + /** Get example by ids or the shared example if not specifed. */ + @JvmOverloads + fun list( + params: PublicExampleListParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture> +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/ExampleServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/ExampleServiceAsyncImpl.kt new file mode 100644 index 00000000..aa5055e2 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/ExampleServiceAsyncImpl.kt @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.Example +import com.langsmith.api.models.PublicExampleListParams +import com.langsmith.api.services.async.public.examples.RunServiceAsync +import com.langsmith.api.services.async.public.examples.RunServiceAsyncImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class ExampleServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : ExampleServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val runs: RunServiceAsync by lazy { RunServiceAsyncImpl(clientOptions) } + + override fun runs(): RunServiceAsync = runs + + private val listHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get example by ids or the shared example if not specifed. */ + override fun list( + params: PublicExampleListParams, + requestOptions: RequestOptions + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "examples") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/FeedbackServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/FeedbackServiceAsync.kt similarity index 54% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/FeedbackServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/FeedbackServiceAsync.kt index 94612d48..8aceced1 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/FeedbackServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/FeedbackServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_ +package com.langsmith.api.services.async.public import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.FeedbackSchema import com.langsmith.api.models.PublicFeedbackListParams import java.util.concurrent.CompletableFuture -interface FeedbackServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackServiceAsync { /** Read Shared Feedbacks */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: PublicFeedbackListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/FeedbackServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/FeedbackServiceAsyncImpl.kt new file mode 100644 index 00000000..08d1eced --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/FeedbackServiceAsyncImpl.kt @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.FeedbackSchema +import com.langsmith.api.models.PublicFeedbackListParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class FeedbackServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : FeedbackServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val listHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Read Shared Feedbacks */ + override fun list( + params: PublicFeedbackListParams, + requestOptions: RequestOptions + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "feedbacks") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/LatestRunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/LatestRunServiceAsync.kt similarity index 54% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/LatestRunServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/LatestRunServiceAsync.kt index db44fe5a..8358c757 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/LatestRunServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/LatestRunServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_ +package com.langsmith.api.services.async.public import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.PublicLatestRunRetrieveParams import com.langsmith.api.models.RunPublicSchema import java.util.concurrent.CompletableFuture -interface LatestRunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface LatestRunServiceAsync { /** Get the shared run. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: PublicLatestRunRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/LatestRunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/LatestRunServiceAsyncImpl.kt new file mode 100644 index 00000000..5738b2d7 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/LatestRunServiceAsyncImpl.kt @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicLatestRunRetrieveParams +import com.langsmith.api.models.RunPublicSchema +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class LatestRunServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : LatestRunServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get the shared run. */ + override fun retrieve( + params: PublicLatestRunRetrieveParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "run") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/RunServiceAsync.kt new file mode 100644 index 00000000..bc60b027 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/RunServiceAsync.kt @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.PublicRunRetrieveParams +import com.langsmith.api.models.RunPublicSchema +import com.langsmith.api.services.async.public.runs.QueryServiceAsync +import java.util.concurrent.CompletableFuture + +interface RunServiceAsync { + + fun query(): QueryServiceAsync + + /** Get the shared run. */ + @JvmOverloads + fun retrieve( + params: PublicRunRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/RunServiceAsyncImpl.kt new file mode 100644 index 00000000..97697f6c --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/RunServiceAsyncImpl.kt @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicRunRetrieveParams +import com.langsmith.api.models.RunPublicSchema +import com.langsmith.api.services.async.public.runs.QueryServiceAsync +import com.langsmith.api.services.async.public.runs.QueryServiceAsyncImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class RunServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : RunServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val query: QueryServiceAsync by lazy { QueryServiceAsyncImpl(clientOptions) } + + override fun query(): QueryServiceAsync = query + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get the shared run. */ + override fun retrieve( + params: PublicRunRetrieveParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "run", params.getPathParam(1)) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/FeedbackServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/FeedbackServiceAsync.kt similarity index 57% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/FeedbackServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/FeedbackServiceAsync.kt index a7cac725..579c8830 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/FeedbackServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/FeedbackServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_.datasets +package com.langsmith.api.services.async.public.datasets import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.FeedbackSchema import com.langsmith.api.models.PublicDatasetFeedbackRetrieveParams import java.util.concurrent.CompletableFuture -interface FeedbackServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackServiceAsync { /** Get feedback for runs in projects run over a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: PublicDatasetFeedbackRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/FeedbackServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/FeedbackServiceAsyncImpl.kt new file mode 100644 index 00000000..78671a5e --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/FeedbackServiceAsyncImpl.kt @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.datasets + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.FeedbackSchema +import com.langsmith.api.models.PublicDatasetFeedbackRetrieveParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class FeedbackServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : FeedbackServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val retrieveHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get feedback for runs in projects run over a dataset that has been shared. */ + override fun retrieve( + params: PublicDatasetFeedbackRetrieveParams, + requestOptions: RequestOptions + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "datasets", "feedback") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/RunServiceAsync.kt new file mode 100644 index 00000000..506eff12 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/RunServiceAsync.kt @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.async.public.datasets + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.PublicDatasetRunRetrieveParams +import com.langsmith.api.models.RunPublicDatasetSchema +import com.langsmith.api.services.async.public.datasets.runs.QueryServiceAsync +import com.langsmith.api.services.async.public.datasets.runs.StatServiceAsync +import java.util.concurrent.CompletableFuture + +interface RunServiceAsync { + + fun query(): QueryServiceAsync + + fun stats(): StatServiceAsync + + /** Get runs in projects run over a dataset that has been shared. */ + @JvmOverloads + fun retrieve( + params: PublicDatasetRunRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/RunServiceAsyncImpl.kt new file mode 100644 index 00000000..d51ba999 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/RunServiceAsyncImpl.kt @@ -0,0 +1,70 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.datasets + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicDatasetRunRetrieveParams +import com.langsmith.api.models.RunPublicDatasetSchema +import com.langsmith.api.services.async.public.datasets.runs.QueryServiceAsync +import com.langsmith.api.services.async.public.datasets.runs.QueryServiceAsyncImpl +import com.langsmith.api.services.async.public.datasets.runs.StatServiceAsync +import com.langsmith.api.services.async.public.datasets.runs.StatServiceAsyncImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class RunServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : RunServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val query: QueryServiceAsync by lazy { QueryServiceAsyncImpl(clientOptions) } + + private val stats: StatServiceAsync by lazy { StatServiceAsyncImpl(clientOptions) } + + override fun query(): QueryServiceAsync = query + + override fun stats(): StatServiceAsync = stats + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get runs in projects run over a dataset that has been shared. */ + override fun retrieve( + params: PublicDatasetRunRetrieveParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments( + "public", + params.getPathParam(0), + "datasets", + "runs", + params.getPathParam(1) + ) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/SessionServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/SessionServiceAsync.kt similarity index 55% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/SessionServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/SessionServiceAsync.kt index d27fac89..4a6120af 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/SessionServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/SessionServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_.datasets +package com.langsmith.api.services.async.public.datasets import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.PublicDatasetSessionListParams import com.langsmith.api.models.TracerSession import java.util.concurrent.CompletableFuture -interface SessionServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface SessionServiceAsync { /** Get projects run on a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: PublicDatasetSessionListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/SessionServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/SessionServiceAsyncImpl.kt new file mode 100644 index 00000000..eb3dc69f --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/SessionServiceAsyncImpl.kt @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.datasets + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicDatasetSessionListParams +import com.langsmith.api.models.TracerSession +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class SessionServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : SessionServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val listHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get projects run on a dataset that has been shared. */ + override fun list( + params: PublicDatasetSessionListParams, + requestOptions: RequestOptions + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "datasets", "sessions") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/QueryServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/QueryServiceAsync.kt similarity index 57% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/QueryServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/QueryServiceAsync.kt index 4a197821..d92dbc6d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/QueryServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/QueryServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_.datasets.runs +package com.langsmith.api.services.async.public.datasets.runs import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.ListPublicDatasetRunsResponse import com.langsmith.api.models.PublicDatasetRunQueryCreateParams import java.util.concurrent.CompletableFuture -interface QueryServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueryServiceAsync { /** Get runs in projects run over a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: PublicDatasetRunQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/QueryServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/QueryServiceAsyncImpl.kt new file mode 100644 index 00000000..cecdc1df --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/QueryServiceAsyncImpl.kt @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.datasets.runs + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.ListPublicDatasetRunsResponse +import com.langsmith.api.models.PublicDatasetRunQueryCreateParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class QueryServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : QueryServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Get runs in projects run over a dataset that has been shared. */ + override fun create( + params: PublicDatasetRunQueryCreateParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "query") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/StatServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/StatServiceAsync.kt similarity index 55% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/StatServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/StatServiceAsync.kt index f4c52005..1b3c9dc5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/StatServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/StatServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_.datasets.runs +package com.langsmith.api.services.async.public.datasets.runs import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.PublicDatasetRunStatCreateParams import com.langsmith.api.models.RunStats import java.util.concurrent.CompletableFuture -interface StatServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface StatServiceAsync { /** Get run stats in projects run over a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: PublicDatasetRunStatCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/StatServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/StatServiceAsyncImpl.kt new file mode 100644 index 00000000..9023a320 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/datasets/runs/StatServiceAsyncImpl.kt @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.datasets.runs + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicDatasetRunStatCreateParams +import com.langsmith.api.models.RunStats +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class StatServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : StatServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get run stats in projects run over a dataset that has been shared. */ + override fun create( + params: PublicDatasetRunStatCreateParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "stats") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/examples/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/examples/RunServiceAsync.kt new file mode 100644 index 00000000..1a069ec1 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/examples/RunServiceAsync.kt @@ -0,0 +1,20 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.async.public.examples + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.PublicExampleRunCreateParams +import com.langsmith.api.models.PublicExampleRunCreateResponse +import java.util.concurrent.CompletableFuture + +interface RunServiceAsync { + + /** Get examples with associated runs from sessions in a dataset that has been shared. */ + @JvmOverloads + fun create( + params: PublicExampleRunCreateParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/examples/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/examples/RunServiceAsyncImpl.kt new file mode 100644 index 00000000..4e4cc425 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/examples/RunServiceAsyncImpl.kt @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.examples + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicExampleRunCreateParams +import com.langsmith.api.models.PublicExampleRunCreateResponse +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class RunServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : RunServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Get examples with associated runs from sessions in a dataset that has been shared. */ + override fun create( + params: PublicExampleRunCreateParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "examples", "runs") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/runs/QueryServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/runs/QueryServiceAsync.kt similarity index 56% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/runs/QueryServiceAsync.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/runs/QueryServiceAsync.kt index 9cec34ad..f8b893df 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/runs/QueryServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/runs/QueryServiceAsync.kt @@ -1,21 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.async.public_.runs +package com.langsmith.api.services.async.public.runs import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.ListPublicRunsResponse import com.langsmith.api.models.PublicRunQueryCreateParams import java.util.concurrent.CompletableFuture -interface QueryServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueryServiceAsync { /** Get run by ids or the shared run if not specifed. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: PublicRunQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/runs/QueryServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/runs/QueryServiceAsyncImpl.kt new file mode 100644 index 00000000..a24c4184 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public/runs/QueryServiceAsyncImpl.kt @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.async.public.runs + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.ListPublicRunsResponse +import com.langsmith.api.models.PublicRunQueryCreateParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler +import java.util.concurrent.CompletableFuture + +class QueryServiceAsyncImpl +constructor( + private val clientOptions: ClientOptions, +) : QueryServiceAsync { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get run by ids or the shared run if not specifed. */ + override fun create( + params: PublicRunQueryCreateParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "runs", "query") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/DatasetServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/DatasetServiceAsync.kt deleted file mode 100644 index 1b4f5807..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/DatasetServiceAsync.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.DatasetPublicSchema -import com.langsmith.api.models.PublicDatasetListParams -import com.langsmith.api.services.async.public_.datasets.FeedbackServiceAsync -import com.langsmith.api.services.async.public_.datasets.RunServiceAsync -import com.langsmith.api.services.async.public_.datasets.SessionServiceAsync -import java.util.concurrent.CompletableFuture - -interface DatasetServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - fun sessions(): SessionServiceAsync // templates/JavaSDK/services.ts:55:15 - - fun runs(): RunServiceAsync - - fun feedback(): FeedbackServiceAsync - - /** Get dataset by ids or the shared dataset if not specifed. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun list( - params: PublicDatasetListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/DatasetServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/DatasetServiceAsyncImpl.kt deleted file mode 100644 index df827752..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/DatasetServiceAsyncImpl.kt +++ /dev/null @@ -1,94 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.DatasetPublicSchema -import com.langsmith.api.models.PublicDatasetListParams -import com.langsmith.api.services.async.public_.datasets.FeedbackServiceAsync -import com.langsmith.api.services.async.public_.datasets.FeedbackServiceAsyncImpl -import com.langsmith.api.services.async.public_.datasets.RunServiceAsync -import com.langsmith.api.services.async.public_.datasets.RunServiceAsyncImpl -import com.langsmith.api.services.async.public_.datasets.SessionServiceAsync -import com.langsmith.api.services.async.public_.datasets.SessionServiceAsyncImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class DatasetServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : DatasetServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val sessions: SessionServiceAsync by lazy { SessionServiceAsyncImpl(clientOptions) } - - private val runs: RunServiceAsync by lazy { RunServiceAsyncImpl(clientOptions) } - - private val feedback: FeedbackServiceAsync by lazy { FeedbackServiceAsyncImpl(clientOptions) } - - override fun sessions(): SessionServiceAsync = sessions - - override fun runs(): RunServiceAsync = runs - - override fun feedback(): FeedbackServiceAsync = feedback - - private val listHandler: - Handler< - DatasetPublicSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get dataset by ids or the shared dataset if not specifed. */ - override fun list( - params: PublicDatasetListParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/ExampleServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/ExampleServiceAsync.kt deleted file mode 100644 index 9818281b..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/ExampleServiceAsync.kt +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.Example -import com.langsmith.api.models.PublicExampleListParams -import com.langsmith.api.services.async.public_.examples.RunServiceAsync -import java.util.concurrent.CompletableFuture - -interface ExampleServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - fun runs(): RunServiceAsync // templates/JavaSDK/services.ts:55:15 - - /** Get example by ids or the shared example if not specifed. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun list( - params: PublicExampleListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture> -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/ExampleServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/ExampleServiceAsyncImpl.kt deleted file mode 100644 index 7a1abaab..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/ExampleServiceAsyncImpl.kt +++ /dev/null @@ -1,82 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.Example -import com.langsmith.api.models.PublicExampleListParams -import com.langsmith.api.services.async.public_.examples.RunServiceAsync -import com.langsmith.api.services.async.public_.examples.RunServiceAsyncImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class ExampleServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : ExampleServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val runs: RunServiceAsync by lazy { RunServiceAsyncImpl(clientOptions) } - - override fun runs(): RunServiceAsync = runs - - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get example by ids or the shared example if not specifed. */ - override fun list( - params: PublicExampleListParams, - requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "examples") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/FeedbackServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/FeedbackServiceAsyncImpl.kt deleted file mode 100644 index 0168d2ed..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/FeedbackServiceAsyncImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.FeedbackSchema -import com.langsmith.api.models.PublicFeedbackListParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class FeedbackServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : FeedbackServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Read Shared Feedbacks */ - override fun list( - params: PublicFeedbackListParams, - requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "feedbacks") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/LatestRunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/LatestRunServiceAsyncImpl.kt deleted file mode 100644 index 5d12fb0b..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/LatestRunServiceAsyncImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicLatestRunRetrieveParams -import com.langsmith.api.models.RunPublicSchema -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class LatestRunServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : LatestRunServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val retrieveHandler: - Handler< - RunPublicSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get the shared run. */ - override fun retrieve( - params: PublicLatestRunRetrieveParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "run") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/RunServiceAsync.kt deleted file mode 100644 index c8389b12..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/RunServiceAsync.kt +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.PublicRunRetrieveParams -import com.langsmith.api.models.RunPublicSchema -import com.langsmith.api.services.async.public_.runs.QueryServiceAsync -import java.util.concurrent.CompletableFuture - -interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - fun query(): QueryServiceAsync // templates/JavaSDK/services.ts:55:15 - - /** Get the shared run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun retrieve( - params: PublicRunRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/RunServiceAsyncImpl.kt deleted file mode 100644 index 711f7e29..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/RunServiceAsyncImpl.kt +++ /dev/null @@ -1,81 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicRunRetrieveParams -import com.langsmith.api.models.RunPublicSchema -import com.langsmith.api.services.async.public_.runs.QueryServiceAsync -import com.langsmith.api.services.async.public_.runs.QueryServiceAsyncImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class RunServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : RunServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val query: QueryServiceAsync by lazy { QueryServiceAsyncImpl(clientOptions) } - - override fun query(): QueryServiceAsync = query - - private val retrieveHandler: - Handler< - RunPublicSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get the shared run. */ - override fun retrieve( - params: PublicRunRetrieveParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "run", params.getPathParam(1)) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/FeedbackServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/FeedbackServiceAsyncImpl.kt deleted file mode 100644 index cdb04a44..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/FeedbackServiceAsyncImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.datasets - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.FeedbackSchema -import com.langsmith.api.models.PublicDatasetFeedbackRetrieveParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class FeedbackServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : FeedbackServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val retrieveHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get feedback for runs in projects run over a dataset that has been shared. */ - override fun retrieve( - params: PublicDatasetFeedbackRetrieveParams, - requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "feedback") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/RunServiceAsync.kt deleted file mode 100644 index e6ac6ae0..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/RunServiceAsync.kt +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.async.public_.datasets - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.PublicDatasetRunRetrieveParams -import com.langsmith.api.models.RunPublicDatasetSchema -import com.langsmith.api.services.async.public_.datasets.runs.QueryServiceAsync -import com.langsmith.api.services.async.public_.datasets.runs.StatServiceAsync -import java.util.concurrent.CompletableFuture - -interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - fun query(): QueryServiceAsync // templates/JavaSDK/services.ts:55:15 - - fun stats(): StatServiceAsync - - /** Get runs in projects run over a dataset that has been shared. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun retrieve( - params: PublicDatasetRunRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/RunServiceAsyncImpl.kt deleted file mode 100644 index c93b1aab..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/RunServiceAsyncImpl.kt +++ /dev/null @@ -1,93 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.datasets - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicDatasetRunRetrieveParams -import com.langsmith.api.models.RunPublicDatasetSchema -import com.langsmith.api.services.async.public_.datasets.runs.QueryServiceAsync -import com.langsmith.api.services.async.public_.datasets.runs.QueryServiceAsyncImpl -import com.langsmith.api.services.async.public_.datasets.runs.StatServiceAsync -import com.langsmith.api.services.async.public_.datasets.runs.StatServiceAsyncImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class RunServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : RunServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val query: QueryServiceAsync by lazy { QueryServiceAsyncImpl(clientOptions) } - - private val stats: StatServiceAsync by lazy { StatServiceAsyncImpl(clientOptions) } - - override fun query(): QueryServiceAsync = query - - override fun stats(): StatServiceAsync = stats - - private val retrieveHandler: - Handler< - RunPublicDatasetSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get runs in projects run over a dataset that has been shared. */ - override fun retrieve( - params: PublicDatasetRunRetrieveParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments( - "public", - params.getPathParam(0), - "datasets", - "runs", - params.getPathParam(1) - ) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/SessionServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/SessionServiceAsyncImpl.kt deleted file mode 100644 index 9b302841..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/SessionServiceAsyncImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.datasets - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicDatasetSessionListParams -import com.langsmith.api.models.TracerSession -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class SessionServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : SessionServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get projects run on a dataset that has been shared. */ - override fun list( - params: PublicDatasetSessionListParams, - requestOptions: RequestOptions - ): CompletableFuture> { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "sessions") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/QueryServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/QueryServiceAsyncImpl.kt deleted file mode 100644 index 60a8b75c..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/QueryServiceAsyncImpl.kt +++ /dev/null @@ -1,79 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.datasets.runs - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.ListPublicDatasetRunsResponse -import com.langsmith.api.models.PublicDatasetRunQueryCreateParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class QueryServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : QueryServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - ListPublicDatasetRunsResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Get runs in projects run over a dataset that has been shared. */ - override fun create( - params: PublicDatasetRunQueryCreateParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "query") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/StatServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/StatServiceAsyncImpl.kt deleted file mode 100644 index e3b701a8..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/datasets/runs/StatServiceAsyncImpl.kt +++ /dev/null @@ -1,77 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.datasets.runs - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicDatasetRunStatCreateParams -import com.langsmith.api.models.RunStats -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class StatServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : StatServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - RunStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get run stats in projects run over a dataset that has been shared. */ - override fun create( - params: PublicDatasetRunStatCreateParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "stats") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/examples/RunServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/examples/RunServiceAsync.kt deleted file mode 100644 index 262bdb55..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/examples/RunServiceAsync.kt +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.async.public_.examples - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.PublicExampleRunCreateParams -import com.langsmith.api.models.PublicExampleRunCreateResponse -import java.util.concurrent.CompletableFuture - -interface RunServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - /** - * // templates/JavaSDK/services.ts:55:15 Get examples with associated runs from sessions in a - * dataset that has been shared. - */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun create( - params: PublicExampleRunCreateParams, - requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/examples/RunServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/examples/RunServiceAsyncImpl.kt deleted file mode 100644 index 3f1310b3..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/examples/RunServiceAsyncImpl.kt +++ /dev/null @@ -1,78 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.examples - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicExampleRunCreateParams -import com.langsmith.api.models.PublicExampleRunCreateResponse -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class RunServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : RunServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - PublicExampleRunCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Get examples with associated runs from sessions in a dataset that has been shared. */ - override fun create( - params: PublicExampleRunCreateParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "examples", "runs") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/runs/QueryServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/runs/QueryServiceAsyncImpl.kt deleted file mode 100644 index e0d7bc1e..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/public_/runs/QueryServiceAsyncImpl.kt +++ /dev/null @@ -1,78 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.async.public_.runs - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.ListPublicRunsResponse -import com.langsmith.api.models.PublicRunQueryCreateParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler -import java.util.concurrent.CompletableFuture - -class QueryServiceAsyncImpl -constructor( - private val clientOptions: ClientOptions, -) : QueryServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - ListPublicRunsResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get run by ids or the shared run if not specifed. */ - override fun create( - params: PublicRunQueryCreateParams, - requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "runs", "query") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsync.kt index 090d4fcb..3b3fa414 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.ResponseBodyForRunsGenerateQuery import com.langsmith.api.models.RunGenerateQueryCreateParams import java.util.concurrent.CompletableFuture -interface GenerateQueryServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface GenerateQueryServiceAsync { /** Get runs filter expression query for a given natural language query. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunGenerateQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsyncImpl.kt index 50915cf0..85a521eb 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/GenerateQueryServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.runs @@ -19,18 +19,11 @@ import java.util.concurrent.CompletableFuture class GenerateQueryServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : GenerateQueryServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : GenerateQueryServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - ResponseBodyForRunsGenerateQuery - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -38,18 +31,10 @@ constructor( override fun create( params: RunGenerateQueryCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "generate-query") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -57,20 +42,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsync.kt index 9cad89ff..e6bc71c7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.MonitorResponse import com.langsmith.api.models.RunMonitorCreateParams import java.util.concurrent.CompletableFuture -interface MonitorServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface MonitorServiceAsync { /** Get monitoring data for a specific session. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunMonitorCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsyncImpl.kt index 14bcfbb4..61daad4c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/MonitorServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.runs @@ -19,36 +19,21 @@ import java.util.concurrent.CompletableFuture class MonitorServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : MonitorServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : MonitorServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - MonitorResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get monitoring data for a specific session. */ override fun create( params: RunMonitorCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "monitor") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -56,20 +41,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsync.kt index 2061047f..99b9921c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.ListRunsResponse import com.langsmith.api.models.RunQueryCreateParams import java.util.concurrent.CompletableFuture -interface QueryServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueryServiceAsync { /** Get all runs by query in body payload. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsyncImpl.kt index fb253d68..89334677 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/QueryServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.runs @@ -19,36 +19,21 @@ import java.util.concurrent.CompletableFuture class QueryServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : QueryServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : QueryServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - ListRunsResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all runs by query in body payload. */ override fun create( params: RunQueryCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "query") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -56,20 +41,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsync.kt index dcee4188..0208b650 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -12,27 +12,24 @@ import com.langsmith.api.models.RunShareSchema import com.langsmith.api.models.RunShareUpdateParams import java.util.concurrent.CompletableFuture -interface ShareServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ShareServiceAsync { /** Get the state of sharing of a run. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: RunShareRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Share a run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: RunShareUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Unshare a run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: RunShareDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsyncImpl.kt index 3715a331..1f614c16 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/ShareServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.runs @@ -22,161 +22,87 @@ import java.util.concurrent.CompletableFuture class ShareServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : ShareServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ShareServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - RunShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get the state of sharing of a run. */ override fun retrieve( params: RunShareRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("runs", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - RunShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Share a run. */ override fun update( params: RunShareUpdateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PUT - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PUT) .addPathSegments("runs", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val deleteHandler: - Handler< - RunShareDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Unshare a run. */ override fun delete( params: RunShareDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("runs", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsync.kt index c96d7788..42270e29 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.RunStatCreateParams import com.langsmith.api.models.RunStats import java.util.concurrent.CompletableFuture -interface StatServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface StatServiceAsync { /** Get all runs by query in body payload. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunStatCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsyncImpl.kt index 2aef1cf4..4c1ea57a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/runs/StatServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.runs @@ -19,35 +19,21 @@ import java.util.concurrent.CompletableFuture class StatServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : StatServiceAsync { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : StatServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - RunStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all runs by query in body payload. */ override fun create( params: RunStatCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "stats") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -55,20 +41,11 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsync.kt index e91ea49d..ba162486 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,15 +9,13 @@ import com.langsmith.api.models.SessionMetadataRetrieveParams import com.langsmith.api.models.TracerSessionMetadataResponse import java.util.concurrent.CompletableFuture -interface MetadataServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface MetadataServiceAsync { /** - * // templates/JavaSDK/services.ts:55:15 Given a session, a number K, and (optionally) a list - * of metadata keys, return the top K values for each key. + * Given a session, a number K, and (optionally) a list of metadata keys, return the top K + * values for each key. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: SessionMetadataRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsyncImpl.kt index 70b8512f..fbebe590 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/sessions/MetadataServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.sessions @@ -18,18 +18,11 @@ import java.util.concurrent.CompletableFuture class MetadataServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : MetadataServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : MetadataServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - TracerSessionMetadataResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -40,38 +33,21 @@ constructor( override fun retrieve( params: SessionMetadataRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("sessions", params.getPathParam(0), "metadata") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsync.kt index 1b2bee0c..48357bbf 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -13,27 +13,24 @@ import com.langsmith.api.models.TenantMembers import com.langsmith.api.models.TenantStats import java.util.concurrent.CompletableFuture -interface CurrentServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface CurrentServiceAsync { /** Add Member To Current Tenant */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun membersCreate( params: TenantCurrentMembersCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get Current Tenant Members */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun membersList( params: TenantCurrentMembersListParams, requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture /** Get Current Tenant Stats */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun statsRetrieve( params: TenantCurrentStatsRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsyncImpl.kt index 222e1664..12cb9e1f 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/CurrentServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.tenants @@ -23,36 +23,21 @@ import java.util.concurrent.CompletableFuture class CurrentServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : CurrentServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : CurrentServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val membersCreateHandler: - Handler< - PendingIdentity - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val membersCreateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Add Member To Current Tenant */ override fun membersCreate( params: TenantCurrentMembersCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("tenants", "current", "members") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) @@ -60,118 +45,67 @@ constructor( .body(json(clientOptions.jsonMapper, params.getBody())) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - membersCreateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { membersCreateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val membersListHandler: - Handler< - TenantMembers - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val membersListHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Members */ override fun membersList( params: TenantCurrentMembersListParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "current", "members") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - membersListHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { membersListHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val statsRetrieveHandler: - Handler< - TenantStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val statsRetrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Stats */ override fun statsRetrieve( params: TenantCurrentStatsRetrieveParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "current", "stats") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - statsRetrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { statsRetrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsync.kt index 377ef63c..73ebc98c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -10,14 +10,12 @@ import com.langsmith.api.models.TenantMemberDeleteResponse import com.langsmith.api.services.async.tenants.members.PendingServiceAsync import java.util.concurrent.CompletableFuture -interface MemberServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface MemberServiceAsync { - fun pending(): PendingServiceAsync // templates/JavaSDK/services.ts:55:15 + fun pending(): PendingServiceAsync /** Delete Current Tenant Member */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: TenantMemberDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsyncImpl.kt index 1ae257a5..4ba4b8fd 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/MemberServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.tenants @@ -21,22 +21,15 @@ import java.util.concurrent.CompletableFuture class MemberServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : MemberServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : MemberServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val pending: PendingServiceAsync by lazy { PendingServiceAsyncImpl(clientOptions) } override fun pending(): PendingServiceAsync = pending - private val deleteHandler: - Handler< - TenantMemberDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -44,38 +37,19 @@ constructor( override fun delete( params: TenantMemberDeleteParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("tenants", "current", "members", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsync.kt index f792efbb..c38ad647 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.TenantPendingClaimCreateParams import com.langsmith.api.models.TenantPendingClaimCreateResponse import java.util.concurrent.CompletableFuture -interface PendingServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface PendingServiceAsync { /** Claim Pending Tenant Invite */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun claimCreate( params: TenantPendingClaimCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsyncImpl.kt index fbd8f7ee..91a25fac 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/PendingServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.tenants @@ -19,18 +19,11 @@ import java.util.concurrent.CompletableFuture class PendingServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : PendingServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : PendingServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val claimCreateHandler: - Handler< - TenantPendingClaimCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val claimCreateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -38,38 +31,19 @@ constructor( override fun claimCreate( params: TenantPendingClaimCreateParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("tenants", "pending", params.getPathParam(0), "claim") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - claimCreateHandler.handle(it) - } + -> + response.use { claimCreateHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsync.kt index 28d9a760..c51100e7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.TenantUsageLimitInfo import com.langsmith.api.models.TenantUsageLimitListParams import java.util.concurrent.CompletableFuture -interface UsageLimitServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface UsageLimitServiceAsync { /** Get Current Tenant Usage Limits Info */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: TenantUsageLimitListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsyncImpl.kt index 7e6d8aca..97541dd9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/UsageLimitServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.tenants @@ -18,56 +18,32 @@ import java.util.concurrent.CompletableFuture class UsageLimitServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : UsageLimitServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : UsageLimitServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val listHandler: - Handler< - TenantUsageLimitInfo - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Usage Limits Info */ override fun list( params: TenantUsageLimitListParams, requestOptions: RequestOptions - ): CompletableFuture { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "current", "usage_limits") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 + -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsync.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsync.kt index b6b380bd..32107643 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsync.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsync.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,13 +9,10 @@ import com.langsmith.api.models.TenantMemberPendingDeleteParams import com.langsmith.api.models.TenantMemberPendingDeleteResponse import java.util.concurrent.CompletableFuture -interface PendingServiceAsync { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface PendingServiceAsync { /** Delete Current Tenant Pending Member */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: TenantMemberPendingDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsyncImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsyncImpl.kt index a8cabc77..eee976cf 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsyncImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/async/tenants/members/PendingServiceAsyncImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.async.tenants.members @@ -19,18 +19,11 @@ import java.util.concurrent.CompletableFuture class PendingServiceAsyncImpl constructor( private val clientOptions: ClientOptions, -) : PendingServiceAsync { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : PendingServiceAsync { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val deleteHandler: - Handler< - TenantMemberPendingDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -38,40 +31,19 @@ constructor( override fun delete( params: TenantMemberPendingDeleteParams, requestOptions: RequestOptions - ): CompletableFuture< - TenantMemberPendingDeleteResponse - > { // templates/JavaSDK/services.ts:831:10 + ): CompletableFuture { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("tenants", "current", "members", params.getPathParam(0), "pending") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueService.kt index dd2cd27f..e690b8d0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -17,44 +17,42 @@ import com.langsmith.api.models.AnnotationQueueUpdateResponse import com.langsmith.api.services.blocking.annotationQueues.QueueService import com.langsmith.api.services.blocking.annotationQueues.RunService -interface AnnotationQueueService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface AnnotationQueueService { - fun runs(): RunService // templates/JavaSDK/services.ts:55:15 + fun runs(): RunService fun queues(): QueueService /** Create Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: AnnotationQueueCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): AnnotationQueueSchema /** Update Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: AnnotationQueueUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): AnnotationQueueUpdateResponse /** Get Annotation Queues */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: AnnotationQueueListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: AnnotationQueueDeleteParams, requestOptions: RequestOptions = RequestOptions.none() ): AnnotationQueueDeleteResponse /** Get Size From Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun sizeRetrieve( params: AnnotationQueueSizeRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceImpl.kt index eba30ef2..605bad80 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -29,12 +29,9 @@ import com.langsmith.api.services.withErrorHandler class AnnotationQueueServiceImpl constructor( private val clientOptions: ClientOptions, -) : AnnotationQueueService { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : AnnotationQueueService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val runs: RunService by lazy { RunServiceImpl(clientOptions) } @@ -44,61 +41,35 @@ constructor( override fun queues(): QueueService = queues - private val createHandler: - Handler< - AnnotationQueueSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create Annotation Queue */ override fun create( params: AnnotationQueueCreateParams, requestOptions: RequestOptions - ): AnnotationQueueSchema { // templates/JavaSDK/services.ts:831:10 + ): AnnotationQueueSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("annotation-queues") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - AnnotationQueueUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -106,40 +77,22 @@ constructor( override fun update( params: AnnotationQueueUpdateParams, requestOptions: RequestOptions - ): AnnotationQueueUpdateResponse { // templates/JavaSDK/services.ts:831:10 + ): AnnotationQueueUpdateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("annotation-queues", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { updateHandler.handle(it) } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -147,49 +100,27 @@ constructor( override fun list( params: AnnotationQueueListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - AnnotationQueueDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -197,46 +128,22 @@ constructor( override fun delete( params: AnnotationQueueDeleteParams, requestOptions: RequestOptions - ): AnnotationQueueDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): AnnotationQueueDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("annotation-queues", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } - private val sizeRetrieveHandler: - Handler< - AnnotationQueueSizeSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val sizeRetrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -244,38 +151,20 @@ constructor( override fun sizeRetrieve( params: AnnotationQueueSizeRetrieveParams, requestOptions: RequestOptions - ): AnnotationQueueSizeSchema { // templates/JavaSDK/services.ts:831:10 + ): AnnotationQueueSizeSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues", params.getPathParam(0), "size") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - sizeRetrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { sizeRetrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyService.kt index 1879d632..e1c4303e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -11,27 +11,24 @@ import com.langsmith.api.models.ApiKeyDeleteParams import com.langsmith.api.models.ApiKeyGetResponse import com.langsmith.api.models.ApiKeyRetrieveParams -interface ApiKeyService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ApiKeyService { /** Generate an api key for the user */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ApiKeyCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): ApiKeyCreateResponse /** Get the current tenant's API keys */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: ApiKeyRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete an api key for the user */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: ApiKeyDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceImpl.kt index 637f82b3..bfe0497c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -21,67 +21,39 @@ import com.langsmith.api.services.withErrorHandler class ApiKeyServiceImpl constructor( private val clientOptions: ClientOptions, -) : ApiKeyService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ApiKeyService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - ApiKeyCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Generate an api key for the user */ override fun create( params: ApiKeyCreateParams, requestOptions: RequestOptions - ): ApiKeyCreateResponse { // templates/JavaSDK/services.ts:831:10 + ): ApiKeyCreateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("api-key") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -89,94 +61,48 @@ constructor( override fun retrieve( params: ApiKeyRetrieveParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("api-key") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - ApiKeyGetResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete an api key for the user */ override fun delete( params: ApiKeyDeleteParams, requestOptions: RequestOptions - ): ApiKeyGetResponse { // templates/JavaSDK/services.ts:831:10 + ): ApiKeyGetResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("api-key", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { deleteHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetService.kt index 9f47d1c4..84ebf112 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -20,11 +20,9 @@ import com.langsmith.api.services.blocking.datasets.OpenAIService import com.langsmith.api.services.blocking.datasets.RunService import com.langsmith.api.services.blocking.datasets.ShareService -interface DatasetService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface DatasetService { - fun openai(): OpenAIService // templates/JavaSDK/services.ts:55:15 + fun openai(): OpenAIService fun openaiFt(): OpenAIFtService @@ -35,42 +33,42 @@ interface DatasetService { // templates/JavaSDK/services.ts:55:15 // fun share(): ShareService /** Create a new dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: DatasetCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): Dataset /** Get a specific dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): Dataset /** Update a specific dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: DatasetUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): DatasetSchemaForUpdate /** Get all datasets by query params and owner. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: DatasetListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete a specific dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: DatasetDeleteParams, requestOptions: RequestOptions = RequestOptions.none() ): DatasetDeleteResponse /** Create a new dataset from a CSV file. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun upload( params: DatasetUploadParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetServiceImpl.kt index 7154136b..8c0ce2a1 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/DatasetServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -35,11 +35,9 @@ import com.langsmith.api.services.withErrorHandler class DatasetServiceImpl constructor( private val clientOptions: ClientOptions, -) : DatasetService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : DatasetService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val openai: OpenAIService by lazy { OpenAIServiceImpl(clientOptions) } @@ -61,294 +59,148 @@ constructor( override fun share(): ShareService = share - private val createHandler: - Handler< - Dataset - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new dataset. */ - override fun create( - params: DatasetCreateParams, - requestOptions: RequestOptions - ): Dataset { // templates/JavaSDK/services.ts:831:10 + override fun create(params: DatasetCreateParams, requestOptions: RequestOptions): Dataset { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("datasets") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - Dataset - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific dataset. */ - override fun retrieve( - params: DatasetRetrieveParams, - requestOptions: RequestOptions - ): Dataset { // templates/JavaSDK/services.ts:831:10 + override fun retrieve(params: DatasetRetrieveParams, requestOptions: RequestOptions): Dataset { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - DatasetSchemaForUpdate - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Update a specific dataset. */ override fun update( params: DatasetUpdateParams, requestOptions: RequestOptions - ): DatasetSchemaForUpdate { // templates/JavaSDK/services.ts:831:10 + ): DatasetSchemaForUpdate { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("datasets", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all datasets by query params and owner. */ - override fun list( - params: DatasetListParams, - requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + override fun list(params: DatasetListParams, requestOptions: RequestOptions): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - DatasetDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a specific dataset. */ override fun delete( params: DatasetDeleteParams, requestOptions: RequestOptions - ): DatasetDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): DatasetDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("datasets", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } - private val uploadHandler: - Handler< - Dataset - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val uploadHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new dataset from a CSV file. */ - override fun upload( - params: DatasetUploadParams, - requestOptions: RequestOptions - ): Dataset { // templates/JavaSDK/services.ts:831:10 + override fun upload(params: DatasetUploadParams, requestOptions: RequestOptions): Dataset { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("datasets", "upload") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - uploadHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { uploadHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleService.kt index 19ce7f60..50724846 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -16,44 +16,42 @@ import com.langsmith.api.models.ExampleUpdateResponse import com.langsmith.api.services.blocking.examples.BulkService import com.langsmith.api.services.blocking.examples.UploadService -interface ExampleService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ExampleService { - fun bulk(): BulkService // templates/JavaSDK/services.ts:55:15 + fun bulk(): BulkService fun upload(): UploadService /** Create a new example. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ExampleCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): Example /** Get a specific example. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: ExampleRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): Example /** Update a specific example. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: ExampleUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): ExampleUpdateResponse /** Get all examples by query params */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: ExampleListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete a specific set of examples. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: ExampleDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleServiceImpl.kt index 1bfbffaa..deb3c00d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/ExampleServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -28,11 +28,9 @@ import com.langsmith.api.services.withErrorHandler class ExampleServiceImpl constructor( private val clientOptions: ClientOptions, -) : ExampleService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : ExampleService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val bulk: BulkService by lazy { BulkServiceImpl(clientOptions) } @@ -42,237 +40,120 @@ constructor( override fun upload(): UploadService = upload - private val createHandler: - Handler< - Example - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new example. */ - override fun create( - params: ExampleCreateParams, - requestOptions: RequestOptions - ): Example { // templates/JavaSDK/services.ts:831:10 + override fun create(params: ExampleCreateParams, requestOptions: RequestOptions): Example { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("examples") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - Example - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific example. */ - override fun retrieve( - params: ExampleRetrieveParams, - requestOptions: RequestOptions - ): Example { // templates/JavaSDK/services.ts:831:10 + override fun retrieve(params: ExampleRetrieveParams, requestOptions: RequestOptions): Example { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("examples", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - ExampleUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Update a specific example. */ override fun update( params: ExampleUpdateParams, requestOptions: RequestOptions - ): ExampleUpdateResponse { // templates/JavaSDK/services.ts:831:10 + ): ExampleUpdateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("examples", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { updateHandler.handle(it) } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all examples by query params */ - override fun list( - params: ExampleListParams, - requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + override fun list(params: ExampleListParams, requestOptions: RequestOptions): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("examples") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - ExampleDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a specific set of examples. */ override fun delete( params: ExampleDeleteParams, requestOptions: RequestOptions - ): ExampleDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): ExampleDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("examples") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigService.kt index 7761c724..5f1ee7ad 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,20 +9,17 @@ import com.langsmith.api.models.FeedbackConfigCreateParams import com.langsmith.api.models.FeedbackConfigListParams import com.langsmith.api.models.FeedbackConfigSchema -interface FeedbackConfigService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackConfigService { /** Create Feedback Config Endpoint */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: FeedbackConfigCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): FeedbackConfigSchema /** List Feedback Configs Endpoint */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: FeedbackConfigListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceImpl.kt index f7b59703..5bb326ca 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -19,68 +19,39 @@ import com.langsmith.api.services.withErrorHandler class FeedbackConfigServiceImpl constructor( private val clientOptions: ClientOptions, -) : FeedbackConfigService { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : FeedbackConfigService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - FeedbackConfigSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create Feedback Config Endpoint */ override fun create( params: FeedbackConfigCreateParams, requestOptions: RequestOptions - ): FeedbackConfigSchema { // templates/JavaSDK/services.ts:831:10 + ): FeedbackConfigSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("feedback-configs", "") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -88,38 +59,20 @@ constructor( override fun list( params: FeedbackConfigListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("feedback-configs", "") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackService.kt index ef2cb271..7da63d17 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -14,41 +14,38 @@ import com.langsmith.api.models.FeedbackRetrieveParams import com.langsmith.api.models.FeedbackSchema import com.langsmith.api.models.FeedbackUpdateParams -interface FeedbackService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackService { /** Create a new feedback. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: FeedbackCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): FeedbackSchema /** Get a specific feedback. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: FeedbackRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): FeedbackSchema /** Replace an existing feedback entry with a new, modified entry. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: FeedbackUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): FeedbackSchema /** List all Feedback by query params. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: FeedbackListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete a feedback. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: FeedbackDeleteParams, requestOptions: RequestOptions = RequestOptions.none() @@ -60,7 +57,7 @@ interface FeedbackService { // templates/JavaSDK/services.ts:55:15 // * This method is invoked under the assumption that the run is already visible in the app, thus * already present in DB */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun eager( params: FeedbackEagerParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackServiceImpl.kt index de645f32..fb942bf6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/FeedbackServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -24,261 +24,143 @@ import com.langsmith.api.services.withErrorHandler class FeedbackServiceImpl constructor( private val clientOptions: ClientOptions, -) : FeedbackService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : FeedbackService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new feedback. */ override fun create( params: FeedbackCreateParams, requestOptions: RequestOptions - ): FeedbackSchema { // templates/JavaSDK/services.ts:831:10 + ): FeedbackSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("feedback") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific feedback. */ override fun retrieve( params: FeedbackRetrieveParams, requestOptions: RequestOptions - ): FeedbackSchema { // templates/JavaSDK/services.ts:831:10 + ): FeedbackSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("feedback", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Replace an existing feedback entry with a new, modified entry. */ override fun update( params: FeedbackUpdateParams, requestOptions: RequestOptions - ): FeedbackSchema { // templates/JavaSDK/services.ts:831:10 + ): FeedbackSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("feedback", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** List all Feedback by query params. */ override fun list( params: FeedbackListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("feedback") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - FeedbackDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a feedback. */ override fun delete( params: FeedbackDeleteParams, requestOptions: RequestOptions - ): FeedbackDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): FeedbackDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("feedback", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } - private val eagerHandler: - Handler< - FeedbackSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val eagerHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** @@ -290,39 +172,21 @@ constructor( override fun eager( params: FeedbackEagerParams, requestOptions: RequestOptions - ): FeedbackSchema { // templates/JavaSDK/services.ts:831:10 + ): FeedbackSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("feedback", "eager") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - eagerHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { eagerHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoService.kt index d3d31d51..93399b83 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.InfoGetResponse import com.langsmith.api.models.InfoRetrieveParams -interface InfoService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface InfoService { /** Get information about the current deployment of LangSmith. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: InfoRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoServiceImpl.kt index 11ef83c8..5b7fd1a9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/InfoServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -17,55 +17,31 @@ import com.langsmith.api.services.withErrorHandler class InfoServiceImpl constructor( private val clientOptions: ClientOptions, -) : InfoService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : InfoService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - InfoGetResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get information about the current deployment of LangSmith. */ override fun retrieve( params: InfoRetrieveParams, requestOptions: RequestOptions - ): InfoGetResponse { // templates/JavaSDK/services.ts:831:10 + ): InfoGetResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("info") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkService.kt index 9126af09..bdecdee7 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,12 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.OkRetrieveParams import com.langsmith.api.models.OkRetrieveResponse -interface OkService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 +interface OkService { /** Ok */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: OkRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkServiceImpl.kt index 99a33c09..a6a3d830 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/OkServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -17,48 +17,28 @@ import com.langsmith.api.services.withErrorHandler class OkServiceImpl constructor( private val clientOptions: ClientOptions, -) : OkService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : OkService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - OkRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Ok */ override fun retrieve( params: OkRetrieveParams, requestOptions: RequestOptions - ): OkRetrieveResponse { // templates/JavaSDK/services.ts:831:10 + ): OkRetrieveResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("ok") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicService.kt index 4d258e7a..0707ebae 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -10,11 +10,9 @@ import com.langsmith.api.services.blocking.public_.FeedbackService import com.langsmith.api.services.blocking.public_.LatestRunService import com.langsmith.api.services.blocking.public_.RunService -interface PublicService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface PublicService { - fun runs(): RunService // templates/JavaSDK/services.ts:55:15 + fun runs(): RunService fun latestRun(): LatestRunService diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicServiceImpl.kt index e7b333dd..2aa9d6c4 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/PublicServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -20,11 +20,9 @@ import com.langsmith.api.services.errorHandler class PublicServiceImpl constructor( private val clientOptions: ClientOptions, -) : PublicService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : PublicService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val runs: RunService by lazy { RunServiceImpl(clientOptions) } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestService.kt index 1a727bc3..606f4c27 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.RunManifestRetrieveParams import com.langsmith.api.models.RunManifestSchema -interface RunManifestService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface RunManifestService { /** Get a specific run manifest. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: RunManifestRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestServiceImpl.kt index 3ad40b6b..51f5b55e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunManifestServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -17,56 +17,31 @@ import com.langsmith.api.services.withErrorHandler class RunManifestServiceImpl constructor( private val clientOptions: ClientOptions, -) : RunManifestService { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : RunManifestService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - RunManifestSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific run manifest. */ override fun retrieve( params: RunManifestRetrieveParams, requestOptions: RequestOptions - ): RunManifestSchema { // templates/JavaSDK/services.ts:831:10 + ): RunManifestSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("run-manifests", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunService.kt index 213e35af..7875cc5a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -19,10 +19,9 @@ import com.langsmith.api.services.blocking.runs.QueryService import com.langsmith.api.services.blocking.runs.ShareService import com.langsmith.api.services.blocking.runs.StatService -interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 +interface RunService { - fun share(): ShareService // templates/JavaSDK/services.ts:55:15 + fun share(): ShareService fun query(): QueryService @@ -33,28 +32,28 @@ interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaS fun monitor(): MonitorService /** Create a new run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): RunCreateResponse /** Get a specific run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: RunRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): RunSchema /** Update a run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: RunUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): RunUpdateResponse /** Batch ingest runs. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun batch( params: RunBatchParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunServiceImpl.kt index 2a585898..6f2f99fa 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/RunServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -34,11 +34,9 @@ import com.langsmith.api.services.withErrorHandler class RunServiceImpl constructor( private val clientOptions: ClientOptions, -) : RunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : RunService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val share: ShareService by lazy { ShareServiceImpl(clientOptions) } @@ -62,190 +60,90 @@ constructor( override fun monitor(): MonitorService = monitor - private val createHandler: - Handler< - RunCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new run. */ override fun create( params: RunCreateParams, requestOptions: RequestOptions - ): RunCreateResponse { // templates/JavaSDK/services.ts:831:10 + ): RunCreateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { createHandler.handle(it) } } } - private val retrieveHandler: - Handler< - RunSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific run. */ - override fun retrieve( - params: RunRetrieveParams, - requestOptions: RequestOptions - ): RunSchema { // templates/JavaSDK/services.ts:831:10 + override fun retrieve(params: RunRetrieveParams, requestOptions: RequestOptions): RunSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("runs", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - RunUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Update a run. */ override fun update( params: RunUpdateParams, requestOptions: RequestOptions - ): RunUpdateResponse { // templates/JavaSDK/services.ts:831:10 + ): RunUpdateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("runs", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { updateHandler.handle(it) } } } - private val batchHandler: - Handler< - RunBatchResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val batchHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Batch ingest runs. */ - override fun batch( - params: RunBatchParams, - requestOptions: RequestOptions - ): RunBatchResponse { // templates/JavaSDK/services.ts:831:10 + override fun batch(params: RunBatchParams, requestOptions: RequestOptions): RunBatchResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "batch") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - batchHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { batchHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionService.kt index 2510a1cf..d6018b31 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -15,42 +15,40 @@ import com.langsmith.api.models.TracerSession import com.langsmith.api.models.TracerSessionWithoutVirtualFields import com.langsmith.api.services.blocking.sessions.MetadataService -interface SessionService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface SessionService { - fun metadata(): MetadataService // templates/JavaSDK/services.ts:55:15 + fun metadata(): MetadataService /** Create a new session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: SessionCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): TracerSessionWithoutVirtualFields /** Get a specific session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: SessionRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): TracerSession /** Create a new session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: SessionUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): TracerSessionWithoutVirtualFields /** Get all sessions. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: SessionListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete a specific session. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: SessionDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionServiceImpl.kt index 5435c828..0ef2f43e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/SessionServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -26,21 +26,15 @@ import com.langsmith.api.services.withErrorHandler class SessionServiceImpl constructor( private val clientOptions: ClientOptions, -) : SessionService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : SessionService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val metadata: MetadataService by lazy { MetadataServiceImpl(clientOptions) } override fun metadata(): MetadataService = metadata - private val createHandler: - Handler< - TracerSessionWithoutVirtualFields - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -48,99 +42,55 @@ constructor( override fun create( params: SessionCreateParams, requestOptions: RequestOptions - ): TracerSessionWithoutVirtualFields { // templates/JavaSDK/services.ts:831:10 + ): TracerSessionWithoutVirtualFields { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("sessions") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val retrieveHandler: - Handler< - TracerSession - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get a specific session. */ override fun retrieve( params: SessionRetrieveParams, requestOptions: RequestOptions - ): TracerSession { // templates/JavaSDK/services.ts:831:10 + ): TracerSession { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("sessions", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - TracerSessionWithoutVirtualFields - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -148,137 +98,73 @@ constructor( override fun update( params: SessionUpdateParams, requestOptions: RequestOptions - ): TracerSessionWithoutVirtualFields { // templates/JavaSDK/services.ts:831:10 + ): TracerSessionWithoutVirtualFields { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments("sessions", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all sessions. */ override fun list( params: SessionListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("sessions") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - SessionDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Delete a specific session. */ override fun delete( params: SessionDeleteParams, requestOptions: RequestOptions - ): SessionDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): SessionDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("sessions") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantService.kt index 6de074a3..59f5611c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -19,11 +19,9 @@ import com.langsmith.api.services.blocking.tenants.MemberService import com.langsmith.api.services.blocking.tenants.PendingService import com.langsmith.api.services.blocking.tenants.UsageLimitService -interface TenantService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface TenantService { - fun pending(): PendingService // templates/JavaSDK/services.ts:55:15 + fun pending(): PendingService fun current(): CurrentService @@ -32,35 +30,35 @@ interface TenantService { // templates/JavaSDK/services.ts:55:15 // fun usageLimits(): UsageLimitService /** Create a new tenant. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: TenantCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): Tenant /** Get all tenants visible to this auth */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: TenantListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete Pending Tenant Invite */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun pendingDelete( params: TenantPendingDeleteParams, requestOptions: RequestOptions = RequestOptions.none() ): TenantPendingDeleteResponse /** Get all tenants visible to this auth */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun pendingList( params: TenantPendingListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Get Current Tenant Stats */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun statsList( params: TenantStatsListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantServiceImpl.kt index 80979648..5c4206f6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/TenantServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -33,11 +33,9 @@ import com.langsmith.api.services.withErrorHandler class TenantServiceImpl constructor( private val clientOptions: ClientOptions, -) : TenantService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : TenantService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val pending: PendingService by lazy { PendingServiceImpl(clientOptions) } @@ -55,110 +53,59 @@ constructor( override fun usageLimits(): UsageLimitService = usageLimits - private val createHandler: - Handler< - Tenant - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new tenant. */ - override fun create( - params: TenantCreateParams, - requestOptions: RequestOptions - ): Tenant { // templates/JavaSDK/services.ts:831:10 + override fun create(params: TenantCreateParams, requestOptions: RequestOptions): Tenant { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("tenants") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all tenants visible to this auth */ override fun list( params: TenantListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val pendingDeleteHandler: - Handler< - TenantPendingDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val pendingDeleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -166,133 +113,69 @@ constructor( override fun pendingDelete( params: TenantPendingDeleteParams, requestOptions: RequestOptions - ): TenantPendingDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): TenantPendingDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("tenants", "pending", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - pendingDeleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { pendingDeleteHandler.handle(it) } } } - private val pendingListHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val pendingListHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all tenants visible to this auth */ override fun pendingList( params: TenantPendingListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "pending") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - pendingListHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { pendingListHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val statsListHandler: - Handler< - TenantStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val statsListHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Stats */ override fun statsList( params: TenantStatsListParams, requestOptions: RequestOptions - ): TenantStats { // templates/JavaSDK/services.ts:831:10 + ): TenantStats { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "stats") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - statsListHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { statsListHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueService.kt index 1e32fab5..6341a3b4 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.AnnotationQueueQueueListParams import com.langsmith.api.models.AnnotationQueueSchema -interface QueueService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueueService { /** Get Annotation Queues For Run */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: AnnotationQueueQueueListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceImpl.kt index c25a121c..169a7a7a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.annotationQueues @@ -17,17 +17,11 @@ import com.langsmith.api.services.withErrorHandler class QueueServiceImpl constructor( private val clientOptions: ClientOptions, -) : QueueService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : QueueService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -35,38 +29,20 @@ constructor( override fun list( params: AnnotationQueueQueueListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues", params.getPathParam(0), "queues") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunService.kt index d19a0193..affbb50e 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -14,33 +14,31 @@ import com.langsmith.api.models.AnnotationQueueRunUpdateParams import com.langsmith.api.models.AnnotationQueueRunUpdateResponse import com.langsmith.api.models.RunSchemaWithAnnotationQueueInfo -interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 +interface RunService { /** Add Runs To Annotation Queue */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: AnnotationQueueRunCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Update Run In Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: AnnotationQueueRunUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): AnnotationQueueRunUpdateResponse /** Get Runs From Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: AnnotationQueueRunListParams, requestOptions: RequestOptions = RequestOptions.none() ): List /** Delete Run From Annotation Queue */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: AnnotationQueueRunDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceImpl.kt index 3e79e2b5..444c30d3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.annotationQueues @@ -24,17 +24,11 @@ import com.langsmith.api.services.withErrorHandler class RunServiceImpl constructor( private val clientOptions: ClientOptions, -) : RunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : RunService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -42,50 +36,28 @@ constructor( override fun create( params: AnnotationQueueRunCreateParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("annotation-queues", params.getPathParam(0), "runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val updateHandler: - Handler< - AnnotationQueueRunUpdateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -93,18 +65,10 @@ constructor( override fun update( params: AnnotationQueueRunUpdateParams, requestOptions: RequestOptions - ): AnnotationQueueRunUpdateResponse { // templates/JavaSDK/services.ts:831:10 + ): AnnotationQueueRunUpdateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PATCH - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PATCH) .addPathSegments( "annotation-queues", params.getPathParam(0), @@ -116,22 +80,12 @@ constructor( .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { updateHandler.handle(it) } } } - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler> = jsonHandler>(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -139,49 +93,27 @@ constructor( override fun list( params: AnnotationQueueRunListParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("annotation-queues", params.getPathParam(0), "runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } } } - private val deleteHandler: - Handler< - AnnotationQueueRunDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -189,18 +121,10 @@ constructor( override fun delete( params: AnnotationQueueRunDeleteParams, requestOptions: RequestOptions - ): AnnotationQueueRunDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): AnnotationQueueRunDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments( "annotation-queues", params.getPathParam(0), @@ -210,22 +134,10 @@ constructor( .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvService.kt index ef3ec20a..afc67b9b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,12 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.DatasetCsvRetrieveParams import com.langsmith.api.models.DatasetCsvRetrieveResponse -interface CsvService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 +interface CsvService { /** Download a dataset as CSV format. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetCsvRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceImpl.kt index e9b2f548..789ed75b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -17,17 +17,11 @@ import com.langsmith.api.services.withErrorHandler class CsvServiceImpl constructor( private val clientOptions: ClientOptions, -) : CsvService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : CsvService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetCsvRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -35,31 +29,17 @@ constructor( override fun retrieve( params: DatasetCsvRetrieveParams, requestOptions: RequestOptions - ): DatasetCsvRetrieveResponse { // templates/JavaSDK/services.ts:831:10 + ): DatasetCsvRetrieveResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "csv") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtService.kt index dcfb85b0..d6bad1a8 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.DatasetOpenAIFtRetrieveParams import com.langsmith.api.models.DatasetOpenAIFtRetrieveResponse -interface OpenAIFtService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface OpenAIFtService { /** Download a dataset as OpenAI Jsonl format. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetOpenAIFtRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceImpl.kt index b1e56020..b882c4a3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -17,17 +17,11 @@ import com.langsmith.api.services.withErrorHandler class OpenAIFtServiceImpl constructor( private val clientOptions: ClientOptions, -) : OpenAIFtService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : OpenAIFtService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetOpenAIFtRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -35,31 +29,17 @@ constructor( override fun retrieve( params: DatasetOpenAIFtRetrieveParams, requestOptions: RequestOptions - ): DatasetOpenAIFtRetrieveResponse { // templates/JavaSDK/services.ts:831:10 + ): DatasetOpenAIFtRetrieveResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "openai_ft") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIService.kt index 550c2eb0..fd6e2195 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.DatasetOpenAIRetrieveParams import com.langsmith.api.models.DatasetOpenAIRetrieveResponse -interface OpenAIService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface OpenAIService { /** Download a dataset as OpenAI Evals Jsonl format. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetOpenAIRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceImpl.kt index 8f1cc9c4..71bd2fbe 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -17,17 +17,11 @@ import com.langsmith.api.services.withErrorHandler class OpenAIServiceImpl constructor( private val clientOptions: ClientOptions, -) : OpenAIService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : OpenAIService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetOpenAIRetrieveResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -35,31 +29,17 @@ constructor( override fun retrieve( params: DatasetOpenAIRetrieveParams, requestOptions: RequestOptions - ): DatasetOpenAIRetrieveResponse { // templates/JavaSDK/services.ts:831:10 + ): DatasetOpenAIRetrieveResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "openai") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { retrieveHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunService.kt index 88a01f73..cb2fbdca 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,14 +8,13 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.DatasetRunCreateParams import com.langsmith.api.models.DatasetRunCreateResponse -interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 +interface RunService { /** - * // templates/JavaSDK/services.ts:55:15 Fetch examples for a dataset, and fetch the runs for - * each example if they are associated with the given session_ids. + * Fetch examples for a dataset, and fetch the runs for each example if they are associated with + * the given session_ids. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: DatasetRunCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceImpl.kt index f5bfb85a..93c2a3f0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -18,17 +18,11 @@ import com.langsmith.api.services.withErrorHandler class RunServiceImpl constructor( private val clientOptions: ClientOptions, -) : RunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : RunService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - DatasetRunCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -39,39 +33,21 @@ constructor( override fun create( params: DatasetRunCreateParams, requestOptions: RequestOptions - ): DatasetRunCreateResponse { // templates/JavaSDK/services.ts:831:10 + ): DatasetRunCreateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("datasets", params.getPathParam(0), "runs") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareService.kt index 0c3f8eaf..c0d7064d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,20 +9,17 @@ import com.langsmith.api.models.DatasetShareRetrieveParams import com.langsmith.api.models.DatasetShareSchema import com.langsmith.api.models.DatasetShareUpdateParams -interface ShareService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ShareService { /** Get the state of sharing of a run. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: DatasetShareRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): DatasetShareSchema /** Share a dataset. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: DatasetShareUpdateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceImpl.kt index 051c782e..7130e703 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -19,111 +19,59 @@ import com.langsmith.api.services.withErrorHandler class ShareServiceImpl constructor( private val clientOptions: ClientOptions, -) : ShareService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ShareService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - DatasetShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get the state of sharing of a run. */ override fun retrieve( params: DatasetShareRetrieveParams, requestOptions: RequestOptions - ): DatasetShareSchema { // templates/JavaSDK/services.ts:831:10 + ): DatasetShareSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("datasets", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - DatasetShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Share a dataset. */ override fun update( params: DatasetShareUpdateParams, requestOptions: RequestOptions - ): DatasetShareSchema { // templates/JavaSDK/services.ts:831:10 + ): DatasetShareSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PUT - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PUT) .addPathSegments("datasets", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkService.kt index 2acf0ecb..598076b4 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.Example import com.langsmith.api.models.ExampleBulkCreateParams -interface BulkService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface BulkService { /** Create a new example. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ExampleBulkCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceImpl.kt index 795a0dca..8e9848f9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.examples @@ -18,56 +18,32 @@ import com.langsmith.api.services.withErrorHandler class BulkServiceImpl constructor( private val clientOptions: ClientOptions, -) : BulkService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : BulkService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new example. */ override fun create( params: ExampleBulkCreateParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("examples", "bulk") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadService.kt index 4c1bd5be..bcd01585 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.Example import com.langsmith.api.models.ExampleUploadCreateParams -interface UploadService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface UploadService { /** Create a new example. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: ExampleUploadCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceImpl.kt index bde56767..6289eaa5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.examples @@ -18,56 +18,32 @@ import com.langsmith.api.services.withErrorHandler class UploadServiceImpl constructor( private val clientOptions: ClientOptions, -) : UploadService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : UploadService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler> = jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Create a new example. */ override fun create( params: ExampleUploadCreateParams, requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 + ): List { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("examples", "upload", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { forEach { it.validate() } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/DatasetService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/DatasetService.kt new file mode 100644 index 00000000..1ade753e --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/DatasetService.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.DatasetPublicSchema +import com.langsmith.api.models.PublicDatasetListParams +import com.langsmith.api.services.blocking.public.datasets.FeedbackService +import com.langsmith.api.services.blocking.public.datasets.RunService +import com.langsmith.api.services.blocking.public.datasets.SessionService + +interface DatasetService { + + fun sessions(): SessionService + + fun runs(): RunService + + fun feedback(): FeedbackService + + /** Get dataset by ids or the shared dataset if not specifed. */ + @JvmOverloads + fun list( + params: PublicDatasetListParams, + requestOptions: RequestOptions = RequestOptions.none() + ): DatasetPublicSchema +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/DatasetServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/DatasetServiceImpl.kt new file mode 100644 index 00000000..0b69fabf --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/DatasetServiceImpl.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.DatasetPublicSchema +import com.langsmith.api.models.PublicDatasetListParams +import com.langsmith.api.services.blocking.public.datasets.FeedbackService +import com.langsmith.api.services.blocking.public.datasets.FeedbackServiceImpl +import com.langsmith.api.services.blocking.public.datasets.RunService +import com.langsmith.api.services.blocking.public.datasets.RunServiceImpl +import com.langsmith.api.services.blocking.public.datasets.SessionService +import com.langsmith.api.services.blocking.public.datasets.SessionServiceImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class DatasetServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : DatasetService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val sessions: SessionService by lazy { SessionServiceImpl(clientOptions) } + + private val runs: RunService by lazy { RunServiceImpl(clientOptions) } + + private val feedback: FeedbackService by lazy { FeedbackServiceImpl(clientOptions) } + + override fun sessions(): SessionService = sessions + + override fun runs(): RunService = runs + + override fun feedback(): FeedbackService = feedback + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get dataset by ids or the shared dataset if not specifed. */ + override fun list( + params: PublicDatasetListParams, + requestOptions: RequestOptions + ): DatasetPublicSchema { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "datasets") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/ExampleService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/ExampleService.kt new file mode 100644 index 00000000..3d2eeff3 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/ExampleService.kt @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.Example +import com.langsmith.api.models.PublicExampleListParams +import com.langsmith.api.services.blocking.public.examples.RunService + +interface ExampleService { + + fun runs(): RunService + + /** Get example by ids or the shared example if not specifed. */ + @JvmOverloads + fun list( + params: PublicExampleListParams, + requestOptions: RequestOptions = RequestOptions.none() + ): List +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/ExampleServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/ExampleServiceImpl.kt new file mode 100644 index 00000000..076863a9 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/ExampleServiceImpl.kt @@ -0,0 +1,56 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.Example +import com.langsmith.api.models.PublicExampleListParams +import com.langsmith.api.services.blocking.public.examples.RunService +import com.langsmith.api.services.blocking.public.examples.RunServiceImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class ExampleServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : ExampleService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val runs: RunService by lazy { RunServiceImpl(clientOptions) } + + override fun runs(): RunService = runs + + private val listHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get example by ids or the shared example if not specifed. */ + override fun list( + params: PublicExampleListParams, + requestOptions: RequestOptions + ): List { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "examples") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/FeedbackService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/FeedbackService.kt similarity index 50% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/FeedbackService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/FeedbackService.kt index f87ccb7c..47f8d527 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/FeedbackService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/FeedbackService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_ +package com.langsmith.api.services.blocking.public import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.FeedbackSchema import com.langsmith.api.models.PublicFeedbackListParams -interface FeedbackService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackService { /** Read Shared Feedbacks */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: PublicFeedbackListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/FeedbackServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/FeedbackServiceImpl.kt new file mode 100644 index 00000000..ac761359 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/FeedbackServiceImpl.kt @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.FeedbackSchema +import com.langsmith.api.models.PublicFeedbackListParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class FeedbackServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : FeedbackService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val listHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Read Shared Feedbacks */ + override fun list( + params: PublicFeedbackListParams, + requestOptions: RequestOptions + ): List { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "feedbacks") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/LatestRunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/LatestRunService.kt similarity index 51% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/LatestRunService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/LatestRunService.kt index 810ff09c..b72d8b36 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/LatestRunService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/LatestRunService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_ +package com.langsmith.api.services.blocking.public import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.PublicLatestRunRetrieveParams import com.langsmith.api.models.RunPublicSchema -interface LatestRunService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface LatestRunService { /** Get the shared run. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: PublicLatestRunRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/LatestRunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/LatestRunServiceImpl.kt new file mode 100644 index 00000000..7afd85a8 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/LatestRunServiceImpl.kt @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicLatestRunRetrieveParams +import com.langsmith.api.models.RunPublicSchema +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class LatestRunServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : LatestRunService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get the shared run. */ + override fun retrieve( + params: PublicLatestRunRetrieveParams, + requestOptions: RequestOptions + ): RunPublicSchema { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "run") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/RunService.kt new file mode 100644 index 00000000..f0d99f92 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/RunService.kt @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.PublicRunRetrieveParams +import com.langsmith.api.models.RunPublicSchema +import com.langsmith.api.services.blocking.public.runs.QueryService + +interface RunService { + + fun query(): QueryService + + /** Get the shared run. */ + @JvmOverloads + fun retrieve( + params: PublicRunRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none() + ): RunPublicSchema +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/RunServiceImpl.kt new file mode 100644 index 00000000..3fa01041 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/RunServiceImpl.kt @@ -0,0 +1,56 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicRunRetrieveParams +import com.langsmith.api.models.RunPublicSchema +import com.langsmith.api.services.blocking.public.runs.QueryService +import com.langsmith.api.services.blocking.public.runs.QueryServiceImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class RunServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : RunService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val query: QueryService by lazy { QueryServiceImpl(clientOptions) } + + override fun query(): QueryService = query + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get the shared run. */ + override fun retrieve( + params: PublicRunRetrieveParams, + requestOptions: RequestOptions + ): RunPublicSchema { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "run", params.getPathParam(1)) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackService.kt similarity index 54% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackService.kt index 35abfd27..9459f8ca 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_.datasets +package com.langsmith.api.services.blocking.public.datasets import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.FeedbackSchema import com.langsmith.api.models.PublicDatasetFeedbackRetrieveParams -interface FeedbackService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface FeedbackService { /** Get feedback for runs in projects run over a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: PublicDatasetFeedbackRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackServiceImpl.kt new file mode 100644 index 00000000..e0537686 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackServiceImpl.kt @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.FeedbackSchema +import com.langsmith.api.models.PublicDatasetFeedbackRetrieveParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class FeedbackServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : FeedbackService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val retrieveHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get feedback for runs in projects run over a dataset that has been shared. */ + override fun retrieve( + params: PublicDatasetFeedbackRetrieveParams, + requestOptions: RequestOptions + ): List { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "datasets", "feedback") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/RunService.kt new file mode 100644 index 00000000..5f96f56c --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/RunService.kt @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.PublicDatasetRunRetrieveParams +import com.langsmith.api.models.RunPublicDatasetSchema +import com.langsmith.api.services.blocking.public.datasets.runs.QueryService +import com.langsmith.api.services.blocking.public.datasets.runs.StatService + +interface RunService { + + fun query(): QueryService + + fun stats(): StatService + + /** Get runs in projects run over a dataset that has been shared. */ + @JvmOverloads + fun retrieve( + params: PublicDatasetRunRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none() + ): RunPublicDatasetSchema +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/RunServiceImpl.kt new file mode 100644 index 00000000..71001464 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/RunServiceImpl.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicDatasetRunRetrieveParams +import com.langsmith.api.models.RunPublicDatasetSchema +import com.langsmith.api.services.blocking.public.datasets.runs.QueryService +import com.langsmith.api.services.blocking.public.datasets.runs.QueryServiceImpl +import com.langsmith.api.services.blocking.public.datasets.runs.StatService +import com.langsmith.api.services.blocking.public.datasets.runs.StatServiceImpl +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class RunServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : RunService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val query: QueryService by lazy { QueryServiceImpl(clientOptions) } + + private val stats: StatService by lazy { StatServiceImpl(clientOptions) } + + override fun query(): QueryService = query + + override fun stats(): StatService = stats + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get runs in projects run over a dataset that has been shared. */ + override fun retrieve( + params: PublicDatasetRunRetrieveParams, + requestOptions: RequestOptions + ): RunPublicDatasetSchema { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments( + "public", + params.getPathParam(0), + "datasets", + "runs", + params.getPathParam(1) + ) + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionService.kt similarity index 52% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionService.kt index 809240da..67cd886b 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_.datasets +package com.langsmith.api.services.blocking.public.datasets import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.PublicDatasetSessionListParams import com.langsmith.api.models.TracerSession -interface SessionService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface SessionService { /** Get projects run on a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: PublicDatasetSessionListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionServiceImpl.kt new file mode 100644 index 00000000..75ad5bfd --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionServiceImpl.kt @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicDatasetSessionListParams +import com.langsmith.api.models.TracerSession +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class SessionServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : SessionService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val listHandler: Handler> = + jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get projects run on a dataset that has been shared. */ + override fun list( + params: PublicDatasetSessionListParams, + requestOptions: RequestOptions + ): List { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .addPathSegments("public", params.getPathParam(0), "datasets", "sessions") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + forEach { it.validate() } + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryService.kt similarity index 54% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryService.kt index 9067b2eb..a6e90eba 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_.datasets.runs +package com.langsmith.api.services.blocking.public.datasets.runs import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.ListPublicDatasetRunsResponse import com.langsmith.api.models.PublicDatasetRunQueryCreateParams -interface QueryService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueryService { /** Get runs in projects run over a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: PublicDatasetRunQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryServiceImpl.kt new file mode 100644 index 00000000..29080b8c --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryServiceImpl.kt @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets.runs + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.ListPublicDatasetRunsResponse +import com.langsmith.api.models.PublicDatasetRunQueryCreateParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class QueryServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : QueryService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Get runs in projects run over a dataset that has been shared. */ + override fun create( + params: PublicDatasetRunQueryCreateParams, + requestOptions: RequestOptions + ): ListPublicDatasetRunsResponse { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "query") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatService.kt similarity index 52% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatService.kt index 3a8359a3..15c783e5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_.datasets.runs +package com.langsmith.api.services.blocking.public.datasets.runs import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.PublicDatasetRunStatCreateParams import com.langsmith.api.models.RunStats -interface StatService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface StatService { /** Get run stats in projects run over a dataset that has been shared. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: PublicDatasetRunStatCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatServiceImpl.kt new file mode 100644 index 00000000..7213869f --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatServiceImpl.kt @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets.runs + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicDatasetRunStatCreateParams +import com.langsmith.api.models.RunStats +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class StatServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : StatService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get run stats in projects run over a dataset that has been shared. */ + override fun create( + params: PublicDatasetRunStatCreateParams, + requestOptions: RequestOptions + ): RunStats { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "stats") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/examples/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/examples/RunService.kt new file mode 100644 index 00000000..dab439e3 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/examples/RunService.kt @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. + +@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 + +package com.langsmith.api.services.blocking.public.examples + +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.models.PublicExampleRunCreateParams +import com.langsmith.api.models.PublicExampleRunCreateResponse + +interface RunService { + + /** Get examples with associated runs from sessions in a dataset that has been shared. */ + @JvmOverloads + fun create( + params: PublicExampleRunCreateParams, + requestOptions: RequestOptions = RequestOptions.none() + ): PublicExampleRunCreateResponse +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/examples/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/examples/RunServiceImpl.kt new file mode 100644 index 00000000..109bf827 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/examples/RunServiceImpl.kt @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.examples + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.PublicExampleRunCreateParams +import com.langsmith.api.models.PublicExampleRunCreateResponse +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class RunServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : RunService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Get examples with associated runs from sessions in a dataset that has been shared. */ + override fun create( + params: PublicExampleRunCreateParams, + requestOptions: RequestOptions + ): PublicExampleRunCreateResponse { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "examples", "runs") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/runs/QueryService.kt similarity index 53% rename from langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryService.kt rename to langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/runs/QueryService.kt index 8beb72d6..1c78ea99 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/runs/QueryService.kt @@ -1,20 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 -package com.langsmith.api.services.blocking.public_.runs +package com.langsmith.api.services.blocking.public.runs import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.ListPublicRunsResponse import com.langsmith.api.models.PublicRunQueryCreateParams -interface QueryService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueryService { /** Get run by ids or the shared run if not specifed. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: PublicRunQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/runs/QueryServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/runs/QueryServiceImpl.kt new file mode 100644 index 00000000..8a1057d7 --- /dev/null +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public/runs/QueryServiceImpl.kt @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.runs + +import com.langsmith.api.core.ClientOptions +import com.langsmith.api.core.RequestOptions +import com.langsmith.api.core.http.HttpMethod +import com.langsmith.api.core.http.HttpRequest +import com.langsmith.api.core.http.HttpResponse.Handler +import com.langsmith.api.errors.LangSmithError +import com.langsmith.api.models.ListPublicRunsResponse +import com.langsmith.api.models.PublicRunQueryCreateParams +import com.langsmith.api.services.errorHandler +import com.langsmith.api.services.json +import com.langsmith.api.services.jsonHandler +import com.langsmith.api.services.withErrorHandler + +class QueryServiceImpl +constructor( + private val clientOptions: ClientOptions, +) : QueryService { + + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** Get run by ids or the shared run if not specifed. */ + override fun create( + params: PublicRunQueryCreateParams, + requestOptions: RequestOptions + ): ListPublicRunsResponse { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("public", params.getPathParam(0), "runs", "query") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } +} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/DatasetService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/DatasetService.kt deleted file mode 100644 index d503f539..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/DatasetService.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.DatasetPublicSchema -import com.langsmith.api.models.PublicDatasetListParams -import com.langsmith.api.services.blocking.public_.datasets.FeedbackService -import com.langsmith.api.services.blocking.public_.datasets.RunService -import com.langsmith.api.services.blocking.public_.datasets.SessionService - -interface DatasetService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - fun sessions(): SessionService // templates/JavaSDK/services.ts:55:15 - - fun runs(): RunService - - fun feedback(): FeedbackService - - /** Get dataset by ids or the shared dataset if not specifed. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun list( - params: PublicDatasetListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): DatasetPublicSchema -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/DatasetServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/DatasetServiceImpl.kt deleted file mode 100644 index 8dc6c563..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/DatasetServiceImpl.kt +++ /dev/null @@ -1,92 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.DatasetPublicSchema -import com.langsmith.api.models.PublicDatasetListParams -import com.langsmith.api.services.blocking.public_.datasets.FeedbackService -import com.langsmith.api.services.blocking.public_.datasets.FeedbackServiceImpl -import com.langsmith.api.services.blocking.public_.datasets.RunService -import com.langsmith.api.services.blocking.public_.datasets.RunServiceImpl -import com.langsmith.api.services.blocking.public_.datasets.SessionService -import com.langsmith.api.services.blocking.public_.datasets.SessionServiceImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class DatasetServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : DatasetService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val sessions: SessionService by lazy { SessionServiceImpl(clientOptions) } - - private val runs: RunService by lazy { RunServiceImpl(clientOptions) } - - private val feedback: FeedbackService by lazy { FeedbackServiceImpl(clientOptions) } - - override fun sessions(): SessionService = sessions - - override fun runs(): RunService = runs - - override fun feedback(): FeedbackService = feedback - - private val listHandler: - Handler< - DatasetPublicSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get dataset by ids or the shared dataset if not specifed. */ - override fun list( - params: PublicDatasetListParams, - requestOptions: RequestOptions - ): DatasetPublicSchema { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/ExampleService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/ExampleService.kt deleted file mode 100644 index ed2549ab..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/ExampleService.kt +++ /dev/null @@ -1,24 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.Example -import com.langsmith.api.models.PublicExampleListParams -import com.langsmith.api.services.blocking.public_.examples.RunService - -interface ExampleService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 - - fun runs(): RunService // templates/JavaSDK/services.ts:55:15 - - /** Get example by ids or the shared example if not specifed. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun list( - params: PublicExampleListParams, - requestOptions: RequestOptions = RequestOptions.none() - ): List -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/ExampleServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/ExampleServiceImpl.kt deleted file mode 100644 index 0996a260..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/ExampleServiceImpl.kt +++ /dev/null @@ -1,80 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.Example -import com.langsmith.api.models.PublicExampleListParams -import com.langsmith.api.services.blocking.public_.examples.RunService -import com.langsmith.api.services.blocking.public_.examples.RunServiceImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class ExampleServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : ExampleService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val runs: RunService by lazy { RunServiceImpl(clientOptions) } - - override fun runs(): RunService = runs - - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get example by ids or the shared example if not specifed. */ - override fun list( - params: PublicExampleListParams, - requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "examples") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/FeedbackServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/FeedbackServiceImpl.kt deleted file mode 100644 index 9bb327f7..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/FeedbackServiceImpl.kt +++ /dev/null @@ -1,74 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.FeedbackSchema -import com.langsmith.api.models.PublicFeedbackListParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class FeedbackServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : FeedbackService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Read Shared Feedbacks */ - override fun list( - params: PublicFeedbackListParams, - requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "feedbacks") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/LatestRunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/LatestRunServiceImpl.kt deleted file mode 100644 index 224ee8b1..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/LatestRunServiceImpl.kt +++ /dev/null @@ -1,74 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicLatestRunRetrieveParams -import com.langsmith.api.models.RunPublicSchema -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class LatestRunServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : LatestRunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val retrieveHandler: - Handler< - RunPublicSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get the shared run. */ - override fun retrieve( - params: PublicLatestRunRetrieveParams, - requestOptions: RequestOptions - ): RunPublicSchema { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "run") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/RunService.kt deleted file mode 100644 index fd08099c..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/RunService.kt +++ /dev/null @@ -1,23 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.PublicRunRetrieveParams -import com.langsmith.api.models.RunPublicSchema -import com.langsmith.api.services.blocking.public_.runs.QueryService - -interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 - - fun query(): QueryService // templates/JavaSDK/services.ts:55:15 - - /** Get the shared run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun retrieve( - params: PublicRunRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() - ): RunPublicSchema -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/RunServiceImpl.kt deleted file mode 100644 index c4b201c0..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/RunServiceImpl.kt +++ /dev/null @@ -1,80 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicRunRetrieveParams -import com.langsmith.api.models.RunPublicSchema -import com.langsmith.api.services.blocking.public_.runs.QueryService -import com.langsmith.api.services.blocking.public_.runs.QueryServiceImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class RunServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : RunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val query: QueryService by lazy { QueryServiceImpl(clientOptions) } - - override fun query(): QueryService = query - - private val retrieveHandler: - Handler< - RunPublicSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get the shared run. */ - override fun retrieve( - params: PublicRunRetrieveParams, - requestOptions: RequestOptions - ): RunPublicSchema { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "run", params.getPathParam(1)) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackServiceImpl.kt deleted file mode 100644 index fe1e90ad..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackServiceImpl.kt +++ /dev/null @@ -1,74 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.FeedbackSchema -import com.langsmith.api.models.PublicDatasetFeedbackRetrieveParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class FeedbackServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : FeedbackService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val retrieveHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get feedback for runs in projects run over a dataset that has been shared. */ - override fun retrieve( - params: PublicDatasetFeedbackRetrieveParams, - requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "feedback") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunService.kt deleted file mode 100644 index 71b4e916..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunService.kt +++ /dev/null @@ -1,26 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.PublicDatasetRunRetrieveParams -import com.langsmith.api.models.RunPublicDatasetSchema -import com.langsmith.api.services.blocking.public_.datasets.runs.QueryService -import com.langsmith.api.services.blocking.public_.datasets.runs.StatService - -interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 - - fun query(): QueryService // templates/JavaSDK/services.ts:55:15 - - fun stats(): StatService - - /** Get runs in projects run over a dataset that has been shared. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun retrieve( - params: PublicDatasetRunRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() - ): RunPublicDatasetSchema -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunServiceImpl.kt deleted file mode 100644 index 2e423e84..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunServiceImpl.kt +++ /dev/null @@ -1,92 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicDatasetRunRetrieveParams -import com.langsmith.api.models.RunPublicDatasetSchema -import com.langsmith.api.services.blocking.public_.datasets.runs.QueryService -import com.langsmith.api.services.blocking.public_.datasets.runs.QueryServiceImpl -import com.langsmith.api.services.blocking.public_.datasets.runs.StatService -import com.langsmith.api.services.blocking.public_.datasets.runs.StatServiceImpl -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class RunServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : RunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val query: QueryService by lazy { QueryServiceImpl(clientOptions) } - - private val stats: StatService by lazy { StatServiceImpl(clientOptions) } - - override fun query(): QueryService = query - - override fun stats(): StatService = stats - - private val retrieveHandler: - Handler< - RunPublicDatasetSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get runs in projects run over a dataset that has been shared. */ - override fun retrieve( - params: PublicDatasetRunRetrieveParams, - requestOptions: RequestOptions - ): RunPublicDatasetSchema { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments( - "public", - params.getPathParam(0), - "datasets", - "runs", - params.getPathParam(1) - ) - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionServiceImpl.kt deleted file mode 100644 index 64f4cb3c..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionServiceImpl.kt +++ /dev/null @@ -1,74 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicDatasetSessionListParams -import com.langsmith.api.models.TracerSession -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class SessionServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : SessionService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val listHandler: - Handler< - List - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler>(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get projects run on a dataset that has been shared. */ - override fun list( - params: PublicDatasetSessionListParams, - requestOptions: RequestOptions - ): List { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "sessions") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - forEach { it.validate() } - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryServiceImpl.kt deleted file mode 100644 index 701934a1..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryServiceImpl.kt +++ /dev/null @@ -1,77 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets.runs - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.ListPublicDatasetRunsResponse -import com.langsmith.api.models.PublicDatasetRunQueryCreateParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class QueryServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : QueryService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - ListPublicDatasetRunsResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Get runs in projects run over a dataset that has been shared. */ - override fun create( - params: PublicDatasetRunQueryCreateParams, - requestOptions: RequestOptions - ): ListPublicDatasetRunsResponse { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "query") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatServiceImpl.kt deleted file mode 100644 index 35e69ed1..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatServiceImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets.runs - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicDatasetRunStatCreateParams -import com.langsmith.api.models.RunStats -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class StatServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : StatService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - RunStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get run stats in projects run over a dataset that has been shared. */ - override fun create( - params: PublicDatasetRunStatCreateParams, - requestOptions: RequestOptions - ): RunStats { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "datasets", "runs", "stats") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/examples/RunService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/examples/RunService.kt deleted file mode 100644 index cb656809..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/examples/RunService.kt +++ /dev/null @@ -1,23 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 - -package com.langsmith.api.services.blocking.public_.examples - -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.models.PublicExampleRunCreateParams -import com.langsmith.api.models.PublicExampleRunCreateResponse - -interface RunService { // templates/JavaSDK/services.ts:55:15 // templates/JavaSDK/services.ts:55:15 - // // templates/JavaSDK/services.ts:55:15 - - /** - * // templates/JavaSDK/services.ts:55:15 Get examples with associated runs from sessions in a - * dataset that has been shared. - */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 - fun create( - params: PublicExampleRunCreateParams, - requestOptions: RequestOptions = RequestOptions.none() - ): PublicExampleRunCreateResponse -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/examples/RunServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/examples/RunServiceImpl.kt deleted file mode 100644 index 0e990563..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/examples/RunServiceImpl.kt +++ /dev/null @@ -1,77 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.examples - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.PublicExampleRunCreateParams -import com.langsmith.api.models.PublicExampleRunCreateResponse -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class RunServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : RunService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - PublicExampleRunCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) - - /** Get examples with associated runs from sessions in a dataset that has been shared. */ - override fun create( - params: PublicExampleRunCreateParams, - requestOptions: RequestOptions - ): PublicExampleRunCreateResponse { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "examples", "runs") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryServiceImpl.kt deleted file mode 100644 index 1d14c8d6..00000000 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryServiceImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.runs - -import com.langsmith.api.core.ClientOptions -import com.langsmith.api.core.RequestOptions -import com.langsmith.api.core.http.HttpMethod -import com.langsmith.api.core.http.HttpRequest -import com.langsmith.api.core.http.HttpResponse.Handler -import com.langsmith.api.errors.LangSmithError -import com.langsmith.api.models.ListPublicRunsResponse -import com.langsmith.api.models.PublicRunQueryCreateParams -import com.langsmith.api.services.errorHandler -import com.langsmith.api.services.json -import com.langsmith.api.services.jsonHandler -import com.langsmith.api.services.withErrorHandler - -class QueryServiceImpl -constructor( - private val clientOptions: ClientOptions, -) : QueryService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 - - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 - - private val createHandler: - Handler< - ListPublicRunsResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 - jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - - /** Get run by ids or the shared run if not specifed. */ - override fun create( - params: PublicRunQueryCreateParams, - requestOptions: RequestOptions - ): ListPublicRunsResponse { // templates/JavaSDK/services.ts:831:10 - val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 - .addPathSegments("public", params.getPathParam(0), "runs", "query") - .putAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .putAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) - .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 - validate() - } - } - } - } -} diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryService.kt index 34e0986a..10d3f764 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.ResponseBodyForRunsGenerateQuery import com.langsmith.api.models.RunGenerateQueryCreateParams -interface GenerateQueryService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface GenerateQueryService { /** Get runs filter expression query for a given natural language query. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunGenerateQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceImpl.kt index 71cdd576..370436a8 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -18,18 +18,11 @@ import com.langsmith.api.services.withErrorHandler class GenerateQueryServiceImpl constructor( private val clientOptions: ClientOptions, -) : GenerateQueryService { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : GenerateQueryService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - ResponseBodyForRunsGenerateQuery - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -37,39 +30,21 @@ constructor( override fun create( params: RunGenerateQueryCreateParams, requestOptions: RequestOptions - ): ResponseBodyForRunsGenerateQuery { // templates/JavaSDK/services.ts:831:10 + ): ResponseBodyForRunsGenerateQuery { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "generate-query") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorService.kt index 2b57f1f3..30c5377c 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.MonitorResponse import com.langsmith.api.models.RunMonitorCreateParams -interface MonitorService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface MonitorService { /** Get monitoring data for a specific session. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunMonitorCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceImpl.kt index 2e875ba6..df48c9b0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -18,56 +18,32 @@ import com.langsmith.api.services.withErrorHandler class MonitorServiceImpl constructor( private val clientOptions: ClientOptions, -) : MonitorService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : MonitorService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - MonitorResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get monitoring data for a specific session. */ override fun create( params: RunMonitorCreateParams, requestOptions: RequestOptions - ): MonitorResponse { // templates/JavaSDK/services.ts:831:10 + ): MonitorResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "monitor") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryService.kt index 6b3686ce..77f98d20 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.ListRunsResponse import com.langsmith.api.models.RunQueryCreateParams -interface QueryService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface QueryService { /** Get all runs by query in body payload. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunQueryCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceImpl.kt index ad4a2d0f..454cc95d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -18,56 +18,32 @@ import com.langsmith.api.services.withErrorHandler class QueryServiceImpl constructor( private val clientOptions: ClientOptions, -) : QueryService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : QueryService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - ListRunsResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all runs by query in body payload. */ override fun create( params: RunQueryCreateParams, requestOptions: RequestOptions - ): ListRunsResponse { // templates/JavaSDK/services.ts:831:10 + ): ListRunsResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "query") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareService.kt index 062458a8..8ecbdc89 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -11,27 +11,24 @@ import com.langsmith.api.models.RunShareRetrieveParams import com.langsmith.api.models.RunShareSchema import com.langsmith.api.models.RunShareUpdateParams -interface ShareService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface ShareService { /** Get the state of sharing of a run. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: RunShareRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() ): RunShareSchema /** Share a run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun update( params: RunShareUpdateParams, requestOptions: RequestOptions = RequestOptions.none() ): RunShareSchema /** Unshare a run. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: RunShareDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceImpl.kt index 3926ec35..a6d104e9 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -21,160 +21,84 @@ import com.langsmith.api.services.withErrorHandler class ShareServiceImpl constructor( private val clientOptions: ClientOptions, -) : ShareService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : ShareService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - RunShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get the state of sharing of a run. */ override fun retrieve( params: RunShareRetrieveParams, requestOptions: RequestOptions - ): RunShareSchema { // templates/JavaSDK/services.ts:831:10 + ): RunShareSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("runs", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val updateHandler: - Handler< - RunShareSchema - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val updateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Share a run. */ override fun update( params: RunShareUpdateParams, requestOptions: RequestOptions - ): RunShareSchema { // templates/JavaSDK/services.ts:831:10 + ): RunShareSchema { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.PUT - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.PUT) .addPathSegments("runs", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - updateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val deleteHandler: - Handler< - RunShareDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Unshare a run. */ override fun delete( params: RunShareDeleteParams, requestOptions: RequestOptions - ): RunShareDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): RunShareDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("runs", params.getPathParam(0), "share") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatService.kt index 3e3a95cc..65a763e0 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.RunStatCreateParams import com.langsmith.api.models.RunStats -interface StatService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface StatService { /** Get all runs by query in body payload. */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun create( params: RunStatCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatServiceImpl.kt index c3a4a0a3..ca12738a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/runs/StatServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -18,56 +18,29 @@ import com.langsmith.api.services.withErrorHandler class StatServiceImpl constructor( private val clientOptions: ClientOptions, -) : StatService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : StatService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val createHandler: - Handler< - RunStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get all runs by query in body payload. */ - override fun create( - params: RunStatCreateParams, - requestOptions: RequestOptions - ): RunStats { // templates/JavaSDK/services.ts:831:10 + override fun create(params: RunStatCreateParams, requestOptions: RequestOptions): RunStats { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("runs", "stats") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - createHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataService.kt index 5d801610..e3aad0a6 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,15 +8,13 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.SessionMetadataRetrieveParams import com.langsmith.api.models.TracerSessionMetadataResponse -interface MetadataService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface MetadataService { /** - * // templates/JavaSDK/services.ts:55:15 Given a session, a number K, and (optionally) a list - * of metadata keys, return the top K values for each key. + * Given a session, a number K, and (optionally) a list of metadata keys, return the top K + * values for each key. */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun retrieve( params: SessionMetadataRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceImpl.kt index ab3d859b..60f3c64d 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.sessions @@ -17,17 +17,11 @@ import com.langsmith.api.services.withErrorHandler class MetadataServiceImpl constructor( private val clientOptions: ClientOptions, -) : MetadataService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : MetadataService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val retrieveHandler: - Handler< - TracerSessionMetadataResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -38,38 +32,20 @@ constructor( override fun retrieve( params: SessionMetadataRetrieveParams, requestOptions: RequestOptions - ): TracerSessionMetadataResponse { // templates/JavaSDK/services.ts:831:10 + ): TracerSessionMetadataResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("sessions", params.getPathParam(0), "metadata") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - retrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentService.kt index 869431fa..f3be5ef3 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -12,27 +12,24 @@ import com.langsmith.api.models.TenantCurrentStatsRetrieveParams import com.langsmith.api.models.TenantMembers import com.langsmith.api.models.TenantStats -interface CurrentService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface CurrentService { /** Add Member To Current Tenant */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun membersCreate( params: TenantCurrentMembersCreateParams, requestOptions: RequestOptions = RequestOptions.none() ): PendingIdentity /** Get Current Tenant Members */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun membersList( params: TenantCurrentMembersListParams, requestOptions: RequestOptions = RequestOptions.none() ): TenantMembers /** Get Current Tenant Stats */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun statsRetrieve( params: TenantCurrentStatsRetrieveParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceImpl.kt index d77527c4..5d7c4df2 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -22,154 +22,86 @@ import com.langsmith.api.services.withErrorHandler class CurrentServiceImpl constructor( private val clientOptions: ClientOptions, -) : CurrentService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : CurrentService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val membersCreateHandler: - Handler< - PendingIdentity - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val membersCreateHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Add Member To Current Tenant */ override fun membersCreate( params: TenantCurrentMembersCreateParams, requestOptions: RequestOptions - ): PendingIdentity { // templates/JavaSDK/services.ts:831:10 + ): PendingIdentity { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("tenants", "current", "members") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .body(json(clientOptions.jsonMapper, params.getBody())) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - membersCreateHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { membersCreateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val membersListHandler: - Handler< - TenantMembers - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val membersListHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Members */ override fun membersList( params: TenantCurrentMembersListParams, requestOptions: RequestOptions - ): TenantMembers { // templates/JavaSDK/services.ts:831:10 + ): TenantMembers { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "current", "members") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - membersListHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { membersListHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } } } - private val statsRetrieveHandler: - Handler< - TenantStats - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val statsRetrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Stats */ override fun statsRetrieve( params: TenantCurrentStatsRetrieveParams, requestOptions: RequestOptions - ): TenantStats { // templates/JavaSDK/services.ts:831:10 + ): TenantStats { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "current", "stats") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - statsRetrieveHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { statsRetrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberService.kt index ea9d14ac..5602c198 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -9,14 +9,12 @@ import com.langsmith.api.models.TenantMemberDeleteParams import com.langsmith.api.models.TenantMemberDeleteResponse import com.langsmith.api.services.blocking.tenants.members.PendingService -interface MemberService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface MemberService { - fun pending(): PendingService // templates/JavaSDK/services.ts:55:15 + fun pending(): PendingService /** Delete Current Tenant Member */ - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: TenantMemberDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceImpl.kt index 3d2e401d..0a249bce 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -20,21 +20,15 @@ import com.langsmith.api.services.withErrorHandler class MemberServiceImpl constructor( private val clientOptions: ClientOptions, -) : MemberService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : MemberService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val pending: PendingService by lazy { PendingServiceImpl(clientOptions) } override fun pending(): PendingService = pending - private val deleteHandler: - Handler< - TenantMemberDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -42,38 +36,18 @@ constructor( override fun delete( params: TenantMemberDeleteParams, requestOptions: RequestOptions - ): TenantMemberDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): TenantMemberDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("tenants", "current", "members", params.getPathParam(0)) .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingService.kt index e6ea62dc..4b352589 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.TenantPendingClaimCreateParams import com.langsmith.api.models.TenantPendingClaimCreateResponse -interface PendingService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface PendingService { /** Claim Pending Tenant Invite */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun claimCreate( params: TenantPendingClaimCreateParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceImpl.kt index de2c1434..14eccff5 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -18,17 +18,11 @@ import com.langsmith.api.services.withErrorHandler class PendingServiceImpl constructor( private val clientOptions: ClientOptions, -) : PendingService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : PendingService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val claimCreateHandler: - Handler< - TenantPendingClaimCreateResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val claimCreateHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -36,38 +30,18 @@ constructor( override fun claimCreate( params: TenantPendingClaimCreateParams, requestOptions: RequestOptions - ): TenantPendingClaimCreateResponse { // templates/JavaSDK/services.ts:831:10 + ): TenantPendingClaimCreateResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.POST - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.POST) .addPathSegments("tenants", "pending", params.getPathParam(0), "claim") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - claimCreateHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { claimCreateHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitService.kt index fb5d0df4..d6bd4787 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.TenantUsageLimitInfo import com.langsmith.api.models.TenantUsageLimitListParams -interface UsageLimitService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface UsageLimitService { /** Get Current Tenant Usage Limits Info */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun list( params: TenantUsageLimitListParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceImpl.kt index 3fa4b3b7..933a76ac 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -17,56 +17,31 @@ import com.langsmith.api.services.withErrorHandler class UsageLimitServiceImpl constructor( private val clientOptions: ClientOptions, -) : UsageLimitService { // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 // - // templates/JavaSDK/services.ts:76:15 +) : UsageLimitService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val listHandler: - Handler< - TenantUsageLimitInfo - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get Current Tenant Usage Limits Info */ override fun list( params: TenantUsageLimitListParams, requestOptions: RequestOptions - ): TenantUsageLimitInfo { // templates/JavaSDK/services.ts:831:10 + ): TenantUsageLimitInfo { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.GET - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.GET) .addPathSegments("tenants", "current", "usage_limits") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 + return clientOptions.httpClient.execute(request, requestOptions).let { response -> response - .use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - listHandler.handle(it) - } - .apply { // templates/JavaSDK/services.ts:176:10 - if ( - requestOptions.responseValidation ?: clientOptions.responseValidation - ) { // templates/JavaSDK/services.ts:179:14 // - // templates/JavaSDK/services.ts:176:10 // - // templates/JavaSDK/services.ts:176:10 + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { validate() } } diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingService.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingService.kt index dc18d095..d521629a 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingService.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingService.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. @file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102 @@ -8,13 +8,10 @@ import com.langsmith.api.core.RequestOptions import com.langsmith.api.models.TenantMemberPendingDeleteParams import com.langsmith.api.models.TenantMemberPendingDeleteResponse -interface PendingService { // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 // - // templates/JavaSDK/services.ts:55:15 +interface PendingService { /** Delete Current Tenant Pending Member */ - // templates/JavaSDK/services.ts:55:15 - @JvmOverloads // templates/JavaSDK/services.ts:738:15 + @JvmOverloads fun delete( params: TenantMemberPendingDeleteParams, requestOptions: RequestOptions = RequestOptions.none() diff --git a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceImpl.kt b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceImpl.kt index 9d45f619..66c2e5da 100644 --- a/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceImpl.kt +++ b/langsmith-java-core/src/main/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceImpl.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants.members @@ -18,17 +18,11 @@ import com.langsmith.api.services.withErrorHandler class PendingServiceImpl constructor( private val clientOptions: ClientOptions, -) : PendingService { // templates/JavaSDK/services.ts:76:15 // templates/JavaSDK/services.ts:76:15 - // // templates/JavaSDK/services.ts:76:15 +) : PendingService { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) // templates/JavaSDK/services.ts:76:15 + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val deleteHandler: - Handler< - TenantMemberPendingDeleteResponse - > = // templates/JavaSDK/services.ts:826:12 // templates/JavaSDK/services.ts:826:12 // - // templates/JavaSDK/services.ts:825:19 + private val deleteHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) @@ -36,38 +30,18 @@ constructor( override fun delete( params: TenantMemberPendingDeleteParams, requestOptions: RequestOptions - ): TenantMemberPendingDeleteResponse { // templates/JavaSDK/services.ts:831:10 + ): TenantMemberPendingDeleteResponse { val request = - HttpRequest.builder() // templates/JavaSDK/services.ts:107:20 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:105:8 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:104:29 // - // templates/JavaSDK/services.ts:227:15 // - // templates/JavaSDK/services.ts:227:15 - .method( - HttpMethod.DELETE - ) // templates/JavaSDK/services.ts:109:18 // templates/JavaSDK/services.ts:109:18 + HttpRequest.builder() + .method(HttpMethod.DELETE) .addPathSegments("tenants", "current", "members", params.getPathParam(0), "pending") .putAllQueryParams(params.getQueryParams()) .putAllHeaders(clientOptions.headers) .putAllHeaders(params.getHeaders()) - .apply { // templates/JavaSDK/services.ts:118:18 - params.getBody().ifPresent { // templates/JavaSDK/services.ts:121:41 // - // templates/JavaSDK/services.ts:118:18 // - // templates/JavaSDK/services.ts:118:18 - body(json(clientOptions.jsonMapper, it)) - } - } + .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.execute(request, requestOptions).let { response - -> // templates/JavaSDK/services.ts:230:8 - response.use { // templates/JavaSDK/services.ts:166:8 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:233:30 // - // templates/JavaSDK/services.ts:230:8 // templates/JavaSDK/services.ts:230:8 - deleteHandler.handle(it) - } + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response.use { deleteHandler.handle(it) } } } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/client/LangSmithClientTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/client/LangSmithClientTest.kt index 038e8020..1ba4bf45 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/client/LangSmithClientTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/client/LangSmithClientTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.client diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueCreateParamsTest.kt index 42526233..8b2bf21e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueCreateParams() { + AnnotationQueueCreateParams.builder() .name("string") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -25,14 +20,10 @@ class AnnotationQueueCreateParamsTest { // templates/JavaSDK/entities/params.ts: .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - AnnotationQueueCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueCreateParams.builder() .name("string") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -48,15 +39,9 @@ class AnnotationQueueCreateParamsTest { // templates/JavaSDK/entities/params.ts: assertThat(body.updatedAt()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - AnnotationQueueCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .name("string") - .build() + @Test + fun getBodyWithoutOptionalFields() { + val params = AnnotationQueueCreateParams.builder().name("string").build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.name()).isEqualTo("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParamsTest.kt index d302d894..1b801fa2 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueDeleteParams() { + AnnotationQueueDeleteParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueDeleteParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueListParamsTest.kt index f9819589..3005f584 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueListParams() { + AnnotationQueueListParams.builder() .ids(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .limit(123L) .name("string") @@ -24,14 +19,10 @@ class AnnotationQueueListParamsTest { // templates/JavaSDK/entities/params.ts:90 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - AnnotationQueueListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + AnnotationQueueListParams.builder() .ids(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .limit(123L) .name("string") @@ -47,12 +38,9 @@ class AnnotationQueueListParamsTest { // templates/JavaSDK/entities/params.ts:90 assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - AnnotationQueueListParams.builder() - .build() // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = AnnotationQueueListParams.builder().build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParamsTest.kt index 5990cd89..f7481a96 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueQueueListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueQueueListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueQueueListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueQueueListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueQueueListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueQueueListParams() { + AnnotationQueueQueueListParams.builder() .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueQueueListParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueQueueListParams.builder() .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParamsTest.kt index 1e20886f..e45fb188 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,30 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueRunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueRunCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueRunCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueRunCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueRunCreateParams() { + AnnotationQueueRunCreateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .body(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - AnnotationQueueRunCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueRunCreateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .body(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() @@ -38,14 +28,10 @@ class AnnotationQueueRunCreateParamsTest { // templates/JavaSDK/entities/params. assertThat(body.body()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - AnnotationQueueRunCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueRunCreateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .body(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() @@ -54,14 +40,10 @@ class AnnotationQueueRunCreateParamsTest { // templates/JavaSDK/entities/params. assertThat(body.body()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueRunCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueRunCreateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .body(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParamsTest.kt index 5920aa50..cfab9672 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueRunDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueRunDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueRunDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueRunDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueRunDeleteParams() { + AnnotationQueueRunDeleteParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueRunDeleteParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueRunDeleteParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunListParamsTest.kt index 32ce5abe..5c5f17af 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,30 +6,21 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueRunListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueRunListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueRunListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueRunListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueRunListParams() { + AnnotationQueueRunListParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .limit(123L) .offset(123L) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - AnnotationQueueRunListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + AnnotationQueueRunListParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .limit(123L) .offset(123L) @@ -40,27 +31,20 @@ class AnnotationQueueRunListParamsTest { // templates/JavaSDK/entities/params.ts assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - AnnotationQueueRunListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + AnnotationQueueRunListParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueRunListParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueRunListParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunSchemaTest.kt index ce36e3f3..bb9219de 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueRunSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class AnnotationQueueRunSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createAnnotationQueueRunSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createAnnotationQueueRunSchema() { val annotationQueueRunSchema = - AnnotationQueueRunSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + AnnotationQueueRunSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParamsTest.kt index 32f064a8..1d8b7ec2 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueRunUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueRunUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueRunUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueRunUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueRunUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueRunUpdateParams() { + AnnotationQueueRunUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -24,15 +19,10 @@ class AnnotationQueueRunUpdateParamsTest { // templates/JavaSDK/entities/params. .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - AnnotationQueueRunUpdateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueRunUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -45,14 +35,10 @@ class AnnotationQueueRunUpdateParamsTest { // templates/JavaSDK/entities/params. .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - AnnotationQueueRunUpdateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueRunUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -60,14 +46,10 @@ class AnnotationQueueRunUpdateParamsTest { // templates/JavaSDK/entities/params. assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueRunUpdateParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueRunUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSchemaTest.kt index 86e392cf..1f192df0 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class AnnotationQueueSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createAnnotationQueueSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createAnnotationQueueSchema() { val annotationQueueSchema = - AnnotationQueueSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + AnnotationQueueSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParamsTest.kt index 7433f834..1e340d4c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueSizeRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueSizeRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueSizeRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueSizeRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueSizeRetrieveParams() { + AnnotationQueueSizeRetrieveParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueSizeRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueSizeRetrieveParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchemaTest.kt index 2bd21762..3a7bfc2f 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueSizeSchemaTest.kt @@ -1,24 +1,15 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueSizeSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class AnnotationQueueSizeSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createAnnotationQueueSizeSchema() { // templates/JavaSDK/entities/testing.ts:18:13 - val annotationQueueSizeSchema = - AnnotationQueueSizeSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 - .size(123L) - .build() + @Test + fun createAnnotationQueueSizeSchema() { + val annotationQueueSizeSchema = AnnotationQueueSizeSchema.builder().size(123L).build() assertThat(annotationQueueSizeSchema).isNotNull assertThat(annotationQueueSizeSchema.size()).isEqualTo(123L) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParamsTest.kt index 11a52eac..ce891fc8 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/AnnotationQueueUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class AnnotationQueueUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class AnnotationQueueUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createAnnotationQueueUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - AnnotationQueueUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createAnnotationQueueUpdateParams() { + AnnotationQueueUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -25,14 +20,10 @@ class AnnotationQueueUpdateParamsTest { // templates/JavaSDK/entities/params.ts: .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - AnnotationQueueUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -47,13 +38,10 @@ class AnnotationQueueUpdateParamsTest { // templates/JavaSDK/entities/params.ts: assertThat(body.updatedAt()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - AnnotationQueueUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + AnnotationQueueUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .build() @@ -62,13 +50,10 @@ class AnnotationQueueUpdateParamsTest { // templates/JavaSDK/entities/params.ts: assertThat(body.name()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - AnnotationQueueUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + AnnotationQueueUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateParamsTest.kt index e2381f07..d4fbee22 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,40 +6,24 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ApiKeyCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ApiKeyCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createApiKeyCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ApiKeyCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .readOnly(true) - .build() + @Test + fun createApiKeyCreateParams() { + ApiKeyCreateParams.builder().readOnly(true).build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - ApiKeyCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .readOnly(true) - .build() + @Test + fun getBody() { + val params = ApiKeyCreateParams.builder().readOnly(true).build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.readOnly()).isEqualTo(true) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - ApiKeyCreateParams.builder().build() // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + @Test + fun getBodyWithoutOptionalFields() { + val params = ApiKeyCreateParams.builder().build() val body = params.getBody() assertThat(body).isNotNull } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateResponseTest.kt index 723560da..c23aa5e8 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyCreateResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ApiKeyCreateResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ApiKeyCreateResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createApiKeyCreateResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createApiKeyCreateResponse() { val apiKeyCreateResponse = - ApiKeyCreateResponse.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + ApiKeyCreateResponse.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .key("string") .readOnly(true) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyDeleteParamsTest.kt index 0a2c3688..80d51801 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ApiKeyDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ApiKeyDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createApiKeyDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ApiKeyDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .apiKeyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createApiKeyDeleteParams() { + ApiKeyDeleteParams.builder().apiKeyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - ApiKeyDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .apiKeyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + ApiKeyDeleteParams.builder().apiKeyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "apiKeyId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyGetResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyGetResponseTest.kt index c4ac9477..7600322c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyGetResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyGetResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ApiKeyGetResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ApiKeyGetResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createApiKeyGetResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createApiKeyGetResponse() { val apiKeyGetResponse = - ApiKeyGetResponse.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + ApiKeyGetResponse.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .readOnly(true) .shortKey("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyRetrieveParamsTest.kt index 51bbc4d5..29736ee4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ApiKeyRetrieveParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class ApiKeyRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ApiKeyRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createApiKeyRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createApiKeyRetrieveParams() { ApiKeyRetrieveParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCreateParamsTest.kt index 5af7add5..b91c2bc1 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetCreateParams() { + DatasetCreateParams.builder() .name("string") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -25,14 +20,10 @@ class DatasetCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - DatasetCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + DatasetCreateParams.builder() .name("string") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -48,15 +39,9 @@ class DatasetCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.description()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - DatasetCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .name("string") - .build() + @Test + fun getBodyWithoutOptionalFields() { + val params = DatasetCreateParams.builder().name("string").build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.name()).isEqualTo("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParamsTest.kt index 06ecd382..7dfc96d1 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetCsvRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,29 +7,20 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetCsvRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetCsvRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetCsvRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetCsvRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetCsvRetrieveParams() { + DatasetCsvRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - DatasetCsvRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetCsvRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() @@ -38,26 +29,20 @@ class DatasetCsvRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907 assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - DatasetCsvRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetCsvRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetCsvRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetCsvRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetDeleteParamsTest.kt index b2d20c77..ffabb6cf 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createDatasetDeleteParams() { + DatasetDeleteParams.builder().datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + DatasetDeleteParams.builder().datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "datasetId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetListParamsTest.kt index c4e35753..4a3cd53e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetListParams() { + DatasetListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dataType(DatasetListParams.DataType.KV) @@ -27,14 +22,10 @@ class DatasetListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - DatasetListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dataType(DatasetListParams.DataType.KV) @@ -54,11 +45,9 @@ class DatasetListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - DatasetListParams.builder().build() // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = DatasetListParams.builder().build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParamsTest.kt index 9255aa88..8bc478d0 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIFtRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,30 +7,20 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetOpenAIFtRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetOpenAIFtRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetOpenAIFtRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetOpenAIFtRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetOpenAIFtRetrieveParams() { + DatasetOpenAIFtRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - DatasetOpenAIFtRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetOpenAIFtRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() @@ -39,28 +29,20 @@ class DatasetOpenAIFtRetrieveParamsTest { // templates/JavaSDK/entities/params.t assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - DatasetOpenAIFtRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetOpenAIFtRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetOpenAIFtRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetOpenAIFtRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParamsTest.kt index 37450ebd..51187abe 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetOpenAIRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,29 +7,20 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetOpenAIRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetOpenAIRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetOpenAIRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetOpenAIRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetOpenAIRetrieveParams() { + DatasetOpenAIRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - DatasetOpenAIRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetOpenAIRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() @@ -38,26 +29,20 @@ class DatasetOpenAIRetrieveParamsTest { // templates/JavaSDK/entities/params.ts: assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - DatasetOpenAIRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetOpenAIRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetOpenAIRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetOpenAIRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetPublicSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetPublicSchemaTest.kt index d6931ec7..a017ba6f 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetPublicSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetPublicSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetPublicSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class DatasetPublicSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createDatasetPublicSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createDatasetPublicSchema() { val datasetPublicSchema = - DatasetPublicSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + DatasetPublicSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .exampleCount(123L) .name("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRetrieveParamsTest.kt index b95aa7e3..c7667511 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createDatasetRetrieveParams() { + DatasetRetrieveParams.builder().datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRunCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRunCreateParamsTest.kt index a1cc5d82..17f83531 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRunCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetRunCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetRunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetRunCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetRunCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetRunCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetRunCreateParams() { + DatasetRunCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .filters(DatasetRunCreateParams.Filters.builder().build()) @@ -24,14 +19,10 @@ class DatasetRunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - DatasetRunCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + DatasetRunCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .filters(DatasetRunCreateParams.Filters.builder().build()) @@ -46,13 +37,10 @@ class DatasetRunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 assertThat(body.offset()).isEqualTo(123L) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - DatasetRunCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + DatasetRunCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() @@ -61,13 +49,10 @@ class DatasetRunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 assertThat(body.sessionIds()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetRunCreateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetRunCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetSchemaForUpdateTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetSchemaForUpdateTest.kt index 8ccf83ca..55a93678 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetSchemaForUpdateTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetSchemaForUpdateTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetSchemaForUpdateTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class DatasetSchemaForUpdateTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createDatasetSchemaForUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createDatasetSchemaForUpdate() { val datasetSchemaForUpdate = - DatasetSchemaForUpdate.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + DatasetSchemaForUpdate.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareRetrieveParamsTest.kt index 767104ec..fe692717 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetShareRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetShareRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetShareRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetShareRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetShareRetrieveParams() { + DatasetShareRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetShareRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetShareRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareSchemaTest.kt index e10cb12d..65936bbc 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareSchemaTest.kt @@ -1,22 +1,16 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetShareSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class DatasetShareSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createDatasetShareSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createDatasetShareSchema() { val datasetShareSchema = - DatasetShareSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + DatasetShareSchema.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareUpdateParamsTest.kt index 7b087cb5..fc62c201 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetShareUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetShareUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetShareUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetShareUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetShareUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetShareUpdateParams() { + DatasetShareUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shareProjects(true) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - DatasetShareUpdateParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetShareUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shareProjects(true) .build() @@ -37,26 +28,20 @@ class DatasetShareUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907 assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - DatasetShareUpdateParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + DatasetShareUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetShareUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + DatasetShareUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetTest.kt index 4aa4238e..8b18c21d 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class DatasetTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createDataset() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createDataset() { val dataset = - Dataset.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + Dataset.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .exampleCount(123L) .modifiedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUpdateParamsTest.kt index 22ff7d74..bf900f7a 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,30 +6,21 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetUpdateParams() { + DatasetUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") .name("string") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - DatasetUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + DatasetUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") .name("string") @@ -40,28 +31,18 @@ class DatasetUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.name()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - DatasetUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + DatasetUpdateParams.builder().datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - DatasetUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + DatasetUpdateParams.builder().datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "datasetId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUploadParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUploadParamsTest.kt index 8e3bc5dd..9341302a 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUploadParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/DatasetUploadParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class DatasetUploadParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class DatasetUploadParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createDatasetUploadParams() { // templates/JavaSDK/entities/testing.ts:18:13 - DatasetUploadParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createDatasetUploadParams() { + DatasetUploadParams.builder() .file("file.txt") .inputKeys(listOf("string")) .dataType(DatasetUploadParams.DataType.KV) @@ -25,14 +20,10 @@ class DatasetUploadParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - DatasetUploadParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + DatasetUploadParams.builder() .file("file.txt") .inputKeys(listOf("string")) .dataType(DatasetUploadParams.DataType.KV) @@ -50,16 +41,10 @@ class DatasetUploadParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.outputKeys()).isEqualTo(listOf("string")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - DatasetUploadParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .file("file.txt") - .inputKeys(listOf("string")) - .build() + DatasetUploadParams.builder().file("file.txt").inputKeys(listOf("string")).build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.file()).isEqualTo("file.txt") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleBulkCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleBulkCreateParamsTest.kt index 7ec3eb39..88e7cd95 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleBulkCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleBulkCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -8,19 +8,14 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleBulkCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleBulkCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleBulkCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleBulkCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleBulkCreateParams() { + ExampleBulkCreateParams.builder() .body( listOf( - ExampleBulkCreateParams.ExampleCreate.builder() + ExampleBulkCreateParams.Body.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -33,17 +28,13 @@ class ExampleBulkCreateParamsTest { // templates/JavaSDK/entities/params.ts:907: .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - ExampleBulkCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleBulkCreateParams.builder() .body( listOf( - ExampleBulkCreateParams.ExampleCreate.builder() + ExampleBulkCreateParams.Body.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -59,8 +50,7 @@ class ExampleBulkCreateParamsTest { // templates/JavaSDK/entities/params.ts:907: assertThat(body.body()) .isEqualTo( listOf( - ExampleBulkCreateParams.ExampleCreate - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + ExampleBulkCreateParams.Body.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -72,16 +62,13 @@ class ExampleBulkCreateParamsTest { // templates/JavaSDK/entities/params.ts:907: ) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - ExampleBulkCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleBulkCreateParams.builder() .body( listOf( - ExampleBulkCreateParams.ExampleCreate.builder() + ExampleBulkCreateParams.Body.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .build() @@ -93,8 +80,7 @@ class ExampleBulkCreateParamsTest { // templates/JavaSDK/entities/params.ts:907: assertThat(body.body()) .isEqualTo( listOf( - ExampleBulkCreateParams.ExampleCreate - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + ExampleBulkCreateParams.Body.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleCreateParamsTest.kt index e9b1f470..389b1490 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -8,16 +8,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleCreateParams() { + ExampleCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -27,14 +22,10 @@ class ExampleCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - ExampleCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -52,13 +43,10 @@ class ExampleCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.sourceRunId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - ExampleCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleDeleteParamsTest.kt index 2358d9f8..d4d3c071 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleDeleteParams() { + ExampleDeleteParams.builder() .exampleIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - ExampleDeleteParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + ExampleDeleteParams.builder() .exampleIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() @@ -35,13 +26,10 @@ class ExampleDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - ExampleDeleteParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + ExampleDeleteParams.builder() .exampleIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleListParamsTest.kt index 102e8300..b0d5bc4c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleListParams() { + ExampleListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dataset("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -25,14 +20,10 @@ class ExampleListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - ExampleListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + ExampleListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dataset("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -48,11 +39,9 @@ class ExampleListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - ExampleListParams.builder().build() // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = ExampleListParams.builder().build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleRetrieveParamsTest.kt index 75ad347d..6a380536 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,29 +7,20 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleRetrieveParams() { + ExampleRetrieveParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - ExampleRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + ExampleRetrieveParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() @@ -38,26 +29,20 @@ class ExampleRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - ExampleRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + ExampleRetrieveParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - ExampleRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + ExampleRetrieveParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleTest.kt index 22aa889c..276edf98 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ExampleTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createExample() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createExample() { val example = - Example.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + Example.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUpdateParamsTest.kt index cc3028b4..df7b4d6c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleUpdateParams() { + ExampleUpdateParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) @@ -24,14 +19,10 @@ class ExampleUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - ExampleUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleUpdateParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) @@ -44,28 +35,18 @@ class ExampleUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.outputs()).isEqualTo(JsonValue.from(mapOf())) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - ExampleUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + ExampleUpdateParams.builder().exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - ExampleUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + ExampleUpdateParams.builder().exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "exampleId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUploadCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUploadCreateParamsTest.kt index 4330ecfd..76e90975 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUploadCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ExampleUploadCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ExampleUploadCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class ExampleUploadCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createExampleUploadCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - ExampleUploadCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createExampleUploadCreateParams() { + ExampleUploadCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .file("file.txt") .inputKeys(listOf("string")) @@ -23,14 +18,10 @@ class ExampleUploadCreateParamsTest { // templates/JavaSDK/entities/params.ts:90 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - ExampleUploadCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleUploadCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .file("file.txt") .inputKeys(listOf("string")) @@ -43,13 +34,10 @@ class ExampleUploadCreateParamsTest { // templates/JavaSDK/entities/params.ts:90 assertThat(body.outputKeys()).isEqualTo(listOf("string")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - ExampleUploadCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + ExampleUploadCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .file("file.txt") .inputKeys(listOf("string")) @@ -60,13 +48,10 @@ class ExampleUploadCreateParamsTest { // templates/JavaSDK/entities/params.ts:90 assertThat(body.inputKeys()).isEqualTo(listOf("string")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - ExampleUploadCreateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + ExampleUploadCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .file("file.txt") .inputKeys(listOf("string")) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigCreateParamsTest.kt index 1102242a..db4eaf2d 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,22 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackConfigCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackConfigCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackConfigCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackConfigCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createFeedbackConfigCreateParams() { + FeedbackConfigCreateParams.builder() .feedbackConfig( FeedbackConfigCreateParams.FeedbackConfig.builder() .type(FeedbackConfigCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackConfigCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackConfigCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -35,20 +30,16 @@ class FeedbackConfigCreateParamsTest { // templates/JavaSDK/entities/params.ts:9 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - FeedbackConfigCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackConfigCreateParams.builder() .feedbackConfig( FeedbackConfigCreateParams.FeedbackConfig.builder() .type(FeedbackConfigCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackConfigCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackConfigCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -64,12 +55,11 @@ class FeedbackConfigCreateParamsTest { // templates/JavaSDK/entities/params.ts:9 assertThat(body).isNotNull assertThat(body.feedbackConfig()) .isEqualTo( - FeedbackConfigCreateParams.FeedbackConfig - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackConfigCreateParams.FeedbackConfig.builder() .type(FeedbackConfigCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackConfigCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackConfigCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -82,13 +72,10 @@ class FeedbackConfigCreateParamsTest { // templates/JavaSDK/entities/params.ts:9 assertThat(body.feedbackKey()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - FeedbackConfigCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackConfigCreateParams.builder() .feedbackConfig( FeedbackConfigCreateParams.FeedbackConfig.builder() .type(FeedbackConfigCreateParams.FeedbackConfig.Type.CONTINUOUS) @@ -100,8 +87,7 @@ class FeedbackConfigCreateParamsTest { // templates/JavaSDK/entities/params.ts:9 assertThat(body).isNotNull assertThat(body.feedbackConfig()) .isEqualTo( - FeedbackConfigCreateParams.FeedbackConfig - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackConfigCreateParams.FeedbackConfig.builder() .type(FeedbackConfigCreateParams.FeedbackConfig.Type.CONTINUOUS) .build() ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigListParamsTest.kt index 0da22646..bf2ddb23 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigListParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class FeedbackConfigListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackConfigListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackConfigListParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createFeedbackConfigListParams() { FeedbackConfigListParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigSchemaTest.kt index 13c2529f..ed6642d6 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackConfigSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,24 +6,18 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackConfigSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class FeedbackConfigSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createFeedbackConfigSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createFeedbackConfigSchema() { val feedbackConfigSchema = - FeedbackConfigSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + FeedbackConfigSchema.builder() .feedbackConfig( FeedbackConfigSchema.FeedbackConfig.builder() .type(FeedbackConfigSchema.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackConfigSchema.FeedbackConfig.FeedbackCategory.builder() + FeedbackConfigSchema.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -40,12 +34,11 @@ class FeedbackConfigSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 assertThat(feedbackConfigSchema).isNotNull assertThat(feedbackConfigSchema.feedbackConfig()) .isEqualTo( - FeedbackConfigSchema.FeedbackConfig - .builder() // templates/JavaSDK/entities/objects.ts:717:13 + FeedbackConfigSchema.FeedbackConfig.builder() .type(FeedbackConfigSchema.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackConfigSchema.FeedbackConfig.FeedbackCategory.builder() + FeedbackConfigSchema.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackCreateParamsTest.kt index 89d70a16..91873cdc 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -8,16 +8,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createFeedbackCreateParams() { + FeedbackCreateParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -29,7 +24,7 @@ class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .type(FeedbackCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -53,14 +48,10 @@ class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - FeedbackCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackCreateParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -72,7 +63,7 @@ class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .type(FeedbackCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -104,12 +95,11 @@ class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(body.createdAt()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.feedbackConfig()) .isEqualTo( - FeedbackCreateParams.FeedbackConfig - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackCreateParams.FeedbackConfig.builder() .type(FeedbackCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -122,8 +112,7 @@ class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(body.feedbackSource()) .isEqualTo( FeedbackCreateParams.FeedbackSource.ofAppFeedbackSource( - FeedbackCreateParams.FeedbackSource.AppFeedbackSource - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackCreateParams.FeedbackSource.AppFeedbackSource.builder() .metadata(JsonValue.from(mapOf())) .type("string") .build() @@ -134,13 +123,10 @@ class FeedbackCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(body.value()).isEqualTo(FeedbackCreateParams.Value.ofDouble(42.23)) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - FeedbackCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackCreateParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackDeleteParamsTest.kt index 8af5f2cf..c860d93b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createFeedbackDeleteParams() { + FeedbackDeleteParams.builder().feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - FeedbackDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + FeedbackDeleteParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackEagerParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackEagerParamsTest.kt index 81150234..9e4cffe4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackEagerParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackEagerParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -8,16 +8,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackEagerParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackEagerParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackEagerParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createFeedbackEagerParams() { + FeedbackEagerParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -29,7 +24,7 @@ class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .type(FeedbackEagerParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackEagerParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackEagerParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -53,14 +48,10 @@ class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - FeedbackEagerParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackEagerParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -72,7 +63,7 @@ class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .type(FeedbackEagerParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackEagerParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackEagerParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -104,12 +95,11 @@ class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.createdAt()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.feedbackConfig()) .isEqualTo( - FeedbackEagerParams.FeedbackConfig - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackEagerParams.FeedbackConfig.builder() .type(FeedbackEagerParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackEagerParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackEagerParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -122,8 +112,7 @@ class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.feedbackSource()) .isEqualTo( FeedbackEagerParams.FeedbackSource.ofAppFeedbackSource( - FeedbackEagerParams.FeedbackSource.AppFeedbackSource - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackEagerParams.FeedbackSource.AppFeedbackSource.builder() .metadata(JsonValue.from(mapOf())) .type("string") .build() @@ -134,13 +123,10 @@ class FeedbackEagerParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.value()).isEqualTo(FeedbackEagerParams.Value.ofDouble(42.23)) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - FeedbackEagerParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackEagerParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackListParamsTest.kt index 1db88e8d..6c4d3a31 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createFeedbackListParams() { + FeedbackListParams.builder() .hasComment(true) .hasScore(true) .key(listOf("string")) @@ -23,19 +18,15 @@ class FeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(FeedbackListParams.SourceType.API)) + .source(listOf(FeedbackListParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - FeedbackListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + FeedbackListParams.builder() .hasComment(true) .hasScore(true) .key(listOf("string")) @@ -43,7 +34,7 @@ class FeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(FeedbackListParams.SourceType.API)) + .source(listOf(FeedbackListParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() @@ -54,16 +45,14 @@ class FeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // expected.put("offset", listOf("123")) expected.put("run", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) expected.put("session", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - expected.put("source", listOf(FeedbackListParams.SourceType.API.toString())) + expected.put("source", listOf(FeedbackListParams.Source.API.toString())) expected.put("user", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - FeedbackListParams.builder().build() // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = FeedbackListParams.builder().build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackRetrieveParamsTest.kt index dee165fe..b90ad7c3 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createFeedbackRetrieveParams() { + FeedbackRetrieveParams.builder().feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - FeedbackRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + FeedbackRetrieveParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackSchemaTest.kt index b2402821..3bb74286 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class FeedbackSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createFeedbackSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createFeedbackSchema() { val feedbackSchema = - FeedbackSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + FeedbackSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -46,8 +40,7 @@ class FeedbackSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(feedbackSchema.feedbackSource()) .contains( - FeedbackSchema.FeedbackSource - .builder() // templates/JavaSDK/entities/objects.ts:717:13 + FeedbackSchema.FeedbackSource.builder() .metadata(JsonValue.from(mapOf())) .type("string") .userId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackTest.kt index 429a9177..0ec5ac0c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class FeedbackTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createFeedback() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createFeedback() { val feedback = - Feedback.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + Feedback.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -45,7 +39,7 @@ class FeedbackTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(feedback.createdAt()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(feedback.feedbackSource()) .contains( - Feedback.FeedbackSource.builder() // templates/JavaSDK/entities/objects.ts:717:13 + Feedback.FeedbackSource.builder() .metadata(JsonValue.from(mapOf())) .type("string") .userId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackUpdateParamsTest.kt index 1c2fef8b..f7d9e25b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/FeedbackUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class FeedbackUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class FeedbackUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createFeedbackUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - FeedbackUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createFeedbackUpdateParams() { + FeedbackUpdateParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .comment("string") .correction(JsonValue.from(mapOf())) @@ -25,7 +20,7 @@ class FeedbackUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .type(FeedbackUpdateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackUpdateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackUpdateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -40,14 +35,10 @@ class FeedbackUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - FeedbackUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackUpdateParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .comment("string") .correction(JsonValue.from(mapOf())) @@ -56,7 +47,7 @@ class FeedbackUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .type(FeedbackUpdateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackUpdateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackUpdateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -75,12 +66,11 @@ class FeedbackUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(body.correction()).isEqualTo(JsonValue.from(mapOf())) assertThat(body.feedbackConfig()) .isEqualTo( - FeedbackUpdateParams.FeedbackConfig - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + FeedbackUpdateParams.FeedbackConfig.builder() .type(FeedbackUpdateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackUpdateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackUpdateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -94,26 +84,20 @@ class FeedbackUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(body.value()).isEqualTo(FeedbackUpdateParams.Value.ofDouble(42.23)) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - FeedbackUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + FeedbackUpdateParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - FeedbackUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + FeedbackUpdateParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoGetResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoGetResponseTest.kt index 87c04505..43b72355 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoGetResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoGetResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class InfoGetResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class InfoGetResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createInfoGetResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createInfoGetResponse() { val infoGetResponse = - InfoGetResponse.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + InfoGetResponse.builder() .version("string") .batchIngestConfig( InfoGetResponse.BatchIngestConfig.builder() @@ -33,8 +27,7 @@ class InfoGetResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(infoGetResponse.version()).isEqualTo("string") assertThat(infoGetResponse.batchIngestConfig()) .contains( - InfoGetResponse.BatchIngestConfig - .builder() // templates/JavaSDK/entities/objects.ts:717:13 + InfoGetResponse.BatchIngestConfig.builder() .scaleDownNemptyTrigger(123L) .scaleUpNthreadsLimit(123L) .scaleUpQsizeTrigger(123L) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoRetrieveParamsTest.kt index c6a8aaa3..6b61b775 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/InfoRetrieveParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class InfoRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class InfoRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createInfoRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createInfoRetrieveParams() { InfoRetrieveParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponseTest.kt index 96bbc436..c10de3b4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicDatasetRunsResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,19 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ListPublicDatasetRunsResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ListPublicDatasetRunsResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createListPublicDatasetRunsResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createListPublicDatasetRunsResponse() { val listPublicDatasetRunsResponse = - ListPublicDatasetRunsResponse - .builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + ListPublicDatasetRunsResponse.builder() .cursors(ListPublicDatasetRunsResponse.Cursors.builder().build()) .runs( listOf( @@ -68,7 +61,7 @@ class ListPublicDatasetRunsResponseTest { // templates/JavaSDK/entities/objects. .isEqualTo(ListPublicDatasetRunsResponse.Cursors.builder().build()) assertThat(listPublicDatasetRunsResponse.runs()) .containsExactly( - RunPublicDatasetSchema.builder() // templates/JavaSDK/entities/objects.ts:717:13 + RunPublicDatasetSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dottedOrder("string") .name("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicRunsResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicRunsResponseTest.kt index d2b82eaf..d19c020b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicRunsResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListPublicRunsResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ListPublicRunsResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ListPublicRunsResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createListPublicRunsResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createListPublicRunsResponse() { val listPublicRunsResponse = - ListPublicRunsResponse.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + ListPublicRunsResponse.builder() .cursors(ListPublicRunsResponse.Cursors.builder().build()) .runs( listOf( @@ -66,7 +60,7 @@ class ListPublicRunsResponseTest { // templates/JavaSDK/entities/objects.ts:645: .isEqualTo(ListPublicRunsResponse.Cursors.builder().build()) assertThat(listPublicRunsResponse.runs()) .containsExactly( - RunPublicSchema.builder() // templates/JavaSDK/entities/objects.ts:717:13 + RunPublicSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dottedOrder("string") .name("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListRunsResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListRunsResponseTest.kt index 250b94d7..6d1fa7c5 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListRunsResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ListRunsResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ListRunsResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ListRunsResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createListRunsResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createListRunsResponse() { val listRunsResponse = - ListRunsResponse.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + ListRunsResponse.builder() .cursors(ListRunsResponse.Cursors.builder().build()) .runs( listOf( @@ -70,7 +64,7 @@ class ListRunsResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(listRunsResponse.cursors()).isEqualTo(ListRunsResponse.Cursors.builder().build()) assertThat(listRunsResponse.runs()) .containsExactly( - RunSchema.builder() // templates/JavaSDK/entities/objects.ts:717:13 + RunSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .appPath("string") .dottedOrder("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/MonitorResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/MonitorResponseTest.kt index d03c9d2a..cde06a0a 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/MonitorResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/MonitorResponseTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,21 +6,15 @@ import com.langsmith.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class MonitorResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class MonitorResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createMonitorResponse() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createMonitorResponse() { val monitorResponse = - MonitorResponse.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + MonitorResponse.builder() .blocks( listOf( - MonitorResponse.MonitorBlock.builder() + MonitorResponse.Block.builder() .chartSpec(JsonValue.from(mapOf())) .columns(listOf("string")) .rows(listOf(listOf(JsonValue.from(mapOf())))) @@ -29,7 +23,7 @@ class MonitorResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // .clickTarget("string") .subtitle("string") .toggleableMarks( - MonitorResponse.MonitorBlock.ToggleableMarks.builder().build() + MonitorResponse.Block.ToggleableMarks.builder().build() ) .build() ) @@ -38,8 +32,7 @@ class MonitorResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(monitorResponse).isNotNull assertThat(monitorResponse.blocks()) .containsExactly( - MonitorResponse.MonitorBlock - .builder() // templates/JavaSDK/entities/objects.ts:717:13 + MonitorResponse.Block.builder() .chartSpec(JsonValue.from(mapOf())) .columns(listOf("string")) .rows(listOf(listOf(JsonValue.from(mapOf())))) @@ -47,7 +40,7 @@ class MonitorResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // .title("string") .clickTarget("string") .subtitle("string") - .toggleableMarks(MonitorResponse.MonitorBlock.ToggleableMarks.builder().build()) + .toggleableMarks(MonitorResponse.Block.ToggleableMarks.builder().build()) .build() ) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/OkRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/OkRetrieveParamsTest.kt index 92cea6d5..0afd5cfd 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/OkRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/OkRetrieveParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class OkRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class OkRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createOkRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createOkRetrieveParams() { OkRetrieveParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PendingIdentityTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PendingIdentityTest.kt index cef2b84d..a0e6da73 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PendingIdentityTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PendingIdentityTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PendingIdentityTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class PendingIdentityTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createPendingIdentity() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createPendingIdentity() { val pendingIdentity = - PendingIdentity.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + PendingIdentity.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .email("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParamsTest.kt index 2f68e8db..0835b8c0 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetFeedbackRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,17 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicDatasetFeedbackRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicDatasetFeedbackRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicDatasetFeedbackRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicDatasetFeedbackRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicDatasetFeedbackRetrieveParams() { + PublicDatasetFeedbackRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .hasComment(true) .hasScore(true) @@ -25,20 +19,15 @@ class PublicDatasetFeedbackRetrieveParamsTest { // templates/JavaSDK/entities/pa .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(PublicDatasetFeedbackRetrieveParams.SourceType.API)) + .source(listOf(PublicDatasetFeedbackRetrieveParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - PublicDatasetFeedbackRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicDatasetFeedbackRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .hasComment(true) .hasScore(true) @@ -47,7 +36,7 @@ class PublicDatasetFeedbackRetrieveParamsTest { // templates/JavaSDK/entities/pa .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(PublicDatasetFeedbackRetrieveParams.SourceType.API)) + .source(listOf(PublicDatasetFeedbackRetrieveParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() @@ -58,36 +47,25 @@ class PublicDatasetFeedbackRetrieveParamsTest { // templates/JavaSDK/entities/pa expected.put("offset", listOf("123")) expected.put("run", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) expected.put("session", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - expected.put( - "source", - listOf(PublicDatasetFeedbackRetrieveParams.SourceType.API.toString()) - ) + expected.put("source", listOf(PublicDatasetFeedbackRetrieveParams.Source.API.toString())) expected.put("user", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - PublicDatasetFeedbackRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicDatasetFeedbackRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicDatasetFeedbackRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicDatasetFeedbackRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetListParamsTest.kt index 231fcd21..8bd5f597 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,30 +6,21 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicDatasetListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicDatasetListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicDatasetListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicDatasetListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicDatasetListParams() { + PublicDatasetListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .limit(123L) .offset(123L) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - PublicDatasetListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicDatasetListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .limit(123L) .offset(123L) @@ -40,26 +31,20 @@ class PublicDatasetListParamsTest { // templates/JavaSDK/entities/params.ts:907: assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - PublicDatasetListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicDatasetListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicDatasetListParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicDatasetListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParamsTest.kt index 0a1ec1d4..93b10514 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunQueryCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,17 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicDatasetRunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicDatasetRunQueryCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicDatasetRunQueryCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicDatasetRunQueryCreateParams - .builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicDatasetRunQueryCreateParams() { + PublicDatasetRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .cursor("string") @@ -31,22 +25,17 @@ class PublicDatasetRunQueryCreateParamsTest { // templates/JavaSDK/entities/para .query("string") .referenceExample(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .runType(PublicDatasetRunQueryCreateParams.RunType.TOOL) - .select(listOf(PublicDatasetRunQueryCreateParams.RunSelect.ID)) + .select(listOf(PublicDatasetRunQueryCreateParams.Select.ID)) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - PublicDatasetRunQueryCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicDatasetRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .cursor("string") @@ -60,7 +49,7 @@ class PublicDatasetRunQueryCreateParamsTest { // templates/JavaSDK/entities/para .query("string") .referenceExample(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .runType(PublicDatasetRunQueryCreateParams.RunType.TOOL) - .select(listOf(PublicDatasetRunQueryCreateParams.RunSelect.ID)) + .select(listOf(PublicDatasetRunQueryCreateParams.Select.ID)) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -80,34 +69,26 @@ class PublicDatasetRunQueryCreateParamsTest { // templates/JavaSDK/entities/para assertThat(body.referenceExample()) .isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(body.runType()).isEqualTo(PublicDatasetRunQueryCreateParams.RunType.TOOL) - assertThat(body.select()).isEqualTo(listOf(PublicDatasetRunQueryCreateParams.RunSelect.ID)) + assertThat(body.select()).isEqualTo(listOf(PublicDatasetRunQueryCreateParams.Select.ID)) assertThat(body.session()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(body.startTime()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.trace()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - PublicDatasetRunQueryCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicDatasetRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicDatasetRunQueryCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicDatasetRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunRetrieveParamsTest.kt index e8f6b165..3b43d9c1 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicDatasetRunRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicDatasetRunRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicDatasetRunRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicDatasetRunRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicDatasetRunRetrieveParams() { + PublicDatasetRunRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicDatasetRunRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicDatasetRunRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunStatCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunStatCreateParamsTest.kt index 950a953c..9ebe1aed 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunStatCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetRunStatCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicDatasetRunStatCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicDatasetRunStatCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicDatasetRunStatCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicDatasetRunStatCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicDatasetRunStatCreateParams() { + PublicDatasetRunStatCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -34,15 +29,10 @@ class PublicDatasetRunStatCreateParamsTest { // templates/JavaSDK/entities/param .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - PublicDatasetRunStatCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicDatasetRunStatCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -76,28 +66,20 @@ class PublicDatasetRunStatCreateParamsTest { // templates/JavaSDK/entities/param assertThat(body.trace()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - PublicDatasetRunStatCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicDatasetRunStatCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicDatasetRunStatCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicDatasetRunStatCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetSessionListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetSessionListParamsTest.kt index 905c80f7..27d2fdbd 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetSessionListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicDatasetSessionListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicDatasetSessionListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicDatasetSessionListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicDatasetSessionListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicDatasetSessionListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicDatasetSessionListParams() { + PublicDatasetSessionListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .facets(true) @@ -29,15 +24,10 @@ class PublicDatasetSessionListParamsTest { // templates/JavaSDK/entities/params. .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - PublicDatasetSessionListParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicDatasetSessionListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .facets(true) @@ -62,28 +52,20 @@ class PublicDatasetSessionListParamsTest { // templates/JavaSDK/entities/params. assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - PublicDatasetSessionListParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicDatasetSessionListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicDatasetSessionListParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicDatasetSessionListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleListParamsTest.kt index e1c3bc62..b833bead 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicExampleListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicExampleListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicExampleListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicExampleListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicExampleListParams() { + PublicExampleListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -25,14 +20,10 @@ class PublicExampleListParamsTest { // templates/JavaSDK/entities/params.ts:907: .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - PublicExampleListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicExampleListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -47,26 +38,20 @@ class PublicExampleListParamsTest { // templates/JavaSDK/entities/params.ts:907: assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - PublicExampleListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicExampleListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicExampleListParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicExampleListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleRunCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleRunCreateParamsTest.kt index f30b5d57..a9bb155d 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleRunCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicExampleRunCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicExampleRunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicExampleRunCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicExampleRunCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicExampleRunCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicExampleRunCreateParams() { + PublicExampleRunCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .filters(PublicExampleRunCreateParams.Filters.builder().build()) @@ -24,15 +19,10 @@ class PublicExampleRunCreateParamsTest { // templates/JavaSDK/entities/params.ts .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - PublicExampleRunCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicExampleRunCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .filters(PublicExampleRunCreateParams.Filters.builder().build()) @@ -47,14 +37,10 @@ class PublicExampleRunCreateParamsTest { // templates/JavaSDK/entities/params.ts assertThat(body.offset()).isEqualTo(123L) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - PublicExampleRunCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicExampleRunCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() @@ -63,14 +49,10 @@ class PublicExampleRunCreateParamsTest { // templates/JavaSDK/entities/params.ts assertThat(body.sessionIds()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicExampleRunCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicExampleRunCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicFeedbackListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicFeedbackListParamsTest.kt index 9d535cb2..a2a5fd5b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicFeedbackListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicFeedbackListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicFeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicFeedbackListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicFeedbackListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicFeedbackListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicFeedbackListParams() { + PublicFeedbackListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .hasComment(true) .hasScore(true) @@ -24,19 +19,15 @@ class PublicFeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907 .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(PublicFeedbackListParams.SourceType.API)) + .source(listOf(PublicFeedbackListParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - PublicFeedbackListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicFeedbackListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .hasComment(true) .hasScore(true) @@ -45,7 +36,7 @@ class PublicFeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907 .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(PublicFeedbackListParams.SourceType.API)) + .source(listOf(PublicFeedbackListParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() @@ -56,31 +47,25 @@ class PublicFeedbackListParamsTest { // templates/JavaSDK/entities/params.ts:907 expected.put("offset", listOf("123")) expected.put("run", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) expected.put("session", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - expected.put("source", listOf(PublicFeedbackListParams.SourceType.API.toString())) + expected.put("source", listOf(PublicFeedbackListParams.Source.API.toString())) expected.put("user", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - PublicFeedbackListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + PublicFeedbackListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicFeedbackListParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicFeedbackListParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicLatestRunRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicLatestRunRetrieveParamsTest.kt index 6ee4bc5d..491cc23b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicLatestRunRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicLatestRunRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicLatestRunRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicLatestRunRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicLatestRunRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicLatestRunRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicLatestRunRetrieveParams() { + PublicLatestRunRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicLatestRunRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicLatestRunRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunQueryCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunQueryCreateParamsTest.kt index 4516d2b9..039ed6ad 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunQueryCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunQueryCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicRunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicRunQueryCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicRunQueryCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicRunQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicRunQueryCreateParams() { + PublicRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - PublicRunQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() @@ -37,26 +28,20 @@ class PublicRunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:9 assertThat(body.id()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - PublicRunQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + PublicRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicRunQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunRetrieveParamsTest.kt index 1541ae10..7c20d709 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/PublicRunRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class PublicRunRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class PublicRunRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createPublicRunRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - PublicRunRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createPublicRunRetrieveParams() { + PublicRunRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - PublicRunRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + PublicRunRetrieveParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ResponseBodyForRunsGenerateQueryTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ResponseBodyForRunsGenerateQueryTest.kt index bf43196a..e60197b8 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ResponseBodyForRunsGenerateQueryTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/ResponseBodyForRunsGenerateQueryTest.kt @@ -1,25 +1,16 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class ResponseBodyForRunsGenerateQueryTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class ResponseBodyForRunsGenerateQueryTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createResponseBodyForRunsGenerateQuery() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createResponseBodyForRunsGenerateQuery() { val responseBodyForRunsGenerateQuery = - ResponseBodyForRunsGenerateQuery - .builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 - .filter("string") - .build() + ResponseBodyForRunsGenerateQuery.builder().filter("string").build() assertThat(responseBodyForRunsGenerateQuery).isNotNull assertThat(responseBodyForRunsGenerateQuery.filter()).isEqualTo("string") } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunBatchParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunBatchParamsTest.kt index dc43e0d7..d049ec12 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunBatchParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunBatchParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class RunBatchParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunBatchParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunBatchParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunBatchParams() { RunBatchParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunCreateParamsTest.kt index 09573ba6..18de4b4b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunCreateParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class RunCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunCreateParams() { RunCreateParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunGenerateQueryCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunGenerateQueryCreateParamsTest.kt index 1722560f..0ed9bf42 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunGenerateQueryCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunGenerateQueryCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,46 +6,24 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunGenerateQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunGenerateQueryCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunGenerateQueryCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunGenerateQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .query("string") - .build() + @Test + fun createRunGenerateQueryCreateParams() { + RunGenerateQueryCreateParams.builder().query("string").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - RunGenerateQueryCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .query("string") - .build() + @Test + fun getBody() { + val params = RunGenerateQueryCreateParams.builder().query("string").build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.query()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - RunGenerateQueryCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .query("string") - .build() + @Test + fun getBodyWithoutOptionalFields() { + val params = RunGenerateQueryCreateParams.builder().query("string").build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.query()).isEqualTo("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestRetrieveParamsTest.kt index 171a9dec..8040f6f4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunManifestRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunManifestRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunManifestRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunManifestRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createRunManifestRetrieveParams() { + RunManifestRetrieveParams.builder() .runManifestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - RunManifestRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + RunManifestRetrieveParams.builder() .runManifestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestSchemaTest.kt index 89cde65f..1a378478 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunManifestSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import com.langsmith.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunManifestSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunManifestSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunManifestSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunManifestSchema() { val runManifestSchema = - RunManifestSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunManifestSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .manifest(JsonValue.from(mapOf())) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunMonitorCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunMonitorCreateParamsTest.kt index 53a1fa5b..5bf47973 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunMonitorCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunMonitorCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,22 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunMonitorCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunMonitorCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunMonitorCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunMonitorCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createRunMonitorCreateParams() { + RunMonitorCreateParams.builder() .groups( listOf( - RunMonitorCreateParams.MonitorGroupSpec.builder() + RunMonitorCreateParams.Group.builder() .session("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( - RunMonitorCreateParams.MonitorGroupSpec.Metadata.builder() + RunMonitorCreateParams.Group.Metadata.builder() .key("string") .value("string") .build() @@ -44,20 +39,16 @@ class RunMonitorCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - RunMonitorCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + RunMonitorCreateParams.builder() .groups( listOf( - RunMonitorCreateParams.MonitorGroupSpec.builder() + RunMonitorCreateParams.Group.builder() .session("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( - RunMonitorCreateParams.MonitorGroupSpec.Metadata.builder() + RunMonitorCreateParams.Group.Metadata.builder() .key("string") .value("string") .build() @@ -87,11 +78,10 @@ class RunMonitorCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 assertThat(body.groups()) .isEqualTo( listOf( - RunMonitorCreateParams.MonitorGroupSpec - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + RunMonitorCreateParams.Group.builder() .session("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( - RunMonitorCreateParams.MonitorGroupSpec.Metadata.builder() + RunMonitorCreateParams.Group.Metadata.builder() .key("string") .value("string") .build() @@ -102,8 +92,7 @@ class RunMonitorCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 ) assertThat(body.interval()) .isEqualTo( - RunMonitorCreateParams.Interval - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + RunMonitorCreateParams.Interval.builder() .days(123L) .hours(123L) .minutes(123L) @@ -111,26 +100,18 @@ class RunMonitorCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 ) assertThat(body.stride()) .isEqualTo( - RunMonitorCreateParams.Stride - .builder() // templates/JavaSDK/entities/params.ts:1055:14 - .days(123L) - .hours(123L) - .minutes(123L) - .build() + RunMonitorCreateParams.Stride.builder().days(123L).hours(123L).minutes(123L).build() ) assertThat(body.timezone()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - RunMonitorCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + RunMonitorCreateParams.builder() .groups( listOf( - RunMonitorCreateParams.MonitorGroupSpec.builder() + RunMonitorCreateParams.Group.builder() .session("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -141,8 +122,7 @@ class RunMonitorCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:1 assertThat(body.groups()) .isEqualTo( listOf( - RunMonitorCreateParams.MonitorGroupSpec - .builder() // templates/JavaSDK/entities/params.ts:1055:14 + RunMonitorCreateParams.Group.builder() .session("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicDatasetSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicDatasetSchemaTest.kt index 97f105e2..b47e57cc 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicDatasetSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicDatasetSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunPublicDatasetSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunPublicDatasetSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunPublicDatasetSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunPublicDatasetSchema() { val runPublicDatasetSchema = - RunPublicDatasetSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunPublicDatasetSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dottedOrder("string") .name("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicSchemaTest.kt index 1cf53c84..e7ef06d5 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunPublicSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunPublicSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunPublicSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunPublicSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunPublicSchema() { val runPublicSchema = - RunPublicSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunPublicSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dottedOrder("string") .name("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunQueryCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunQueryCreateParamsTest.kt index 12aca95f..8c2e9e54 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunQueryCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunQueryCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunQueryCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunQueryCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createRunQueryCreateParams() { + RunQueryCreateParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .cursor("string") .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -29,21 +24,17 @@ class RunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .query("string") .referenceExample(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .runType(RunQueryCreateParams.RunType.TOOL) - .select(listOf(RunQueryCreateParams.RunSelect.ID)) + .select(listOf(RunQueryCreateParams.Select.ID)) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - RunQueryCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + RunQueryCreateParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .cursor("string") .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -56,7 +47,7 @@ class RunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 .query("string") .referenceExample(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .runType(RunQueryCreateParams.RunType.TOOL) - .select(listOf(RunQueryCreateParams.RunSelect.ID)) + .select(listOf(RunQueryCreateParams.Select.ID)) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -76,18 +67,15 @@ class RunQueryCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(body.referenceExample()) .isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(body.runType()).isEqualTo(RunQueryCreateParams.RunType.TOOL) - assertThat(body.select()).isEqualTo(listOf(RunQueryCreateParams.RunSelect.ID)) + assertThat(body.select()).isEqualTo(listOf(RunQueryCreateParams.Select.ID)) assertThat(body.session()).isEqualTo(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(body.startTime()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.trace()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - RunQueryCreateParams.builder() - .build() // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + @Test + fun getBodyWithoutOptionalFields() { + val params = RunQueryCreateParams.builder().build() val body = params.getBody() assertThat(body).isNotNull } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunRetrieveParamsTest.kt index 218f769e..58509b6f 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createRunRetrieveParams() { + RunRetrieveParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - RunRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunRetrieveParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "runId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaTest.kt index 6653d142..d880b5e6 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunSchema() { val runSchema = - RunSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunSchema.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .appPath("string") .dottedOrder("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfoTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfoTest.kt index e019200e..66cbc88e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfoTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunSchemaWithAnnotationQueueInfoTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,19 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunSchemaWithAnnotationQueueInfoTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunSchemaWithAnnotationQueueInfoTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunSchemaWithAnnotationQueueInfo() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunSchemaWithAnnotationQueueInfo() { val runSchemaWithAnnotationQueueInfo = - RunSchemaWithAnnotationQueueInfo - .builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunSchemaWithAnnotationQueueInfo.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .appPath("string") .dottedOrder("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareDeleteParamsTest.kt index 51d3cf1d..4a2ad5d1 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunShareDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunShareDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunShareDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunShareDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createRunShareDeleteParams() { + RunShareDeleteParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - RunShareDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunShareDeleteParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "runId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareRetrieveParamsTest.kt index 412772b9..689a62e6 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunShareRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunShareRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunShareRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunShareRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createRunShareRetrieveParams() { + RunShareRetrieveParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - RunShareRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunShareRetrieveParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "runId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareSchemaTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareSchemaTest.kt index ef878f56..fe3fb0d6 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareSchemaTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareSchemaTest.kt @@ -1,22 +1,16 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunShareSchemaTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunShareSchemaTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunShareSchema() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunShareSchema() { val runShareSchema = - RunShareSchema.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunShareSchema.builder() .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareUpdateParamsTest.kt index 10af26ca..6474648c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunShareUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunShareUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunShareUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunShareUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunShareUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createRunShareUpdateParams() { + RunShareUpdateParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - RunShareUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunShareUpdateParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "runId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatCreateParamsTest.kt index cc30308e..83c29aa2 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunStatCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunStatCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunStatCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunStatCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createRunStatCreateParams() { + RunStatCreateParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .error(true) @@ -33,14 +28,10 @@ class RunStatCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - RunStatCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + RunStatCreateParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .error(true) @@ -73,11 +64,9 @@ class RunStatCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.trace()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - RunStatCreateParams.builder().build() // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + @Test + fun getBodyWithoutOptionalFields() { + val params = RunStatCreateParams.builder().build() val body = params.getBody() assertThat(body).isNotNull } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatsTest.kt index a71069dc..628a3999 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunStatsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunStatsTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class RunStatsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createRunStats() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createRunStats() { val runStats = - RunStats.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + RunStats.builder() .runCount(123L) .completionCost(42.23) .completionTokens(123L) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunUpdateParamsTest.kt index 26a976eb..0525df88 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/RunUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,16 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class RunUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class RunUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createRunUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - RunUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createRunUpdateParams() { + RunUpdateParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - RunUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun getPathParam() { + val params = RunUpdateParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "runId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionCreateParamsTest.kt index 0cd646a1..16c02840 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -8,16 +8,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class SessionCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class SessionCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createSessionCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - SessionCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createSessionCreateParams() { + SessionCreateParams.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -30,14 +25,10 @@ class SessionCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - SessionCreateParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionCreateParams.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -53,23 +44,17 @@ class SessionCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - SessionCreateParams.builder().build() // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = SessionCreateParams.builder().build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - SessionCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + SessionCreateParams.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -92,11 +77,9 @@ class SessionCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.startTime()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - SessionCreateParams.builder().build() // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + @Test + fun getBodyWithoutOptionalFields() { + val params = SessionCreateParams.builder().build() val body = params.getBody() assertThat(body).isNotNull } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionDeleteParamsTest.kt index 9464cc90..a987a45a 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class SessionDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class SessionDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createSessionDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - SessionDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createSessionDeleteParams() { + SessionDeleteParams.builder() .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - SessionDeleteParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionDeleteParams.builder() .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() @@ -35,13 +26,10 @@ class SessionDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - SessionDeleteParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionDeleteParams.builder() .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionListParamsTest.kt index d7aaee7e..7c756210 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionListParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class SessionListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class SessionListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createSessionListParams() { // templates/JavaSDK/entities/testing.ts:18:13 - SessionListParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createSessionListParams() { + SessionListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .facets(true) .limit(123L) @@ -30,14 +25,10 @@ class SessionListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - SessionListParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .facets(true) .limit(123L) @@ -65,11 +56,9 @@ class SessionListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - SessionListParams.builder().build() // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + @Test + fun getQueryParamsWithoutOptionalFields() { + val params = SessionListParams.builder().build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParamsTest.kt index 224c4d5b..98c846aa 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionMetadataRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,16 +7,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class SessionMetadataRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class SessionMetadataRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createSessionMetadataRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - SessionMetadataRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createSessionMetadataRetrieveParams() { + SessionMetadataRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .k(123L) .metadataKeys(listOf("string")) @@ -24,15 +19,10 @@ class SessionMetadataRetrieveParamsTest { // templates/JavaSDK/entities/params.t .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - SessionMetadataRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionMetadataRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .k(123L) .metadataKeys(listOf("string")) @@ -45,28 +35,20 @@ class SessionMetadataRetrieveParamsTest { // templates/JavaSDK/entities/params.t assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - SessionMetadataRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionMetadataRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - SessionMetadataRetrieveParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + SessionMetadataRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionRetrieveParamsTest.kt index 9c07e634..6679a915 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionRetrieveParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,20 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class SessionRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class SessionRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createSessionRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 - SessionRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createSessionRetrieveParams() { + SessionRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .includeStats(true) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:921:17 - fun getQueryParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParams() { val params = - SessionRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .includeStats(true) .build() @@ -37,26 +28,20 @@ class SessionRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getQueryParamsWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getQueryParamsWithoutOptionalFields() { val params = - SessionRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:954:10 // - // templates/JavaSDK/entities/params.ts:953:16 // - // templates/JavaSDK/entities/params.ts:953:16 + SessionRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val expected = mutableMapOf>() assertThat(params.getQueryParams()).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - SessionRetrieveParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + SessionRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionUpdateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionUpdateParamsTest.kt index 718eee6b..90f0d3e2 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionUpdateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/SessionUpdateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -8,16 +8,11 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class SessionUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class SessionUpdateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createSessionUpdateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - SessionUpdateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createSessionUpdateParams() { + SessionUpdateParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -27,14 +22,10 @@ class SessionUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - SessionUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + SessionUpdateParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -51,28 +42,18 @@ class SessionUpdateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 / assertThat(body.name()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBodyWithoutOptionalFields() { val params = - SessionUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + SessionUpdateParams.builder().sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() val body = params.getBody() assertThat(body).isNotNull } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - SessionUpdateParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + SessionUpdateParams.builder().sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "sessionId" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCreateParamsTest.kt index a2d2f67f..a5bc192d 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,16 +6,11 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - TenantCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createTenantCreateParams() { + TenantCreateParams.builder() .displayName("x") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -23,14 +18,10 @@ class TenantCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - TenantCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 + TenantCreateParams.builder() .displayName("x") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -44,15 +35,9 @@ class TenantCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // assertThat(body.tenantHandle()).isEqualTo("string") } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - TenantCreateParams.builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .displayName("x") - .build() + @Test + fun getBodyWithoutOptionalFields() { + val params = TenantCreateParams.builder().displayName("x").build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.displayName()).isEqualTo("x") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParamsTest.kt index 91ad321a..1bb86ed3 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,49 +6,26 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantCurrentMembersCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantCurrentMembersCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantCurrentMembersCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - TenantCurrentMembersCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .email("string") - .readOnly(true) - .build() + @Test + fun createTenantCurrentMembersCreateParams() { + TenantCurrentMembersCreateParams.builder().email("string").readOnly(true).build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:1011:17 - fun getBody() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getBody() { val params = - TenantCurrentMembersCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .email("string") - .readOnly(true) - .build() + TenantCurrentMembersCreateParams.builder().email("string").readOnly(true).build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.email()).isEqualTo("string") assertThat(body.readOnly()).isEqualTo(true) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getBodyWithoutOptionalFields() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = - TenantCurrentMembersCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1043:10 // - // templates/JavaSDK/entities/params.ts:1042:16 // - // templates/JavaSDK/entities/params.ts:1042:16 - .email("string") - .build() + @Test + fun getBodyWithoutOptionalFields() { + val params = TenantCurrentMembersCreateParams.builder().email("string").build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.email()).isEqualTo("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersListParamsTest.kt index c9ace5ed..31fe6719 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentMembersListParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class TenantCurrentMembersListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantCurrentMembersListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantCurrentMembersListParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantCurrentMembersListParams() { TenantCurrentMembersListParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParamsTest.kt index a375284a..2daf5c32 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantCurrentStatsRetrieveParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class TenantCurrentStatsRetrieveParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantCurrentStatsRetrieveParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantCurrentStatsRetrieveParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantCurrentStatsRetrieveParams() { TenantCurrentStatsRetrieveParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantForUserTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantForUserTest.kt index ef1c8238..4f39907e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantForUserTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantForUserTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantForUserTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TenantForUserTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTenantForUser() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantForUser() { val tenantForUser = - TenantForUser.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + TenantForUser.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .config( TenantForUser.Config.builder() @@ -39,7 +33,7 @@ class TenantForUserTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(tenantForUser.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(tenantForUser.config()) .isEqualTo( - TenantForUser.Config.builder() // templates/JavaSDK/entities/objects.ts:717:13 + TenantForUser.Config.builder() .flags(TenantForUser.Config.Flags.builder().build()) .isPersonal(true) .maxHourlyTracingBytes(123L) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantListParamsTest.kt index 69190c80..7963e70c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantListParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class TenantListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantListParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantListParams() { TenantListParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberDeleteParamsTest.kt index 863acf7a..804cd366 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,27 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantMemberDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantMemberDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantMemberDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - TenantMemberDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createTenantMemberDeleteParams() { + TenantMemberDeleteParams.builder() .identityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - TenantMemberDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + TenantMemberDeleteParams.builder() .identityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParamsTest.kt index c51b0af3..b25b027e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMemberPendingDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantMemberPendingDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantMemberPendingDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantMemberPendingDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - TenantMemberPendingDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createTenantMemberPendingDeleteParams() { + TenantMemberPendingDeleteParams.builder() .identityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - TenantMemberPendingDeleteParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + TenantMemberPendingDeleteParams.builder() .identityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMembersTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMembersTest.kt index 0e414df5..af500fbe 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMembersTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantMembersTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,21 +6,15 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantMembersTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TenantMembersTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTenantMembers() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantMembers() { val tenantMembers = - TenantMembers.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + TenantMembers.builder() .members( listOf( - TenantMembers.TenantMemberIdentity.builder() + TenantMembers.Member.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .readOnly(true) @@ -50,8 +44,7 @@ class TenantMembersTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(tenantMembers).isNotNull assertThat(tenantMembers.members()) .containsExactly( - TenantMembers.TenantMemberIdentity - .builder() // templates/JavaSDK/entities/objects.ts:717:13 + TenantMembers.Member.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .readOnly(true) @@ -65,7 +58,7 @@ class TenantMembersTest { // templates/JavaSDK/entities/objects.ts:645:15 // ) assertThat(tenantMembers.pending()) .containsExactly( - PendingIdentity.builder() // templates/JavaSDK/entities/objects.ts:717:13 + PendingIdentity.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .email("string") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParamsTest.kt index 401908f8..b42cbd96 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingClaimCreateParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,28 +6,19 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantPendingClaimCreateParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantPendingClaimCreateParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantPendingClaimCreateParams() { // templates/JavaSDK/entities/testing.ts:18:13 - TenantPendingClaimCreateParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 + @Test + fun createTenantPendingClaimCreateParams() { + TenantPendingClaimCreateParams.builder() .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - TenantPendingClaimCreateParams - .builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 + TenantPendingClaimCreateParams.builder() .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(params).isNotNull diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingDeleteParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingDeleteParamsTest.kt index 203ff63e..36e39baa 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingDeleteParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingDeleteParamsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,29 +6,17 @@ import com.langsmith.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantPendingDeleteParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantPendingDeleteParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantPendingDeleteParams() { // templates/JavaSDK/entities/testing.ts:18:13 - TenantPendingDeleteParams.builder() // templates/JavaSDK/entities/params.ts:916:21 // - // templates/JavaSDK/entities/params.ts:916:16 // - // templates/JavaSDK/entities/params.ts:916:16 - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + @Test + fun createTenantPendingDeleteParams() { + TenantPendingDeleteParams.builder().id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun getPathParam() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun getPathParam() { val params = - TenantPendingDeleteParams.builder() // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1072:10 // - // templates/JavaSDK/entities/params.ts:1071:16 // - // templates/JavaSDK/entities/params.ts:1071:16 - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + TenantPendingDeleteParams.builder().id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() assertThat(params).isNotNull // path param "id" assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingListParamsTest.kt index e5bae11f..a327f8f3 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantPendingListParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class TenantPendingListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantPendingListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantPendingListParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantPendingListParams() { TenantPendingListParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsListParamsTest.kt index 6c8acb9b..65b86e09 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsListParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class TenantStatsListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantStatsListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantStatsListParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantStatsListParams() { TenantStatsListParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsTest.kt index b56a1825..c4bb1b3d 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantStatsTest.kt @@ -1,22 +1,16 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantStatsTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TenantStatsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTenantStats() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantStats() { val tenantStats = - TenantStats.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + TenantStats.builder() .annotationQueueCount(123L) .datasetCount(123L) .repoCount(123L) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantTest.kt index 6f24f850..781be04a 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -6,18 +6,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TenantTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTenant() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenant() { val tenant = - Tenant.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + Tenant.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .config( Tenant.Config.builder() @@ -38,7 +32,7 @@ class TenantTest { // templates/JavaSDK/entities/objects.ts:645:15 // assertThat(tenant.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(tenant.config()) .isEqualTo( - Tenant.Config.builder() // templates/JavaSDK/entities/objects.ts:717:13 + Tenant.Config.builder() .flags(Tenant.Config.Flags.builder().build()) .isPersonal(true) .maxHourlyTracingBytes(123L) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitInfoTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitInfoTest.kt index 66dc98d2..faeea0f5 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitInfoTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitInfoTest.kt @@ -1,22 +1,16 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TenantUsageLimitInfoTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TenantUsageLimitInfoTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTenantUsageLimitInfo() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantUsageLimitInfo() { val tenantUsageLimitInfo = - TenantUsageLimitInfo.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + TenantUsageLimitInfo.builder() .inRejectSet(true) .tenantLimit(123L) .usageLimitType(TenantUsageLimitInfo.UsageLimitType.PAYLOAD_SIZE) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitListParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitListParamsTest.kt index 4f0bd364..e5ae3935 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitListParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TenantUsageLimitListParamsTest.kt @@ -1,17 +1,14 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import com.langsmith.api.models.* import org.junit.jupiter.api.Test -class TenantUsageLimitListParamsTest { // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 // - // templates/JavaSDK/entities/params.ts:907:13 +class TenantUsageLimitListParamsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/params.ts:907:13 - fun createTenantUsageLimitListParams() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTenantUsageLimitListParams() { TenantUsageLimitListParams.builder().build() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionMetadataResponseTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionMetadataResponseTest.kt index 0d213c9a..f57ec8ce 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionMetadataResponseTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionMetadataResponseTest.kt @@ -1,21 +1,15 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TracerSessionMetadataResponseTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TracerSessionMetadataResponseTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTracerSessionMetadataResponse() { // templates/JavaSDK/entities/testing.ts:18:13 - val tracerSessionMetadataResponse = - TracerSessionMetadataResponse.builder() - .build() // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + @Test + fun createTracerSessionMetadataResponse() { + val tracerSessionMetadataResponse = TracerSessionMetadataResponse.builder().build() assertThat(tracerSessionMetadataResponse).isNotNull } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionTest.kt index 77ae9265..7f5d5c44 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,18 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TracerSessionTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TracerSessionTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTracerSession() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTracerSession() { val tracerSession = - TracerSession.builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + TracerSession.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .completionCost(42.23) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFieldsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFieldsTest.kt index 2164f940..ed58bfd3 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFieldsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/models/TracerSessionWithoutVirtualFieldsTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.models @@ -7,19 +7,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class TracerSessionWithoutVirtualFieldsTest { // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 // - // templates/JavaSDK/entities/objects.ts:645:15 +class TracerSessionWithoutVirtualFieldsTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // - // templates/JavaSDK/entities/objects.ts:645:15 - fun createTracerSessionWithoutVirtualFields() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun createTracerSessionWithoutVirtualFields() { val tracerSessionWithoutVirtualFields = - TracerSessionWithoutVirtualFields - .builder() // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:657:10 // - // templates/JavaSDK/entities/objects.ts:656:16 // - // templates/JavaSDK/entities/objects.ts:656:16 + TracerSessionWithoutVirtualFields.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ErrorHandlingTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ErrorHandlingTest.kt index 68d0aed1..4fcdbaf6 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ErrorHandlingTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ErrorHandlingTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services @@ -8,7 +8,7 @@ import com.github.tomakehurst.wiremock.client.WireMock.get import com.github.tomakehurst.wiremock.client.WireMock.ok import com.github.tomakehurst.wiremock.client.WireMock.status import com.github.tomakehurst.wiremock.client.WireMock.stubFor -import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo // templates/JavaSDK/components/file.ts:28:17 // templates/JavaSDK/components/file.ts:28:17 +import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.google.common.collect.ImmutableListMultimap import com.google.common.collect.ListMultimap @@ -35,39 +35,32 @@ import org.assertj.guava.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -@WireMockTest // templates/JavaSDK/errors.ts:269:13 // templates/JavaSDK/errors.ts:269:13 // -// templates/JavaSDK/errors.ts:269:13 // templates/JavaSDK/errors.ts:269:13 +@WireMockTest class ErrorHandlingTest { - private val JSON_MAPPER: JsonMapper = jsonMapper() // templates/JavaSDK/errors.ts:269:13 + private val JSON_MAPPER: JsonMapper = jsonMapper() private val LANG_SMITH_ERROR: LangSmithError = LangSmithError.builder().putAdditionalProperty("key", JsonString.of("value")).build() private lateinit var client: LangSmithClient - @BeforeEach // templates/JavaSDK/errors.ts:292:10 - fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { // templates/JavaSDK/errors.ts:292:10 + @BeforeEach + fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/errors.ts:302:36 // - // templates/JavaSDK/errors.ts:302:20 - .baseUrl( - wmRuntimeInfo.getHttpBaseUrl() - ) // templates/JavaSDK/errors.ts:304:26 // templates/JavaSDK/errors.ts:304:26 + LangSmithOkHttpClient.builder() + .baseUrl(wmRuntimeInfo.getHttpBaseUrl()) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve200() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:317:22 + @Test + fun apiKeysRetrieve200() { + val params = ApiKeyRetrieveParams.builder().build() val expected = listOf( - ApiKeyGetResponse.builder() // templates/JavaSDK/errors.ts:329:16 // - // templates/JavaSDK/errors.ts:329:16 + ApiKeyGetResponse.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .readOnly(true) .shortKey("string") @@ -75,116 +68,81 @@ class ErrorHandlingTest { .build() ) - stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:338:16 // templates/JavaSDK/errors.ts:338:16 - .willReturn(ok().withBody(toJson(expected))) - ) + stubFor(get(anyUrl()).willReturn(ok().withBody(toJson(expected)))) assertThat(client.apiKeys().retrieve(params)).isEqualTo(expected) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve400() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve400() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(400).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertBadRequest(e, ImmutableListMultimap.of("Foo", "Bar"), LANG_SMITH_ERROR) }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve401() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve401() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(401).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertUnauthorized(e, ImmutableListMultimap.of("Foo", "Bar"), LANG_SMITH_ERROR) }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve403() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve403() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(403).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertPermissionDenied(e, ImmutableListMultimap.of("Foo", "Bar"), LANG_SMITH_ERROR) }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve404() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve404() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(404).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertNotFound(e, ImmutableListMultimap.of("Foo", "Bar"), LANG_SMITH_ERROR) }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve422() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve422() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(422).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertUnprocessableEntity( e, @@ -194,57 +152,42 @@ class ErrorHandlingTest { }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve429() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve429() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(429).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertRateLimit(e, ImmutableListMultimap.of("Foo", "Bar"), LANG_SMITH_ERROR) }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieve500() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:385:24 + @Test + fun apiKeysRetrieve500() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:392:20 // templates/JavaSDK/errors.ts:392:20 // - // templates/JavaSDK/errors.ts:391:16 + get(anyUrl()) .willReturn(status(500).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) - assertThatThrownBy({ - client.apiKeys().retrieve(params) - }) // templates/JavaSDK/errors.ts:402:20 // templates/JavaSDK/errors.ts:402:20 // - // templates/JavaSDK/errors.ts:401:16 + assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> assertInternalServer(e, ImmutableListMultimap.of("Foo", "Bar"), LANG_SMITH_ERROR) }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun unexpectedStatusCode() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:424:22 + @Test + fun unexpectedStatusCode() { + val params = ApiKeyRetrieveParams.builder().build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:431:18 // templates/JavaSDK/errors.ts:431:18 // - // templates/JavaSDK/errors.ts:430:14 + get(anyUrl()) .willReturn(status(999).withHeader("Foo", "Bar").withBody(toJson(LANG_SMITH_ERROR))) ) @@ -259,42 +202,25 @@ class ErrorHandlingTest { }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun invalidBody() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:470:24 + @Test + fun invalidBody() { + val params = ApiKeyRetrieveParams.builder().build() - stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:477:20 // templates/JavaSDK/errors.ts:477:20 // - // templates/JavaSDK/errors.ts:476:16 - .willReturn(status(200).withBody("Not JSON")) - ) + stubFor(get(anyUrl()).willReturn(status(200).withBody("Not JSON"))) assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> - assertThat( - e - ) // templates/JavaSDK/errors.ts:489:31 // templates/JavaSDK/errors.ts:483:20 // - // templates/JavaSDK/errors.ts:483:20 // templates/JavaSDK/errors.ts:482:16 - .isInstanceOf( - LangSmithException::class.java - ) // templates/JavaSDK/errors.ts:491:28 // templates/JavaSDK/errors.ts:491:28 + assertThat(e) + .isInstanceOf(LangSmithException::class.java) .hasMessage("Error reading response") }) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun invalidErrorBody() { // templates/JavaSDK/entities/testing.ts:18:13 - val params = ApiKeyRetrieveParams.builder().build() // templates/JavaSDK/errors.ts:505:22 + @Test + fun invalidErrorBody() { + val params = ApiKeyRetrieveParams.builder().build() - stubFor( - get( - anyUrl() - ) // templates/JavaSDK/errors.ts:512:18 // templates/JavaSDK/errors.ts:512:18 // - // templates/JavaSDK/errors.ts:511:14 - .willReturn(status(400).withBody("Not JSON")) - ) + stubFor(get(anyUrl()).willReturn(status(400).withBody("Not JSON"))) assertThatThrownBy({ client.apiKeys().retrieve(params) }) .satisfies({ e -> @@ -302,7 +228,7 @@ class ErrorHandlingTest { }) } - private fun toJson(body: T): ByteArray { // templates/JavaSDK/errors.ts:530:10 + private fun toJson(body: T): ByteArray { return JSON_MAPPER.writeValueAsBytes(body) } @@ -311,19 +237,13 @@ class ErrorHandlingTest { statusCode: Int, headers: ListMultimap, responseBody: ByteArray - ) { // templates/JavaSDK/errors.ts:538:10 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:552:18 // templates/JavaSDK/errors.ts:552:18 // - // templates/JavaSDK/errors.ts:551:20 + ) { + assertThat(throwable) .asInstanceOf( InstanceOfAssertFactories.throwable(UnexpectedStatusCodeException::class.java) - ) // templates/JavaSDK/errors.ts:555:22 // templates/JavaSDK/errors.ts:555:22 + ) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - statusCode - ) // templates/JavaSDK/errors.ts:560:32 // templates/JavaSDK/errors.ts:560:32 + assertThat(e.statusCode()).isEqualTo(statusCode) assertThat(e.body()).isEqualTo(String(responseBody)) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -333,19 +253,11 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 - .asInstanceOf( - InstanceOfAssertFactories.throwable(BadRequestException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) { + assertThat(throwable) + .asInstanceOf(InstanceOfAssertFactories.throwable(BadRequestException::class.java)) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 400 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(400) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -355,19 +267,11 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 - .asInstanceOf( - InstanceOfAssertFactories.throwable(UnauthorizedException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) { + assertThat(throwable) + .asInstanceOf(InstanceOfAssertFactories.throwable(UnauthorizedException::class.java)) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 401 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(401) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -377,19 +281,13 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 + ) { + assertThat(throwable) .asInstanceOf( InstanceOfAssertFactories.throwable(PermissionDeniedException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 403 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(403) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -399,19 +297,11 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 - .asInstanceOf( - InstanceOfAssertFactories.throwable(NotFoundException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) { + assertThat(throwable) + .asInstanceOf(InstanceOfAssertFactories.throwable(NotFoundException::class.java)) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 404 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(404) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -421,19 +311,13 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 + ) { + assertThat(throwable) .asInstanceOf( InstanceOfAssertFactories.throwable(UnprocessableEntityException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 422 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(422) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -443,19 +327,11 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 - .asInstanceOf( - InstanceOfAssertFactories.throwable(RateLimitException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) { + assertThat(throwable) + .asInstanceOf(InstanceOfAssertFactories.throwable(RateLimitException::class.java)) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 429 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(429) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) @@ -465,19 +341,11 @@ class ErrorHandlingTest { throwable: Throwable, headers: ListMultimap, error: LangSmithError - ) { // templates/JavaSDK/errors.ts:575:12 - assertThat( - throwable - ) // templates/JavaSDK/errors.ts:585:20 // templates/JavaSDK/errors.ts:585:20 // - // templates/JavaSDK/errors.ts:584:22 - .asInstanceOf( - InstanceOfAssertFactories.throwable(InternalServerException::class.java) - ) // templates/JavaSDK/errors.ts:588:24 // templates/JavaSDK/errors.ts:588:24 + ) { + assertThat(throwable) + .asInstanceOf(InstanceOfAssertFactories.throwable(InternalServerException::class.java)) .satisfies({ e -> - assertThat(e.statusCode()) - .isEqualTo( - 500 - ) // templates/JavaSDK/errors.ts:593:34 // templates/JavaSDK/errors.ts:593:34 + assertThat(e.statusCode()).isEqualTo(500) assertThat(e.error()).isEqualTo(error) assertThat(e.headers()).containsAllEntriesOf(headers) }) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ServiceParamsTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ServiceParamsTest.kt index 5e3d3a4a..a26cb75e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ServiceParamsTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/ServiceParamsTest.kt @@ -1,10 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services -// // -// templates/JavaSDK/components/file.ts:28:17 -import com.fasterxml.jackson.databind.json.JsonMapper // templates/JavaSDK/components/file.ts:28:17 +import com.fasterxml.jackson.databind.json.JsonMapper import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.equalTo import com.github.tomakehurst.wiremock.client.WireMock.get @@ -21,32 +19,25 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -@WireMockTest // templates/JavaSDK/services.ts:581:15 // templates/JavaSDK/services.ts:581:15 // -// templates/JavaSDK/services.ts:581:15 // templates/JavaSDK/services.ts:581:15 +@WireMockTest class ServiceParamsTest { - private val JSON_MAPPER: JsonMapper = jsonMapper() // templates/JavaSDK/services.ts:581:15 + private val JSON_MAPPER: JsonMapper = jsonMapper() private lateinit var client: LangSmithClient - @BeforeEach // templates/JavaSDK/services.ts:598:12 - fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { // templates/JavaSDK/services.ts:598:12 + @BeforeEach + fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:608:38 // - // templates/JavaSDK/services.ts:608:22 - .apiKey( - "My API Key" - ) // templates/JavaSDK/services.ts:610:28 // templates/JavaSDK/services.ts:610:28 - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") + LangSmithOkHttpClient.builder() + .apiKey("My API Key") .baseUrl(wmRuntimeInfo.getHttpBaseUrl()) .build() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun apiKeysRetrieveWithAdditionalParams() { // templates/JavaSDK/entities/testing.ts:18:13 - val additionalHeaders = - mutableMapOf>() // templates/JavaSDK/services.ts:628:26 + @Test + fun apiKeysRetrieveWithAdditionalParams() { + val additionalHeaders = mutableMapOf>() additionalHeaders.put("x-test-header", listOf("abc1234")) @@ -55,20 +46,14 @@ class ServiceParamsTest { additionalQueryParams.put("test_query_param", listOf("def567")) val params = - ApiKeyRetrieveParams.builder() // templates/JavaSDK/services.ts:651:18 + ApiKeyRetrieveParams.builder() .additionalHeaders(additionalHeaders) .additionalQueryParams(additionalQueryParams) .build() stubFor( - get( - anyUrl() - ) // templates/JavaSDK/services.ts:680:22 // templates/JavaSDK/services.ts:680:22 // - // templates/JavaSDK/services.ts:679:18 - .withHeader( - "x-test-header", - equalTo("abc1234") - ) // templates/JavaSDK/services.ts:683:26 // templates/JavaSDK/services.ts:683:26 + get(anyUrl()) + .withHeader("x-test-header", equalTo("abc1234")) .withQueryParam("test_query_param", equalTo("def567")) .willReturn(ok("[]")) ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceTest.kt index 8f93d3e2..24a8dae0 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/AnnotationQueueServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class AnnotationQueueServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val annotationQueueService = client.annotationQueues() val annotationQueueSchema = annotationQueueService.create( - AnnotationQueueCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueCreateParams.builder() .name("string") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -42,32 +30,21 @@ class AnnotationQueueServiceTest { .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - println( - annotationQueueSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(annotationQueueSchema) annotationQueueSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val annotationQueueService = client.annotationQueues() val annotationQueueUpdateResponse = annotationQueueService.update( - AnnotationQueueUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .name("string") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -78,26 +55,17 @@ class AnnotationQueueServiceTest { println(annotationQueueUpdateResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val annotationQueueService = client.annotationQueues() val annotationQueueListResponse = annotationQueueService.list( - AnnotationQueueListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueListParams.builder() .ids(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .limit(123L) .name("string") @@ -105,68 +73,44 @@ class AnnotationQueueServiceTest { .offset(123L) .build() ) - println( - annotationQueueListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (annotationQueueSchema: AnnotationQueueSchema in - annotationQueueListResponse) { // templates/JavaSDK/services.ts:509:10 + println(annotationQueueListResponse) + for (annotationQueueSchema: AnnotationQueueSchema in annotationQueueListResponse) { annotationQueueSchema.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val annotationQueueService = client.annotationQueues() val annotationQueueDeleteResponse = annotationQueueService.delete( - AnnotationQueueDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueDeleteParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) println(annotationQueueDeleteResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callSizeRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callSizeRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val annotationQueueService = client.annotationQueues() val annotationQueueSizeSchema = annotationQueueService.sizeRetrieve( - AnnotationQueueSizeRetrieveParams - .builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueSizeRetrieveParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - annotationQueueSizeSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(annotationQueueSizeSchema) annotationQueueSizeSchema.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceTest.kt index 9cbe178e..9c770718 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ApiKeyServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,92 +8,53 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class ApiKeyServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val apiKeyService = client.apiKeys() val apiKeyCreateResponse = - apiKeyService.create( - ApiKeyCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .readOnly(true) - .build() - ) - println( - apiKeyCreateResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + apiKeyService.create(ApiKeyCreateParams.builder().readOnly(true).build()) + println(apiKeyCreateResponse) apiKeyCreateResponse.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val apiKeyService = client.apiKeys() - val apiKeyRetrieveResponse = - apiKeyService.retrieve( - ApiKeyRetrieveParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - apiKeyRetrieveResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (apiKeyGetResponse: ApiKeyGetResponse in - apiKeyRetrieveResponse) { // templates/JavaSDK/services.ts:509:10 + val apiKeyRetrieveResponse = apiKeyService.retrieve(ApiKeyRetrieveParams.builder().build()) + println(apiKeyRetrieveResponse) + for (apiKeyGetResponse: ApiKeyGetResponse in apiKeyRetrieveResponse) { apiKeyGetResponse.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val apiKeyService = client.apiKeys() val apiKeyGetResponse = apiKeyService.delete( - ApiKeyDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ApiKeyDeleteParams.builder() .apiKeyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - apiKeyGetResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(apiKeyGetResponse) apiKeyGetResponse.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/DatasetServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/DatasetServiceTest.kt index 154ade31..bf97ca29 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/DatasetServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/DatasetServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class DatasetServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val datasetService = client.datasets() val dataset = datasetService.create( - DatasetCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetCreateParams.builder() .name("string") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -42,92 +30,59 @@ class DatasetServiceTest { .description("string") .build() ) - println( - dataset - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(dataset) dataset.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val datasetService = client.datasets() val dataset = datasetService.retrieve( - DatasetRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - dataset - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(dataset) dataset.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val datasetService = client.datasets() val datasetSchemaForUpdate = datasetService.update( - DatasetUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") .name("string") .build() ) - println( - datasetSchemaForUpdate - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(datasetSchemaForUpdate) datasetSchemaForUpdate.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val datasetService = client.datasets() val datasetListResponse = datasetService.list( - DatasetListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dataType(DatasetListParams.DataType.KV) @@ -137,60 +92,40 @@ class DatasetServiceTest { .offset(123L) .build() ) - println( - datasetListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (dataset: Dataset in datasetListResponse) { // templates/JavaSDK/services.ts:509:10 + println(datasetListResponse) + for (dataset: Dataset in datasetListResponse) { dataset.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val datasetService = client.datasets() val datasetDeleteResponse = datasetService.delete( - DatasetDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetDeleteParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) println(datasetDeleteResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpload() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpload() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val datasetService = client.datasets() val dataset = datasetService.upload( - DatasetUploadParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetUploadParams.builder() .file("file.txt") .inputKeys(listOf("string")) .dataType(DatasetUploadParams.DataType.KV) @@ -199,9 +134,7 @@ class DatasetServiceTest { .outputKeys(listOf("string")) .build() ) - println( - dataset - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(dataset) dataset.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ExampleServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ExampleServiceTest.kt index dd16f72f..95fe6841 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ExampleServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/ExampleServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -10,32 +10,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class ExampleServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val exampleService = client.examples() val example = exampleService.create( - ExampleCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -44,62 +32,40 @@ class ExampleServiceTest { .sourceRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - example - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(example) example.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val exampleService = client.examples() val example = exampleService.retrieve( - ExampleRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleRetrieveParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - println( - example - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(example) example.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val exampleService = client.examples() val exampleUpdateResponse = exampleService.update( - ExampleUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleUpdateParams.builder() .exampleId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) @@ -109,26 +75,17 @@ class ExampleServiceTest { println(exampleUpdateResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val exampleService = client.examples() val exampleListResponse = exampleService.list( - ExampleListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dataset("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -136,34 +93,23 @@ class ExampleServiceTest { .offset(123L) .build() ) - println( - exampleListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (example: Example in exampleListResponse) { // templates/JavaSDK/services.ts:509:10 + println(exampleListResponse) + for (example: Example in exampleListResponse) { example.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val exampleService = client.examples() val exampleDeleteResponse = exampleService.delete( - ExampleDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleDeleteParams.builder() .exampleIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceTest.kt index 29ec31cf..9ff24ae4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackConfigServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,39 +8,26 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class FeedbackConfigServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackConfigService = client.feedbackConfigs() val feedbackConfigSchema = feedbackConfigService.create( - FeedbackConfigCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackConfigCreateParams.builder() .feedbackConfig( FeedbackConfigCreateParams.FeedbackConfig.builder() .type(FeedbackConfigCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackConfigCreateParams.FeedbackConfig.FeedbackCategory - .builder() + FeedbackConfigCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -53,33 +40,22 @@ class FeedbackConfigServiceTest { .feedbackKey("string") .build() ) - println( - feedbackConfigSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(feedbackConfigSchema) feedbackConfigSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackConfigService = client.feedbackConfigs() val feedbackConfigListResponse = - feedbackConfigService.list( - FeedbackConfigListParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - feedbackConfigListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (feedbackConfigSchema: FeedbackConfigSchema in - feedbackConfigListResponse) { // templates/JavaSDK/services.ts:509:10 + feedbackConfigService.list(FeedbackConfigListParams.builder().build()) + println(feedbackConfigListResponse) + for (feedbackConfigSchema: FeedbackConfigSchema in feedbackConfigListResponse) { feedbackConfigSchema.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackServiceTest.kt index 35c574f1..f6906ff3 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/FeedbackServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -10,32 +10,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class FeedbackServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackService = client.feedback() val feedbackSchema = feedbackService.create( - FeedbackCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackCreateParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -47,7 +35,7 @@ class FeedbackServiceTest { .type(FeedbackCreateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackCreateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackCreateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -70,61 +58,39 @@ class FeedbackServiceTest { .value(FeedbackCreateParams.Value.ofDouble(42.23)) .build() ) - println( - feedbackSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(feedbackSchema) feedbackSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackService = client.feedback() val feedbackSchema = feedbackService.retrieve( - FeedbackRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackRetrieveParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - feedbackSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(feedbackSchema) feedbackSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackService = client.feedback() val feedbackSchema = feedbackService.update( - FeedbackUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackUpdateParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .comment("string") .correction(JsonValue.from(mapOf())) @@ -133,7 +99,7 @@ class FeedbackServiceTest { .type(FeedbackUpdateParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackUpdateParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackUpdateParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -147,32 +113,21 @@ class FeedbackServiceTest { .value(FeedbackUpdateParams.Value.ofDouble(42.23)) .build() ) - println( - feedbackSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(feedbackSchema) feedbackSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackService = client.feedback() val feedbackListResponse = feedbackService.list( - FeedbackListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackListParams.builder() .hasComment(true) .hasScore(true) .key(listOf("string")) @@ -180,65 +135,44 @@ class FeedbackServiceTest { .offset(123L) .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(FeedbackListParams.SourceType.API)) + .source(listOf(FeedbackListParams.Source.API)) .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() ) - println( - feedbackListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (feedbackSchema: FeedbackSchema in - feedbackListResponse) { // templates/JavaSDK/services.ts:509:10 + println(feedbackListResponse) + for (feedbackSchema: FeedbackSchema in feedbackListResponse) { feedbackSchema.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackService = client.feedback() val feedbackDeleteResponse = feedbackService.delete( - FeedbackDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackDeleteParams.builder() .feedbackId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) println(feedbackDeleteResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callEager() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callEager() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val feedbackService = client.feedback() val feedbackSchema = feedbackService.eager( - FeedbackEagerParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + FeedbackEagerParams.builder() .key("string") .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -250,7 +184,7 @@ class FeedbackServiceTest { .type(FeedbackEagerParams.FeedbackConfig.Type.CONTINUOUS) .categories( listOf( - FeedbackEagerParams.FeedbackConfig.FeedbackCategory.builder() + FeedbackEagerParams.FeedbackConfig.Category.builder() .value(42.23) .label("x") .build() @@ -273,9 +207,7 @@ class FeedbackServiceTest { .value(FeedbackEagerParams.Value.ofDouble(42.23)) .build() ) - println( - feedbackSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(feedbackSchema) feedbackSchema.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/InfoServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/InfoServiceTest.kt index 4e17adf1..28c1c1f4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/InfoServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/InfoServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,31 +8,19 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class InfoServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val infoService = client.info() - val infoGetResponse = - infoService.retrieve( - InfoRetrieveParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - infoGetResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + val infoGetResponse = infoService.retrieve(InfoRetrieveParams.builder().build()) + println(infoGetResponse) infoGetResponse.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/OkServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/OkServiceTest.kt index f4df465a..b2d261dc 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/OkServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/OkServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,28 +8,18 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class OkServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val okService = client.ok() - val okRetrieveResponse = - okService.retrieve( - OkRetrieveParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 + val okRetrieveResponse = okService.retrieve(OkRetrieveParams.builder().build()) println(okRetrieveResponse) } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/PublicServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/PublicServiceTest.kt index c0a67a10..e6d569aa 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/PublicServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/PublicServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -6,5 +6,4 @@ import com.langsmith.api.TestServerExtension import com.langsmith.api.models.* import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith(TestServerExtension::class) // templates/JavaSDK/services.ts:298:15 -class PublicServiceTest +@ExtendWith(TestServerExtension::class) class PublicServiceTest diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunManifestServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunManifestServiceTest.kt index f8cfd1eb..ca7077c8 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunManifestServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunManifestServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,38 +8,24 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class RunManifestServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runManifestService = client.runManifests() val runManifestSchema = runManifestService.retrieve( - RunManifestRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + RunManifestRetrieveParams.builder() .runManifestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - runManifestSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(runManifestSchema) runManifestSchema.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunServiceTest.kt index db31fab2..b4346b88 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/RunServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,102 +8,61 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class RunServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.runs() - val runCreateResponse = - runService.create( - RunCreateParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 + val runCreateResponse = runService.create(RunCreateParams.builder().build()) println(runCreateResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.runs() val runSchema = runService.retrieve( - RunRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunRetrieveParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() ) - println( - runSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(runSchema) runSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.runs() val runUpdateResponse = runService.update( - RunUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunUpdateParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() ) println(runUpdateResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callBatch() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callBatch() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.runs() - val runBatchResponse = - runService.batch( - RunBatchParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 + val runBatchResponse = runService.batch(RunBatchParams.builder().build()) println(runBatchResponse) } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/SessionServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/SessionServiceTest.kt index ab4c5808..da69d7b4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/SessionServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/SessionServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -10,32 +10,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class SessionServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val sessionService = client.sessions() val tracerSessionWithoutVirtualFields = sessionService.create( - SessionCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + SessionCreateParams.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -47,62 +35,40 @@ class SessionServiceTest { .upsert(true) .build() ) - println( - tracerSessionWithoutVirtualFields - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(tracerSessionWithoutVirtualFields) tracerSessionWithoutVirtualFields.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val sessionService = client.sessions() val tracerSession = sessionService.retrieve( - SessionRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + SessionRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .includeStats(true) .build() ) - println( - tracerSession - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(tracerSession) tracerSession.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val sessionService = client.sessions() val tracerSessionWithoutVirtualFields = sessionService.update( - SessionUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + SessionUpdateParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .defaultDatasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .description("string") @@ -111,32 +77,21 @@ class SessionServiceTest { .name("string") .build() ) - println( - tracerSessionWithoutVirtualFields - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(tracerSessionWithoutVirtualFields) tracerSessionWithoutVirtualFields.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val sessionService = client.sessions() val sessionListResponse = sessionService.list( - SessionListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + SessionListParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .facets(true) .limit(123L) @@ -150,35 +105,23 @@ class SessionServiceTest { .sortByFeedbackKey("string") .build() ) - println( - sessionListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (tracerSession: TracerSession in - sessionListResponse) { // templates/JavaSDK/services.ts:509:10 + println(sessionListResponse) + for (tracerSession: TracerSession in sessionListResponse) { tracerSession.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val sessionService = client.sessions() val sessionDeleteResponse = sessionService.delete( - SessionDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + SessionDeleteParams.builder() .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/TenantServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/TenantServiceTest.kt index d5b7873d..6842f406 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/TenantServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/TenantServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking @@ -8,138 +8,88 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class TenantServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val tenantService = client.tenants() val tenant = tenantService.create( - TenantCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + TenantCreateParams.builder() .displayName("x") .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .tenantHandle("string") .build() ) - println( - tenant - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(tenant) tenant.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val tenantService = client.tenants() - val tenantListResponse = - tenantService.list( - TenantListParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - tenantListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (tenantForUser: TenantForUser in - tenantListResponse) { // templates/JavaSDK/services.ts:509:10 + val tenantListResponse = tenantService.list(TenantListParams.builder().build()) + println(tenantListResponse) + for (tenantForUser: TenantForUser in tenantListResponse) { tenantForUser.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callPendingDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callPendingDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val tenantService = client.tenants() val tenantPendingDeleteResponse = tenantService.pendingDelete( - TenantPendingDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + TenantPendingDeleteParams.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) println(tenantPendingDeleteResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callPendingList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callPendingList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val tenantService = client.tenants() val tenantPendingListResponse = - tenantService.pendingList( - TenantPendingListParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - tenantPendingListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (tenant: Tenant in tenantPendingListResponse) { // templates/JavaSDK/services.ts:509:10 + tenantService.pendingList(TenantPendingListParams.builder().build()) + println(tenantPendingListResponse) + for (tenant: Tenant in tenantPendingListResponse) { tenant.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callStatsList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callStatsList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val tenantService = client.tenants() - val tenantStats = - tenantService.statsList( - TenantStatsListParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - tenantStats - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + val tenantStats = tenantService.statsList(TenantStatsListParams.builder().build()) + println(tenantStats) tenantStats.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceTest.kt index 03de6391..fcee9f93 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/QueueServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.annotationQueues @@ -8,40 +8,25 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class QueueServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val queueService = client.annotationQueues().queues() val annotationQueueQueueListResponse = queueService.list( - AnnotationQueueQueueListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueQueueListParams.builder() .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - annotationQueueQueueListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (annotationQueueSchema: AnnotationQueueSchema in - annotationQueueQueueListResponse) { // templates/JavaSDK/services.ts:509:10 + println(annotationQueueQueueListResponse) + for (annotationQueueSchema: AnnotationQueueSchema in annotationQueueQueueListResponse) { annotationQueueSchema.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceTest.kt index 0321f669..dcffc550 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/annotationQueues/RunServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.annotationQueues @@ -9,65 +9,42 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class RunServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.annotationQueues().runs() val annotationQueueRunCreateResponse = runService.create( - AnnotationQueueRunCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueRunCreateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .body(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() ) - println( - annotationQueueRunCreateResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(annotationQueueRunCreateResponse) for (annotationQueueRunSchema: AnnotationQueueRunSchema in - annotationQueueRunCreateResponse) { // templates/JavaSDK/services.ts:509:10 + annotationQueueRunCreateResponse) { annotationQueueRunSchema.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.annotationQueues().runs() val annotationQueueRunUpdateResponse = runService.update( - AnnotationQueueRunUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueRunUpdateParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -77,60 +54,40 @@ class RunServiceTest { println(annotationQueueRunUpdateResponse) } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.annotationQueues().runs() val annotationQueueRunListResponse = runService.list( - AnnotationQueueRunListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueRunListParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .limit(123L) .offset(123L) .build() ) - println( - annotationQueueRunListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(annotationQueueRunListResponse) for (runSchemaWithAnnotationQueueInfo: RunSchemaWithAnnotationQueueInfo in - annotationQueueRunListResponse) { // templates/JavaSDK/services.ts:509:10 + annotationQueueRunListResponse) { runSchemaWithAnnotationQueueInfo.validate() } } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.annotationQueues().runs() val annotationQueueRunDeleteResponse = runService.delete( - AnnotationQueueRunDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + AnnotationQueueRunDeleteParams.builder() .queueId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .queueRunId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceTest.kt index 57f34a39..15e7b4fe 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/CsvServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class CsvServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val csvService = client.datasets().csv() val datasetCsvRetrieveResponse = csvService.retrieve( - DatasetCsvRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetCsvRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceTest.kt index b60ab149..be42178e 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIFtServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class OpenAIFtServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val openaiFtService = client.datasets().openaiFt() val datasetOpenAIFtRetrieveResponse = openaiFtService.retrieve( - DatasetOpenAIFtRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetOpenAIFtRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceTest.kt index cd766954..32c80e7c 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/OpenAIServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class OpenAIServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val openaiService = client.datasets().openai() val datasetOpenAIRetrieveResponse = openaiService.retrieve( - DatasetOpenAIRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetOpenAIRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceTest.kt index b8b91e46..53577e7a 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/RunServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -8,32 +8,20 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class RunServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val runService = client.datasets().runs() val datasetRunCreateResponse = runService.create( - DatasetRunCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetRunCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .filters(DatasetRunCreateParams.Filters.builder().build()) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceTest.kt index e7320e0b..bd37ac45 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/datasets/ShareServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.datasets @@ -8,68 +8,43 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class ShareServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val shareService = client.datasets().share() val datasetShareSchema = shareService.retrieve( - DatasetShareRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetShareRetrieveParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - datasetShareSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(datasetShareSchema) datasetShareSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val shareService = client.datasets().share() val datasetShareSchema = shareService.update( - DatasetShareUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + DatasetShareUpdateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .shareProjects(true) .build() ) - println( - datasetShareSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(datasetShareSchema) datasetShareSchema.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceTest.kt index e31c71a2..ac4bf1fd 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/BulkServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.examples @@ -10,35 +10,23 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class BulkServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val bulkService = client.examples().bulk() val exampleBulkCreateResponse = bulkService.create( - ExampleBulkCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleBulkCreateParams.builder() .body( listOf( - ExampleBulkCreateParams.ExampleCreate.builder() + ExampleBulkCreateParams.Body.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .inputs(JsonValue.from(mapOf())) .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -50,11 +38,8 @@ class BulkServiceTest { ) .build() ) - println( - exampleBulkCreateResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (example: Example in - exampleBulkCreateResponse) { // templates/JavaSDK/services.ts:509:10 + println(exampleBulkCreateResponse) + for (example: Example in exampleBulkCreateResponse) { example.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceTest.kt index 00aacf0f..61bc996b 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/examples/UploadServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.examples @@ -8,43 +8,28 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class UploadServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val uploadService = client.examples().upload() val exampleUploadCreateResponse = uploadService.create( - ExampleUploadCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + ExampleUploadCreateParams.builder() .datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .file("file.txt") .inputKeys(listOf("string")) .outputKeys(listOf("string")) .build() ) - println( - exampleUploadCreateResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (example: Example in - exampleUploadCreateResponse) { // templates/JavaSDK/services.ts:509:10 + println(exampleUploadCreateResponse) + for (example: Example in exampleUploadCreateResponse) { example.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/DatasetServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/DatasetServiceTest.kt new file mode 100644 index 00000000..9bdf21b9 --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/DatasetServiceTest.kt @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class DatasetServiceTest { + + @Test + fun callList() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val datasetService = client.public_().datasets() + val datasetPublicSchema = + datasetService.list( + PublicDatasetListParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limit(123L) + .offset(123L) + .build() + ) + println(datasetPublicSchema) + datasetPublicSchema.validate() + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/ExampleServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/ExampleServiceTest.kt new file mode 100644 index 00000000..130a8a66 --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/ExampleServiceTest.kt @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import java.time.OffsetDateTime +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class ExampleServiceTest { + + @Test + fun callList() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val exampleService = client.public_().examples() + val publicExampleListResponse = + exampleService.list( + PublicExampleListParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .limit(123L) + .offset(123L) + .build() + ) + println(publicExampleListResponse) + for (example: Example in publicExampleListResponse) { + example.validate() + } + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/FeedbackServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/FeedbackServiceTest.kt new file mode 100644 index 00000000..0f8d2ff5 --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/FeedbackServiceTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class FeedbackServiceTest { + + @Test + fun callList() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val feedbackService = client.public_().feedbacks() + val publicFeedbackListResponse = + feedbackService.list( + PublicFeedbackListParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hasComment(true) + .hasScore(true) + .key(listOf("string")) + .limit(123L) + .offset(123L) + .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .source(listOf(PublicFeedbackListParams.Source.API)) + .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .build() + ) + println(publicFeedbackListResponse) + for (feedbackSchema: FeedbackSchema in publicFeedbackListResponse) { + feedbackSchema.validate() + } + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/LatestRunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/LatestRunServiceTest.kt new file mode 100644 index 00000000..7e138825 --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/LatestRunServiceTest.kt @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class LatestRunServiceTest { + + @Test + fun callRetrieve() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val latestRunService = client.public_().latestRun() + val runPublicSchema = + latestRunService.retrieve( + PublicLatestRunRetrieveParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + println(runPublicSchema) + runPublicSchema.validate() + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/RunServiceTest.kt new file mode 100644 index 00000000..515bedfb --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/RunServiceTest.kt @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class RunServiceTest { + + @Test + fun callRetrieve() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val runService = client.public_().runs() + val runPublicSchema = + runService.retrieve( + PublicRunRetrieveParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + println(runPublicSchema) + runPublicSchema.validate() + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackServiceTest.kt new file mode 100644 index 00000000..11f0f5db --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/FeedbackServiceTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class FeedbackServiceTest { + + @Test + fun callRetrieve() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val feedbackService = client.public_().datasets().feedback() + val publicDatasetFeedbackRetrieveResponse = + feedbackService.retrieve( + PublicDatasetFeedbackRetrieveParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .hasComment(true) + .hasScore(true) + .key(listOf("string")) + .limit(123L) + .offset(123L) + .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .source(listOf(PublicDatasetFeedbackRetrieveParams.Source.API)) + .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .build() + ) + println(publicDatasetFeedbackRetrieveResponse) + for (feedbackSchema: FeedbackSchema in publicDatasetFeedbackRetrieveResponse) { + feedbackSchema.validate() + } + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/RunServiceTest.kt new file mode 100644 index 00000000..7a4e1d8e --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/RunServiceTest.kt @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class RunServiceTest { + + @Test + fun callRetrieve() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val runService = client.public_().datasets().runs() + val runPublicDatasetSchema = + runService.retrieve( + PublicDatasetRunRetrieveParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + println(runPublicDatasetSchema) + runPublicDatasetSchema.validate() + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionServiceTest.kt new file mode 100644 index 00000000..47784c25 --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/SessionServiceTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.datasets + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class SessionServiceTest { + + @Test + fun callList() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val sessionService = client.public_().datasets().sessions() + val publicDatasetSessionListResponse = + sessionService.list( + PublicDatasetSessionListParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .facets(true) + .limit(123L) + .name("string") + .nameContains("string") + .offset(123L) + .sortBy(PublicDatasetSessionListParams.SortBy.NAME) + .sortByDesc(true) + .sortByFeedbackKey("string") + .build() + ) + println(publicDatasetSessionListResponse) + for (tracerSession: TracerSession in publicDatasetSessionListResponse) { + tracerSession.validate() + } + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryServiceTest.kt similarity index 53% rename from langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryServiceTest.kt rename to langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryServiceTest.kt index 10713c9b..c8d287bd 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/QueryServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/QueryServiceTest.kt @@ -1,6 +1,6 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. -package com.langsmith.api.services.blocking.public_.datasets.runs +package com.langsmith.api.services.blocking.public.datasets.runs import com.langsmith.api.TestServerExtension import com.langsmith.api.client.okhttp.LangSmithOkHttpClient @@ -9,33 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class QueryServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val queryService = client.public_().datasets().runs().query() val listPublicDatasetRunsResponse = queryService.create( - PublicDatasetRunQueryCreateParams - .builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + PublicDatasetRunQueryCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .cursor("string") @@ -49,15 +36,13 @@ class QueryServiceTest { .query("string") .referenceExample(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .runType(PublicDatasetRunQueryCreateParams.RunType.TOOL) - .select(listOf(PublicDatasetRunQueryCreateParams.RunSelect.ID)) + .select(listOf(PublicDatasetRunQueryCreateParams.Select.ID)) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - listPublicDatasetRunsResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(listPublicDatasetRunsResponse) listPublicDatasetRunsResponse.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatServiceTest.kt similarity index 51% rename from langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatServiceTest.kt rename to langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatServiceTest.kt index 09e03683..b65c0034 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/runs/StatServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/datasets/runs/StatServiceTest.kt @@ -1,6 +1,6 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. -package com.langsmith.api.services.blocking.public_.datasets.runs +package com.langsmith.api.services.blocking.public.datasets.runs import com.langsmith.api.TestServerExtension import com.langsmith.api.client.okhttp.LangSmithOkHttpClient @@ -9,33 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class StatServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val statService = client.public_().datasets().runs().stats() val runStats = statService.create( - PublicDatasetRunStatCreateParams - .builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + PublicDatasetRunStatCreateParams.builder() .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -52,9 +39,7 @@ class StatServiceTest { .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - runStats - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(runStats) runStats.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/examples/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/examples/RunServiceTest.kt new file mode 100644 index 00000000..05a2f604 --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/examples/RunServiceTest.kt @@ -0,0 +1,34 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.examples + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class RunServiceTest { + + @Test + fun callCreate() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val runService = client.public_().examples().runs() + val publicExampleRunCreateResponse = + runService.create( + PublicExampleRunCreateParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .filters(PublicExampleRunCreateParams.Filters.builder().build()) + .limit(123L) + .offset(123L) + .build() + ) + println(publicExampleRunCreateResponse) + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/runs/QueryServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/runs/QueryServiceTest.kt new file mode 100644 index 00000000..6cd1d83b --- /dev/null +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public/runs/QueryServiceTest.kt @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.langsmith.api.services.blocking.public.runs + +import com.langsmith.api.TestServerExtension +import com.langsmith.api.client.okhttp.LangSmithOkHttpClient +import com.langsmith.api.models.* +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +class QueryServiceTest { + + @Test + fun callCreate() { + val client = + LangSmithOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val queryService = client.public_().runs().query() + val listPublicRunsResponse = + queryService.create( + PublicRunQueryCreateParams.builder() + .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) + .build() + ) + println(listPublicRunsResponse) + listPublicRunsResponse.validate() + } +} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/DatasetServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/DatasetServiceTest.kt deleted file mode 100644 index 5774386b..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/DatasetServiceTest.kt +++ /dev/null @@ -1,47 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class DatasetServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val datasetService = client.public_().datasets() - val datasetPublicSchema = - datasetService.list( - PublicDatasetListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .limit(123L) - .offset(123L) - .build() - ) - println( - datasetPublicSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - datasetPublicSchema.validate() - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/ExampleServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/ExampleServiceTest.kt deleted file mode 100644 index 247ef556..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/ExampleServiceTest.kt +++ /dev/null @@ -1,53 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import java.time.OffsetDateTime -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class ExampleServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val exampleService = client.public_().examples() - val publicExampleListResponse = - exampleService.list( - PublicExampleListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .asOf(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .limit(123L) - .offset(123L) - .build() - ) - println( - publicExampleListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (example: Example in - publicExampleListResponse) { // templates/JavaSDK/services.ts:509:10 - example.validate() - } - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/FeedbackServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/FeedbackServiceTest.kt deleted file mode 100644 index 8441bc12..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/FeedbackServiceTest.kt +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class FeedbackServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val feedbackService = client.public_().feedbacks() - val publicFeedbackListResponse = - feedbackService.list( - PublicFeedbackListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hasComment(true) - .hasScore(true) - .key(listOf("string")) - .limit(123L) - .offset(123L) - .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(PublicFeedbackListParams.SourceType.API)) - .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .build() - ) - println( - publicFeedbackListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (feedbackSchema: FeedbackSchema in - publicFeedbackListResponse) { // templates/JavaSDK/services.ts:509:10 - feedbackSchema.validate() - } - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/LatestRunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/LatestRunServiceTest.kt deleted file mode 100644 index bc92b308..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/LatestRunServiceTest.kt +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class LatestRunServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val latestRunService = client.public_().latestRun() - val runPublicSchema = - latestRunService.retrieve( - PublicLatestRunRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - println( - runPublicSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - runPublicSchema.validate() - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/RunServiceTest.kt deleted file mode 100644 index 83df432c..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/RunServiceTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_ - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class RunServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val runService = client.public_().runs() - val runPublicSchema = - runService.retrieve( - PublicRunRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - println( - runPublicSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - runPublicSchema.validate() - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackServiceTest.kt deleted file mode 100644 index 7f0b709b..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/FeedbackServiceTest.kt +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class FeedbackServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val feedbackService = client.public_().datasets().feedback() - val publicDatasetFeedbackRetrieveResponse = - feedbackService.retrieve( - PublicDatasetFeedbackRetrieveParams - .builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .hasComment(true) - .hasScore(true) - .key(listOf("string")) - .limit(123L) - .offset(123L) - .run(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .source(listOf(PublicDatasetFeedbackRetrieveParams.SourceType.API)) - .user(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .build() - ) - println( - publicDatasetFeedbackRetrieveResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (feedbackSchema: FeedbackSchema in - publicDatasetFeedbackRetrieveResponse) { // templates/JavaSDK/services.ts:509:10 - feedbackSchema.validate() - } - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunServiceTest.kt deleted file mode 100644 index dcfbaa23..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/RunServiceTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class RunServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val runService = client.public_().datasets().runs() - val runPublicDatasetSchema = - runService.retrieve( - PublicDatasetRunRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - println( - runPublicDatasetSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - runPublicDatasetSchema.validate() - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionServiceTest.kt deleted file mode 100644 index 3de20ec7..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/datasets/SessionServiceTest.kt +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.datasets - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class SessionServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val sessionService = client.public_().datasets().sessions() - val publicDatasetSessionListResponse = - sessionService.list( - PublicDatasetSessionListParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .facets(true) - .limit(123L) - .name("string") - .nameContains("string") - .offset(123L) - .sortBy(PublicDatasetSessionListParams.SortBy.NAME) - .sortByDesc(true) - .sortByFeedbackKey("string") - .build() - ) - println( - publicDatasetSessionListResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - for (tracerSession: TracerSession in - publicDatasetSessionListResponse) { // templates/JavaSDK/services.ts:509:10 - tracerSession.validate() - } - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/examples/RunServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/examples/RunServiceTest.kt deleted file mode 100644 index ae4db457..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/examples/RunServiceTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.examples - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class RunServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val runService = client.public_().examples().runs() - val publicExampleRunCreateResponse = - runService.create( - PublicExampleRunCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .sessionIds(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .filters(PublicExampleRunCreateParams.Filters.builder().build()) - .limit(123L) - .offset(123L) - .build() - ) - println(publicExampleRunCreateResponse) - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryServiceTest.kt deleted file mode 100644 index 3d880246..00000000 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/public_/runs/QueryServiceTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 - -package com.langsmith.api.services.blocking.public_.runs - -import com.langsmith.api.TestServerExtension -import com.langsmith.api.client.okhttp.LangSmithOkHttpClient -import com.langsmith.api.models.* -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 -class QueryServiceTest { - - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 - val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") - .build() - val queryService = client.public_().runs().query() - val listPublicRunsResponse = - queryService.create( - PublicRunQueryCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .shareToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) - .build() - ) - println( - listPublicRunsResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 - listPublicRunsResponse.validate() - } -} diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceTest.kt index d7d22f0a..1d25bfc5 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/GenerateQueryServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -8,38 +8,22 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class GenerateQueryServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val generateQueryService = client.runs().generateQuery() val responseBodyForRunsGenerateQuery = generateQueryService.create( - RunGenerateQueryCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .query("string") - .build() + RunGenerateQueryCreateParams.builder().query("string").build() ) - println( - responseBodyForRunsGenerateQuery - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(responseBodyForRunsGenerateQuery) responseBodyForRunsGenerateQuery.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceTest.kt index 8e55abf3..fad39ad2 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/MonitorServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -8,38 +8,26 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class MonitorServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val monitorService = client.runs().monitor() val monitorResponse = monitorService.create( - RunMonitorCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + RunMonitorCreateParams.builder() .groups( listOf( - RunMonitorCreateParams.MonitorGroupSpec.builder() + RunMonitorCreateParams.Group.builder() .session("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( - RunMonitorCreateParams.MonitorGroupSpec.Metadata.builder() + RunMonitorCreateParams.Group.Metadata.builder() .key("string") .value("string") .build() @@ -65,9 +53,7 @@ class MonitorServiceTest { .timezone("string") .build() ) - println( - monitorResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(monitorResponse) monitorResponse.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceTest.kt index 519d7a35..b8ff53a4 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/QueryServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class QueryServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val queryService = client.runs().query() val listRunsResponse = queryService.create( - RunQueryCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + RunQueryCreateParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .cursor("string") .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -47,15 +35,13 @@ class QueryServiceTest { .query("string") .referenceExample(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .runType(RunQueryCreateParams.RunType.TOOL) - .select(listOf(RunQueryCreateParams.RunSelect.ID)) + .select(listOf(RunQueryCreateParams.Select.ID)) .session(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - listRunsResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(listRunsResponse) listRunsResponse.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceTest.kt index aacb101c..4293ce05 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/ShareServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -8,92 +8,54 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class ShareServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val shareService = client.runs().share() val runShareSchema = shareService.retrieve( - RunShareRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + RunShareRetrieveParams.builder() .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - runShareSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(runShareSchema) runShareSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callUpdate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callUpdate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val shareService = client.runs().share() val runShareSchema = shareService.update( - RunShareUpdateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunShareUpdateParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() ) - println( - runShareSchema - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(runShareSchema) runShareSchema.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val shareService = client.runs().share() val runShareDeleteResponse = shareService.delete( - RunShareDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() + RunShareDeleteParams.builder().runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() ) println(runShareDeleteResponse) } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/StatServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/StatServiceTest.kt index 2a10a7d9..0b7d5c82 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/StatServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/runs/StatServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.runs @@ -9,32 +9,20 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class StatServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val statService = client.runs().stats() val runStats = statService.create( - RunStatCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + RunStatCreateParams.builder() .id(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .endTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .error(true) @@ -50,9 +38,7 @@ class StatServiceTest { .trace("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) - println( - runStats - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(runStats) runStats.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceTest.kt index f55101b0..1de13aa7 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/sessions/MetadataServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.sessions @@ -9,41 +9,27 @@ import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class MetadataServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val metadataService = client.sessions().metadata() val tracerSessionMetadataResponse = metadataService.retrieve( - SessionMetadataRetrieveParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + SessionMetadataRetrieveParams.builder() .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .k(123L) .metadataKeys(listOf("string")) .startTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - println( - tracerSessionMetadataResponse - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(tracerSessionMetadataResponse) tracerSessionMetadataResponse.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceTest.kt index d3faadbd..1da84214 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/CurrentServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -8,84 +8,50 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class CurrentServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callMembersCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callMembersCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val currentService = client.tenants().current() val pendingIdentity = currentService.membersCreate( - TenantCurrentMembersCreateParams - .builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 - .email("string") - .readOnly(true) - .build() + TenantCurrentMembersCreateParams.builder().email("string").readOnly(true).build() ) - println( - pendingIdentity - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + println(pendingIdentity) pendingIdentity.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callMembersList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callMembersList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val currentService = client.tenants().current() val tenantMembers = - currentService.membersList( - TenantCurrentMembersListParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - tenantMembers - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + currentService.membersList(TenantCurrentMembersListParams.builder().build()) + println(tenantMembers) tenantMembers.validate() } - @Test // templates/JavaSDK/entities/testing.ts:18:13 - fun callStatsRetrieve() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callStatsRetrieve() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val currentService = client.tenants().current() val tenantStats = - currentService.statsRetrieve( - TenantCurrentStatsRetrieveParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - tenantStats - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + currentService.statsRetrieve(TenantCurrentStatsRetrieveParams.builder().build()) + println(tenantStats) tenantStats.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceTest.kt index bc15b646..661c9b32 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/MemberServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -8,32 +8,20 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class MemberServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val memberService = client.tenants().members() val tenantMemberDeleteResponse = memberService.delete( - TenantMemberDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + TenantMemberDeleteParams.builder() .identityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceTest.kt index bab9eea3..c91e4c49 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/PendingServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -8,32 +8,20 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class PendingServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callClaimCreate() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callClaimCreate() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val pendingService = client.tenants().pending() val tenantPendingClaimCreateResponse = pendingService.claimCreate( - TenantPendingClaimCreateParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + TenantPendingClaimCreateParams.builder() .tenantId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceTest.kt index 6b69df5b..316afb41 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/UsageLimitServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants @@ -8,31 +8,20 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class UsageLimitServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callList() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callList() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val usageLimitService = client.tenants().usageLimits() val tenantUsageLimitInfo = - usageLimitService.list( - TenantUsageLimitListParams.builder().build() - ) // templates/JavaSDK/services.ts:475:17 // templates/JavaSDK/services.ts:475:17 - println( - tenantUsageLimitInfo - ) // templates/JavaSDK/services.ts:526:15 // templates/JavaSDK/services.ts:526:15 + usageLimitService.list(TenantUsageLimitListParams.builder().build()) + println(tenantUsageLimitInfo) tenantUsageLimitInfo.validate() } } diff --git a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceTest.kt b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceTest.kt index cac5624f..639d3268 100644 --- a/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceTest.kt +++ b/langsmith-java-core/src/test/kotlin/com/langsmith/api/services/blocking/tenants/members/PendingServiceTest.kt @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. // templates/JavaSDK/components/file.ts:28:17 +// File generated from our OpenAPI spec by Stainless. package com.langsmith.api.services.blocking.tenants.members @@ -8,32 +8,20 @@ import com.langsmith.api.models.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -@ExtendWith( - TestServerExtension::class -) // templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 // -// templates/JavaSDK/services.ts:298:15 // templates/JavaSDK/services.ts:298:15 +@ExtendWith(TestServerExtension::class) class PendingServiceTest { - @Test // templates/JavaSDK/entities/testing.ts:18:13 // templates/JavaSDK/services.ts:298:15 - fun callDelete() { // templates/JavaSDK/entities/testing.ts:18:13 + @Test + fun callDelete() { val client = - LangSmithOkHttpClient.builder() // templates/JavaSDK/services.ts:308:18 // - // templates/JavaSDK/services.ts:307:24 // - // templates/JavaSDK/services.ts:307:24 + LangSmithOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") - .tenantId("My Tenant ID") - .bearerToken("My Bearer Token") .build() val pendingService = client.tenants().members().pending() val tenantMemberPendingDeleteResponse = pendingService.delete( - TenantMemberPendingDeleteParams.builder() // templates/JavaSDK/services.ts:464:26 // - // templates/JavaSDK/services.ts:479:20 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:476:10 // - // templates/JavaSDK/services.ts:475:17 // - // templates/JavaSDK/services.ts:475:17 + TenantMemberPendingDeleteParams.builder() .identityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/langsmith-java-lib/.keep b/langsmith-java-lib/.keep index 480a265a..5e2c99fd 100644 --- a/langsmith-java-lib/.keep +++ b/langsmith-java-lib/.keep @@ -1,4 +1,4 @@ -File generated from our OpenAPI spec by Stainless. // templates/common/index.ts:21:50 +File generated from our OpenAPI spec by Stainless. This directory can be used to store custom files to expand the SDK. It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file