Skip to content

Commit ea4e843

Browse files
feat(api): api update
1 parent 8f411f8 commit ea4e843

10 files changed

Lines changed: 160 additions & 7 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-943731171b9e387a4138a091a637e64723e22e997282d5c5d1986372b5d5921e.yml
3-
openapi_spec_hash: c8f1a61e97d450713836294f0fcacd26
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-af9329544589ffcdfd32c9a993bc490b2ba7290a0e101164e12df3b7a2cdd848.yml
3+
openapi_spec_hash: 9bd3735b0fa2e50379fa125f4ab4d8a5
44
config_hash: 95f6a6cccc50b0e616468fc26d25b304

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/repos/RepoUpdateParams.kt

Lines changed: 100 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ private constructor(
6060
*/
6161
fun readme(): Optional<String> = body.readme()
6262

63+
/**
64+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
65+
* server responded with an unexpected value).
66+
*/
67+
fun restrictedMode(): Optional<Boolean> = body.restrictedMode()
68+
6369
/**
6470
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
6571
* server responded with an unexpected value).
@@ -94,6 +100,13 @@ private constructor(
94100
*/
95101
fun _readme(): JsonField<String> = body._readme()
96102

103+
/**
104+
* Returns the raw JSON value of [restrictedMode].
105+
*
106+
* Unlike [restrictedMode], this method doesn't throw if the JSON field has an unexpected type.
107+
*/
108+
fun _restrictedMode(): JsonField<Boolean> = body._restrictedMode()
109+
97110
/**
98111
* Returns the raw JSON value of [tags].
99112
*
@@ -158,7 +171,7 @@ private constructor(
158171
* - [isArchived]
159172
* - [isPublic]
160173
* - [readme]
161-
* - [tags]
174+
* - [restrictedMode]
162175
* - etc.
163176
*/
164177
fun body(body: Body) = apply { this.body = body.toBuilder() }
@@ -232,6 +245,30 @@ private constructor(
232245
*/
233246
fun readme(readme: JsonField<String>) = apply { body.readme(readme) }
234247

248+
fun restrictedMode(restrictedMode: Boolean?) = apply { body.restrictedMode(restrictedMode) }
249+
250+
/**
251+
* Alias for [Builder.restrictedMode].
252+
*
253+
* This unboxed primitive overload exists for backwards compatibility.
254+
*/
255+
fun restrictedMode(restrictedMode: Boolean) = restrictedMode(restrictedMode as Boolean?)
256+
257+
/** Alias for calling [Builder.restrictedMode] with `restrictedMode.orElse(null)`. */
258+
fun restrictedMode(restrictedMode: Optional<Boolean>) =
259+
restrictedMode(restrictedMode.getOrNull())
260+
261+
/**
262+
* Sets [Builder.restrictedMode] to an arbitrary JSON value.
263+
*
264+
* You should usually call [Builder.restrictedMode] with a well-typed [Boolean] value
265+
* instead. This method is primarily for setting the field to an undocumented or not yet
266+
* supported value.
267+
*/
268+
fun restrictedMode(restrictedMode: JsonField<Boolean>) = apply {
269+
body.restrictedMode(restrictedMode)
270+
}
271+
235272
fun tags(tags: List<String>?) = apply { body.tags(tags) }
236273

237274
/** Alias for calling [Builder.tags] with `tags.orElse(null)`. */
@@ -413,6 +450,7 @@ private constructor(
413450
private val isArchived: JsonField<Boolean>,
414451
private val isPublic: JsonField<Boolean>,
415452
private val readme: JsonField<String>,
453+
private val restrictedMode: JsonField<Boolean>,
416454
private val tags: JsonField<List<String>>,
417455
private val additionalProperties: MutableMap<String, JsonValue>,
418456
) {
@@ -429,8 +467,11 @@ private constructor(
429467
@ExcludeMissing
430468
isPublic: JsonField<Boolean> = JsonMissing.of(),
431469
@JsonProperty("readme") @ExcludeMissing readme: JsonField<String> = JsonMissing.of(),
470+
@JsonProperty("restricted_mode")
471+
@ExcludeMissing
472+
restrictedMode: JsonField<Boolean> = JsonMissing.of(),
432473
@JsonProperty("tags") @ExcludeMissing tags: JsonField<List<String>> = JsonMissing.of(),
433-
) : this(description, isArchived, isPublic, readme, tags, mutableMapOf())
474+
) : this(description, isArchived, isPublic, readme, restrictedMode, tags, mutableMapOf())
434475

435476
/**
436477
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
@@ -456,6 +497,12 @@ private constructor(
456497
*/
457498
fun readme(): Optional<String> = readme.getOptional("readme")
458499

500+
/**
501+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
502+
* the server responded with an unexpected value).
503+
*/
504+
fun restrictedMode(): Optional<Boolean> = restrictedMode.getOptional("restricted_mode")
505+
459506
/**
460507
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
461508
* the server responded with an unexpected value).
@@ -494,6 +541,16 @@ private constructor(
494541
*/
495542
@JsonProperty("readme") @ExcludeMissing fun _readme(): JsonField<String> = readme
496543

544+
/**
545+
* Returns the raw JSON value of [restrictedMode].
546+
*
547+
* Unlike [restrictedMode], this method doesn't throw if the JSON field has an unexpected
548+
* type.
549+
*/
550+
@JsonProperty("restricted_mode")
551+
@ExcludeMissing
552+
fun _restrictedMode(): JsonField<Boolean> = restrictedMode
553+
497554
/**
498555
* Returns the raw JSON value of [tags].
499556
*
@@ -526,6 +583,7 @@ private constructor(
526583
private var isArchived: JsonField<Boolean> = JsonMissing.of()
527584
private var isPublic: JsonField<Boolean> = JsonMissing.of()
528585
private var readme: JsonField<String> = JsonMissing.of()
586+
private var restrictedMode: JsonField<Boolean> = JsonMissing.of()
529587
private var tags: JsonField<MutableList<String>>? = null
530588
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
531589

@@ -535,6 +593,7 @@ private constructor(
535593
isArchived = body.isArchived
536594
isPublic = body.isPublic
537595
readme = body.readme
596+
restrictedMode = body.restrictedMode
538597
tags = body.tags.map { it.toMutableList() }
539598
additionalProperties = body.additionalProperties.toMutableMap()
540599
}
@@ -611,6 +670,31 @@ private constructor(
611670
*/
612671
fun readme(readme: JsonField<String>) = apply { this.readme = readme }
613672

673+
fun restrictedMode(restrictedMode: Boolean?) =
674+
restrictedMode(JsonField.ofNullable(restrictedMode))
675+
676+
/**
677+
* Alias for [Builder.restrictedMode].
678+
*
679+
* This unboxed primitive overload exists for backwards compatibility.
680+
*/
681+
fun restrictedMode(restrictedMode: Boolean) = restrictedMode(restrictedMode as Boolean?)
682+
683+
/** Alias for calling [Builder.restrictedMode] with `restrictedMode.orElse(null)`. */
684+
fun restrictedMode(restrictedMode: Optional<Boolean>) =
685+
restrictedMode(restrictedMode.getOrNull())
686+
687+
/**
688+
* Sets [Builder.restrictedMode] to an arbitrary JSON value.
689+
*
690+
* You should usually call [Builder.restrictedMode] with a well-typed [Boolean] value
691+
* instead. This method is primarily for setting the field to an undocumented or not yet
692+
* supported value.
693+
*/
694+
fun restrictedMode(restrictedMode: JsonField<Boolean>) = apply {
695+
this.restrictedMode = restrictedMode
696+
}
697+
614698
fun tags(tags: List<String>?) = tags(JsonField.ofNullable(tags))
615699

616700
/** Alias for calling [Builder.tags] with `tags.orElse(null)`. */
@@ -667,6 +751,7 @@ private constructor(
667751
isArchived,
668752
isPublic,
669753
readme,
754+
restrictedMode,
670755
(tags ?: JsonMissing.of()).map { it.toImmutable() },
671756
additionalProperties.toMutableMap(),
672757
)
@@ -683,6 +768,7 @@ private constructor(
683768
isArchived()
684769
isPublic()
685770
readme()
771+
restrictedMode()
686772
tags()
687773
validated = true
688774
}
@@ -707,6 +793,7 @@ private constructor(
707793
(if (isArchived.asKnown().isPresent) 1 else 0) +
708794
(if (isPublic.asKnown().isPresent) 1 else 0) +
709795
(if (readme.asKnown().isPresent) 1 else 0) +
796+
(if (restrictedMode.asKnown().isPresent) 1 else 0) +
710797
(tags.asKnown().getOrNull()?.size ?: 0)
711798

712799
override fun equals(other: Any?): Boolean {
@@ -719,18 +806,27 @@ private constructor(
719806
isArchived == other.isArchived &&
720807
isPublic == other.isPublic &&
721808
readme == other.readme &&
809+
restrictedMode == other.restrictedMode &&
722810
tags == other.tags &&
723811
additionalProperties == other.additionalProperties
724812
}
725813

726814
private val hashCode: Int by lazy {
727-
Objects.hash(description, isArchived, isPublic, readme, tags, additionalProperties)
815+
Objects.hash(
816+
description,
817+
isArchived,
818+
isPublic,
819+
readme,
820+
restrictedMode,
821+
tags,
822+
additionalProperties,
823+
)
728824
}
729825

730826
override fun hashCode(): Int = hashCode
731827

732828
override fun toString() =
733-
"Body{description=$description, isArchived=$isArchived, isPublic=$isPublic, readme=$readme, tags=$tags, additionalProperties=$additionalProperties}"
829+
"Body{description=$description, isArchived=$isArchived, isPublic=$isPublic, readme=$readme, restrictedMode=$restrictedMode, tags=$tags, additionalProperties=$additionalProperties}"
734830
}
735831

736832
override fun equals(other: Any?): Boolean {

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/repos/RepoWithLookups.kt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ private constructor(
5050
private val originalRepoFullName: JsonField<String>,
5151
private val originalRepoId: JsonField<String>,
5252
private val readme: JsonField<String>,
53+
private val restrictedMode: JsonField<Boolean>,
5354
private val upstreamRepoFullName: JsonField<String>,
5455
private val upstreamRepoId: JsonField<String>,
5556
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -105,6 +106,9 @@ private constructor(
105106
@ExcludeMissing
106107
originalRepoId: JsonField<String> = JsonMissing.of(),
107108
@JsonProperty("readme") @ExcludeMissing readme: JsonField<String> = JsonMissing.of(),
109+
@JsonProperty("restricted_mode")
110+
@ExcludeMissing
111+
restrictedMode: JsonField<Boolean> = JsonMissing.of(),
108112
@JsonProperty("upstream_repo_full_name")
109113
@ExcludeMissing
110114
upstreamRepoFullName: JsonField<String> = JsonMissing.of(),
@@ -136,6 +140,7 @@ private constructor(
136140
originalRepoFullName,
137141
originalRepoId,
138142
readme,
143+
restrictedMode,
139144
upstreamRepoFullName,
140145
upstreamRepoId,
141146
mutableMapOf(),
@@ -289,6 +294,12 @@ private constructor(
289294
*/
290295
fun readme(): Optional<String> = readme.getOptional("readme")
291296

297+
/**
298+
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
299+
* server responded with an unexpected value).
300+
*/
301+
fun restrictedMode(): Optional<Boolean> = restrictedMode.getOptional("restricted_mode")
302+
292303
/**
293304
* @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
294305
* server responded with an unexpected value).
@@ -490,6 +501,15 @@ private constructor(
490501
*/
491502
@JsonProperty("readme") @ExcludeMissing fun _readme(): JsonField<String> = readme
492503

504+
/**
505+
* Returns the raw JSON value of [restrictedMode].
506+
*
507+
* Unlike [restrictedMode], this method doesn't throw if the JSON field has an unexpected type.
508+
*/
509+
@JsonProperty("restricted_mode")
510+
@ExcludeMissing
511+
fun _restrictedMode(): JsonField<Boolean> = restrictedMode
512+
493513
/**
494514
* Returns the raw JSON value of [upstreamRepoFullName].
495515
*
@@ -575,6 +595,7 @@ private constructor(
575595
private var originalRepoFullName: JsonField<String> = JsonMissing.of()
576596
private var originalRepoId: JsonField<String> = JsonMissing.of()
577597
private var readme: JsonField<String> = JsonMissing.of()
598+
private var restrictedMode: JsonField<Boolean> = JsonMissing.of()
578599
private var upstreamRepoFullName: JsonField<String> = JsonMissing.of()
579600
private var upstreamRepoId: JsonField<String> = JsonMissing.of()
580601
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -605,6 +626,7 @@ private constructor(
605626
originalRepoFullName = repoWithLookups.originalRepoFullName
606627
originalRepoId = repoWithLookups.originalRepoId
607628
readme = repoWithLookups.readme
629+
restrictedMode = repoWithLookups.restrictedMode
608630
upstreamRepoFullName = repoWithLookups.upstreamRepoFullName
609631
upstreamRepoId = repoWithLookups.upstreamRepoId
610632
additionalProperties = repoWithLookups.additionalProperties.toMutableMap()
@@ -952,6 +974,19 @@ private constructor(
952974
*/
953975
fun readme(readme: JsonField<String>) = apply { this.readme = readme }
954976

977+
fun restrictedMode(restrictedMode: Boolean) = restrictedMode(JsonField.of(restrictedMode))
978+
979+
/**
980+
* Sets [Builder.restrictedMode] to an arbitrary JSON value.
981+
*
982+
* You should usually call [Builder.restrictedMode] with a well-typed [Boolean] value
983+
* instead. This method is primarily for setting the field to an undocumented or not yet
984+
* supported value.
985+
*/
986+
fun restrictedMode(restrictedMode: JsonField<Boolean>) = apply {
987+
this.restrictedMode = restrictedMode
988+
}
989+
955990
fun upstreamRepoFullName(upstreamRepoFullName: String?) =
956991
upstreamRepoFullName(JsonField.ofNullable(upstreamRepoFullName))
957992

@@ -1062,6 +1097,7 @@ private constructor(
10621097
originalRepoFullName,
10631098
originalRepoId,
10641099
readme,
1100+
restrictedMode,
10651101
upstreamRepoFullName,
10661102
upstreamRepoId,
10671103
additionalProperties.toMutableMap(),
@@ -1099,6 +1135,7 @@ private constructor(
10991135
originalRepoFullName()
11001136
originalRepoId()
11011137
readme()
1138+
restrictedMode()
11021139
upstreamRepoFullName()
11031140
upstreamRepoId()
11041141
validated = true
@@ -1143,6 +1180,7 @@ private constructor(
11431180
(if (originalRepoFullName.asKnown().isPresent) 1 else 0) +
11441181
(if (originalRepoId.asKnown().isPresent) 1 else 0) +
11451182
(if (readme.asKnown().isPresent) 1 else 0) +
1183+
(if (restrictedMode.asKnown().isPresent) 1 else 0) +
11461184
(if (upstreamRepoFullName.asKnown().isPresent) 1 else 0) +
11471185
(if (upstreamRepoId.asKnown().isPresent) 1 else 0)
11481186

@@ -1315,6 +1353,7 @@ private constructor(
13151353
originalRepoFullName == other.originalRepoFullName &&
13161354
originalRepoId == other.originalRepoId &&
13171355
readme == other.readme &&
1356+
restrictedMode == other.restrictedMode &&
13181357
upstreamRepoFullName == other.upstreamRepoFullName &&
13191358
upstreamRepoId == other.upstreamRepoId &&
13201359
additionalProperties == other.additionalProperties
@@ -1346,6 +1385,7 @@ private constructor(
13461385
originalRepoFullName,
13471386
originalRepoId,
13481387
readme,
1388+
restrictedMode,
13491389
upstreamRepoFullName,
13501390
upstreamRepoId,
13511391
additionalProperties,
@@ -1355,5 +1395,5 @@ private constructor(
13551395
override fun hashCode(): Int = hashCode
13561396

13571397
override fun toString() =
1358-
"RepoWithLookups{id=$id, createdAt=$createdAt, fullName=$fullName, isArchived=$isArchived, isPublic=$isPublic, numCommits=$numCommits, numDownloads=$numDownloads, numLikes=$numLikes, numViews=$numViews, owner=$owner, repoHandle=$repoHandle, repoType=$repoType, tags=$tags, tenantId=$tenantId, updatedAt=$updatedAt, commitTags=$commitTags, createdBy=$createdBy, description=$description, lastCommitHash=$lastCommitHash, latestCommitManifest=$latestCommitManifest, likedByAuthUser=$likedByAuthUser, originalRepoFullName=$originalRepoFullName, originalRepoId=$originalRepoId, readme=$readme, upstreamRepoFullName=$upstreamRepoFullName, upstreamRepoId=$upstreamRepoId, additionalProperties=$additionalProperties}"
1398+
"RepoWithLookups{id=$id, createdAt=$createdAt, fullName=$fullName, isArchived=$isArchived, isPublic=$isPublic, numCommits=$numCommits, numDownloads=$numDownloads, numLikes=$numLikes, numViews=$numViews, owner=$owner, repoHandle=$repoHandle, repoType=$repoType, tags=$tags, tenantId=$tenantId, updatedAt=$updatedAt, commitTags=$commitTags, createdBy=$createdBy, description=$description, lastCommitHash=$lastCommitHash, latestCommitManifest=$latestCommitManifest, likedByAuthUser=$likedByAuthUser, originalRepoFullName=$originalRepoFullName, originalRepoId=$originalRepoId, readme=$readme, restrictedMode=$restrictedMode, upstreamRepoFullName=$upstreamRepoFullName, upstreamRepoId=$upstreamRepoId, additionalProperties=$additionalProperties}"
13591399
}

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/repos/CreateRepoResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ internal class CreateRepoResponseTest {
6868
.originalRepoFullName("original_repo_full_name")
6969
.originalRepoId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
7070
.readme("readme")
71+
.restrictedMode(true)
7172
.upstreamRepoFullName("upstream_repo_full_name")
7273
.upstreamRepoId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
7374
.build()
@@ -127,6 +128,7 @@ internal class CreateRepoResponseTest {
127128
.originalRepoFullName("original_repo_full_name")
128129
.originalRepoId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
129130
.readme("readme")
131+
.restrictedMode(true)
130132
.upstreamRepoFullName("upstream_repo_full_name")
131133
.upstreamRepoId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
132134
.build()
@@ -190,6 +192,7 @@ internal class CreateRepoResponseTest {
190192
.originalRepoFullName("original_repo_full_name")
191193
.originalRepoId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
192194
.readme("readme")
195+
.restrictedMode(true)
193196
.upstreamRepoFullName("upstream_repo_full_name")
194197
.upstreamRepoId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
195198
.build()

0 commit comments

Comments
 (0)