Skip to content

Commit 403207c

Browse files
committed
require_model for the app bricks
1 parent 8900850 commit 403207c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

internal/orchestrator/bricks/bricks.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func (s *Service) AppBrickInstancesList(a *app.ArduinoApp) (AppBrickInstancesRes
8989
Author: "Arduino", // TODO: for now we only support our bricks
9090
Category: brick.Category,
9191
Status: "installed",
92+
ModelRequired: brick.ModelRequired,
9293
ModelID: brickInstance.Model, // TODO: in case is not set by the user, should we return the default model?
9394
Variables: variablesMap, // TODO: do we want to show also the default value of not explicitly set variables?
9495
ConfigVariables: configVariables,

internal/orchestrator/bricks/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type BrickInstance struct {
4242
Status string `json:"status"`
4343
Variables map[string]string `json:"variables,omitempty" description:"Deprecated: use config_variables instead. This field is kept for backward compatibility."`
4444
ConfigVariables []BrickConfigVariable `json:"config_variables,omitempty"`
45+
ModelRequired bool `json:"model_required,omitempty"`
4546
ModelID string `json:"model,omitempty"`
4647
}
4748

internal/orchestrator/orchestrator.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,10 @@ type AppDetailedInfo struct {
667667
}
668668

669669
type AppDetailedBrick struct {
670-
ID string `json:"id" required:"true"`
671-
Name string `json:"name" required:"true"`
672-
Category string `json:"category,omitempty"`
670+
ID string `json:"id" required:"true"`
671+
Name string `json:"name" required:"true"`
672+
Category string `json:"category,omitempty"`
673+
ModelRequired bool `json:"model_required,omitempty"`
673674
}
674675

675676
func AppDetails(
@@ -732,6 +733,7 @@ func AppDetails(
732733
}
733734
res.Name = bi.Name
734735
res.Category = bi.Category
736+
res.ModelRequired = bi.ModelRequired
735737
return res
736738
}),
737739
}, nil

0 commit comments

Comments
 (0)