diff --git a/.tutone.yml b/.tutone.yml index 9186c94dc..9769f37fe 100644 --- a/.tutone.yml +++ b/.tutone.yml @@ -814,6 +814,20 @@ packages: - name: EntityAlertViolationInt create_as: int + # TODO: These should be generated and referenced from the dashboards package + - name: DashboardVariable + skip_type_create: true + - name: DashboardVariableDefaultValue + field_type_override: "*DashboardVariableDefaultValue" + - name: DashboardVariableNRQLQuery + field_type_override: "*DashboardVariableNRQLQuery" + - name: DashboardVariableOptions + field_type_override: "*DashboardVariableOptions" + - name: DashboardVariableDefaultItem + - name: DashboardVariableEnumItem + - name: DashboardVariableReplacementStrategy + - name: DashboardVariableType + # # Types that our other packages define # TODO: Fix tutone to figure this out for us diff --git a/pkg/entities/types.go b/pkg/entities/types.go index 1684ae47f..6411af4c7 100644 --- a/pkg/entities/types.go +++ b/pkg/entities/types.go @@ -5272,34 +5272,10 @@ type DashboardTableWidgetConfiguration struct { NRQLQueries []DashboardWidgetNRQLQuery `json:"nrqlQueries,omitempty"` } -// DashboardVariable - Definition of a variable that is local to this dashboard. Variables are placeholders for dynamic values in widget NRQLs. -type DashboardVariable struct { - // [DEPRECATED] Default value for this variable. The actual value to be used will depend on the type. - DefaultValue DashboardVariableDefaultValue `json:"defaultValue,omitempty"` - // Default values for this variable. The actual value to be used will depend on the type. - DefaultValues []DashboardVariableDefaultItem `json:"defaultValues,omitempty"` - // Indicates whether this variable supports multiple selection or not. Only applies to variables of type NRQL or ENUM. - IsMultiSelection bool `json:"isMultiSelection,omitempty"` - // List of possible values for variables of type ENUM. - Items []DashboardVariableEnumItem `json:"items,omitempty"` - // Configuration for variables of type NRQL. - NRQLQuery DashboardVariableNRQLQuery `json:"nrqlQuery,omitempty"` - // Variable identifier. - Name string `json:"name,omitempty"` - // Options applied to the variable. - Options DashboardVariableOptions `json:"options,omitempty"` - // Indicates the strategy to apply when replacing a variable in a NRQL query. - ReplacementStrategy DashboardVariableReplacementStrategy `json:"replacementStrategy,omitempty"` - // Human-friendly display string for this variable. - Title string `json:"title,omitempty"` - // Specifies the data type of the variable and where its possible values may come from. - Type DashboardVariableType `json:"type,omitempty"` -} - // DashboardVariableDefaultItem - Represents a possible default value item. type DashboardVariableDefaultItem struct { // The value of this default item. - Value DashboardVariableDefaultValue `json:"value,omitempty"` + Value *DashboardVariableDefaultValue `json:"value,omitempty"` } // DashboardVariableDefaultValue - Specifies a default value for variables. diff --git a/pkg/entities/types_.go b/pkg/entities/types_.go index e2fa180a3..4334c12f4 100644 --- a/pkg/entities/types_.go +++ b/pkg/entities/types_.go @@ -157,3 +157,27 @@ var DashboardPermissionsTypes = struct { // Public read & write PUBLIC_READ_WRITE: "PUBLIC_READ_WRITE", } + +// DashboardVariable - Definition of a variable that is local to this dashboard. Variables are placeholders for dynamic values in widget NRQLs. +type DashboardVariable struct { + // [DEPRECATED] Default value for this variable. The actual value to be used will depend on the type. + DefaultValue *DashboardVariableDefaultValue `json:"defaultValue,omitempty"` + // Default values for this variable. The actual value to be used will depend on the type. + DefaultValues *[]DashboardVariableDefaultItem `json:"defaultValues,omitempty"` + // Indicates whether this variable supports multiple selection or not. Only applies to variables of type NRQL or ENUM. + IsMultiSelection bool `json:"isMultiSelection,omitempty"` + // List of possible values for variables of type ENUM. + Items []DashboardVariableEnumItem `json:"items,omitempty"` + // Configuration for variables of type NRQL. + NRQLQuery *DashboardVariableNRQLQuery `json:"nrqlQuery,omitempty"` + // Variable identifier. + Name string `json:"name,omitempty"` + // Options applied to the variable + Options *DashboardVariableOptions `json:"options,omitempty"` + // Indicates the strategy to apply when replacing a variable in a NRQL query. + ReplacementStrategy DashboardVariableReplacementStrategy `json:"replacementStrategy,omitempty"` + // Human-friendly display string for this variable. + Title string `json:"title,omitempty"` + // Specifies the data type of the variable and where its possible values may come from. + Type DashboardVariableType `json:"type,omitempty"` +}