diff --git a/datadog-accessors.go b/datadog-accessors.go index 9422c86..0c42c2d 100644 --- a/datadog-accessors.go +++ b/datadog-accessors.go @@ -5005,18 +5005,18 @@ func (r *Rule) SetColor(v string) { } // GetThreshold returns the Threshold field if non-nil, zero value otherwise. -func (r *Rule) GetThreshold() int { +func (r *Rule) GetThreshold() json.Number { if r == nil || r.Threshold == nil { - return 0 + return "" } return *r.Threshold } // GetOkThreshold returns a tuple with the Threshold field if it's non-nil, zero value otherwise // and a boolean to check if the value has been set. -func (r *Rule) GetThresholdOk() (int, bool) { +func (r *Rule) GetThresholdOk() (json.Number, bool) { if r == nil || r.Threshold == nil { - return 0, false + return "", false } return *r.Threshold, true } @@ -5031,7 +5031,7 @@ func (r *Rule) HasThreshold() bool { } // SetThreshold allocates a new r.Threshold and returns the pointer to it. -func (r *Rule) SetThreshold(v int) { +func (r *Rule) SetThreshold(v json.Number) { r.Threshold = &v } diff --git a/integration/screen_widgets_test.go b/integration/screen_widgets_test.go index b8752f9..d68d371 100644 --- a/integration/screen_widgets_test.go +++ b/integration/screen_widgets_test.go @@ -351,6 +351,7 @@ func TestWidgets(t *testing.T) { }, }, { + // Widget is undocumented, subject to breaking API changes, and without customer support Type: datadog.String("uptime"), X: datadog.Int(1), Y: datadog.Int(1), diff --git a/screen_widgets.go b/screen_widgets.go index f3b77b7..2e3dc0a 100644 --- a/screen_widgets.go +++ b/screen_widgets.go @@ -1,5 +1,7 @@ package datadog +import "encoding/json" + type TileDef struct { Events []TileDefEvent `json:"events,omitempty"` Markers []TileDefMarker `json:"markers,omitempty"` @@ -178,6 +180,7 @@ type Widget struct { Logset *string `json:"logset,omitempty"` // For Uptime + // Widget is undocumented, subject to breaking API changes, and without customer support Timeframes []*string `json:"timeframes,omitempty"` Rules map[string]*Rule `json:"rules,omitempty"` Monitor *ScreenboardMonitor `json:"monitor,omitempty"` @@ -191,9 +194,9 @@ type Params struct { } type Rule struct { - Threshold *int `json:"threshold,omitempty"` - Timeframe *string `json:"timeframe,omitempty"` - Color *string `json:"color,omitempty"` + Threshold *json.Number `json:"threshold,omitempty"` + Timeframe *string `json:"timeframe,omitempty"` + Color *string `json:"color,omitempty"` } type ScreenboardMonitor struct {