Skip to content

Commit ff16250

Browse files
feat(api): api update
1 parent 2a66248 commit ff16250

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 104
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-58a77ebe1df4770a815f3c59d27ff414f89f026f60e6afc6033564358e70f2bc.yml
3-
openapi_spec_hash: b172d58c3da9fd0b061e8b1683b1bb16
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-c07181e1d313b071acf65992af66947e1fe43bb41fabaa833c9709b634549ec0.yml
3+
openapi_spec_hash: c732f063dc5f5bd9904db5edde021c3d
44
config_hash: 95f6a6cccc50b0e616468fc26d25b304

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/annotationqueues/info/InfoListResponse.kt

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private constructor(
2626
private val version: JsonField<String>,
2727
private val batchIngestConfig: JsonField<BatchIngestConfig>,
2828
private val customerInfo: JsonField<CustomerInfo>,
29+
private val gitSha: JsonField<String>,
2930
private val instanceFlags: JsonField<InstanceFlags>,
3031
private val licenseExpirationTime: JsonField<OffsetDateTime>,
3132
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -40,6 +41,7 @@ private constructor(
4041
@JsonProperty("customer_info")
4142
@ExcludeMissing
4243
customerInfo: JsonField<CustomerInfo> = JsonMissing.of(),
44+
@JsonProperty("git_sha") @ExcludeMissing gitSha: JsonField<String> = JsonMissing.of(),
4345
@JsonProperty("instance_flags")
4446
@ExcludeMissing
4547
instanceFlags: JsonField<InstanceFlags> = JsonMissing.of(),
@@ -50,6 +52,7 @@ private constructor(
5052
version,
5153
batchIngestConfig,
5254
customerInfo,
55+
gitSha,
5356
instanceFlags,
5457
licenseExpirationTime,
5558
mutableMapOf(),
@@ -78,6 +81,12 @@ private constructor(
7881
*/
7982
fun customerInfo(): Optional<CustomerInfo> = customerInfo.getOptional("customer_info")
8083

84+
/**
85+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
86+
* server responded with an unexpected value).
87+
*/
88+
fun gitSha(): Optional<String> = gitSha.getOptional("git_sha")
89+
8190
/**
8291
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
8392
* server responded with an unexpected value).
@@ -117,6 +126,13 @@ private constructor(
117126
@ExcludeMissing
118127
fun _customerInfo(): JsonField<CustomerInfo> = customerInfo
119128

129+
/**
130+
* Returns the raw JSON value of [gitSha].
131+
*
132+
* Unlike [gitSha], this method doesn't throw if the JSON field has an unexpected type.
133+
*/
134+
@JsonProperty("git_sha") @ExcludeMissing fun _gitSha(): JsonField<String> = gitSha
135+
120136
/**
121137
* Returns the raw JSON value of [instanceFlags].
122138
*
@@ -167,6 +183,7 @@ private constructor(
167183
private var version: JsonField<String>? = null
168184
private var batchIngestConfig: JsonField<BatchIngestConfig> = JsonMissing.of()
169185
private var customerInfo: JsonField<CustomerInfo> = JsonMissing.of()
186+
private var gitSha: JsonField<String> = JsonMissing.of()
170187
private var instanceFlags: JsonField<InstanceFlags> = JsonMissing.of()
171188
private var licenseExpirationTime: JsonField<OffsetDateTime> = JsonMissing.of()
172189
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -176,6 +193,7 @@ private constructor(
176193
version = infoListResponse.version
177194
batchIngestConfig = infoListResponse.batchIngestConfig
178195
customerInfo = infoListResponse.customerInfo
196+
gitSha = infoListResponse.gitSha
179197
instanceFlags = infoListResponse.instanceFlags
180198
licenseExpirationTime = infoListResponse.licenseExpirationTime
181199
additionalProperties = infoListResponse.additionalProperties.toMutableMap()
@@ -225,6 +243,19 @@ private constructor(
225243
this.customerInfo = customerInfo
226244
}
227245

246+
fun gitSha(gitSha: String?) = gitSha(JsonField.ofNullable(gitSha))
247+
248+
/** Alias for calling [Builder.gitSha] with `gitSha.orElse(null)`. */
249+
fun gitSha(gitSha: Optional<String>) = gitSha(gitSha.getOrNull())
250+
251+
/**
252+
* Sets [Builder.gitSha] to an arbitrary JSON value.
253+
*
254+
* You should usually call [Builder.gitSha] with a well-typed [String] value instead. This
255+
* method is primarily for setting the field to an undocumented or not yet supported value.
256+
*/
257+
fun gitSha(gitSha: JsonField<String>) = apply { this.gitSha = gitSha }
258+
228259
fun instanceFlags(instanceFlags: InstanceFlags) = instanceFlags(JsonField.of(instanceFlags))
229260

230261
/**
@@ -295,6 +326,7 @@ private constructor(
295326
checkRequired("version", version),
296327
batchIngestConfig,
297328
customerInfo,
329+
gitSha,
298330
instanceFlags,
299331
licenseExpirationTime,
300332
additionalProperties.toMutableMap(),
@@ -311,6 +343,7 @@ private constructor(
311343
version()
312344
batchIngestConfig().ifPresent { it.validate() }
313345
customerInfo().ifPresent { it.validate() }
346+
gitSha()
314347
instanceFlags().ifPresent { it.validate() }
315348
licenseExpirationTime()
316349
validated = true
@@ -334,6 +367,7 @@ private constructor(
334367
(if (version.asKnown().isPresent) 1 else 0) +
335368
(batchIngestConfig.asKnown().getOrNull()?.validity() ?: 0) +
336369
(customerInfo.asKnown().getOrNull()?.validity() ?: 0) +
370+
(if (gitSha.asKnown().isPresent) 1 else 0) +
337371
(instanceFlags.asKnown().getOrNull()?.validity() ?: 0) +
338372
(if (licenseExpirationTime.asKnown().isPresent) 1 else 0)
339373

@@ -1019,6 +1053,7 @@ private constructor(
10191053
version == other.version &&
10201054
batchIngestConfig == other.batchIngestConfig &&
10211055
customerInfo == other.customerInfo &&
1056+
gitSha == other.gitSha &&
10221057
instanceFlags == other.instanceFlags &&
10231058
licenseExpirationTime == other.licenseExpirationTime &&
10241059
additionalProperties == other.additionalProperties
@@ -1029,6 +1064,7 @@ private constructor(
10291064
version,
10301065
batchIngestConfig,
10311066
customerInfo,
1067+
gitSha,
10321068
instanceFlags,
10331069
licenseExpirationTime,
10341070
additionalProperties,
@@ -1038,5 +1074,5 @@ private constructor(
10381074
override fun hashCode(): Int = hashCode
10391075

10401076
override fun toString() =
1041-
"InfoListResponse{version=$version, batchIngestConfig=$batchIngestConfig, customerInfo=$customerInfo, instanceFlags=$instanceFlags, licenseExpirationTime=$licenseExpirationTime, additionalProperties=$additionalProperties}"
1077+
"InfoListResponse{version=$version, batchIngestConfig=$batchIngestConfig, customerInfo=$customerInfo, gitSha=$gitSha, instanceFlags=$instanceFlags, licenseExpirationTime=$licenseExpirationTime, additionalProperties=$additionalProperties}"
10421078
}

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/annotationqueues/info/InfoListResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ internal class InfoListResponseTest {
3232
.customerName("customer_name")
3333
.build()
3434
)
35+
.gitSha("git_sha")
3536
.instanceFlags(
3637
InfoListResponse.InstanceFlags.builder()
3738
.putAdditionalProperty("foo", JsonValue.from("bar"))
@@ -59,6 +60,7 @@ internal class InfoListResponseTest {
5960
.customerName("customer_name")
6061
.build()
6162
)
63+
assertThat(infoListResponse.gitSha()).contains("git_sha")
6264
assertThat(infoListResponse.instanceFlags())
6365
.contains(
6466
InfoListResponse.InstanceFlags.builder()
@@ -91,6 +93,7 @@ internal class InfoListResponseTest {
9193
.customerName("customer_name")
9294
.build()
9395
)
96+
.gitSha("git_sha")
9497
.instanceFlags(
9598
InfoListResponse.InstanceFlags.builder()
9699
.putAdditionalProperty("foo", JsonValue.from("bar"))

0 commit comments

Comments
 (0)