From e717cec5ea579bd0bfaef3387ca3dc7b1b914f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Perell=C3=B3=20Mar=C3=ADn?= Date: Thu, 12 Mar 2020 10:20:27 +0100 Subject: [PATCH] Added support for tags_execution property (#303) --- board_widgets.go | 28 ++++----- datadog-accessors.go | 93 ++++++++++++++++++++++++++++++ integration/screen_widgets_test.go | 42 +++++++------- screen_widgets.go | 3 + 4 files changed, 133 insertions(+), 33 deletions(-) diff --git a/board_widgets.go b/board_widgets.go index ce0e7c1..2450f9f 100644 --- a/board_widgets.go +++ b/board_widgets.go @@ -192,23 +192,25 @@ type DistributionRequest struct { // EventStreamDefinition represents the definition for an Event Stream widget type EventStreamDefinition struct { - Type *string `json:"type"` - Query *string `json:"query"` - EventSize *string `json:"event_size,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"` + Query *string `json:"query"` + TagsExecution *string `json:"tags_execution,omitempty"` + EventSize *string `json:"event_size,omitempty"` + Title *string `json:"title,omitempty"` + TitleSize *string `json:"title_size,omitempty"` + TitleAlign *string `json:"title_align,omitempty"` + Time *WidgetTime `json:"time,omitempty"` } // EventTimelineDefinition represents the definition for an Event Timeline widget type EventTimelineDefinition struct { - Type *string `json:"type"` - Query *string `json:"query"` - 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"` + Query *string `json:"query"` + TagsExecution *string `json:"tags_execution,omitempty"` + Title *string `json:"title,omitempty"` + TitleSize *string `json:"title_size,omitempty"` + TitleAlign *string `json:"title_align,omitempty"` + Time *WidgetTime `json:"time,omitempty"` } // FreeTextDefinition represents the definition for a Free Text widget diff --git a/datadog-accessors.go b/datadog-accessors.go index 793f2dc..f57e6a5 100644 --- a/datadog-accessors.go +++ b/datadog-accessors.go @@ -6121,6 +6121,37 @@ func (e *EventStreamDefinition) SetQuery(v string) { e.Query = &v } +// GetTagsExecution returns the TagsExecution field if non-nil, zero value otherwise. +func (e *EventStreamDefinition) GetTagsExecution() string { + if e == nil || e.TagsExecution == nil { + return "" + } + return *e.TagsExecution +} + +// GetTagsExecutionOk returns a tuple with the TagsExecution field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (e *EventStreamDefinition) GetTagsExecutionOk() (string, bool) { + if e == nil || e.TagsExecution == nil { + return "", false + } + return *e.TagsExecution, true +} + +// HasTagsExecution returns a boolean if a field has been set. +func (e *EventStreamDefinition) HasTagsExecution() bool { + if e != nil && e.TagsExecution != nil { + return true + } + + return false +} + +// SetTagsExecution allocates a new e.TagsExecution and returns the pointer to it. +func (e *EventStreamDefinition) SetTagsExecution(v string) { + e.TagsExecution = &v +} + // GetTime returns the Time field if non-nil, zero value otherwise. func (e *EventStreamDefinition) GetTime() WidgetTime { if e == nil || e.Time == nil { @@ -6307,6 +6338,37 @@ func (e *EventTimelineDefinition) SetQuery(v string) { e.Query = &v } +// GetTagsExecution returns the TagsExecution field if non-nil, zero value otherwise. +func (e *EventTimelineDefinition) GetTagsExecution() string { + if e == nil || e.TagsExecution == nil { + return "" + } + return *e.TagsExecution +} + +// GetTagsExecutionOk returns a tuple with the TagsExecution field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (e *EventTimelineDefinition) GetTagsExecutionOk() (string, bool) { + if e == nil || e.TagsExecution == nil { + return "", false + } + return *e.TagsExecution, true +} + +// HasTagsExecution returns a boolean if a field has been set. +func (e *EventTimelineDefinition) HasTagsExecution() bool { + if e != nil && e.TagsExecution != nil { + return true + } + + return false +} + +// SetTagsExecution allocates a new e.TagsExecution and returns the pointer to it. +func (e *EventTimelineDefinition) SetTagsExecution(v string) { + e.TagsExecution = &v +} + // GetTime returns the Time field if non-nil, zero value otherwise. func (e *EventTimelineDefinition) GetTime() WidgetTime { if e == nil || e.Time == nil { @@ -26984,6 +27046,37 @@ func (w *Widget) SetSummaryType(v string) { w.SummaryType = &v } +// GetTagsExecution returns the TagsExecution field if non-nil, zero value otherwise. +func (w *Widget) GetTagsExecution() string { + if w == nil || w.TagsExecution == nil { + return "" + } + return *w.TagsExecution +} + +// GetTagsExecutionOk returns a tuple with the TagsExecution field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (w *Widget) GetTagsExecutionOk() (string, bool) { + if w == nil || w.TagsExecution == nil { + return "", false + } + return *w.TagsExecution, true +} + +// HasTagsExecution returns a boolean if a field has been set. +func (w *Widget) HasTagsExecution() bool { + if w != nil && w.TagsExecution != nil { + return true + } + + return false +} + +// SetTagsExecution allocates a new w.TagsExecution and returns the pointer to it. +func (w *Widget) SetTagsExecution(v string) { + w.TagsExecution = &v +} + // GetText returns the Text field if non-nil, zero value otherwise. func (w *Widget) GetText() string { if w == nil || w.Text == nil { diff --git a/integration/screen_widgets_test.go b/integration/screen_widgets_test.go index 0d85848..ee082c0 100644 --- a/integration/screen_widgets_test.go +++ b/integration/screen_widgets_test.go @@ -302,31 +302,33 @@ func TestWidgets(t *testing.T) { }, }, { - Type: datadog.String("event_timeline"), - X: datadog.Int(1), - Y: datadog.Int(1), - Width: datadog.Int(5), - Height: datadog.Int(5), - Title: datadog.Bool(true), - TitleText: datadog.String("Test title"), - TitleSize: datadog.Int(16), - TitleAlign: datadog.String("right"), + Type: datadog.String("event_timeline"), + X: datadog.Int(1), + Y: datadog.Int(1), + Width: datadog.Int(5), + Height: datadog.Int(5), + Title: datadog.Bool(true), + TitleText: datadog.String("Test title"), + TitleSize: datadog.Int(16), + TitleAlign: datadog.String("right"), + TagsExecution: datadog.String("or"), Time: &datadog.Time{ LiveSpan: datadog.String("1d"), }, }, { - Type: datadog.String("event_stream"), - X: datadog.Int(1), - Y: datadog.Int(1), - Width: datadog.Int(5), - Height: datadog.Int(5), - Title: datadog.Bool(true), - TitleText: datadog.String("Test title"), - TitleSize: datadog.Int(16), - TitleAlign: datadog.String("right"), - Query: datadog.String("*"), - EventSize: datadog.String("l"), + Type: datadog.String("event_stream"), + X: datadog.Int(1), + Y: datadog.Int(1), + Width: datadog.Int(5), + Height: datadog.Int(5), + Title: datadog.Bool(true), + TitleText: datadog.String("Test title"), + TitleSize: datadog.Int(16), + TitleAlign: datadog.String("right"), + Query: datadog.String("*"), + TagsExecution: datadog.String("or"), + EventSize: datadog.String("l"), Time: &datadog.Time{ LiveSpan: datadog.String("4h"), }, diff --git a/screen_widgets.go b/screen_widgets.go index 99e8ddf..b646e60 100644 --- a/screen_widgets.go +++ b/screen_widgets.go @@ -197,6 +197,9 @@ type Widget struct { // For EventTimeline, EventStream, Hostmap, LogStream widgets Query *string `json:"query,omitempty"` + // For EventTimeline, EventStream + TagsExecution *string `json:"tags_execution,omitempty"` + // For Image, IFrame widgets URL *string `json:"url,omitempty"`