@@ -12,6 +12,8 @@ import (
1212
1313// TimeseriesWidgetDefinition The timeseries visualization allows you to display the evolution of one or more metrics, log events, or Indexed Spans over time.
1414type TimeseriesWidgetDefinition struct {
15+ // Anomaly detection configuration for a timeseries widget.
16+ AnomalyDetection * TimeseriesWidgetAnomalyDetection `json:"anomaly_detection,omitempty"`
1517 // List of custom links.
1618 CustomLinks []WidgetCustomLink `json:"custom_links,omitempty"`
1719 // The description of the widget.
@@ -71,6 +73,34 @@ func NewTimeseriesWidgetDefinitionWithDefaults() *TimeseriesWidgetDefinition {
7173 return & this
7274}
7375
76+ // GetAnomalyDetection returns the AnomalyDetection field value if set, zero value otherwise.
77+ func (o * TimeseriesWidgetDefinition ) GetAnomalyDetection () TimeseriesWidgetAnomalyDetection {
78+ if o == nil || o .AnomalyDetection == nil {
79+ var ret TimeseriesWidgetAnomalyDetection
80+ return ret
81+ }
82+ return * o .AnomalyDetection
83+ }
84+
85+ // GetAnomalyDetectionOk returns a tuple with the AnomalyDetection field value if set, nil otherwise
86+ // and a boolean to check if the value has been set.
87+ func (o * TimeseriesWidgetDefinition ) GetAnomalyDetectionOk () (* TimeseriesWidgetAnomalyDetection , bool ) {
88+ if o == nil || o .AnomalyDetection == nil {
89+ return nil , false
90+ }
91+ return o .AnomalyDetection , true
92+ }
93+
94+ // HasAnomalyDetection returns a boolean if a field has been set.
95+ func (o * TimeseriesWidgetDefinition ) HasAnomalyDetection () bool {
96+ return o != nil && o .AnomalyDetection != nil
97+ }
98+
99+ // SetAnomalyDetection gets a reference to the given TimeseriesWidgetAnomalyDetection and assigns it to the AnomalyDetection field.
100+ func (o * TimeseriesWidgetDefinition ) SetAnomalyDetection (v TimeseriesWidgetAnomalyDetection ) {
101+ o .AnomalyDetection = & v
102+ }
103+
74104// GetCustomLinks returns the CustomLinks field value if set, zero value otherwise.
75105func (o * TimeseriesWidgetDefinition ) GetCustomLinks () []WidgetCustomLink {
76106 if o == nil || o .CustomLinks == nil {
@@ -518,6 +548,9 @@ func (o TimeseriesWidgetDefinition) MarshalJSON() ([]byte, error) {
518548 if o .UnparsedObject != nil {
519549 return datadog .Marshal (o .UnparsedObject )
520550 }
551+ if o .AnomalyDetection != nil {
552+ toSerialize ["anomaly_detection" ] = o .AnomalyDetection
553+ }
521554 if o .CustomLinks != nil {
522555 toSerialize ["custom_links" ] = o .CustomLinks
523556 }
@@ -572,22 +605,23 @@ func (o TimeseriesWidgetDefinition) MarshalJSON() ([]byte, error) {
572605// UnmarshalJSON deserializes the given payload.
573606func (o * TimeseriesWidgetDefinition ) UnmarshalJSON (bytes []byte ) (err error ) {
574607 all := struct {
575- CustomLinks []WidgetCustomLink `json:"custom_links,omitempty"`
576- Description * string `json:"description,omitempty"`
577- Events []WidgetEvent `json:"events,omitempty"`
578- LegendColumns []TimeseriesWidgetLegendColumn `json:"legend_columns,omitempty"`
579- LegendLayout * TimeseriesWidgetLegendLayout `json:"legend_layout,omitempty"`
580- LegendSize * string `json:"legend_size,omitempty"`
581- Markers []WidgetMarker `json:"markers,omitempty"`
582- Requests * []TimeseriesWidgetRequest `json:"requests"`
583- RightYaxis * WidgetAxis `json:"right_yaxis,omitempty"`
584- ShowLegend * bool `json:"show_legend,omitempty"`
585- Time * WidgetTime `json:"time,omitempty"`
586- Title * string `json:"title,omitempty"`
587- TitleAlign * WidgetTextAlign `json:"title_align,omitempty"`
588- TitleSize * string `json:"title_size,omitempty"`
589- Type * TimeseriesWidgetDefinitionType `json:"type"`
590- Yaxis * WidgetAxis `json:"yaxis,omitempty"`
608+ AnomalyDetection * TimeseriesWidgetAnomalyDetection `json:"anomaly_detection,omitempty"`
609+ CustomLinks []WidgetCustomLink `json:"custom_links,omitempty"`
610+ Description * string `json:"description,omitempty"`
611+ Events []WidgetEvent `json:"events,omitempty"`
612+ LegendColumns []TimeseriesWidgetLegendColumn `json:"legend_columns,omitempty"`
613+ LegendLayout * TimeseriesWidgetLegendLayout `json:"legend_layout,omitempty"`
614+ LegendSize * string `json:"legend_size,omitempty"`
615+ Markers []WidgetMarker `json:"markers,omitempty"`
616+ Requests * []TimeseriesWidgetRequest `json:"requests"`
617+ RightYaxis * WidgetAxis `json:"right_yaxis,omitempty"`
618+ ShowLegend * bool `json:"show_legend,omitempty"`
619+ Time * WidgetTime `json:"time,omitempty"`
620+ Title * string `json:"title,omitempty"`
621+ TitleAlign * WidgetTextAlign `json:"title_align,omitempty"`
622+ TitleSize * string `json:"title_size,omitempty"`
623+ Type * TimeseriesWidgetDefinitionType `json:"type"`
624+ Yaxis * WidgetAxis `json:"yaxis,omitempty"`
591625 }{}
592626 if err = datadog .Unmarshal (bytes , & all ); err != nil {
593627 return datadog .Unmarshal (bytes , & o .UnparsedObject )
@@ -600,12 +634,16 @@ func (o *TimeseriesWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
600634 }
601635 additionalProperties := make (map [string ]interface {})
602636 if err = datadog .UnmarshalUseNumber (bytes , & additionalProperties ); err == nil {
603- datadog .DeleteKeys (additionalProperties , & []string {"custom_links" , "description" , "events" , "legend_columns" , "legend_layout" , "legend_size" , "markers" , "requests" , "right_yaxis" , "show_legend" , "time" , "title" , "title_align" , "title_size" , "type" , "yaxis" })
637+ datadog .DeleteKeys (additionalProperties , & []string {"anomaly_detection" , " custom_links" , "description" , "events" , "legend_columns" , "legend_layout" , "legend_size" , "markers" , "requests" , "right_yaxis" , "show_legend" , "time" , "title" , "title_align" , "title_size" , "type" , "yaxis" })
604638 } else {
605639 return err
606640 }
607641
608642 hasInvalidField := false
643+ if all .AnomalyDetection != nil && all .AnomalyDetection .UnparsedObject != nil && o .UnparsedObject == nil {
644+ hasInvalidField = true
645+ }
646+ o .AnomalyDetection = all .AnomalyDetection
609647 o .CustomLinks = all .CustomLinks
610648 o .Description = all .Description
611649 o .Events = all .Events
0 commit comments