Skip to content

Commit da95613

Browse files
chrismddSlavek Kabrda
authored andcommitted
Add new monitor summary widget parameters (#290)
1 parent 9e2c892 commit da95613

File tree

4 files changed

+141
-11
lines changed

4 files changed

+141
-11
lines changed

board_widgets.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,17 +304,19 @@ type LogStreamDefinition struct {
304304

305305
// ManageStatusDefinition represents the definition for a Manage Status widget
306306
type ManageStatusDefinition struct {
307-
Type *string `json:"type"`
308-
Query *string `json:"query"`
309-
Sort *string `json:"sort,omitempty"`
310-
Count *int `json:"count,omitempty"`
311-
Start *int `json:"start,omitempty"`
312-
DisplayFormat *string `json:"display_format,omitempty"`
313-
ColorPreference *string `json:"color_preference,omitempty"`
314-
HideZeroCounts *bool `json:"hide_zero_counts,omitempty"`
315-
Title *string `json:"title,omitempty"`
316-
TitleSize *string `json:"title_size,omitempty"`
317-
TitleAlign *string `json:"title_align,omitempty"`
307+
Type *string `json:"type"`
308+
SummaryType *string `json:"summary_type,omitempty"`
309+
Query *string `json:"query"`
310+
Sort *string `json:"sort,omitempty"`
311+
Count *int `json:"count,omitempty"`
312+
Start *int `json:"start,omitempty"`
313+
DisplayFormat *string `json:"display_format,omitempty"`
314+
ColorPreference *string `json:"color_preference,omitempty"`
315+
HideZeroCounts *bool `json:"hide_zero_counts,omitempty"`
316+
ShowLastTriggered *bool `json:"show_last_triggered,omitempty"`
317+
Title *string `json:"title,omitempty"`
318+
TitleSize *string `json:"title_size,omitempty"`
319+
TitleAlign *string `json:"title_align,omitempty"`
318320
}
319321

320322
// NoteDefinition represents the definition for a Note widget

datadog-accessors.go

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12879,6 +12879,37 @@ func (m *ManageStatusDefinition) SetQuery(v string) {
1287912879
m.Query = &v
1288012880
}
1288112881

12882+
// GetShowLastTriggered returns the ShowLastTriggered field if non-nil, zero value otherwise.
12883+
func (m *ManageStatusDefinition) GetShowLastTriggered() bool {
12884+
if m == nil || m.ShowLastTriggered == nil {
12885+
return false
12886+
}
12887+
return *m.ShowLastTriggered
12888+
}
12889+
12890+
// GetShowLastTriggeredOk returns a tuple with the ShowLastTriggered field if it's non-nil, zero value otherwise
12891+
// and a boolean to check if the value has been set.
12892+
func (m *ManageStatusDefinition) GetShowLastTriggeredOk() (bool, bool) {
12893+
if m == nil || m.ShowLastTriggered == nil {
12894+
return false, false
12895+
}
12896+
return *m.ShowLastTriggered, true
12897+
}
12898+
12899+
// HasShowLastTriggered returns a boolean if a field has been set.
12900+
func (m *ManageStatusDefinition) HasShowLastTriggered() bool {
12901+
if m != nil && m.ShowLastTriggered != nil {
12902+
return true
12903+
}
12904+
12905+
return false
12906+
}
12907+
12908+
// SetShowLastTriggered allocates a new m.ShowLastTriggered and returns the pointer to it.
12909+
func (m *ManageStatusDefinition) SetShowLastTriggered(v bool) {
12910+
m.ShowLastTriggered = &v
12911+
}
12912+
1288212913
// GetSort returns the Sort field if non-nil, zero value otherwise.
1288312914
func (m *ManageStatusDefinition) GetSort() string {
1288412915
if m == nil || m.Sort == nil {
@@ -12941,6 +12972,37 @@ func (m *ManageStatusDefinition) SetStart(v int) {
1294112972
m.Start = &v
1294212973
}
1294312974

12975+
// GetSummaryType returns the SummaryType field if non-nil, zero value otherwise.
12976+
func (m *ManageStatusDefinition) GetSummaryType() string {
12977+
if m == nil || m.SummaryType == nil {
12978+
return ""
12979+
}
12980+
return *m.SummaryType
12981+
}
12982+
12983+
// GetSummaryTypeOk returns a tuple with the SummaryType field if it's non-nil, zero value otherwise
12984+
// and a boolean to check if the value has been set.
12985+
func (m *ManageStatusDefinition) GetSummaryTypeOk() (string, bool) {
12986+
if m == nil || m.SummaryType == nil {
12987+
return "", false
12988+
}
12989+
return *m.SummaryType, true
12990+
}
12991+
12992+
// HasSummaryType returns a boolean if a field has been set.
12993+
func (m *ManageStatusDefinition) HasSummaryType() bool {
12994+
if m != nil && m.SummaryType != nil {
12995+
return true
12996+
}
12997+
12998+
return false
12999+
}
13000+
13001+
// SetSummaryType allocates a new m.SummaryType and returns the pointer to it.
13002+
func (m *ManageStatusDefinition) SetSummaryType(v string) {
13003+
m.SummaryType = &v
13004+
}
13005+
1294413006
// GetTitle returns the Title field if non-nil, zero value otherwise.
1294513007
func (m *ManageStatusDefinition) GetTitle() string {
1294613008
if m == nil || m.Title == nil {
@@ -25713,6 +25775,37 @@ func (w *Widget) SetServiceService(v string) {
2571325775
w.ServiceService = &v
2571425776
}
2571525777

25778+
// GetShowLastTriggered returns the ShowLastTriggered field if non-nil, zero value otherwise.
25779+
func (w *Widget) GetShowLastTriggered() bool {
25780+
if w == nil || w.ShowLastTriggered == nil {
25781+
return false
25782+
}
25783+
return *w.ShowLastTriggered
25784+
}
25785+
25786+
// GetShowLastTriggeredOk returns a tuple with the ShowLastTriggered field if it's non-nil, zero value otherwise
25787+
// and a boolean to check if the value has been set.
25788+
func (w *Widget) GetShowLastTriggeredOk() (bool, bool) {
25789+
if w == nil || w.ShowLastTriggered == nil {
25790+
return false, false
25791+
}
25792+
return *w.ShowLastTriggered, true
25793+
}
25794+
25795+
// HasShowLastTriggered returns a boolean if a field has been set.
25796+
func (w *Widget) HasShowLastTriggered() bool {
25797+
if w != nil && w.ShowLastTriggered != nil {
25798+
return true
25799+
}
25800+
25801+
return false
25802+
}
25803+
25804+
// SetShowLastTriggered allocates a new w.ShowLastTriggered and returns the pointer to it.
25805+
func (w *Widget) SetShowLastTriggered(v bool) {
25806+
w.ShowLastTriggered = &v
25807+
}
25808+
2571625809
// GetSizeVersion returns the SizeVersion field if non-nil, zero value otherwise.
2571725810
func (w *Widget) GetSizeVersion() string {
2571825811
if w == nil || w.SizeVersion == nil {
@@ -25775,6 +25868,37 @@ func (w *Widget) SetSizing(v string) {
2577525868
w.Sizing = &v
2577625869
}
2577725870

25871+
// GetSummaryType returns the SummaryType field if non-nil, zero value otherwise.
25872+
func (w *Widget) GetSummaryType() string {
25873+
if w == nil || w.SummaryType == nil {
25874+
return ""
25875+
}
25876+
return *w.SummaryType
25877+
}
25878+
25879+
// GetSummaryTypeOk returns a tuple with the SummaryType field if it's non-nil, zero value otherwise
25880+
// and a boolean to check if the value has been set.
25881+
func (w *Widget) GetSummaryTypeOk() (string, bool) {
25882+
if w == nil || w.SummaryType == nil {
25883+
return "", false
25884+
}
25885+
return *w.SummaryType, true
25886+
}
25887+
25888+
// HasSummaryType returns a boolean if a field has been set.
25889+
func (w *Widget) HasSummaryType() bool {
25890+
if w != nil && w.SummaryType != nil {
25891+
return true
25892+
}
25893+
25894+
return false
25895+
}
25896+
25897+
// SetSummaryType allocates a new w.SummaryType and returns the pointer to it.
25898+
func (w *Widget) SetSummaryType(v string) {
25899+
w.SummaryType = &v
25900+
}
25901+
2577825902
// GetText returns the Text field if non-nil, zero value otherwise.
2577925903
func (w *Widget) GetText() string {
2578025904
if w == nil || w.Text == nil {

integration/screen_widgets_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,11 @@ func TestWidgets(t *testing.T) {
470470
Y: datadog.Int(1),
471471
Width: datadog.Int(5),
472472
Height: datadog.Int(5),
473+
SummaryType: datadog.String("monitors"),
473474
DisplayFormat: datadog.String("countsAndList"),
474475
ColorPreference: datadog.String("background"),
475476
HideZeroCounts: datadog.Bool(true),
477+
ShowLastTriggered: datadog.Bool(true),
476478
ManageStatusShowTitle: datadog.Bool(false),
477479
ManageStatusTitleText: datadog.String("Test title"),
478480
ManageStatusTitleSize: datadog.String("20"),

screen_widgets.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ type Widget struct {
243243
ManageStatusTitleSize *string `json:"titleSize,omitempty"`
244244
ManageStatusTitleAlign *string `json:"titleAlign,omitempty"`
245245
Params *Params `json:"params,omitempty"`
246+
ShowLastTriggered *bool `json:"show_last_triggered,omitempty"`
247+
SummaryType *string `json:"summary_type,omitempty"`
246248

247249
// For LogStream widget
248250
Columns *string `json:"columns,omitempty"`

0 commit comments

Comments
 (0)