Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java: Throw RuntimeException when a condition isn't met #376

Merged
merged 6 commits into from
May 20, 2024
Merged

Conversation

spinillos
Copy link
Member

@spinillos spinillos commented May 13, 2024

Contributes to #360

The easiest way to archive this is throwing a RuntimeException when a condition isn't met. With this we delegate the exception management to the user.

It also negates all constraints conditions because it was wrong 😅.

@spinillos spinillos requested a review from a team as a code owner May 13, 2024 15:38
@spinillos spinillos mentioned this pull request May 13, 2024
11 tasks
Copy link

github-actions bot commented May 13, 2024

Note: in addition to the changes introduced by this PR, the diff includes unreleased changes living in main.

🔎 Changes to grafana-foundation-sdk@next+cog-v0.0.x

diff --git a/go/dashboardlist/panel_builder_gen.go b/go/dashboardlist/panel_builder_gen.go
index 498d4c1..68175fa 100644
--- a/go/dashboardlist/panel_builder_gen.go
+++ b/go/dashboardlist/panel_builder_gen.go
@@ -461,6 +461,15 @@ func (builder *PanelBuilder) ShowHeadings(showHeadings bool) *PanelBuilder {
 	return builder
 }
 
+func (builder *PanelBuilder) ShowFolderNames(showFolderNames bool) *PanelBuilder {
+	if builder.internal.Options == nil {
+		builder.internal.Options = &Options{}
+	}
+	builder.internal.Options.(*Options).ShowFolderNames = showFolderNames
+
+	return builder
+}
+
 func (builder *PanelBuilder) MaxItems(maxItems int64) *PanelBuilder {
 	if builder.internal.Options == nil {
 		builder.internal.Options = &Options{}
@@ -508,6 +517,7 @@ func (builder *PanelBuilder) applyDefaults() {
 	builder.ShowRecentlyViewed(false)
 	builder.ShowSearch(false)
 	builder.ShowHeadings(true)
+	builder.ShowFolderNames(true)
 	builder.MaxItems(10)
 	builder.Query("")
 }
diff --git a/go/dashboardlist/types_gen.go b/go/dashboardlist/types_gen.go
index a86f90f..9b0d7be 100644
--- a/go/dashboardlist/types_gen.go
+++ b/go/dashboardlist/types_gen.go
@@ -9,6 +9,7 @@ type Options struct {
 	ShowRecentlyViewed bool     `json:"showRecentlyViewed"`
 	ShowSearch         bool     `json:"showSearch"`
 	ShowHeadings       bool     `json:"showHeadings"`
+	ShowFolderNames    bool     `json:"showFolderNames"`
 	MaxItems           int64    `json:"maxItems"`
 	Query              string   `json:"query"`
 	Tags               []string `json:"tags"`
diff --git a/go/testdata/csvwave_builder_gen.go b/go/testdata/csvwave_builder_gen.go
new file mode 100644
index 0000000..2a808e1
--- /dev/null
+++ b/go/testdata/csvwave_builder_gen.go
@@ -0,0 +1,67 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[CSVWave] = (*CSVWaveBuilder)(nil)
+
+type CSVWaveBuilder struct {
+	internal *CSVWave
+	errors   map[string]cog.BuildErrors
+}
+
+func NewCSVWaveBuilder() *CSVWaveBuilder {
+	resource := &CSVWave{}
+	builder := &CSVWaveBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *CSVWaveBuilder) Build() (CSVWave, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("CSVWave", err)...)
+	}
+
+	if len(errs) != 0 {
+		return CSVWave{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *CSVWaveBuilder) Labels(labels string) *CSVWaveBuilder {
+	builder.internal.Labels = &labels
+
+	return builder
+}
+
+func (builder *CSVWaveBuilder) Name(name string) *CSVWaveBuilder {
+	builder.internal.Name = &name
+
+	return builder
+}
+
+func (builder *CSVWaveBuilder) TimeStep(timeStep int64) *CSVWaveBuilder {
+	builder.internal.TimeStep = &timeStep
+
+	return builder
+}
+
+func (builder *CSVWaveBuilder) ValuesCSV(valuesCSV string) *CSVWaveBuilder {
+	builder.internal.ValuesCSV = &valuesCSV
+
+	return builder
+}
+
+func (builder *CSVWaveBuilder) applyDefaults() {
+}
diff --git a/go/testdata/dataquery_builder_gen.go b/go/testdata/dataquery_builder_gen.go
new file mode 100644
index 0000000..9e09020
--- /dev/null
+++ b/go/testdata/dataquery_builder_gen.go
@@ -0,0 +1,363 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+	cogvariants "github.com/grafana/grafana-foundation-sdk/go/cog/variants"
+)
+
+var _ cog.Builder[cogvariants.Dataquery] = (*DataqueryBuilder)(nil)
+
+type DataqueryBuilder struct {
+	internal *Dataquery
+	errors   map[string]cog.BuildErrors
+}
+
+func NewDataqueryBuilder() *DataqueryBuilder {
+	resource := &Dataquery{}
+	builder := &DataqueryBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Build() (cogvariants.Dataquery, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("Dataquery", err)...)
+	}
+
+	if len(errs) != 0 {
+		return Dataquery{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *DataqueryBuilder) Alias(alias string) *DataqueryBuilder {
+	builder.internal.Alias = &alias
+
+	return builder
+}
+
+// Used for live query
+func (builder *DataqueryBuilder) Channel(channel string) *DataqueryBuilder {
+	builder.internal.Channel = &channel
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) CsvContent(csvContent string) *DataqueryBuilder {
+	builder.internal.CsvContent = &csvContent
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) CsvFileName(csvFileName string) *DataqueryBuilder {
+	builder.internal.CsvFileName = &csvFileName
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) CsvWave(csvWave []cog.Builder[CSVWave]) *DataqueryBuilder {
+	csvWaveResources := make([]CSVWave, 0, len(csvWave))
+	for _, r1 := range csvWave {
+		csvWaveDepth1, err := r1.Build()
+		if err != nil {
+			builder.errors["csvWave"] = err.(cog.BuildErrors)
+			return builder
+		}
+		csvWaveResources = append(csvWaveResources, csvWaveDepth1)
+	}
+	builder.internal.CsvWave = csvWaveResources
+
+	return builder
+}
+
+// The datasource
+func (builder *DataqueryBuilder) Datasource(datasource cog.Builder[Datasource]) *DataqueryBuilder {
+	datasourceResource, err := datasource.Build()
+	if err != nil {
+		builder.errors["datasource"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.Datasource = &datasourceResource
+
+	return builder
+}
+
+// Drop percentage (the chance we will lose a point 0-100)
+func (builder *DataqueryBuilder) DropPercent(dropPercent float64) *DataqueryBuilder {
+	builder.internal.DropPercent = &dropPercent
+
+	return builder
+}
+
+// Possible enum values:
+//   - `"frontend_exception"`
+//   - `"frontend_observable"`
+//   - `"server_panic"`
+func (builder *DataqueryBuilder) ErrorType(errorType DataqueryErrorType) *DataqueryBuilder {
+	builder.internal.ErrorType = &errorType
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) FlamegraphDiff(flamegraphDiff bool) *DataqueryBuilder {
+	builder.internal.FlamegraphDiff = &flamegraphDiff
+
+	return builder
+}
+
+// true if query is disabled (ie should not be returned to the dashboard)
+// NOTE: this does not always imply that the query should not be executed since
+// the results from a hidden query may be used as the input to other queries (SSE etc)
+func (builder *DataqueryBuilder) Hide(hide bool) *DataqueryBuilder {
+	builder.internal.Hide = &hide
+
+	return builder
+}
+
+// Interval is the suggested duration between time points in a time series query.
+// NOTE: the values for intervalMs is not saved in the query model.  It is typically calculated
+// from the interval required to fill a pixels in the visualization
+func (builder *DataqueryBuilder) IntervalMs(intervalMs float64) *DataqueryBuilder {
+	builder.internal.IntervalMs = &intervalMs
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Labels(labels string) *DataqueryBuilder {
+	builder.internal.Labels = &labels
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) LevelColumn(levelColumn bool) *DataqueryBuilder {
+	builder.internal.LevelColumn = &levelColumn
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Lines(lines int64) *DataqueryBuilder {
+	builder.internal.Lines = &lines
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Max(max float64) *DataqueryBuilder {
+	builder.internal.Max = &max
+
+	return builder
+}
+
+// MaxDataPoints is the maximum number of data points that should be returned from a time series query.
+// NOTE: the values for maxDataPoints is not saved in the query model.  It is typically calculated
+// from the number of pixels visible in a visualization
+func (builder *DataqueryBuilder) MaxDataPoints(maxDataPoints int64) *DataqueryBuilder {
+	builder.internal.MaxDataPoints = &maxDataPoints
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Min(min float64) *DataqueryBuilder {
+	builder.internal.Min = &min
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Nodes(nodes cog.Builder[NodesQuery]) *DataqueryBuilder {
+	nodesResource, err := nodes.Build()
+	if err != nil {
+		builder.errors["nodes"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.Nodes = &nodesResource
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Noise(noise float64) *DataqueryBuilder {
+	builder.internal.Noise = &noise
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Points(points [][]any) *DataqueryBuilder {
+	builder.internal.Points = points
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) PulseWave(pulseWave cog.Builder[PulseWaveQuery]) *DataqueryBuilder {
+	pulseWaveResource, err := pulseWave.Build()
+	if err != nil {
+		builder.errors["pulseWave"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.PulseWave = &pulseWaveResource
+
+	return builder
+}
+
+// QueryType is an optional identifier for the type of query.
+// It can be used to distinguish different types of queries.
+func (builder *DataqueryBuilder) QueryType(queryType string) *DataqueryBuilder {
+	builder.internal.QueryType = &queryType
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) RawFrameContent(rawFrameContent string) *DataqueryBuilder {
+	builder.internal.RawFrameContent = &rawFrameContent
+
+	return builder
+}
+
+// RefID is the unique identifier of the query, set by the frontend call.
+func (builder *DataqueryBuilder) RefId(refId string) *DataqueryBuilder {
+	builder.internal.RefId = &refId
+
+	return builder
+}
+
+// Optionally define expected query result behavior
+func (builder *DataqueryBuilder) ResultAssertions(resultAssertions cog.Builder[ResultAssertions]) *DataqueryBuilder {
+	resultAssertionsResource, err := resultAssertions.Build()
+	if err != nil {
+		builder.errors["resultAssertions"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.ResultAssertions = &resultAssertionsResource
+
+	return builder
+}
+
+// Possible enum values:
+//   - `"annotations"`
+//   - `"arrow"`
+//   - `"csv_content"`
+//   - `"csv_file"`
+//   - `"csv_metric_values"`
+//   - `"datapoints_outside_range"`
+//   - `"exponential_heatmap_bucket_data"`
+//   - `"flame_graph"`
+//   - `"grafana_api"`
+//   - `"linear_heatmap_bucket_data"`
+//   - `"live"`
+//   - `"logs"`
+//   - `"manual_entry"`
+//   - `"no_data_points"`
+//   - `"node_graph"`
+//   - `"predictable_csv_wave"`
+//   - `"predictable_pulse"`
+//   - `"random_walk"`
+//   - `"random_walk_table"`
+//   - `"random_walk_with_error"`
+//   - `"raw_frame"`
+//   - `"server_error_500"`
+//   - `"simulation"`
+//   - `"slow_query"`
+//   - `"streaming_client"`
+//   - `"table_static"`
+//   - `"trace"`
+//   - `"usa"`
+//   - `"variables-query"`
+func (builder *DataqueryBuilder) ScenarioId(scenarioId DataqueryScenarioId) *DataqueryBuilder {
+	builder.internal.ScenarioId = &scenarioId
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) SeriesCount(seriesCount int64) *DataqueryBuilder {
+	builder.internal.SeriesCount = &seriesCount
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Sim(sim cog.Builder[SimulationQuery]) *DataqueryBuilder {
+	simResource, err := sim.Build()
+	if err != nil {
+		builder.errors["sim"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.Sim = &simResource
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) SpanCount(spanCount int64) *DataqueryBuilder {
+	builder.internal.SpanCount = &spanCount
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Spread(spread float64) *DataqueryBuilder {
+	builder.internal.Spread = &spread
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) StartValue(startValue float64) *DataqueryBuilder {
+	builder.internal.StartValue = &startValue
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Stream(stream cog.Builder[StreamingQuery]) *DataqueryBuilder {
+	streamResource, err := stream.Build()
+	if err != nil {
+		builder.errors["stream"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.Stream = &streamResource
+
+	return builder
+}
+
+// common parameter used by many query types
+func (builder *DataqueryBuilder) StringInput(stringInput string) *DataqueryBuilder {
+	builder.internal.StringInput = &stringInput
+
+	return builder
+}
+
+// TimeRange represents the query range
+// NOTE: unlike generic /ds/query, we can now send explicit time values in each query
+// NOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly
+func (builder *DataqueryBuilder) TimeRange(timeRange cog.Builder[TimeRange]) *DataqueryBuilder {
+	timeRangeResource, err := timeRange.Build()
+	if err != nil {
+		builder.errors["timeRange"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.TimeRange = &timeRangeResource
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) Usa(usa cog.Builder[USAQuery]) *DataqueryBuilder {
+	usaResource, err := usa.Build()
+	if err != nil {
+		builder.errors["usa"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.Usa = &usaResource
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) WithNil(withNil bool) *DataqueryBuilder {
+	builder.internal.WithNil = &withNil
+
+	return builder
+}
+
+func (builder *DataqueryBuilder) applyDefaults() {
+}
diff --git a/go/testdata/datasource_builder_gen.go b/go/testdata/datasource_builder_gen.go
new file mode 100644
index 0000000..a995e8c
--- /dev/null
+++ b/go/testdata/datasource_builder_gen.go
@@ -0,0 +1,57 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[Datasource] = (*DatasourceBuilder)(nil)
+
+type DatasourceBuilder struct {
+	internal *Datasource
+	errors   map[string]cog.BuildErrors
+}
+
+func NewDatasourceBuilder() *DatasourceBuilder {
+	resource := &Datasource{}
+	builder := &DatasourceBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *DatasourceBuilder) Build() (Datasource, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("Datasource", err)...)
+	}
+
+	if len(errs) != 0 {
+		return Datasource{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+// The datasource plugin type
+func (builder *DatasourceBuilder) Type(typeArg string) *DatasourceBuilder {
+	builder.internal.Type = typeArg
+
+	return builder
+}
+
+// Datasource UID
+func (builder *DatasourceBuilder) Uid(uid string) *DatasourceBuilder {
+	builder.internal.Uid = &uid
+
+	return builder
+}
+
+func (builder *DatasourceBuilder) applyDefaults() {
+}
diff --git a/go/testdata/key_builder_gen.go b/go/testdata/key_builder_gen.go
new file mode 100644
index 0000000..8b2c534
--- /dev/null
+++ b/go/testdata/key_builder_gen.go
@@ -0,0 +1,61 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[Key] = (*KeyBuilder)(nil)
+
+type KeyBuilder struct {
+	internal *Key
+	errors   map[string]cog.BuildErrors
+}
+
+func NewKeyBuilder() *KeyBuilder {
+	resource := &Key{}
+	builder := &KeyBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *KeyBuilder) Build() (Key, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("Key", err)...)
+	}
+
+	if len(errs) != 0 {
+		return Key{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *KeyBuilder) Tick(tick float64) *KeyBuilder {
+	builder.internal.Tick = tick
+
+	return builder
+}
+
+func (builder *KeyBuilder) Type(typeArg string) *KeyBuilder {
+	builder.internal.Type = typeArg
+
+	return builder
+}
+
+func (builder *KeyBuilder) Uid(uid string) *KeyBuilder {
+	builder.internal.Uid = &uid
+
+	return builder
+}
+
+func (builder *KeyBuilder) applyDefaults() {
+}
diff --git a/go/testdata/nodesquery_builder_gen.go b/go/testdata/nodesquery_builder_gen.go
new file mode 100644
index 0000000..62a3671
--- /dev/null
+++ b/go/testdata/nodesquery_builder_gen.go
@@ -0,0 +1,67 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[NodesQuery] = (*NodesQueryBuilder)(nil)
+
+type NodesQueryBuilder struct {
+	internal *NodesQuery
+	errors   map[string]cog.BuildErrors
+}
+
+func NewNodesQueryBuilder() *NodesQueryBuilder {
+	resource := &NodesQuery{}
+	builder := &NodesQueryBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *NodesQueryBuilder) Build() (NodesQuery, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("NodesQuery", err)...)
+	}
+
+	if len(errs) != 0 {
+		return NodesQuery{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *NodesQueryBuilder) Count(count int64) *NodesQueryBuilder {
+	builder.internal.Count = &count
+
+	return builder
+}
+
+func (builder *NodesQueryBuilder) Seed(seed int64) *NodesQueryBuilder {
+	builder.internal.Seed = &seed
+
+	return builder
+}
+
+// Possible enum values:
+//   - `"random"`
+//   - `"random edges"`
+//   - `"response_medium"`
+//   - `"response_small"`
+//   - `"feature_showcase"`
+func (builder *NodesQueryBuilder) Type(typeArg NodesQueryType) *NodesQueryBuilder {
+	builder.internal.Type = &typeArg
+
+	return builder
+}
+
+func (builder *NodesQueryBuilder) applyDefaults() {
+}
diff --git a/go/testdata/pulsewavequery_builder_gen.go b/go/testdata/pulsewavequery_builder_gen.go
new file mode 100644
index 0000000..390f9fc
--- /dev/null
+++ b/go/testdata/pulsewavequery_builder_gen.go
@@ -0,0 +1,73 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[PulseWaveQuery] = (*PulseWaveQueryBuilder)(nil)
+
+type PulseWaveQueryBuilder struct {
+	internal *PulseWaveQuery
+	errors   map[string]cog.BuildErrors
+}
+
+func NewPulseWaveQueryBuilder() *PulseWaveQueryBuilder {
+	resource := &PulseWaveQuery{}
+	builder := &PulseWaveQueryBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *PulseWaveQueryBuilder) Build() (PulseWaveQuery, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("PulseWaveQuery", err)...)
+	}
+
+	if len(errs) != 0 {
+		return PulseWaveQuery{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *PulseWaveQueryBuilder) OffCount(offCount int64) *PulseWaveQueryBuilder {
+	builder.internal.OffCount = &offCount
+
+	return builder
+}
+
+func (builder *PulseWaveQueryBuilder) OffValue(offValue float64) *PulseWaveQueryBuilder {
+	builder.internal.OffValue = &offValue
+
+	return builder
+}
+
+func (builder *PulseWaveQueryBuilder) OnCount(onCount int64) *PulseWaveQueryBuilder {
+	builder.internal.OnCount = &onCount
+
+	return builder
+}
+
+func (builder *PulseWaveQueryBuilder) OnValue(onValue float64) *PulseWaveQueryBuilder {
+	builder.internal.OnValue = &onValue
+
+	return builder
+}
+
+func (builder *PulseWaveQueryBuilder) TimeStep(timeStep int64) *PulseWaveQueryBuilder {
+	builder.internal.TimeStep = &timeStep
+
+	return builder
+}
+
+func (builder *PulseWaveQueryBuilder) applyDefaults() {
+}
diff --git a/go/testdata/resultassertions_builder_gen.go b/go/testdata/resultassertions_builder_gen.go
new file mode 100644
index 0000000..d117f19
--- /dev/null
+++ b/go/testdata/resultassertions_builder_gen.go
@@ -0,0 +1,77 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[ResultAssertions] = (*ResultAssertionsBuilder)(nil)
+
+type ResultAssertionsBuilder struct {
+	internal *ResultAssertions
+	errors   map[string]cog.BuildErrors
+}
+
+func NewResultAssertionsBuilder() *ResultAssertionsBuilder {
+	resource := &ResultAssertions{}
+	builder := &ResultAssertionsBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *ResultAssertionsBuilder) Build() (ResultAssertions, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("ResultAssertions", err)...)
+	}
+
+	if len(errs) != 0 {
+		return ResultAssertions{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+// Maximum frame count
+func (builder *ResultAssertionsBuilder) MaxFrames(maxFrames int64) *ResultAssertionsBuilder {
+	builder.internal.MaxFrames = &maxFrames
+
+	return builder
+}
+
+// Type asserts that the frame matches a known type structure.
+// Possible enum values:
+//   - `""`
+//   - `"timeseries-wide"`
+//   - `"timeseries-long"`
+//   - `"timeseries-many"`
+//   - `"timeseries-multi"`
+//   - `"directory-listing"`
+//   - `"table"`
+//   - `"numeric-wide"`
+//   - `"numeric-multi"`
+//   - `"numeric-long"`
+//   - `"log-lines"`
+func (builder *ResultAssertionsBuilder) Type(typeArg ResultAssertionsType) *ResultAssertionsBuilder {
+	builder.internal.Type = &typeArg
+
+	return builder
+}
+
+// TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane
+// contract documentation https://grafana.github.io/dataplane/contract/.
+func (builder *ResultAssertionsBuilder) TypeVersion(typeVersion []int64) *ResultAssertionsBuilder {
+	builder.internal.TypeVersion = typeVersion
+
+	return builder
+}
+
+func (builder *ResultAssertionsBuilder) applyDefaults() {
+}
diff --git a/go/testdata/simulationquery_builder_gen.go b/go/testdata/simulationquery_builder_gen.go
new file mode 100644
index 0000000..2fb4b29
--- /dev/null
+++ b/go/testdata/simulationquery_builder_gen.go
@@ -0,0 +1,72 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[SimulationQuery] = (*SimulationQueryBuilder)(nil)
+
+type SimulationQueryBuilder struct {
+	internal *SimulationQuery
+	errors   map[string]cog.BuildErrors
+}
+
+func NewSimulationQueryBuilder() *SimulationQueryBuilder {
+	resource := &SimulationQuery{}
+	builder := &SimulationQueryBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *SimulationQueryBuilder) Build() (SimulationQuery, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("SimulationQuery", err)...)
+	}
+
+	if len(errs) != 0 {
+		return SimulationQuery{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *SimulationQueryBuilder) Config(config any) *SimulationQueryBuilder {
+	builder.internal.Config = &config
+
+	return builder
+}
+
+func (builder *SimulationQueryBuilder) Key(key cog.Builder[Key]) *SimulationQueryBuilder {
+	keyResource, err := key.Build()
+	if err != nil {
+		builder.errors["key"] = err.(cog.BuildErrors)
+		return builder
+	}
+	builder.internal.Key = keyResource
+
+	return builder
+}
+
+func (builder *SimulationQueryBuilder) Last(last bool) *SimulationQueryBuilder {
+	builder.internal.Last = &last
+
+	return builder
+}
+
+func (builder *SimulationQueryBuilder) Stream(stream bool) *SimulationQueryBuilder {
+	builder.internal.Stream = &stream
+
+	return builder
+}
+
+func (builder *SimulationQueryBuilder) applyDefaults() {
+}
diff --git a/go/testdata/streamingquery_builder_gen.go b/go/testdata/streamingquery_builder_gen.go
new file mode 100644
index 0000000..110a952
--- /dev/null
+++ b/go/testdata/streamingquery_builder_gen.go
@@ -0,0 +1,84 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[StreamingQuery] = (*StreamingQueryBuilder)(nil)
+
+type StreamingQueryBuilder struct {
+	internal *StreamingQuery
+	errors   map[string]cog.BuildErrors
+}
+
+func NewStreamingQueryBuilder() *StreamingQueryBuilder {
+	resource := &StreamingQuery{}
+	builder := &StreamingQueryBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *StreamingQueryBuilder) Build() (StreamingQuery, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("StreamingQuery", err)...)
+	}
+
+	if len(errs) != 0 {
+		return StreamingQuery{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *StreamingQueryBuilder) Bands(bands int64) *StreamingQueryBuilder {
+	builder.internal.Bands = &bands
+
+	return builder
+}
+
+func (builder *StreamingQueryBuilder) Noise(noise float64) *StreamingQueryBuilder {
+	builder.internal.Noise = noise
+
+	return builder
+}
+
+func (builder *StreamingQueryBuilder) Speed(speed float64) *StreamingQueryBuilder {
+	builder.internal.Speed = speed
+
+	return builder
+}
+
+func (builder *StreamingQueryBuilder) Spread(spread float64) *StreamingQueryBuilder {
+	builder.internal.Spread = spread
+
+	return builder
+}
+
+// Possible enum values:
+//   - `"fetch"`
+//   - `"logs"`
+//   - `"signal"`
+//   - `"traces"`
+func (builder *StreamingQueryBuilder) Type(typeArg StreamingQueryType) *StreamingQueryBuilder {
+	builder.internal.Type = typeArg
+
+	return builder
+}
+
+func (builder *StreamingQueryBuilder) Url(url string) *StreamingQueryBuilder {
+	builder.internal.Url = &url
+
+	return builder
+}
+
+func (builder *StreamingQueryBuilder) applyDefaults() {
+}
diff --git a/go/testdata/timerange_builder_gen.go b/go/testdata/timerange_builder_gen.go
new file mode 100644
index 0000000..7c35568
--- /dev/null
+++ b/go/testdata/timerange_builder_gen.go
@@ -0,0 +1,59 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[TimeRange] = (*TimeRangeBuilder)(nil)
+
+type TimeRangeBuilder struct {
+	internal *TimeRange
+	errors   map[string]cog.BuildErrors
+}
+
+func NewTimeRangeBuilder() *TimeRangeBuilder {
+	resource := &TimeRange{}
+	builder := &TimeRangeBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *TimeRangeBuilder) Build() (TimeRange, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("TimeRange", err)...)
+	}
+
+	if len(errs) != 0 {
+		return TimeRange{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+// From is the start time of the query.
+func (builder *TimeRangeBuilder) From(from string) *TimeRangeBuilder {
+	builder.internal.From = from
+
+	return builder
+}
+
+// To is the end time of the query.
+func (builder *TimeRangeBuilder) To(to string) *TimeRangeBuilder {
+	builder.internal.To = to
+
+	return builder
+}
+
+func (builder *TimeRangeBuilder) applyDefaults() {
+	builder.From("now-6h")
+	builder.To("now")
+}
diff --git a/go/testdata/types_gen.go b/go/testdata/types_gen.go
new file mode 100644
index 0000000..357dc96
--- /dev/null
+++ b/go/testdata/types_gen.go
@@ -0,0 +1,272 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+type Dataquery struct {
+	Alias *string `json:"alias,omitempty"`
+	// Used for live query
+	Channel     *string   `json:"channel,omitempty"`
+	CsvContent  *string   `json:"csvContent,omitempty"`
+	CsvFileName *string   `json:"csvFileName,omitempty"`
+	CsvWave     []CSVWave `json:"csvWave,omitempty"`
+	// The datasource
+	Datasource *Datasource `json:"datasource,omitempty"`
+	// Drop percentage (the chance we will lose a point 0-100)
+	DropPercent *float64 `json:"dropPercent,omitempty"`
+	// Possible enum values:
+	//  - `"frontend_exception"`
+	//  - `"frontend_observable"`
+	//  - `"server_panic"`
+	ErrorType      *DataqueryErrorType `json:"errorType,omitempty"`
+	FlamegraphDiff *bool               `json:"flamegraphDiff,omitempty"`
+	// true if query is disabled (ie should not be returned to the dashboard)
+	// NOTE: this does not always imply that the query should not be executed since
+	// the results from a hidden query may be used as the input to other queries (SSE etc)
+	Hide *bool `json:"hide,omitempty"`
+	// Interval is the suggested duration between time points in a time series query.
+	// NOTE: the values for intervalMs is not saved in the query model.  It is typically calculated
+	// from the interval required to fill a pixels in the visualization
+	IntervalMs  *float64 `json:"intervalMs,omitempty"`
+	Labels      *string  `json:"labels,omitempty"`
+	LevelColumn *bool    `json:"levelColumn,omitempty"`
+	Lines       *int64   `json:"lines,omitempty"`
+	Max         *float64 `json:"max,omitempty"`
+	// MaxDataPoints is the maximum number of data points that should be returned from a time series query.
+	// NOTE: the values for maxDataPoints is not saved in the query model.  It is typically calculated
+	// from the number of pixels visible in a visualization
+	MaxDataPoints *int64          `json:"maxDataPoints,omitempty"`
+	Min           *float64        `json:"min,omitempty"`
+	Nodes         *NodesQuery     `json:"nodes,omitempty"`
+	Noise         *float64        `json:"noise,omitempty"`
+	Points        [][]any         `json:"points,omitempty"`
+	PulseWave     *PulseWaveQuery `json:"pulseWave,omitempty"`
+	// QueryType is an optional identifier for the type of query.
+	// It can be used to distinguish different types of queries.
+	QueryType       *string `json:"queryType,omitempty"`
+	RawFrameContent *string `json:"rawFrameContent,omitempty"`
+	// RefID is the unique identifier of the query, set by the frontend call.
+	RefId *string `json:"refId,omitempty"`
+	// Optionally define expected query result behavior
+	ResultAssertions *ResultAssertions `json:"resultAssertions,omitempty"`
+	// Possible enum values:
+	//  - `"annotations"`
+	//  - `"arrow"`
+	//  - `"csv_content"`
+	//  - `"csv_file"`
+	//  - `"csv_metric_values"`
+	//  - `"datapoints_outside_range"`
+	//  - `"exponential_heatmap_bucket_data"`
+	//  - `"flame_graph"`
+	//  - `"grafana_api"`
+	//  - `"linear_heatmap_bucket_data"`
+	//  - `"live"`
+	//  - `"logs"`
+	//  - `"manual_entry"`
+	//  - `"no_data_points"`
+	//  - `"node_graph"`
+	//  - `"predictable_csv_wave"`
+	//  - `"predictable_pulse"`
+	//  - `"random_walk"`
+	//  - `"random_walk_table"`
+	//  - `"random_walk_with_error"`
+	//  - `"raw_frame"`
+	//  - `"server_error_500"`
+	//  - `"simulation"`
+	//  - `"slow_query"`
+	//  - `"streaming_client"`
+	//  - `"table_static"`
+	//  - `"trace"`
+	//  - `"usa"`
+	//  - `"variables-query"`
+	ScenarioId  *DataqueryScenarioId `json:"scenarioId,omitempty"`
+	SeriesCount *int64               `json:"seriesCount,omitempty"`
+	Sim         *SimulationQuery     `json:"sim,omitempty"`
+	SpanCount   *int64               `json:"spanCount,omitempty"`
+	Spread      *float64             `json:"spread,omitempty"`
+	StartValue  *float64             `json:"startValue,omitempty"`
+	Stream      *StreamingQuery      `json:"stream,omitempty"`
+	// common parameter used by many query types
+	StringInput *string `json:"stringInput,omitempty"`
+	// TimeRange represents the query range
+	// NOTE: unlike generic /ds/query, we can now send explicit time values in each query
+	// NOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly
+	TimeRange *TimeRange `json:"timeRange,omitempty"`
+	Usa       *USAQuery  `json:"usa,omitempty"`
+	WithNil   *bool      `json:"withNil,omitempty"`
+}
+
+func (resource Dataquery) ImplementsDataqueryVariant() {}
+
+type CSVWave struct {
+	Labels    *string `json:"labels,omitempty"`
+	Name      *string `json:"name,omitempty"`
+	TimeStep  *int64  `json:"timeStep,omitempty"`
+	ValuesCSV *string `json:"valuesCSV,omitempty"`
+}
+
+type Datasource struct {
+	// The datasource plugin type
+	Type string `json:"type"`
+	// Datasource UID
+	Uid *string `json:"uid,omitempty"`
+}
+
+type NodesQuery struct {
+	Count *int64 `json:"count,omitempty"`
+	Seed  *int64 `json:"seed,omitempty"`
+	// Possible enum values:
+	//  - `"random"`
+	//  - `"random edges"`
+	//  - `"response_medium"`
+	//  - `"response_small"`
+	//  - `"feature_showcase"`
+	Type *NodesQueryType `json:"type,omitempty"`
+}
+
+type PulseWaveQuery struct {
+	OffCount *int64   `json:"offCount,omitempty"`
+	OffValue *float64 `json:"offValue,omitempty"`
+	OnCount  *int64   `json:"onCount,omitempty"`
+	OnValue  *float64 `json:"onValue,omitempty"`
+	TimeStep *int64   `json:"timeStep,omitempty"`
+}
+
+type ResultAssertions struct {
+	// Maximum frame count
+	MaxFrames *int64 `json:"maxFrames,omitempty"`
+	// Type asserts that the frame matches a known type structure.
+	// Possible enum values:
+	//  - `""`
+	//  - `"timeseries-wide"`
+	//  - `"timeseries-long"`
+	//  - `"timeseries-many"`
+	//  - `"timeseries-multi"`
+	//  - `"directory-listing"`
+	//  - `"table"`
+	//  - `"numeric-wide"`
+	//  - `"numeric-multi"`
+	//  - `"numeric-long"`
+	//  - `"log-lines"`
+	Type *ResultAssertionsType `json:"type,omitempty"`
+	// TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane
+	// contract documentation https://grafana.github.io/dataplane/contract/.
+	TypeVersion []int64 `json:"typeVersion"`
+}
+
+type Key struct {
+	Tick float64 `json:"tick"`
+	Type string  `json:"type"`
+	Uid  *string `json:"uid,omitempty"`
+}
+
+type SimulationQuery struct {
+	Config any   `json:"config,omitempty"`
+	Key    Key   `json:"key"`
+	Last   *bool `json:"last,omitempty"`
+	Stream *bool `json:"stream,omitempty"`
+}
+
+type StreamingQuery struct {
+	Bands  *int64  `json:"bands,omitempty"`
+	Noise  float64 `json:"noise"`
+	Speed  float64 `json:"speed"`
+	Spread float64 `json:"spread"`
+	// Possible enum values:
+	//  - `"fetch"`
+	//  - `"logs"`
+	//  - `"signal"`
+	//  - `"traces"`
+	Type StreamingQueryType `json:"type"`
+	Url  *string            `json:"url,omitempty"`
+}
+
+type TimeRange struct {
+	// From is the start time of the query.
+	From string `json:"from"`
+	// To is the end time of the query.
+	To string `json:"to"`
+}
+
+type USAQuery struct {
+	Fields []string `json:"fields,omitempty"`
+	Mode   *string  `json:"mode,omitempty"`
+	Period *string  `json:"period,omitempty"`
+	States []string `json:"states,omitempty"`
+}
+
+type DataqueryErrorType string
+
+const (
+	DataqueryErrorTypeFrontendException  DataqueryErrorType = "frontend_exception"
+	DataqueryErrorTypeFrontendObservable DataqueryErrorType = "frontend_observable"
+	DataqueryErrorTypeServerPanic        DataqueryErrorType = "server_panic"
+)
+
+type DataqueryScenarioId string
+
+const (
+	DataqueryScenarioIdAnnotations                  DataqueryScenarioId = "annotations"
+	DataqueryScenarioIdArrow                        DataqueryScenarioId = "arrow"
+	DataqueryScenarioIdCsvContent                   DataqueryScenarioId = "csv_content"
+	DataqueryScenarioIdCsvFile                      DataqueryScenarioId = "csv_file"
+	DataqueryScenarioIdCsvMetricValues              DataqueryScenarioId = "csv_metric_values"
+	DataqueryScenarioIdDatapointsOutsideRange       DataqueryScenarioId = "datapoints_outside_range"
+	DataqueryScenarioIdExponentialHeatmapBucketData DataqueryScenarioId = "exponential_heatmap_bucket_data"
+	DataqueryScenarioIdFlameGraph                   DataqueryScenarioId = "flame_graph"
+	DataqueryScenarioIdGrafanaApi                   DataqueryScenarioId = "grafana_api"
+	DataqueryScenarioIdLinearHeatmapBucketData      DataqueryScenarioId = "linear_heatmap_bucket_data"
+	DataqueryScenarioIdLive                         DataqueryScenarioId = "live"
+	DataqueryScenarioIdLogs                         DataqueryScenarioId = "logs"
+	DataqueryScenarioIdManualEntry                  DataqueryScenarioId = "manual_entry"
+	DataqueryScenarioIdNoDataPoints                 DataqueryScenarioId = "no_data_points"
+	DataqueryScenarioIdNodeGraph                    DataqueryScenarioId = "node_graph"
+	DataqueryScenarioIdPredictableCsvWave           DataqueryScenarioId = "predictable_csv_wave"
+	DataqueryScenarioIdPredictablePulse             DataqueryScenarioId = "predictable_pulse"
+	DataqueryScenarioIdRandomWalk                   DataqueryScenarioId = "random_walk"
+	DataqueryScenarioIdRandomWalkTable              DataqueryScenarioId = "random_walk_table"
+	DataqueryScenarioIdRandomWalkWithError          DataqueryScenarioId = "random_walk_with_error"
+	DataqueryScenarioIdRawFrame                     DataqueryScenarioId = "raw_frame"
+	DataqueryScenarioIdServerError500               DataqueryScenarioId = "server_error_500"
+	DataqueryScenarioIdSimulation                   DataqueryScenarioId = "simulation"
+	DataqueryScenarioIdSlowQuery                    DataqueryScenarioId = "slow_query"
+	DataqueryScenarioIdStreamingClient              DataqueryScenarioId = "streaming_client"
+	DataqueryScenarioIdTableStatic                  DataqueryScenarioId = "table_static"
+	DataqueryScenarioIdTrace                        DataqueryScenarioId = "trace"
+	DataqueryScenarioIdUsa                          DataqueryScenarioId = "usa"
+	DataqueryScenarioIdVariablesQuery               DataqueryScenarioId = "variables-query"
+)
+
+type NodesQueryType string
+
+const (
+	NodesQueryTypeRandom          NodesQueryType = "random"
+	NodesQueryTypeRandomEdges     NodesQueryType = "random edges"
+	NodesQueryTypeResponseMedium  NodesQueryType = "response_medium"
+	NodesQueryTypeResponseSmall   NodesQueryType = "response_small"
+	NodesQueryTypeFeatureShowcase NodesQueryType = "feature_showcase"
+)
+
+type ResultAssertionsType string
+
+const (
+	ResultAssertionsTypeNone             ResultAssertionsType = ""
+	ResultAssertionsTypeTimeseriesWide   ResultAssertionsType = "timeseries-wide"
+	ResultAssertionsTypeTimeseriesLong   ResultAssertionsType = "timeseries-long"
+	ResultAssertionsTypeTimeseriesMany   ResultAssertionsType = "timeseries-many"
+	ResultAssertionsTypeTimeseriesMulti  ResultAssertionsType = "timeseries-multi"
+	ResultAssertionsTypeDirectoryListing ResultAssertionsType = "directory-listing"
+	ResultAssertionsTypeTable            ResultAssertionsType = "table"
+	ResultAssertionsTypeNumericWide      ResultAssertionsType = "numeric-wide"
+	ResultAssertionsTypeNumericMulti     ResultAssertionsType = "numeric-multi"
+	ResultAssertionsTypeNumericLong      ResultAssertionsType = "numeric-long"
+	ResultAssertionsTypeLogLines         ResultAssertionsType = "log-lines"
+)
+
+type StreamingQueryType string
+
+const (
+	StreamingQueryTypeFetch  StreamingQueryType = "fetch"
+	StreamingQueryTypeLogs   StreamingQueryType = "logs"
+	StreamingQueryTypeSignal StreamingQueryType = "signal"
+	StreamingQueryTypeTraces StreamingQueryType = "traces"
+)
diff --git a/go/testdata/types_json_marshalling_gen.go b/go/testdata/types_json_marshalling_gen.go
new file mode 100644
index 0000000..ed0fdf1
--- /dev/null
+++ b/go/testdata/types_json_marshalling_gen.go
@@ -0,0 +1,24 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	"encoding/json"
+
+	cogvariants "github.com/grafana/grafana-foundation-sdk/go/cog/variants"
+)
+
+func VariantConfig() cogvariants.DataqueryConfig {
+	return cogvariants.DataqueryConfig{
+		Identifier: "",
+		DataqueryUnmarshaler: func(raw []byte) (cogvariants.Dataquery, error) {
+			dataquery := Dataquery{}
+
+			if err := json.Unmarshal(raw, &dataquery); err != nil {
+				return nil, err
+			}
+
+			return dataquery, nil
+		},
+	}
+}
diff --git a/go/testdata/usaquery_builder_gen.go b/go/testdata/usaquery_builder_gen.go
new file mode 100644
index 0000000..67a14cd
--- /dev/null
+++ b/go/testdata/usaquery_builder_gen.go
@@ -0,0 +1,67 @@
+// Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+package testdata
+
+import (
+	cog "github.com/grafana/grafana-foundation-sdk/go/cog"
+)
+
+var _ cog.Builder[USAQuery] = (*USAQueryBuilder)(nil)
+
+type USAQueryBuilder struct {
+	internal *USAQuery
+	errors   map[string]cog.BuildErrors
+}
+
+func NewUSAQueryBuilder() *USAQueryBuilder {
+	resource := &USAQuery{}
+	builder := &USAQueryBuilder{
+		internal: resource,
+		errors:   make(map[string]cog.BuildErrors),
+	}
+
+	builder.applyDefaults()
+
+	return builder
+}
+
+func (builder *USAQueryBuilder) Build() (USAQuery, error) {
+	var errs cog.BuildErrors
+
+	for _, err := range builder.errors {
+		errs = append(errs, cog.MakeBuildErrors("USAQuery", err)...)
+	}
+
+	if len(errs) != 0 {
+		return USAQuery{}, errs
+	}
+
+	return *builder.internal, nil
+}
+
+func (builder *USAQueryBuilder) Fields(fields []string) *USAQueryBuilder {
+	builder.internal.Fields = fields
+
+	return builder
+}
+
+func (builder *USAQueryBuilder) Mode(mode string) *USAQueryBuilder {
+	builder.internal.Mode = &mode
+
+	return builder
+}
+
+func (builder *USAQueryBuilder) Period(period string) *USAQueryBuilder {
+	builder.internal.Period = &period
+
+	return builder
+}
+
+func (builder *USAQueryBuilder) States(states []string) *USAQueryBuilder {
+	builder.internal.States = states
+
+	return builder
+}
+
+func (builder *USAQueryBuilder) applyDefaults() {
+}
diff --git a/jsonschema/dashboardlist.jsonschema.json b/jsonschema/dashboardlist.jsonschema.json
index ab90e82..ec60f58 100644
--- a/jsonschema/dashboardlist.jsonschema.json
+++ b/jsonschema/dashboardlist.jsonschema.json
@@ -1 +1 @@
-{"$schema":"http://json-schema.org/draft-07/schema#","definitions":{"Options":{"type":"object","additionalProperties":false,"required":["keepTime","includeVars","showStarred","showRecentlyViewed","showSearch","showHeadings","maxItems","query","tags"],"properties":{"keepTime":{"type":"boolean","default":false},"includeVars":{"type":"boolean","default":false},"showStarred":{"type":"boolean","default":true},"showRecentlyViewed":{"type":"boolean","default":false},"showSearch":{"type":"boolean","default":false},"showHeadings":{"type":"boolean","default":true},"maxItems":{"type":"integer","default":10},"query":{"type":"string","default":""},"tags":{"type":"array","items":{"type":"string"}},"folderId":{"type":"integer","description":"folderId is deprecated, and migrated to folderUid on panel init"},"folderUID":{"type":"string"}}}}}
\ No newline at end of file
+{"$schema":"http://json-schema.org/draft-07/schema#","definitions":{"Options":{"type":"object","additionalProperties":false,"required":["keepTime","includeVars","showStarred","showRecentlyViewed","showSearch","showHeadings","showFolderNames","maxItems","query","tags"],"properties":{"keepTime":{"type":"boolean","default":false},"includeVars":{"type":"boolean","default":false},"showStarred":{"type":"boolean","default":true},"showRecentlyViewed":{"type":"boolean","default":false},"showSearch":{"type":"boolean","default":false},"showHeadings":{"type":"boolean","default":true},"showFolderNames":{"type":"boolean","default":true},"maxItems":{"type":"integer","default":10},"query":{"type":"string","default":""},"tags":{"type":"array","items":{"type":"string"}},"folderId":{"type":"integer","description":"folderId is deprecated, and migrated to folderUid on panel init"},"folderUID":{"type":"string"}}}}}
\ No newline at end of file
diff --git a/jsonschema/testdata.jsonschema.json b/jsonschema/testdata.jsonschema.json
new file mode 100644
index 0000000..c279d21
--- /dev/null
+++ b/jsonschema/testdata.jsonschema.json
@@ -0,0 +1 @@
+{"$schema":"http://json-schema.org/draft-07/schema#","definitions":{"dataquery":{"type":"object","additionalProperties":false,"properties":{"alias":{"type":"string"},"channel":{"type":"string","description":"Used for live query"},"csvContent":{"type":"string"},"csvFileName":{"type":"string"},"csvWave":{"type":"array","items":{"$ref":"#/definitions/CSVWave"}},"datasource":{"$ref":"#/definitions/datasource","description":"The datasource"},"dropPercent":{"type":"number","description":"Drop percentage (the chance we will lose a point 0-100)"},"errorType":{"enum":["frontend_exception","frontend_observable","server_panic"],"description":"Possible enum values:\n - `\"frontend_exception\"` \n - `\"frontend_observable\"` \n - `\"server_panic\"` "},"flamegraphDiff":{"type":"boolean"},"hide":{"type":"boolean","description":"true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)"},"intervalMs":{"type":"number","description":"Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model.  It is typically calculated\nfrom the interval required to fill a pixels in the visualization"},"labels":{"type":"string"},"levelColumn":{"type":"boolean"},"lines":{"type":"integer"},"max":{"type":"number"},"maxDataPoints":{"type":"integer","description":"MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model.  It is typically calculated\nfrom the number of pixels visible in a visualization"},"min":{"type":"number"},"nodes":{"$ref":"#/definitions/NodesQuery"},"noise":{"type":"number"},"points":{"type":"array","items":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"pulseWave":{"$ref":"#/definitions/PulseWaveQuery"},"queryType":{"type":"string","description":"QueryType is an optional identifier for the type of query.\nIt can be used to distinguish different types of queries."},"rawFrameContent":{"type":"string"},"refId":{"type":"string","description":"RefID is the unique identifier of the query, set by the frontend call."},"resultAssertions":{"$ref":"#/definitions/ResultAssertions","description":"Optionally define expected query result behavior"},"scenarioId":{"enum":["annotations","arrow","csv_content","csv_file","csv_metric_values","datapoints_outside_range","exponential_heatmap_bucket_data","flame_graph","grafana_api","linear_heatmap_bucket_data","live","logs","manual_entry","no_data_points","node_graph","predictable_csv_wave","predictable_pulse","random_walk","random_walk_table","random_walk_with_error","raw_frame","server_error_500","simulation","slow_query","streaming_client","table_static","trace","usa","variables-query"],"description":"Possible enum values:\n - `\"annotations\"` \n - `\"arrow\"` \n - `\"csv_content\"` \n - `\"csv_file\"` \n - `\"csv_metric_values\"` \n - `\"datapoints_outside_range\"` \n - `\"exponential_heatmap_bucket_data\"` \n - `\"flame_graph\"` \n - `\"grafana_api\"` \n - `\"linear_heatmap_bucket_data\"` \n - `\"live\"` \n - `\"logs\"` \n - `\"manual_entry\"` \n - `\"no_data_points\"` \n - `\"node_graph\"` \n - `\"predictable_csv_wave\"` \n - `\"predictable_pulse\"` \n - `\"random_walk\"` \n - `\"random_walk_table\"` \n - `\"random_walk_with_error\"` \n - `\"raw_frame\"` \n - `\"server_error_500\"` \n - `\"simulation\"` \n - `\"slow_query\"` \n - `\"streaming_client\"` \n - `\"table_static\"` \n - `\"trace\"` \n - `\"usa\"` \n - `\"variables-query\"` "},"seriesCount":{"type":"integer"},"sim":{"$ref":"#/definitions/SimulationQuery"},"spanCount":{"type":"integer"},"spread":{"type":"number"},"startValue":{"type":"number"},"stream":{"$ref":"#/definitions/StreamingQuery"},"stringInput":{"type":"string","description":"common parameter used by many query types"},"timeRange":{"$ref":"#/definitions/TimeRange","description":"TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly"},"usa":{"$ref":"#/definitions/USAQuery"},"withNil":{"type":"boolean"}}},"CSVWave":{"type":"object","additionalProperties":false,"properties":{"labels":{"type":"string"},"name":{"type":"string"},"timeStep":{"type":"integer"},"valuesCSV":{"type":"string"}}},"datasource":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","description":"The datasource plugin type"},"uid":{"type":"string","description":"Datasource UID"}}},"NodesQuery":{"type":"object","additionalProperties":false,"properties":{"count":{"type":"integer"},"seed":{"type":"integer"},"type":{"enum":["random","random edges","response_medium","response_small","feature_showcase"],"description":"Possible enum values:\n - `\"random\"` \n - `\"random edges\"` \n - `\"response_medium\"` \n - `\"response_small\"` \n - `\"feature_showcase\"` "}}},"PulseWaveQuery":{"type":"object","additionalProperties":false,"properties":{"offCount":{"type":"integer"},"offValue":{"type":"number"},"onCount":{"type":"integer"},"onValue":{"type":"number"},"timeStep":{"type":"integer"}}},"ResultAssertions":{"type":"object","additionalProperties":false,"required":["typeVersion"],"properties":{"maxFrames":{"type":"integer","description":"Maximum frame count"},"type":{"enum":["","timeseries-wide","timeseries-long","timeseries-many","timeseries-multi","directory-listing","table","numeric-wide","numeric-multi","numeric-long","log-lines"],"description":"Type asserts that the frame matches a known type structure.\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` "},"typeVersion":{"type":"array","items":{"type":"integer"},"description":"TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/."}}},"Key":{"type":"object","additionalProperties":false,"required":["tick","type"],"properties":{"tick":{"type":"number"},"type":{"type":"string"},"uid":{"type":"string"}}},"SimulationQuery":{"type":"object","additionalProperties":false,"required":["key"],"properties":{"config":{"type":"object","additionalProperties":{}},"key":{"$ref":"#/definitions/Key"},"last":{"type":"boolean"},"stream":{"type":"boolean"}}},"StreamingQuery":{"type":"object","additionalProperties":false,"required":["noise","speed","spread","type"],"properties":{"bands":{"type":"integer"},"noise":{"type":"number"},"speed":{"type":"number"},"spread":{"type":"number"},"type":{"enum":["fetch","logs","signal","traces"],"description":"Possible enum values:\n - `\"fetch\"` \n - `\"logs\"` \n - `\"signal\"` \n - `\"traces\"` "},"url":{"type":"string"}}},"TimeRange":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","description":"From is the start time of the query.","default":"now-6h"},"to":{"type":"string","description":"To is the end time of the query.","default":"now"}}},"USAQuery":{"type":"object","additionalProperties":false,"properties":{"fields":{"type":"array","items":{"type":"string"}},"mode":{"type":"string"},"period":{"type":"string"},"states":{"type":"array","items":{"type":"string"}}}}}}
\ No newline at end of file
diff --git a/openapi/dashboardlist.openapi.json b/openapi/dashboardlist.openapi.json
index 6601f45..5ed26d1 100644
--- a/openapi/dashboardlist.openapi.json
+++ b/openapi/dashboardlist.openapi.json
@@ -1 +1 @@
-{"openapi":"3.0.0","info":{"title":"dashboardlist","version":"0.0.0","x-schema-identifier":"dashlist","x-schema-kind":"composable","x-schema-variant":"panelcfg"},"paths":{},"components":{"schemas":{"Options":{"type":"object","additionalProperties":false,"required":["keepTime","includeVars","showStarred","showRecentlyViewed","showSearch","showHeadings","maxItems","query","tags"],"properties":{"keepTime":{"type":"boolean","default":false},"includeVars":{"type":"boolean","default":false},"showStarred":{"type":"boolean","default":true},"showRecentlyViewed":{"type":"boolean","default":false},"showSearch":{"type":"boolean","default":false},"showHeadings":{"type":"boolean","default":true},"maxItems":{"type":"integer","default":10},"query":{"type":"string","default":""},"tags":{"type":"array","items":{"type":"string"}},"folderId":{"type":"integer","description":"folderId is deprecated, and migrated to folderUid on panel init"},"folderUID":{"type":"string"}}}}}}
\ No newline at end of file
+{"openapi":"3.0.0","info":{"title":"dashboardlist","version":"0.0.0","x-schema-identifier":"dashlist","x-schema-kind":"composable","x-schema-variant":"panelcfg"},"paths":{},"components":{"schemas":{"Options":{"type":"object","additionalProperties":false,"required":["keepTime","includeVars","showStarred","showRecentlyViewed","showSearch","showHeadings","showFolderNames","maxItems","query","tags"],"properties":{"keepTime":{"type":"boolean","default":false},"includeVars":{"type":"boolean","default":false},"showStarred":{"type":"boolean","default":true},"showRecentlyViewed":{"type":"boolean","default":false},"showSearch":{"type":"boolean","default":false},"showHeadings":{"type":"boolean","default":true},"showFolderNames":{"type":"boolean","default":true},"maxItems":{"type":"integer","default":10},"query":{"type":"string","default":""},"tags":{"type":"array","items":{"type":"string"}},"folderId":{"type":"integer","description":"folderId is deprecated, and migrated to folderUid on panel init"},"folderUID":{"type":"string"}}}}}}
\ No newline at end of file
diff --git a/openapi/testdata.openapi.json b/openapi/testdata.openapi.json
new file mode 100644
index 0000000..6e38d24
--- /dev/null
+++ b/openapi/testdata.openapi.json
@@ -0,0 +1 @@
+{"openapi":"3.0.0","info":{"title":"testdata","version":"0.0.0","x-schema-identifier":"","x-schema-kind":""},"paths":{},"components":{"schemas":{"dataquery":{"type":"object","additionalProperties":false,"properties":{"alias":{"type":"string"},"channel":{"type":"string","description":"Used for live query"},"csvContent":{"type":"string"},"csvFileName":{"type":"string"},"csvWave":{"type":"array","items":{"$ref":"#/components/schemas/CSVWave"}},"datasource":{"$ref":"#/components/schemas/datasource","description":"The datasource"},"dropPercent":{"type":"number","description":"Drop percentage (the chance we will lose a point 0-100)"},"errorType":{"enum":["frontend_exception","frontend_observable","server_panic"],"description":"Possible enum values:\n - `\"frontend_exception\"` \n - `\"frontend_observable\"` \n - `\"server_panic\"` "},"flamegraphDiff":{"type":"boolean"},"hide":{"type":"boolean","description":"true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)"},"intervalMs":{"type":"number","description":"Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model.  It is typically calculated\nfrom the interval required to fill a pixels in the visualization"},"labels":{"type":"string"},"levelColumn":{"type":"boolean"},"lines":{"type":"integer"},"max":{"type":"number"},"maxDataPoints":{"type":"integer","description":"MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model.  It is typically calculated\nfrom the number of pixels visible in a visualization"},"min":{"type":"number"},"nodes":{"$ref":"#/components/schemas/NodesQuery"},"noise":{"type":"number"},"points":{"type":"array","items":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"pulseWave":{"$ref":"#/components/schemas/PulseWaveQuery"},"queryType":{"type":"string","description":"QueryType is an optional identifier for the type of query.\nIt can be used to distinguish different types of queries."},"rawFrameContent":{"type":"string"},"refId":{"type":"string","description":"RefID is the unique identifier of the query, set by the frontend call."},"resultAssertions":{"$ref":"#/components/schemas/ResultAssertions","description":"Optionally define expected query result behavior"},"scenarioId":{"enum":["annotations","arrow","csv_content","csv_file","csv_metric_values","datapoints_outside_range","exponential_heatmap_bucket_data","flame_graph","grafana_api","linear_heatmap_bucket_data","live","logs","manual_entry","no_data_points","node_graph","predictable_csv_wave","predictable_pulse","random_walk","random_walk_table","random_walk_with_error","raw_frame","server_error_500","simulation","slow_query","streaming_client","table_static","trace","usa","variables-query"],"description":"Possible enum values:\n - `\"annotations\"` \n - `\"arrow\"` \n - `\"csv_content\"` \n - `\"csv_file\"` \n - `\"csv_metric_values\"` \n - `\"datapoints_outside_range\"` \n - `\"exponential_heatmap_bucket_data\"` \n - `\"flame_graph\"` \n - `\"grafana_api\"` \n - `\"linear_heatmap_bucket_data\"` \n - `\"live\"` \n - `\"logs\"` \n - `\"manual_entry\"` \n - `\"no_data_points\"` \n - `\"node_graph\"` \n - `\"predictable_csv_wave\"` \n - `\"predictable_pulse\"` \n - `\"random_walk\"` \n - `\"random_walk_table\"` \n - `\"random_walk_with_error\"` \n - `\"raw_frame\"` \n - `\"server_error_500\"` \n - `\"simulation\"` \n - `\"slow_query\"` \n - `\"streaming_client\"` \n - `\"table_static\"` \n - `\"trace\"` \n - `\"usa\"` \n - `\"variables-query\"` "},"seriesCount":{"type":"integer"},"sim":{"$ref":"#/components/schemas/SimulationQuery"},"spanCount":{"type":"integer"},"spread":{"type":"number"},"startValue":{"type":"number"},"stream":{"$ref":"#/components/schemas/StreamingQuery"},"stringInput":{"type":"string","description":"common parameter used by many query types"},"timeRange":{"$ref":"#/components/schemas/TimeRange","description":"TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly"},"usa":{"$ref":"#/components/schemas/USAQuery"},"withNil":{"type":"boolean"}}},"CSVWave":{"type":"object","additionalProperties":false,"properties":{"labels":{"type":"string"},"name":{"type":"string"},"timeStep":{"type":"integer"},"valuesCSV":{"type":"string"}}},"datasource":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","description":"The datasource plugin type"},"uid":{"type":"string","description":"Datasource UID"}}},"NodesQuery":{"type":"object","additionalProperties":false,"properties":{"count":{"type":"integer"},"seed":{"type":"integer"},"type":{"enum":["random","random edges","response_medium","response_small","feature_showcase"],"description":"Possible enum values:\n - `\"random\"` \n - `\"random edges\"` \n - `\"response_medium\"` \n - `\"response_small\"` \n - `\"feature_showcase\"` "}}},"PulseWaveQuery":{"type":"object","additionalProperties":false,"properties":{"offCount":{"type":"integer"},"offValue":{"type":"number"},"onCount":{"type":"integer"},"onValue":{"type":"number"},"timeStep":{"type":"integer"}}},"ResultAssertions":{"type":"object","additionalProperties":false,"required":["typeVersion"],"properties":{"maxFrames":{"type":"integer","description":"Maximum frame count"},"type":{"enum":["","timeseries-wide","timeseries-long","timeseries-many","timeseries-multi","directory-listing","table","numeric-wide","numeric-multi","numeric-long","log-lines"],"description":"Type asserts that the frame matches a known type structure.\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` "},"typeVersion":{"type":"array","items":{"type":"integer"},"description":"TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/."}}},"Key":{"type":"object","additionalProperties":false,"required":["tick","type"],"properties":{"tick":{"type":"number"},"type":{"type":"string"},"uid":{"type":"string"}}},"SimulationQuery":{"type":"object","additionalProperties":false,"required":["key"],"properties":{"config":{"type":"object","additionalProperties":{}},"key":{"$ref":"#/components/schemas/Key"},"last":{"type":"boolean"},"stream":{"type":"boolean"}}},"StreamingQuery":{"type":"object","additionalProperties":false,"required":["noise","speed","spread","type"],"properties":{"bands":{"type":"integer"},"noise":{"type":"number"},"speed":{"type":"number"},"spread":{"type":"number"},"type":{"enum":["fetch","logs","signal","traces"],"description":"Possible enum values:\n - `\"fetch\"` \n - `\"logs\"` \n - `\"signal\"` \n - `\"traces\"` "},"url":{"type":"string"}}},"TimeRange":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"type":"string","description":"From is the start time of the query.","default":"now-6h"},"to":{"type":"string","description":"To is the end time of the query.","default":"now"}}},"USAQuery":{"type":"object","additionalProperties":false,"properties":{"fields":{"type":"array","items":{"type":"string"}},"mode":{"type":"string"},"period":{"type":"string"},"states":{"type":"array","items":{"type":"string"}}}}}}}
\ No newline at end of file
diff --git a/python/grafana_foundation_sdk/builders/dashboardlist.py b/python/grafana_foundation_sdk/builders/dashboardlist.py
index c324c08..73906d4 100644
--- a/python/grafana_foundation_sdk/builders/dashboardlist.py
+++ b/python/grafana_foundation_sdk/builders/dashboardlist.py
@@ -552,6 +552,16 @@ class Panel(cogbuilder.Builder[dashboard.Panel]):
     
         return self
     
+    def show_folder_names(self, show_folder_names: bool) -> typing.Self:        
+        if self._internal.options is None:
+            self._internal.options = dashboardlist.Options()
+        
+        assert isinstance(self._internal.options, dashboardlist.Options)
+        
+        self._internal.options.show_folder_names = show_folder_names
+    
+        return self
+    
     def max_items(self, max_items: int) -> typing.Self:        
         if self._internal.options is None:
             self._internal.options = dashboardlist.Options()
diff --git a/python/grafana_foundation_sdk/builders/testdata.py b/python/grafana_foundation_sdk/builders/testdata.py
new file mode 100644
index 0000000..4bc758f
--- /dev/null
+++ b/python/grafana_foundation_sdk/builders/testdata.py
@@ -0,0 +1,637 @@
+# Code generated - EDITING IS FUTILE. DO NOT EDIT.
+
+import typing
+from ..cog import builder as cogbuilder
+from ..models import testdata
+
+
+class Dataquery(cogbuilder.Builder[testdata.Dataquery]):    
+    _internal: testdata.Dataquery
+
+    def __init__(self):
+        self._internal = testdata.Dataquery()
+
+    def build(self) -> testdata.Dataquery:
+        return self._internal    
+    
+    def alias(self, alias: str) -> typing.Self:        
+        self._internal.alias = alias
+    
+        return self
+    
+    def channel(self, channel: str) -> typing.Self:    
+        """
+        Used for live query
+        """
+            
+        self._internal.channel = channel
+    
+        return self
+    
+    def csv_content(self, csv_content: str) -> typing.Self:        
+        self._internal.csv_content = csv_content
+    
+        return self
+    
+    def csv_file_name(self, csv_file_name: str) -> typing.Self:        
+        self._internal.csv_file_name = csv_file_name
+    
+        return self
+    
+    def csv_wave(self, csv_wave: list[cogbuilder.Builder[testdata.CSVWave]]) -> typing.Self:        
+        csv_wave_resources = [r1.build() for r1 in csv_wave]
+        self._internal.csv_wave = csv_wave_resources
+    
+        return self
+    
+    def datasource(self, datasource: cogbuilder.Builder[testdata.Datasource]) -> typing.Self:    
+        """
+        The datasource
+        """
+            
+        datasource_resource = datasource.build()
+        self._internal.datasource = datasource_resource
+    
+        return self
+    
+    def drop_percent(self, drop_percent: float) -> typing.Self:    
+        """
+        Drop percentage (the chance we will lose a point 0-100)
+        """
+            
+        self._internal.drop_percent = drop_percent
+    
+        return self
+    
+    def error_type(self, error_type: typing.Literal["frontend_exception", "frontend_observable", "server_panic"]) -> typing.Self:    
+        """
+        Possible enum v...*[Comment body truncated]*

@julienduchesne
Copy link
Member

Can you post a before-after diff of the generated java files? I have trouble reviewing these PRs without examples

if (id >= 5) {
return this;
if (!(id >= 5)) {
throw new RuntimeException("id must be >= 5");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These feel more like IllegalArgumentException: https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html which is a subclass of RuntimeException

@julienduchesne
Copy link
Member

Thanks for the diff!

@spinillos spinillos merged commit 29ee8f5 into main May 20, 2024
10 checks passed
@spinillos spinillos deleted the java/errors branch May 20, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants