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

Fix type issue for threshold in screenboard rule #169

Merged
merged 4 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions datadog-accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() string {
func (r *Rule) GetThreshold() float64 {
if r == nil || r.Threshold == nil {
return ""
return 0
}
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() (string, bool) {
func (r *Rule) GetThresholdOk() (float64, bool) {
if r == nil || r.Threshold == nil {
return "", false
return 0, false
}
return *r.Threshold, true
}
Expand All @@ -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 string) {
func (r *Rule) SetThreshold(v float64) {
r.Threshold = &v
}

Expand Down
6 changes: 3 additions & 3 deletions screen_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ type Params struct {
}

type Rule struct {
Threshold *string `json:"threshold,omitempty"`
anatolebeuzon marked this conversation as resolved.
Show resolved Hide resolved
Timeframe *string `json:"timeframe,omitempty"`
Color *string `json:"color,omitempty"`
Threshold *float64 `json:"threshold,omitempty"`
Timeframe *string `json:"timeframe,omitempty"`
Color *string `json:"color,omitempty"`
}

type ScreenboardMonitor struct {
Expand Down