Skip to content

Commit e88e72f

Browse files
committed
Make Precision field in Widget *json.Number
* Make Precision type for Widget match the type for TileDef.
1 parent f3f6d2f commit e88e72f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

datadog-accessors.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10089,7 +10089,7 @@ func (w *Widget) SetParams(v Params) {
1008910089
}
1009010090

1009110091
// GetPrecision returns the Precision field if non-nil, zero value otherwise.
10092-
func (w *Widget) GetPrecision() string {
10092+
func (w *Widget) GetPrecision() json.Number {
1009310093
if w == nil || w.Precision == nil {
1009410094
return ""
1009510095
}
@@ -10098,7 +10098,7 @@ func (w *Widget) GetPrecision() string {
1009810098

1009910099
// GetPrecisionOk returns a tuple with the Precision field if it's non-nil, zero value otherwise
1010010100
// and a boolean to check if the value has been set.
10101-
func (w *Widget) GetPrecisionOk() (string, bool) {
10101+
func (w *Widget) GetPrecisionOk() (json.Number, bool) {
1010210102
if w == nil || w.Precision == nil {
1010310103
return "", false
1010410104
}
@@ -10115,7 +10115,7 @@ func (w *Widget) HasPrecision() bool {
1011510115
}
1011610116

1011710117
// SetPrecision allocates a new w.Precision and returns the pointer to it.
10118-
func (w *Widget) SetPrecision(v string) {
10118+
func (w *Widget) SetPrecision(v json.Number) {
1011910119
w.Precision = &v
1012010120
}
1012110121

integration/screen_widgets_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func TestWidgets(t *testing.T) {
241241
AlertID: datadog.Int(123456),
242242
TextSize: datadog.String("fill_height"),
243243
TextAlign: datadog.String("right"),
244-
Precision: datadog.String("*"),
244+
Precision: datadog.JsonNumber("*"),
245245
Unit: datadog.String("b"),
246246
},
247247
{

screen_widgets.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ type Widget struct {
104104
Color *string `json:"color,omitempty"`
105105

106106
// For AlertValue widget
107-
TextSize *string `json:"text_size,omitempty"`
108-
Unit *string `json:"unit,omitempty"`
109-
Precision *string `json:"precision,omitempty"`
107+
TextSize *string `json:"text_size,omitempty"`
108+
Unit *string `json:"unit,omitempty"`
109+
Precision *json.Number `json:"precision,omitempty"`
110110

111111
// AlertGraph widget
112112
VizType *string `json:"viz_type,omitempty"`

0 commit comments

Comments
 (0)