Skip to content

Commit 8e94d9d

Browse files
feat(api): api update
1 parent f81b7c9 commit 8e94d9d

3 files changed

Lines changed: 22 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: 102
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-4c93d507b2326e5f7af1659d8b081ffa938f9116657401564495ddb8e016858b.yml
3-
openapi_spec_hash: 6634ce7c241bc7eb4b88474c62aa1e5d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-4b22a5706f1f5405ebb50e345ebc2eef2728c6255ee0b717509160bd4712f236.yml
3+
openapi_spec_hash: d39b8ae73909bbf89b36d55276f2649a
44
config_hash: 787a12876983a14bce67ed57899e4a94

langsmith-java-core/src/main/kotlin/com/langchain/smith/models/commits/CommitListParams.kt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ private constructor(
2323
private val includeStats: Boolean?,
2424
private val limit: Long?,
2525
private val offset: Long?,
26+
private val tag: String?,
2627
private val additionalHeaders: Headers,
2728
private val additionalQueryParams: QueryParams,
2829
) : Params {
@@ -40,6 +41,9 @@ private constructor(
4041
/** Offset is the pagination offset */
4142
fun offset(): Optional<Long> = Optional.ofNullable(offset)
4243

44+
/** Tag filters commits to only those with a specific tag (e.g. "production", "staging") */
45+
fun tag(): Optional<String> = Optional.ofNullable(tag)
46+
4347
/** Additional headers to send with the request. */
4448
fun _additionalHeaders(): Headers = additionalHeaders
4549

@@ -69,6 +73,7 @@ private constructor(
6973
private var includeStats: Boolean? = null
7074
private var limit: Long? = null
7175
private var offset: Long? = null
76+
private var tag: String? = null
7277
private var additionalHeaders: Headers.Builder = Headers.builder()
7378
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
7479

@@ -79,6 +84,7 @@ private constructor(
7984
includeStats = commitListParams.includeStats
8085
limit = commitListParams.limit
8186
offset = commitListParams.offset
87+
tag = commitListParams.tag
8288
additionalHeaders = commitListParams.additionalHeaders.toBuilder()
8389
additionalQueryParams = commitListParams.additionalQueryParams.toBuilder()
8490
}
@@ -129,6 +135,12 @@ private constructor(
129135
/** Alias for calling [Builder.offset] with `offset.orElse(null)`. */
130136
fun offset(offset: Optional<Long>) = offset(offset.getOrNull())
131137

138+
/** Tag filters commits to only those with a specific tag (e.g. "production", "staging") */
139+
fun tag(tag: String?) = apply { this.tag = tag }
140+
141+
/** Alias for calling [Builder.tag] with `tag.orElse(null)`. */
142+
fun tag(tag: Optional<String>) = tag(tag.getOrNull())
143+
132144
fun additionalHeaders(additionalHeaders: Headers) = apply {
133145
this.additionalHeaders.clear()
134146
putAllAdditionalHeaders(additionalHeaders)
@@ -246,6 +258,7 @@ private constructor(
246258
includeStats,
247259
limit,
248260
offset,
261+
tag,
249262
additionalHeaders.build(),
250263
additionalQueryParams.build(),
251264
)
@@ -266,6 +279,7 @@ private constructor(
266279
includeStats?.let { put("include_stats", it.toString()) }
267280
limit?.let { put("limit", it.toString()) }
268281
offset?.let { put("offset", it.toString()) }
282+
tag?.let { put("tag", it) }
269283
putAll(additionalQueryParams)
270284
}
271285
.build()
@@ -281,6 +295,7 @@ private constructor(
281295
includeStats == other.includeStats &&
282296
limit == other.limit &&
283297
offset == other.offset &&
298+
tag == other.tag &&
284299
additionalHeaders == other.additionalHeaders &&
285300
additionalQueryParams == other.additionalQueryParams
286301
}
@@ -292,10 +307,11 @@ private constructor(
292307
includeStats,
293308
limit,
294309
offset,
310+
tag,
295311
additionalHeaders,
296312
additionalQueryParams,
297313
)
298314

299315
override fun toString() =
300-
"CommitListParams{owner=$owner, repo=$repo, includeStats=$includeStats, limit=$limit, offset=$offset, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
316+
"CommitListParams{owner=$owner, repo=$repo, includeStats=$includeStats, limit=$limit, offset=$offset, tag=$tag, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
301317
}

langsmith-java-core/src/test/kotlin/com/langchain/smith/models/commits/CommitListParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ internal class CommitListParamsTest {
1616
.includeStats(true)
1717
.limit(1L)
1818
.offset(0L)
19+
.tag("tag")
1920
.build()
2021
}
2122

@@ -38,6 +39,7 @@ internal class CommitListParamsTest {
3839
.includeStats(true)
3940
.limit(1L)
4041
.offset(0L)
42+
.tag("tag")
4143
.build()
4244

4345
val queryParams = params._queryParams()
@@ -48,6 +50,7 @@ internal class CommitListParamsTest {
4850
.put("include_stats", "true")
4951
.put("limit", "1")
5052
.put("offset", "0")
53+
.put("tag", "tag")
5154
.build()
5255
)
5356
}

0 commit comments

Comments
 (0)