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

Add new monitor summary widget parameters #290

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 13 additions & 11 deletions board_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,19 @@ type LogStreamDefinition struct {

// ManageStatusDefinition represents the definition for a Manage Status widget
type ManageStatusDefinition struct {
Type *string `json:"type"`
Query *string `json:"query"`
Sort *string `json:"sort,omitempty"`
Count *int `json:"count,omitempty"`
Start *int `json:"start,omitempty"`
DisplayFormat *string `json:"display_format,omitempty"`
ColorPreference *string `json:"color_preference,omitempty"`
HideZeroCounts *bool `json:"hide_zero_counts,omitempty"`
Title *string `json:"title,omitempty"`
TitleSize *string `json:"title_size,omitempty"`
TitleAlign *string `json:"title_align,omitempty"`
Type *string `json:"type"`
SummaryType *string `json:"summary_type,omitempty"`
Query *string `json:"query"`
Sort *string `json:"sort,omitempty"`
Count *int `json:"count,omitempty"`
Start *int `json:"start,omitempty"`
DisplayFormat *string `json:"display_format,omitempty"`
ColorPreference *string `json:"color_preference,omitempty"`
HideZeroCounts *bool `json:"hide_zero_counts,omitempty"`
ShowLastTriggered *bool `json:"show_last_triggered,omitempty"`
Title *string `json:"title,omitempty"`
TitleSize *string `json:"title_size,omitempty"`
TitleAlign *string `json:"title_align,omitempty"`
}

// NoteDefinition represents the definition for a Note widget
Expand Down
124 changes: 124 additions & 0 deletions datadog-accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12352,6 +12352,37 @@ func (m *ManageStatusDefinition) SetQuery(v string) {
m.Query = &v
}

// GetShowLastTriggered returns the ShowLastTriggered field if non-nil, zero value otherwise.
func (m *ManageStatusDefinition) GetShowLastTriggered() bool {
if m == nil || m.ShowLastTriggered == nil {
return false
}
return *m.ShowLastTriggered
}

// GetShowLastTriggeredOk returns a tuple with the ShowLastTriggered field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (m *ManageStatusDefinition) GetShowLastTriggeredOk() (bool, bool) {
if m == nil || m.ShowLastTriggered == nil {
return false, false
}
return *m.ShowLastTriggered, true
}

// HasShowLastTriggered returns a boolean if a field has been set.
func (m *ManageStatusDefinition) HasShowLastTriggered() bool {
if m != nil && m.ShowLastTriggered != nil {
return true
}

return false
}

// SetShowLastTriggered allocates a new m.ShowLastTriggered and returns the pointer to it.
func (m *ManageStatusDefinition) SetShowLastTriggered(v bool) {
m.ShowLastTriggered = &v
}

// GetSort returns the Sort field if non-nil, zero value otherwise.
func (m *ManageStatusDefinition) GetSort() string {
if m == nil || m.Sort == nil {
Expand Down Expand Up @@ -12414,6 +12445,37 @@ func (m *ManageStatusDefinition) SetStart(v int) {
m.Start = &v
}

// GetSummaryType returns the SummaryType field if non-nil, zero value otherwise.
func (m *ManageStatusDefinition) GetSummaryType() string {
if m == nil || m.SummaryType == nil {
return ""
}
return *m.SummaryType
}

// GetSummaryTypeOk returns a tuple with the SummaryType field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (m *ManageStatusDefinition) GetSummaryTypeOk() (string, bool) {
if m == nil || m.SummaryType == nil {
return "", false
}
return *m.SummaryType, true
}

// HasSummaryType returns a boolean if a field has been set.
func (m *ManageStatusDefinition) HasSummaryType() bool {
if m != nil && m.SummaryType != nil {
return true
}

return false
}

// SetSummaryType allocates a new m.SummaryType and returns the pointer to it.
func (m *ManageStatusDefinition) SetSummaryType(v string) {
m.SummaryType = &v
}

// GetTitle returns the Title field if non-nil, zero value otherwise.
func (m *ManageStatusDefinition) GetTitle() string {
if m == nil || m.Title == nil {
Expand Down Expand Up @@ -25186,6 +25248,37 @@ func (w *Widget) SetServiceService(v string) {
w.ServiceService = &v
}

// GetShowLastTriggered returns the ShowLastTriggered field if non-nil, zero value otherwise.
func (w *Widget) GetShowLastTriggered() bool {
if w == nil || w.ShowLastTriggered == nil {
return false
}
return *w.ShowLastTriggered
}

// GetShowLastTriggeredOk returns a tuple with the ShowLastTriggered field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (w *Widget) GetShowLastTriggeredOk() (bool, bool) {
if w == nil || w.ShowLastTriggered == nil {
return false, false
}
return *w.ShowLastTriggered, true
}

// HasShowLastTriggered returns a boolean if a field has been set.
func (w *Widget) HasShowLastTriggered() bool {
if w != nil && w.ShowLastTriggered != nil {
return true
}

return false
}

// SetShowLastTriggered allocates a new w.ShowLastTriggered and returns the pointer to it.
func (w *Widget) SetShowLastTriggered(v bool) {
w.ShowLastTriggered = &v
}

// GetSizeVersion returns the SizeVersion field if non-nil, zero value otherwise.
func (w *Widget) GetSizeVersion() string {
if w == nil || w.SizeVersion == nil {
Expand Down Expand Up @@ -25248,6 +25341,37 @@ func (w *Widget) SetSizing(v string) {
w.Sizing = &v
}

// GetSummaryType returns the SummaryType field if non-nil, zero value otherwise.
func (w *Widget) GetSummaryType() string {
if w == nil || w.SummaryType == nil {
return ""
}
return *w.SummaryType
}

// GetSummaryTypeOk returns a tuple with the SummaryType field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (w *Widget) GetSummaryTypeOk() (string, bool) {
if w == nil || w.SummaryType == nil {
return "", false
}
return *w.SummaryType, true
}

// HasSummaryType returns a boolean if a field has been set.
func (w *Widget) HasSummaryType() bool {
if w != nil && w.SummaryType != nil {
return true
}

return false
}

// SetSummaryType allocates a new w.SummaryType and returns the pointer to it.
func (w *Widget) SetSummaryType(v string) {
w.SummaryType = &v
}

// GetText returns the Text field if non-nil, zero value otherwise.
func (w *Widget) GetText() string {
if w == nil || w.Text == nil {
Expand Down
2 changes: 2 additions & 0 deletions integration/screen_widgets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,11 @@ func TestWidgets(t *testing.T) {
Y: datadog.Int(1),
Width: datadog.Int(5),
Height: datadog.Int(5),
SummaryType: datadog.String("monitors"),
DisplayFormat: datadog.String("countsAndList"),
ColorPreference: datadog.String("background"),
HideZeroCounts: datadog.Bool(true),
ShowLastTriggered: datadog.Bool(true),
ManageStatusShowTitle: datadog.Bool(false),
ManageStatusTitleText: datadog.String("Test title"),
ManageStatusTitleSize: datadog.String("20"),
Expand Down
2 changes: 2 additions & 0 deletions screen_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ type Widget struct {
ManageStatusTitleSize *string `json:"titleSize,omitempty"`
ManageStatusTitleAlign *string `json:"titleAlign,omitempty"`
Params *Params `json:"params,omitempty"`
ShowLastTriggered *bool `json:"show_last_triggered,omitempty"`
SummaryType *string `json:"summary_type,omitempty"`

// For LogStream widget
Columns *string `json:"columns,omitempty"`
Expand Down