From 4868aae9ea7fce0b9878859875612f30e733d530 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 1 Apr 2020 18:32:49 +0200 Subject: [PATCH] Add new log stream column parameters (#321) --- board_widgets.go | 25 ++- datadog-accessors.go | 310 +++++++++++++++++++++++++++++ integration/screen_widgets_test.go | 7 + screen_widgets.go | 8 +- 4 files changed, 340 insertions(+), 10 deletions(-) diff --git a/board_widgets.go b/board_widgets.go index e6a2f70..afdf481 100644 --- a/board_widgets.go +++ b/board_widgets.go @@ -302,14 +302,23 @@ type ImageDefinition struct { // LogStreamDefinition represents the definition for a Log Stream widget type LogStreamDefinition struct { - Type *string `json:"type"` - Logset *string `json:"logset"` - Query *string `json:"query,omitempty"` - Columns []string `json:"columns,omitempty"` - Title *string `json:"title,omitempty"` - TitleSize *string `json:"title_size,omitempty"` - TitleAlign *string `json:"title_align,omitempty"` - Time *WidgetTime `json:"time,omitempty"` + Type *string `json:"type"` + Logset *string `json:"logset"` + Query *string `json:"query,omitempty"` + Columns []string `json:"columns,omitempty"` + Title *string `json:"title,omitempty"` + TitleSize *string `json:"title_size,omitempty"` + TitleAlign *string `json:"title_align,omitempty"` + Time *WidgetTime `json:"time,omitempty"` + ShowDateColumn *bool `json:"show_date_column,omitempty"` + ShowMessageColumn *bool `json:"show_message_column,omitempty"` + MessageDisplay *string `json:"message_display,omitempty"` + Sort *WidgetFieldSort `json:"sort,omitempty"` +} + +type WidgetFieldSort struct { + Column *string `json:"column"` + Order *string `json:"order"` } // ManageStatusDefinition represents the definition for a Manage Status widget diff --git a/datadog-accessors.go b/datadog-accessors.go index 211418b..39cff77 100644 --- a/datadog-accessors.go +++ b/datadog-accessors.go @@ -12817,6 +12817,37 @@ func (l *LogStreamDefinition) SetLogset(v string) { l.Logset = &v } +// GetMessageDisplay returns the MessageDisplay field if non-nil, zero value otherwise. +func (l *LogStreamDefinition) GetMessageDisplay() string { + if l == nil || l.MessageDisplay == nil { + return "" + } + return *l.MessageDisplay +} + +// GetMessageDisplayOk returns a tuple with the MessageDisplay field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (l *LogStreamDefinition) GetMessageDisplayOk() (string, bool) { + if l == nil || l.MessageDisplay == nil { + return "", false + } + return *l.MessageDisplay, true +} + +// HasMessageDisplay returns a boolean if a field has been set. +func (l *LogStreamDefinition) HasMessageDisplay() bool { + if l != nil && l.MessageDisplay != nil { + return true + } + + return false +} + +// SetMessageDisplay allocates a new l.MessageDisplay and returns the pointer to it. +func (l *LogStreamDefinition) SetMessageDisplay(v string) { + l.MessageDisplay = &v +} + // GetQuery returns the Query field if non-nil, zero value otherwise. func (l *LogStreamDefinition) GetQuery() string { if l == nil || l.Query == nil { @@ -12848,6 +12879,99 @@ func (l *LogStreamDefinition) SetQuery(v string) { l.Query = &v } +// GetShowDateColumn returns the ShowDateColumn field if non-nil, zero value otherwise. +func (l *LogStreamDefinition) GetShowDateColumn() bool { + if l == nil || l.ShowDateColumn == nil { + return false + } + return *l.ShowDateColumn +} + +// GetShowDateColumnOk returns a tuple with the ShowDateColumn field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (l *LogStreamDefinition) GetShowDateColumnOk() (bool, bool) { + if l == nil || l.ShowDateColumn == nil { + return false, false + } + return *l.ShowDateColumn, true +} + +// HasShowDateColumn returns a boolean if a field has been set. +func (l *LogStreamDefinition) HasShowDateColumn() bool { + if l != nil && l.ShowDateColumn != nil { + return true + } + + return false +} + +// SetShowDateColumn allocates a new l.ShowDateColumn and returns the pointer to it. +func (l *LogStreamDefinition) SetShowDateColumn(v bool) { + l.ShowDateColumn = &v +} + +// GetShowMessageColumn returns the ShowMessageColumn field if non-nil, zero value otherwise. +func (l *LogStreamDefinition) GetShowMessageColumn() bool { + if l == nil || l.ShowMessageColumn == nil { + return false + } + return *l.ShowMessageColumn +} + +// GetShowMessageColumnOk returns a tuple with the ShowMessageColumn field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (l *LogStreamDefinition) GetShowMessageColumnOk() (bool, bool) { + if l == nil || l.ShowMessageColumn == nil { + return false, false + } + return *l.ShowMessageColumn, true +} + +// HasShowMessageColumn returns a boolean if a field has been set. +func (l *LogStreamDefinition) HasShowMessageColumn() bool { + if l != nil && l.ShowMessageColumn != nil { + return true + } + + return false +} + +// SetShowMessageColumn allocates a new l.ShowMessageColumn and returns the pointer to it. +func (l *LogStreamDefinition) SetShowMessageColumn(v bool) { + l.ShowMessageColumn = &v +} + +// GetSort returns the Sort field if non-nil, zero value otherwise. +func (l *LogStreamDefinition) GetSort() WidgetFieldSort { + if l == nil || l.Sort == nil { + return WidgetFieldSort{} + } + return *l.Sort +} + +// GetSortOk returns a tuple with the Sort field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (l *LogStreamDefinition) GetSortOk() (WidgetFieldSort, bool) { + if l == nil || l.Sort == nil { + return WidgetFieldSort{}, false + } + return *l.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (l *LogStreamDefinition) HasSort() bool { + if l != nil && l.Sort != nil { + return true + } + + return false +} + +// SetSort allocates a new l.Sort and returns the pointer to it. +func (l *LogStreamDefinition) SetSort(v WidgetFieldSort) { + l.Sort = &v +} + // GetTime returns the Time field if non-nil, zero value otherwise. func (l *LogStreamDefinition) GetTime() WidgetTime { if l == nil || l.Time == nil { @@ -26550,6 +26674,37 @@ func (w *Widget) SetMargin(v string) { w.Margin = &v } +// GetMessageDisplay returns the MessageDisplay field if non-nil, zero value otherwise. +func (w *Widget) GetMessageDisplay() string { + if w == nil || w.MessageDisplay == nil { + return "" + } + return *w.MessageDisplay +} + +// GetMessageDisplayOk returns a tuple with the MessageDisplay field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *Widget) GetMessageDisplayOk() (string, bool) { + if w == nil || w.MessageDisplay == nil { + return "", false + } + return *w.MessageDisplay, true +} + +// HasMessageDisplay returns a boolean if a field has been set. +func (w *Widget) HasMessageDisplay() bool { + if w != nil && w.MessageDisplay != nil { + return true + } + + return false +} + +// SetMessageDisplay allocates a new w.MessageDisplay and returns the pointer to it. +func (w *Widget) SetMessageDisplay(v string) { + w.MessageDisplay = &v +} + // GetMonitor returns the Monitor field if non-nil, zero value otherwise. func (w *Widget) GetMonitor() ScreenboardMonitor { if w == nil || w.Monitor == nil { @@ -26922,6 +27077,37 @@ func (w *Widget) SetServiceService(v string) { w.ServiceService = &v } +// GetShowDateColumn returns the ShowDateColumn field if non-nil, zero value otherwise. +func (w *Widget) GetShowDateColumn() bool { + if w == nil || w.ShowDateColumn == nil { + return false + } + return *w.ShowDateColumn +} + +// GetShowDateColumnOk returns a tuple with the ShowDateColumn field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *Widget) GetShowDateColumnOk() (bool, bool) { + if w == nil || w.ShowDateColumn == nil { + return false, false + } + return *w.ShowDateColumn, true +} + +// HasShowDateColumn returns a boolean if a field has been set. +func (w *Widget) HasShowDateColumn() bool { + if w != nil && w.ShowDateColumn != nil { + return true + } + + return false +} + +// SetShowDateColumn allocates a new w.ShowDateColumn and returns the pointer to it. +func (w *Widget) SetShowDateColumn(v bool) { + w.ShowDateColumn = &v +} + // GetShowLastTriggered returns the ShowLastTriggered field if non-nil, zero value otherwise. func (w *Widget) GetShowLastTriggered() bool { if w == nil || w.ShowLastTriggered == nil { @@ -26953,6 +27139,37 @@ func (w *Widget) SetShowLastTriggered(v bool) { w.ShowLastTriggered = &v } +// GetShowMessageColumn returns the ShowMessageColumn field if non-nil, zero value otherwise. +func (w *Widget) GetShowMessageColumn() bool { + if w == nil || w.ShowMessageColumn == nil { + return false + } + return *w.ShowMessageColumn +} + +// GetShowMessageColumnOk returns a tuple with the ShowMessageColumn field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *Widget) GetShowMessageColumnOk() (bool, bool) { + if w == nil || w.ShowMessageColumn == nil { + return false, false + } + return *w.ShowMessageColumn, true +} + +// HasShowMessageColumn returns a boolean if a field has been set. +func (w *Widget) HasShowMessageColumn() bool { + if w != nil && w.ShowMessageColumn != nil { + return true + } + + return false +} + +// SetShowMessageColumn allocates a new w.ShowMessageColumn and returns the pointer to it. +func (w *Widget) SetShowMessageColumn(v bool) { + w.ShowMessageColumn = &v +} + // GetSizeVersion returns the SizeVersion field if non-nil, zero value otherwise. func (w *Widget) GetSizeVersion() string { if w == nil || w.SizeVersion == nil { @@ -27015,6 +27232,37 @@ func (w *Widget) SetSizing(v string) { w.Sizing = &v } +// GetSort returns the Sort field if non-nil, zero value otherwise. +func (w *Widget) GetSort() WidgetFieldSort { + if w == nil || w.Sort == nil { + return WidgetFieldSort{} + } + return *w.Sort +} + +// GetSortOk returns a tuple with the Sort field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *Widget) GetSortOk() (WidgetFieldSort, bool) { + if w == nil || w.Sort == nil { + return WidgetFieldSort{}, false + } + return *w.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (w *Widget) HasSort() bool { + if w != nil && w.Sort != nil { + return true + } + + return false +} + +// SetSort allocates a new w.Sort and returns the pointer to it. +func (w *Widget) SetSort(v WidgetFieldSort) { + w.Sort = &v +} + // GetSummaryType returns the SummaryType field if non-nil, zero value otherwise. func (w *Widget) GetSummaryType() string { if w == nil || w.SummaryType == nil { @@ -28224,6 +28472,68 @@ func (w *WidgetEvent) SetQuery(v string) { w.Query = &v } +// GetColumn returns the Column field if non-nil, zero value otherwise. +func (w *WidgetFieldSort) GetColumn() string { + if w == nil || w.Column == nil { + return "" + } + return *w.Column +} + +// GetColumnOk returns a tuple with the Column field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *WidgetFieldSort) GetColumnOk() (string, bool) { + if w == nil || w.Column == nil { + return "", false + } + return *w.Column, true +} + +// HasColumn returns a boolean if a field has been set. +func (w *WidgetFieldSort) HasColumn() bool { + if w != nil && w.Column != nil { + return true + } + + return false +} + +// SetColumn allocates a new w.Column and returns the pointer to it. +func (w *WidgetFieldSort) SetColumn(v string) { + w.Column = &v +} + +// GetOrder returns the Order field if non-nil, zero value otherwise. +func (w *WidgetFieldSort) GetOrder() string { + if w == nil || w.Order == nil { + return "" + } + return *w.Order +} + +// GetOrderOk returns a tuple with the Order field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *WidgetFieldSort) GetOrderOk() (string, bool) { + if w == nil || w.Order == nil { + return "", false + } + return *w.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (w *WidgetFieldSort) HasOrder() bool { + if w != nil && w.Order != nil { + return true + } + + return false +} + +// SetOrder allocates a new w.Order and returns the pointer to it. +func (w *WidgetFieldSort) SetOrder(v string) { + w.Order = &v +} + // GetHeight returns the Height field if non-nil, zero value otherwise. func (w *WidgetLayout) GetHeight() float64 { if w == nil || w.Height == nil { diff --git a/integration/screen_widgets_test.go b/integration/screen_widgets_test.go index ee082c0..78940a5 100644 --- a/integration/screen_widgets_test.go +++ b/integration/screen_widgets_test.go @@ -500,6 +500,13 @@ func TestWidgets(t *testing.T) { Time: &datadog.Time{ LiveSpan: datadog.String("1h"), }, + ShowDateColumn: datadog.Bool(true), + ShowMessageColumn: datadog.Bool(true), + MessageDisplay: datadog.String("expanded-lg"), + Sort: &datadog.WidgetFieldSort{ + Column: datadog.String("column_1"), + Order: datadog.String("asc"), + }, }, { // Widget is undocumented, subject to breaking API changes, and without customer support diff --git a/screen_widgets.go b/screen_widgets.go index b646e60..7a28f99 100644 --- a/screen_widgets.go +++ b/screen_widgets.go @@ -250,8 +250,12 @@ type Widget struct { SummaryType *string `json:"summary_type,omitempty"` // For LogStream widget - Columns *string `json:"columns,omitempty"` - Logset *string `json:"logset,omitempty"` + Columns *string `json:"columns,omitempty"` + Logset *string `json:"logset,omitempty"` + ShowDateColumn *bool `json:"show_date_column,omitempty"` + ShowMessageColumn *bool `json:"show_message_column,omitempty"` + MessageDisplay *string `json:"message_display,omitempty"` + Sort *WidgetFieldSort `json:"sort,omitempty"` // For Uptime // Widget is undocumented, subject to breaking API changes, and without customer support