Skip to content

Commit

Permalink
fix(internal): fix imports and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Meadows committed Oct 1, 2024
1 parent f2ce39d commit 73f38b5
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.braintrustdata.api.core.NoAutoDetect
import com.braintrustdata.api.core.getOrThrow
import com.braintrustdata.api.core.toUnmodifiable
import com.braintrustdata.api.errors.BraintrustInvalidDataException
import com.braintrustdata.api.models.*
import com.braintrustdata.api.models.CodeBundle.*
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.braintrustdata.api.core.NoAutoDetect
import com.braintrustdata.api.core.getOrThrow
import com.braintrustdata.api.core.toUnmodifiable
import com.braintrustdata.api.errors.BraintrustInvalidDataException
import com.braintrustdata.api.models.*
import com.braintrustdata.api.models.CodeBundle.*
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.braintrustdata.api.core.NoAutoDetect
import com.braintrustdata.api.core.getOrThrow
import com.braintrustdata.api.core.toUnmodifiable
import com.braintrustdata.api.errors.BraintrustInvalidDataException
import com.braintrustdata.api.models.*
import com.braintrustdata.api.models.CodeBundle.*
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.braintrustdata.api.core.NoAutoDetect
import com.braintrustdata.api.core.getOrThrow
import com.braintrustdata.api.core.toUnmodifiable
import com.braintrustdata.api.errors.BraintrustInvalidDataException
import com.braintrustdata.api.models.*
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
Expand Down Expand Up @@ -294,7 +293,7 @@ constructor(
fun categories(categories: Categories) = apply { this.categories = categories }

/** For categorical-type project scores, the list of all categories */
fun categories(projectScoreCategories: List<ProjectScoreCategory>) = apply {
fun projectScoreCategories(projectScoreCategories: List<ProjectScoreCategory>) = apply {
this.categories = Categories.ofProjectScoreCategories(projectScoreCategories)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.braintrustdata.api.core.NoAutoDetect
import com.braintrustdata.api.core.getOrThrow
import com.braintrustdata.api.core.toUnmodifiable
import com.braintrustdata.api.errors.BraintrustInvalidDataException
import com.braintrustdata.api.models.*
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
Expand Down Expand Up @@ -294,7 +293,7 @@ constructor(
fun categories(categories: Categories) = apply { this.categories = categories }

/** For categorical-type project scores, the list of all categories */
fun categories(projectScoreCategories: List<ProjectScoreCategory>) = apply {
fun projectScoreCategories(projectScoreCategories: List<ProjectScoreCategory>) = apply {
this.categories = Categories.ofProjectScoreCategories(projectScoreCategories)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.braintrustdata.api.core.NoAutoDetect
import com.braintrustdata.api.core.getOrThrow
import com.braintrustdata.api.core.toUnmodifiable
import com.braintrustdata.api.errors.BraintrustInvalidDataException
import com.braintrustdata.api.models.*
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
Expand Down Expand Up @@ -281,7 +280,7 @@ constructor(
fun categories(categories: Categories) = apply { this.categories = categories }

/** For categorical-type project scores, the list of all categories */
fun categories(projectScoreCategories: List<ProjectScoreCategory>) = apply {
fun projectScoreCategories(projectScoreCategories: List<ProjectScoreCategory>) = apply {
this.categories = Categories.ofProjectScoreCategories(projectScoreCategories)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ private constructor(
tryDeserialize(node, jacksonTypeRef<Auto>())?.let {
return FunctionCall(auto = it, _json = json)
}
tryDeserialize(node, jacksonTypeRef<None>())?.let {
tryDeserialize(node, jacksonTypeRef<FunctionCall.None>())?.let {
return FunctionCall(none = it, _json = json)
}
tryDeserialize(node, jacksonTypeRef<Function>()) { it.validate() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private constructor(
tryDeserialize(node, jacksonTypeRef<Auto>())?.let {
return ToolChoice(auto = it, _json = json)
}
tryDeserialize(node, jacksonTypeRef<None>())?.let {
tryDeserialize(node, jacksonTypeRef<ToolChoice.None>())?.let {
return ToolChoice(none = it, _json = json)
}
tryDeserialize(node, jacksonTypeRef<Function>()) { it.validate() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class ProjectScoreCreateParamsTest {
.name("name")
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.scoreType(ProjectScoreType.SLIDER)
.categories(
ProjectScoreCreateParams.Categories.ofList<ProjectScoreCategory>(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.projectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.config(
ProjectScoreConfig.builder()
Expand Down Expand Up @@ -53,10 +51,8 @@ class ProjectScoreCreateParamsTest {
.name("name")
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.scoreType(ProjectScoreType.SLIDER)
.categories(
ProjectScoreCreateParams.Categories.ofList<ProjectScoreCategory>(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.projectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.config(
ProjectScoreConfig.builder()
Expand Down Expand Up @@ -92,7 +88,7 @@ class ProjectScoreCreateParamsTest {
assertThat(body.scoreType()).isEqualTo(ProjectScoreType.SLIDER)
assertThat(body.categories())
.isEqualTo(
ProjectScoreCreateParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreCreateParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ class ProjectScoreListParamsTest {
expected.put(
"score_type",
listOf(
ProjectScoreListParams.ScoreType.ofProjectScoreType(
ProjectScoreType.SLIDER.toString()
)
ProjectScoreListParams.ScoreType.ofProjectScoreType(ProjectScoreType.SLIDER)
.toString()
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class ProjectScoreReplaceParamsTest {
.name("name")
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.scoreType(ProjectScoreType.SLIDER)
.categories(
ProjectScoreReplaceParams.Categories.ofList<ProjectScoreCategory>(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.projectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.config(
ProjectScoreConfig.builder()
Expand Down Expand Up @@ -53,10 +51,8 @@ class ProjectScoreReplaceParamsTest {
.name("name")
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.scoreType(ProjectScoreType.SLIDER)
.categories(
ProjectScoreReplaceParams.Categories.ofList<ProjectScoreCategory>(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.projectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
.config(
ProjectScoreConfig.builder()
Expand Down Expand Up @@ -92,7 +88,7 @@ class ProjectScoreReplaceParamsTest {
assertThat(body.scoreType()).isEqualTo(ProjectScoreType.SLIDER)
assertThat(body.categories())
.isEqualTo(
ProjectScoreReplaceParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreReplaceParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ProjectScoreTest {
.scoreType(ProjectScoreType.SLIDER)
.userId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.categories(
ProjectScore.Categories.ofList<ProjectScoreCategory>(
ProjectScore.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down Expand Up @@ -59,7 +59,7 @@ class ProjectScoreTest {
assertThat(projectScore.userId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
assertThat(projectScore.categories())
.isEqualTo(
ProjectScore.Categories.ofList<ProjectScoreCategory>(
ProjectScore.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ProjectScoreUpdateParamsTest {
ProjectScoreUpdateParams.builder()
.projectScoreId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.categories(
ProjectScoreUpdateParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreUpdateParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down Expand Up @@ -52,7 +52,7 @@ class ProjectScoreUpdateParamsTest {
ProjectScoreUpdateParams.builder()
.projectScoreId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.categories(
ProjectScoreUpdateParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreUpdateParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down Expand Up @@ -89,7 +89,7 @@ class ProjectScoreUpdateParamsTest {
assertThat(body).isNotNull
assertThat(body.categories())
.isEqualTo(
ProjectScoreUpdateParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreUpdateParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class EnvVarServiceTest {
envVarService.list(
EnvVarListParams.builder()
.envVarName("env_var_name")
.ids(EnvVarListParams.Ids.ofString("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"))
.limit(123L)
.objectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.objectType(EnvVarListParams.ObjectType.ORGANIZATION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ProjectScoreServiceTest {
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.scoreType(ProjectScoreType.SLIDER)
.categories(
ProjectScoreCreateParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreCreateParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down Expand Up @@ -95,7 +95,7 @@ class ProjectScoreServiceTest {
ProjectScoreUpdateParams.builder()
.projectScoreId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.categories(
ProjectScoreUpdateParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreUpdateParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down Expand Up @@ -180,7 +180,7 @@ class ProjectScoreServiceTest {
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.scoreType(ProjectScoreType.SLIDER)
.categories(
ProjectScoreReplaceParams.Categories.ofList<ProjectScoreCategory>(
ProjectScoreReplaceParams.Categories.ofProjectScoreCategories(
listOf(ProjectScoreCategory.builder().name("name").value(42.23).build())
)
)
Expand Down

0 comments on commit 73f38b5

Please sign in to comment.