Skip to content

Commit 06cb283

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add description field to widget definition schemas (#3870)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 7690fdc commit 06cb283

41 files changed

Lines changed: 1281 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v1/openapi.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ components:
481481
description: ID of the alert to use in the widget.
482482
example: ""
483483
type: string
484+
description:
485+
description: The description of the widget.
486+
type: string
484487
time:
485488
$ref: "#/components/schemas/WidgetTime"
486489
title:
@@ -516,6 +519,9 @@ components:
516519
description: ID of the alert to use in the widget.
517520
example: ""
518521
type: string
522+
description:
523+
description: The description of the widget.
524+
type: string
519525
precision:
520526
description: Number of decimal to show. If not defined, will use the raw value.
521527
format: int64
@@ -808,6 +814,9 @@ components:
808814
items:
809815
$ref: "#/components/schemas/WidgetCustomLink"
810816
type: array
817+
description:
818+
description: The description of the widget.
819+
type: string
811820
requests:
812821
description: List of bar chart widget requests.
813822
example: ["q": "system.load.1"]
@@ -1015,6 +1024,9 @@ components:
10151024
items:
10161025
$ref: "#/components/schemas/WidgetCustomLink"
10171026
type: array
1027+
description:
1028+
description: The description of the widget.
1029+
type: string
10181030
requests:
10191031
description: |-
10201032
Array of one request object to display in the widget.
@@ -1177,6 +1189,9 @@ components:
11771189
description: Name of the check to use in the widget.
11781190
example: ""
11791191
type: string
1192+
description:
1193+
description: The description of the widget.
1194+
type: string
11801195
group:
11811196
description: Group reporting a single check.
11821197
type: string
@@ -1815,6 +1830,9 @@ components:
18151830
items:
18161831
$ref: "#/components/schemas/WidgetCustomLink"
18171832
type: array
1833+
description:
1834+
description: The description of the widget.
1835+
type: string
18181836
legend_size:
18191837
deprecated: true
18201838
description: (Deprecated) The widget legend was replaced by a tooltip and sidebar.
@@ -2501,6 +2519,9 @@ components:
25012519
The event stream is a widget version of the stream of events
25022520
on the Event Stream view. Only available on FREE layout dashboards.
25032521
properties:
2522+
description:
2523+
description: The description of the widget.
2524+
type: string
25042525
event_size:
25052526
$ref: "#/components/schemas/WidgetEventSize"
25062527
query:
@@ -2538,6 +2559,9 @@ components:
25382559
EventTimelineWidgetDefinition:
25392560
description: The event timeline is a widget version of the timeline that appears at the top of the Event Stream view. Only available on FREE layout dashboards.
25402561
properties:
2562+
description:
2563+
description: The description of the widget.
2564+
type: string
25412565
query:
25422566
description: Query to filter the event timeline with.
25432567
example: ""
@@ -3273,6 +3297,9 @@ components:
32733297
description: |-
32743298
The funnel visualization displays a funnel of user sessions that maps a sequence of view navigation and user interaction in your application.
32753299
properties:
3300+
description:
3301+
description: The description of the widget.
3302+
type: string
32763303
requests:
32773304
description: Request payload used to query items.
32783305
example: [{"query": {"data_source": "rum", "query_string": "@browser.name:Chrome", "steps": [{"facet": "@view.name", "value": "/logs"}, {"facet": "@view.name", "value": "/apm/home"}]}, "request_type": "funnel"}]
@@ -3468,6 +3495,9 @@ components:
34683495
items:
34693496
$ref: "#/components/schemas/WidgetCustomLink"
34703497
type: array
3498+
description:
3499+
description: The description of the widget.
3500+
type: string
34713501
requests:
34723502
description: |-
34733503
Array of request objects to display in the widget. May include an optional request for the region layer and/or an optional request for the points layer. Region layer requests must contain a `group-by` tag whose value is a country ISO code.
@@ -3734,6 +3764,9 @@ components:
37343764
items:
37353765
$ref: "#/components/schemas/WidgetCustomLink"
37363766
type: array
3767+
description:
3768+
description: The description of the widget.
3769+
type: string
37373770
events:
37383771
deprecated: true
37393772
description: List of widget events. Deprecated - Use `overlay` request type instead.
@@ -3999,6 +4032,9 @@ components:
39994032
items:
40004033
$ref: "#/components/schemas/WidgetCustomLink"
40014034
type: array
4035+
description:
4036+
description: The description of the widget.
4037+
type: string
40024038
group:
40034039
description: List of tag prefixes to group by.
40044040
items:
@@ -4978,6 +5014,9 @@ components:
49785014
The list stream visualization displays a table of recent events in your application that
49795015
match a search criteria using user-defined columns.
49805016
properties:
5017+
description:
5018+
description: The description of the widget.
5019+
type: string
49815020
legend_size:
49825021
$ref: "#/components/schemas/WidgetLegendSize"
49835022
requests:
@@ -5159,6 +5198,9 @@ components:
51595198
description: Column name.
51605199
type: string
51615200
type: array
5201+
description:
5202+
description: The description of the widget.
5203+
type: string
51625204
indexes:
51635205
description: An array of index names to query in the stream. Use [] to query all indexes at once.
51645206
example: ["days-3", "days-7"]
@@ -8572,6 +8614,9 @@ components:
85728614
description: The number of monitors to display.
85738615
format: int64
85748616
type: integer
8617+
description:
8618+
description: The description of the widget.
8619+
type: string
85758620
display_format:
85768621
$ref: "#/components/schemas/WidgetMonitorSummaryDisplayFormat"
85778622
hide_zero_counts:
@@ -10960,6 +11005,9 @@ components:
1096011005
custom_unit:
1096111006
description: Display a unit of your choice on the widget.
1096211007
type: string
11008+
description:
11009+
description: The description of the widget.
11010+
type: string
1096311011
precision:
1096411012
description: Number of decimals to show. If not defined, the widget uses the raw value.
1096511013
format: int64
@@ -11129,6 +11177,9 @@ components:
1112911177
items:
1113011178
$ref: "#/components/schemas/WidgetCustomLink"
1113111179
type: array
11180+
description:
11181+
description: The description of the widget.
11182+
type: string
1113211183
inputs:
1113311184
description: Array of workflow inputs to map to dashboard template variables.
1113411185
items:
@@ -12091,6 +12142,9 @@ components:
1209112142
SLOListWidgetDefinition:
1209212143
description: Use the SLO List widget to track your SLOs (Service Level Objectives) on dashboards.
1209312144
properties:
12145+
description:
12146+
description: The description of the widget.
12147+
type: string
1209412148
requests:
1209512149
description: Array of one request object to display in the widget.
1209612150
items:
@@ -12638,6 +12692,9 @@ components:
1263812692
additional_query_filters:
1263912693
description: Additional filters applied to the SLO query.
1264012694
type: string
12695+
description:
12696+
description: The description of the widget.
12697+
type: string
1264112698
global_time_target:
1264212699
description: Defined global time target.
1264312700
type: string
@@ -12737,6 +12794,9 @@ components:
1273712794
items:
1273812795
$ref: "#/components/schemas/WidgetCustomLink"
1273912796
type: array
12797+
description:
12798+
description: The description of the widget.
12799+
type: string
1274012800
requests:
1274112801
$ref: "#/components/schemas/ScatterPlotWidgetDefinitionRequests"
1274212802
time:
@@ -13555,6 +13615,9 @@ components:
1355513615
items:
1355613616
$ref: "#/components/schemas/WidgetCustomLink"
1355713617
type: array
13618+
description:
13619+
description: The description of the widget.
13620+
type: string
1355813621
filters:
1355913622
description: Your environment and primary tag (or * if enabled for your account).
1356013623
example: ["*"]
@@ -13594,6 +13657,9 @@ components:
1359413657
ServiceSummaryWidgetDefinition:
1359513658
description: The service summary displays the graphs of a chosen service in your screenboard. Only available on FREE layout dashboards.
1359613659
properties:
13660+
description:
13661+
description: The description of the widget.
13662+
type: string
1359713663
display_format:
1359813664
$ref: "#/components/schemas/WidgetServiceSummaryDisplayFormat"
1359913665
env:
@@ -14200,6 +14266,9 @@ components:
1420014266
items:
1420114267
$ref: "#/components/schemas/WidgetCustomLink"
1420214268
type: array
14269+
description:
14270+
description: The description of the widget.
14271+
type: string
1420314272
hide_total:
1420414273
description: Show the total value in this widget.
1420514274
type: boolean
@@ -18142,6 +18211,9 @@ components:
1814218211
items:
1814318212
$ref: "#/components/schemas/WidgetCustomLink"
1814418213
type: array
18214+
description:
18215+
description: The description of the widget.
18216+
type: string
1814518217
has_search_bar:
1814618218
$ref: "#/components/schemas/TableWidgetHasSearchBar"
1814718219
requests:
@@ -18487,6 +18559,9 @@ components:
1848718559
items:
1848818560
$ref: "#/components/schemas/WidgetCustomLink"
1848918561
type: array
18562+
description:
18563+
description: The description of the widget.
18564+
type: string
1849018565
events:
1849118566
deprecated: true
1849218567
description: List of widget events. Deprecated - Use `overlay` request type instead.
@@ -18661,6 +18736,9 @@ components:
1866118736
items:
1866218737
$ref: "#/components/schemas/WidgetCustomLink"
1866318738
type: array
18739+
description:
18740+
description: The description of the widget.
18741+
type: string
1866418742
requests:
1866518743
description: List of top list widget requests.
1866618744
example: ["q": "system.load.1"]
@@ -18842,6 +18920,9 @@ components:
1884218920
items:
1884318921
$ref: "#/components/schemas/WidgetCustomLink"
1884418922
type: array
18923+
description:
18924+
description: The description of the widget.
18925+
type: string
1884518926
requests:
1884618927
description: One or more Topology requests.
1884718928
items:
@@ -18957,6 +19038,9 @@ components:
1895719038
items:
1895819039
$ref: "#/components/schemas/WidgetCustomLink"
1895919040
type: array
19041+
description:
19042+
description: The description of the widget.
19043+
type: string
1896019044
group_by:
1896119045
$ref: "#/components/schemas/TreeMapGroupBy"
1896219046
requests:

api/datadogV1/model_alert_graph_widget_definition.go

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
type AlertGraphWidgetDefinition struct {
1515
// ID of the alert to use in the widget.
1616
AlertId string `json:"alert_id"`
17+
// The description of the widget.
18+
Description *string `json:"description,omitempty"`
1719
// Time setting for the widget.
1820
Time *WidgetTime `json:"time,omitempty"`
1921
// The title of the widget.
@@ -76,6 +78,34 @@ func (o *AlertGraphWidgetDefinition) SetAlertId(v string) {
7678
o.AlertId = v
7779
}
7880

81+
// GetDescription returns the Description field value if set, zero value otherwise.
82+
func (o *AlertGraphWidgetDefinition) GetDescription() string {
83+
if o == nil || o.Description == nil {
84+
var ret string
85+
return ret
86+
}
87+
return *o.Description
88+
}
89+
90+
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
91+
// and a boolean to check if the value has been set.
92+
func (o *AlertGraphWidgetDefinition) GetDescriptionOk() (*string, bool) {
93+
if o == nil || o.Description == nil {
94+
return nil, false
95+
}
96+
return o.Description, true
97+
}
98+
99+
// HasDescription returns a boolean if a field has been set.
100+
func (o *AlertGraphWidgetDefinition) HasDescription() bool {
101+
return o != nil && o.Description != nil
102+
}
103+
104+
// SetDescription gets a reference to the given string and assigns it to the Description field.
105+
func (o *AlertGraphWidgetDefinition) SetDescription(v string) {
106+
o.Description = &v
107+
}
108+
79109
// GetTime returns the Time field value if set, zero value otherwise.
80110
func (o *AlertGraphWidgetDefinition) GetTime() WidgetTime {
81111
if o == nil || o.Time == nil {
@@ -241,6 +271,9 @@ func (o AlertGraphWidgetDefinition) MarshalJSON() ([]byte, error) {
241271
return datadog.Marshal(o.UnparsedObject)
242272
}
243273
toSerialize["alert_id"] = o.AlertId
274+
if o.Description != nil {
275+
toSerialize["description"] = o.Description
276+
}
244277
if o.Time != nil {
245278
toSerialize["time"] = o.Time
246279
}
@@ -265,13 +298,14 @@ func (o AlertGraphWidgetDefinition) MarshalJSON() ([]byte, error) {
265298
// UnmarshalJSON deserializes the given payload.
266299
func (o *AlertGraphWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
267300
all := struct {
268-
AlertId *string `json:"alert_id"`
269-
Time *WidgetTime `json:"time,omitempty"`
270-
Title *string `json:"title,omitempty"`
271-
TitleAlign *WidgetTextAlign `json:"title_align,omitempty"`
272-
TitleSize *string `json:"title_size,omitempty"`
273-
Type *AlertGraphWidgetDefinitionType `json:"type"`
274-
VizType *WidgetVizType `json:"viz_type"`
301+
AlertId *string `json:"alert_id"`
302+
Description *string `json:"description,omitempty"`
303+
Time *WidgetTime `json:"time,omitempty"`
304+
Title *string `json:"title,omitempty"`
305+
TitleAlign *WidgetTextAlign `json:"title_align,omitempty"`
306+
TitleSize *string `json:"title_size,omitempty"`
307+
Type *AlertGraphWidgetDefinitionType `json:"type"`
308+
VizType *WidgetVizType `json:"viz_type"`
275309
}{}
276310
if err = datadog.Unmarshal(bytes, &all); err != nil {
277311
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -287,13 +321,14 @@ func (o *AlertGraphWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
287321
}
288322
additionalProperties := make(map[string]interface{})
289323
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
290-
datadog.DeleteKeys(additionalProperties, &[]string{"alert_id", "time", "title", "title_align", "title_size", "type", "viz_type"})
324+
datadog.DeleteKeys(additionalProperties, &[]string{"alert_id", "description", "time", "title", "title_align", "title_size", "type", "viz_type"})
291325
} else {
292326
return err
293327
}
294328

295329
hasInvalidField := false
296330
o.AlertId = *all.AlertId
331+
o.Description = all.Description
297332
o.Time = all.Time
298333
o.Title = all.Title
299334
if all.TitleAlign != nil && !all.TitleAlign.IsValid() {

0 commit comments

Comments
 (0)