Skip to content

Commit

Permalink
chore(internal): codegen related update (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 23, 2024
1 parent ceb91b1 commit e4c8264
Show file tree
Hide file tree
Showing 37 changed files with 442 additions and 437 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/braintrustdata/braintrust-kotlin/issues) with questions, bugs, or suggestions.

## Requirements

This library requires Java 8 or later.
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,33 @@ class DatasetCreateParamsTest {
@Test
fun createDatasetCreateParams() {
DatasetCreateParams.builder()
.name("string")
.description("string")
.name("name")
.description("description")
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build()
}

@Test
fun getBody() {
val params = DatasetCreateParams.builder()
.name("string")
.description("string")
.name("name")
.description("description")
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.name()).isEqualTo("string")
assertThat(body.description()).isEqualTo("string")
assertThat(body.name()).isEqualTo("name")
assertThat(body.description()).isEqualTo("description")
assertThat(body.projectId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
}

@Test
fun getBodyWithoutOptionalFields() {
val params = DatasetCreateParams.builder()
.name("string")
.name("name")
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.name()).isEqualTo("string")
assertThat(body.name()).isEqualTo("name")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class DatasetFeedbackParamsTest {
DatasetFeedbackParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.feedback(listOf(DatasetFeedbackParams.Feedback.builder()
.id("string")
.comment("string")
.id("id")
.comment("comment")
.metadata(DatasetFeedbackParams.Feedback.Metadata.builder().build())
.source(DatasetFeedbackParams.Feedback.Source.APP)
.build()))
Expand All @@ -38,17 +38,17 @@ class DatasetFeedbackParamsTest {
val params = DatasetFeedbackParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.feedback(listOf(DatasetFeedbackParams.Feedback.builder()
.id("string")
.comment("string")
.id("id")
.comment("comment")
.metadata(DatasetFeedbackParams.Feedback.Metadata.builder().build())
.source(DatasetFeedbackParams.Feedback.Source.APP)
.build()))
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.feedback()).isEqualTo(listOf(DatasetFeedbackParams.Feedback.builder()
.id("string")
.comment("string")
.id("id")
.comment("comment")
.metadata(DatasetFeedbackParams.Feedback.Metadata.builder().build())
.source(DatasetFeedbackParams.Feedback.Source.APP)
.build()))
Expand All @@ -59,13 +59,13 @@ class DatasetFeedbackParamsTest {
val params = DatasetFeedbackParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.feedback(listOf(DatasetFeedbackParams.Feedback.builder()
.id("string")
.id("id")
.build()))
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.feedback()).isEqualTo(listOf(DatasetFeedbackParams.Feedback.builder()
.id("string")
.id("id")
.build()))
}

Expand All @@ -74,7 +74,7 @@ class DatasetFeedbackParamsTest {
val params = DatasetFeedbackParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.feedback(listOf(DatasetFeedbackParams.Feedback.builder()
.id("string")
.id("id")
.build()))
.build()
assertThat(params).isNotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class DatasetFetchParamsTest {
DatasetFetchParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.limit(123L)
.maxRootSpanId("string")
.maxXactId("string")
.version("string")
.maxRootSpanId("max_root_span_id")
.maxXactId("max_xact_id")
.version("version")
.build()
}

Expand All @@ -35,15 +35,15 @@ class DatasetFetchParamsTest {
val params = DatasetFetchParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.limit(123L)
.maxRootSpanId("string")
.maxXactId("string")
.version("string")
.maxRootSpanId("max_root_span_id")
.maxXactId("max_xact_id")
.version("version")
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("limit", listOf("123"))
expected.put("max_root_span_id", listOf("string"))
expected.put("max_xact_id", listOf("string"))
expected.put("version", listOf("string"))
expected.put("max_root_span_id", listOf("max_root_span_id"))
expected.put("max_xact_id", listOf("max_xact_id"))
expected.put("version", listOf("version"))
assertThat(params.getQueryParams()).isEqualTo(expected)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,46 @@ class DatasetFetchPostParamsTest {
fun createDatasetFetchPostParams() {
DatasetFetchPostParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.cursor("string")
.cursor("cursor")
.filters(listOf(DatasetFetchPostParams.Filter.builder()
.path(listOf("string"))
.type(DatasetFetchPostParams.Filter.Type.PATH_LOOKUP)
.value(JsonValue.from(mapOf<String, Any>()))
.build()))
.limit(123L)
.maxRootSpanId("string")
.maxXactId("string")
.version("string")
.maxRootSpanId("max_root_span_id")
.maxXactId("max_xact_id")
.version("version")
.build()
}

@Test
fun getBody() {
val params = DatasetFetchPostParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.cursor("string")
.cursor("cursor")
.filters(listOf(DatasetFetchPostParams.Filter.builder()
.path(listOf("string"))
.type(DatasetFetchPostParams.Filter.Type.PATH_LOOKUP)
.value(JsonValue.from(mapOf<String, Any>()))
.build()))
.limit(123L)
.maxRootSpanId("string")
.maxXactId("string")
.version("string")
.maxRootSpanId("max_root_span_id")
.maxXactId("max_xact_id")
.version("version")
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.cursor()).isEqualTo("string")
assertThat(body.cursor()).isEqualTo("cursor")
assertThat(body.filters()).isEqualTo(listOf(DatasetFetchPostParams.Filter.builder()
.path(listOf("string"))
.type(DatasetFetchPostParams.Filter.Type.PATH_LOOKUP)
.value(JsonValue.from(mapOf<String, Any>()))
.build()))
assertThat(body.limit()).isEqualTo(123L)
assertThat(body.maxRootSpanId()).isEqualTo("string")
assertThat(body.maxXactId()).isEqualTo("string")
assertThat(body.version()).isEqualTo("string")
assertThat(body.maxRootSpanId()).isEqualTo("max_root_span_id")
assertThat(body.maxXactId()).isEqualTo("max_xact_id")
assertThat(body.version()).isEqualTo("version")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class DatasetInsertParamsTest {
DatasetInsertParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.events(listOf(DatasetInsertParams.Event.ofInsertDatasetEventReplace(DatasetInsertParams.Event.InsertDatasetEventReplace.builder()
.id("string")
.id("id")
._isMerge(true)
._objectDelete(true)
._parentId("string")
._parentId("_parent_id")
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.expected(JsonValue.from(mapOf<String, Any>()))
.input(JsonValue.from(mapOf<String, Any>()))
Expand All @@ -43,10 +43,10 @@ class DatasetInsertParamsTest {
val params = DatasetInsertParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.events(listOf(DatasetInsertParams.Event.ofInsertDatasetEventReplace(DatasetInsertParams.Event.InsertDatasetEventReplace.builder()
.id("string")
.id("id")
._isMerge(true)
._objectDelete(true)
._parentId("string")
._parentId("_parent_id")
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.expected(JsonValue.from(mapOf<String, Any>()))
.input(JsonValue.from(mapOf<String, Any>()))
Expand All @@ -57,10 +57,10 @@ class DatasetInsertParamsTest {
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.events()).isEqualTo(listOf(DatasetInsertParams.Event.ofInsertDatasetEventReplace(DatasetInsertParams.Event.InsertDatasetEventReplace.builder()
.id("string")
.id("id")
._isMerge(true)
._objectDelete(true)
._parentId("string")
._parentId("_parent_id")
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.expected(JsonValue.from(mapOf<String, Any>()))
.input(JsonValue.from(mapOf<String, Any>()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@ class DatasetListParamsTest {
@Test
fun createDatasetListParams() {
DatasetListParams.builder()
.datasetName("string")
.datasetName("dataset_name")
.endingBefore("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.ids(DatasetListParams.Ids.ofString("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"))
.limit(123L)
.orgName("string")
.projectName("string")
.orgName("org_name")
.projectName("project_name")
.startingAfter("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build()
}

@Test
fun getQueryParams() {
val params = DatasetListParams.builder()
.datasetName("string")
.datasetName("dataset_name")
.endingBefore("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.ids(DatasetListParams.Ids.ofString("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"))
.limit(123L)
.orgName("string")
.projectName("string")
.orgName("org_name")
.projectName("project_name")
.startingAfter("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("dataset_name", listOf("string"))
expected.put("dataset_name", listOf("dataset_name"))
expected.put("ending_before", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"))
expected.put("ids", listOf(DatasetListParams.Ids.ofString("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").toString()))
expected.put("limit", listOf("123"))
expected.put("org_name", listOf("string"))
expected.put("project_name", listOf("string"))
expected.put("org_name", listOf("org_name"))
expected.put("project_name", listOf("project_name"))
expected.put("starting_after", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"))
assertThat(params.getQueryParams()).isEqualTo(expected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ class DatasetUpdateParamsTest {
fun createDatasetUpdateParams() {
DatasetUpdateParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.description("string")
.description("description")
.metadata(DatasetUpdateParams.Metadata.builder().build())
.name("string")
.name("name")
.build()
}

@Test
fun getBody() {
val params = DatasetUpdateParams.builder()
.datasetId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.description("string")
.description("description")
.metadata(DatasetUpdateParams.Metadata.builder().build())
.name("string")
.name("name")
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.description()).isEqualTo("string")
assertThat(body.description()).isEqualTo("description")
assertThat(body.metadata()).isEqualTo(DatasetUpdateParams.Metadata.builder().build())
assertThat(body.name()).isEqualTo("string")
assertThat(body.name()).isEqualTo("name")
}

@Test
Expand Down
Loading

0 comments on commit e4c8264

Please sign in to comment.