Skip to content

Commit

Permalink
Added support for tags_execution property (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosperello authored Mar 12, 2020
1 parent 3c27c73 commit e717cec
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 33 deletions.
28 changes: 15 additions & 13 deletions board_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
93 changes: 93 additions & 0 deletions datadog-accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
42 changes: 22 additions & 20 deletions integration/screen_widgets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
Expand Down
3 changes: 3 additions & 0 deletions screen_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down

0 comments on commit e717cec

Please sign in to comment.