Skip to content

Commit 80d3935

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit d8e7ee77 of spec repo (#3184)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent fe955e0 commit 80d3935

14 files changed

Lines changed: 564 additions & 9 deletions

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-30 10:29:39.541125",
8-
"spec_repo_commit": "be63084a"
7+
"regenerated": "2025-06-30 17:05:04.655065",
8+
"spec_repo_commit": "d8e7ee77"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-30 10:29:39.589743",
13-
"spec_repo_commit": "be63084a"
12+
"regenerated": "2025-06-30 17:05:04.670788",
13+
"spec_repo_commit": "d8e7ee77"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,13 @@ components:
15501550
example: host
15511551
nullable: true
15521552
type: string
1553+
type:
1554+
description: The type of variable. This is to differentiate between filter
1555+
variables (interpolated in query) and group by variables (interpolated
1556+
into group by).
1557+
example: group
1558+
nullable: true
1559+
type: string
15531560
required:
15541561
- name
15551562
type: object
@@ -12578,6 +12585,12 @@ components:
1257812585
prefix:
1257912586
description: The tag/attribute key associated with the template variable.
1258012587
type: string
12588+
type:
12589+
description: The type of variable. This is to differentiate between filter
12590+
variables (interpolated in query) and group by variables (interpolated
12591+
into group by).
12592+
nullable: true
12593+
type: string
1258112594
visible_tags:
1258212595
description: List of visible tag values on the shared dashboard.
1258312596
items:

api/datadogV1/model_dashboard_template_variable.go

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type DashboardTemplateVariable struct {
2323
Name string `json:"name"`
2424
// The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
2525
Prefix datadog.NullableString `json:"prefix,omitempty"`
26+
// The type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
27+
Type datadog.NullableString `json:"type,omitempty"`
2628
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2729
UnparsedObject map[string]interface{} `json:"-"`
2830
AdditionalProperties map[string]interface{} `json:"-"`
@@ -217,6 +219,45 @@ func (o *DashboardTemplateVariable) UnsetPrefix() {
217219
o.Prefix.Unset()
218220
}
219221

222+
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
223+
func (o *DashboardTemplateVariable) GetType() string {
224+
if o == nil || o.Type.Get() == nil {
225+
var ret string
226+
return ret
227+
}
228+
return *o.Type.Get()
229+
}
230+
231+
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
232+
// and a boolean to check if the value has been set.
233+
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
234+
func (o *DashboardTemplateVariable) GetTypeOk() (*string, bool) {
235+
if o == nil {
236+
return nil, false
237+
}
238+
return o.Type.Get(), o.Type.IsSet()
239+
}
240+
241+
// HasType returns a boolean if a field has been set.
242+
func (o *DashboardTemplateVariable) HasType() bool {
243+
return o != nil && o.Type.IsSet()
244+
}
245+
246+
// SetType gets a reference to the given datadog.NullableString and assigns it to the Type field.
247+
func (o *DashboardTemplateVariable) SetType(v string) {
248+
o.Type.Set(&v)
249+
}
250+
251+
// SetTypeNil sets the value for Type to be an explicit nil.
252+
func (o *DashboardTemplateVariable) SetTypeNil() {
253+
o.Type.Set(nil)
254+
}
255+
256+
// UnsetType ensures that no value is present for Type, not even an explicit nil.
257+
func (o *DashboardTemplateVariable) UnsetType() {
258+
o.Type.Unset()
259+
}
260+
220261
// MarshalJSON serializes the struct using spec logic.
221262
func (o DashboardTemplateVariable) MarshalJSON() ([]byte, error) {
222263
toSerialize := map[string]interface{}{}
@@ -236,6 +277,9 @@ func (o DashboardTemplateVariable) MarshalJSON() ([]byte, error) {
236277
if o.Prefix.IsSet() {
237278
toSerialize["prefix"] = o.Prefix.Get()
238279
}
280+
if o.Type.IsSet() {
281+
toSerialize["type"] = o.Type.Get()
282+
}
239283

240284
for key, value := range o.AdditionalProperties {
241285
toSerialize[key] = value
@@ -251,6 +295,7 @@ func (o *DashboardTemplateVariable) UnmarshalJSON(bytes []byte) (err error) {
251295
Defaults []string `json:"defaults,omitempty"`
252296
Name *string `json:"name"`
253297
Prefix datadog.NullableString `json:"prefix,omitempty"`
298+
Type datadog.NullableString `json:"type,omitempty"`
254299
}{}
255300
if err = datadog.Unmarshal(bytes, &all); err != nil {
256301
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -260,7 +305,7 @@ func (o *DashboardTemplateVariable) UnmarshalJSON(bytes []byte) (err error) {
260305
}
261306
additionalProperties := make(map[string]interface{})
262307
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
263-
datadog.DeleteKeys(additionalProperties, &[]string{"available_values", "default", "defaults", "name", "prefix"})
308+
datadog.DeleteKeys(additionalProperties, &[]string{"available_values", "default", "defaults", "name", "prefix", "type"})
264309
} else {
265310
return err
266311
}
@@ -269,6 +314,7 @@ func (o *DashboardTemplateVariable) UnmarshalJSON(bytes []byte) (err error) {
269314
o.Defaults = all.Defaults
270315
o.Name = *all.Name
271316
o.Prefix = all.Prefix
317+
o.Type = all.Type
272318

273319
if len(additionalProperties) > 0 {
274320
o.AdditionalProperties = additionalProperties

api/datadogV1/model_selectable_template_variable_items.go

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type SelectableTemplateVariableItems struct {
1616
Name *string `json:"name,omitempty"`
1717
// The tag/attribute key associated with the template variable.
1818
Prefix *string `json:"prefix,omitempty"`
19+
// The type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
20+
Type datadog.NullableString `json:"type,omitempty"`
1921
// List of visible tag values on the shared dashboard.
2022
VisibleTags datadog.NullableList[string] `json:"visible_tags,omitempty"`
2123
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -124,6 +126,45 @@ func (o *SelectableTemplateVariableItems) SetPrefix(v string) {
124126
o.Prefix = &v
125127
}
126128

129+
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
130+
func (o *SelectableTemplateVariableItems) GetType() string {
131+
if o == nil || o.Type.Get() == nil {
132+
var ret string
133+
return ret
134+
}
135+
return *o.Type.Get()
136+
}
137+
138+
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
139+
// and a boolean to check if the value has been set.
140+
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
141+
func (o *SelectableTemplateVariableItems) GetTypeOk() (*string, bool) {
142+
if o == nil {
143+
return nil, false
144+
}
145+
return o.Type.Get(), o.Type.IsSet()
146+
}
147+
148+
// HasType returns a boolean if a field has been set.
149+
func (o *SelectableTemplateVariableItems) HasType() bool {
150+
return o != nil && o.Type.IsSet()
151+
}
152+
153+
// SetType gets a reference to the given datadog.NullableString and assigns it to the Type field.
154+
func (o *SelectableTemplateVariableItems) SetType(v string) {
155+
o.Type.Set(&v)
156+
}
157+
158+
// SetTypeNil sets the value for Type to be an explicit nil.
159+
func (o *SelectableTemplateVariableItems) SetTypeNil() {
160+
o.Type.Set(nil)
161+
}
162+
163+
// UnsetType ensures that no value is present for Type, not even an explicit nil.
164+
func (o *SelectableTemplateVariableItems) UnsetType() {
165+
o.Type.Unset()
166+
}
167+
127168
// GetVisibleTags returns the VisibleTags field value if set, zero value otherwise (both if not set or set to explicit null).
128169
func (o *SelectableTemplateVariableItems) GetVisibleTags() []string {
129170
if o == nil || o.VisibleTags.Get() == nil {
@@ -178,6 +219,9 @@ func (o SelectableTemplateVariableItems) MarshalJSON() ([]byte, error) {
178219
if o.Prefix != nil {
179220
toSerialize["prefix"] = o.Prefix
180221
}
222+
if o.Type.IsSet() {
223+
toSerialize["type"] = o.Type.Get()
224+
}
181225
if o.VisibleTags.IsSet() {
182226
toSerialize["visible_tags"] = o.VisibleTags.Get()
183227
}
@@ -194,20 +238,22 @@ func (o *SelectableTemplateVariableItems) UnmarshalJSON(bytes []byte) (err error
194238
DefaultValue *string `json:"default_value,omitempty"`
195239
Name *string `json:"name,omitempty"`
196240
Prefix *string `json:"prefix,omitempty"`
241+
Type datadog.NullableString `json:"type,omitempty"`
197242
VisibleTags datadog.NullableList[string] `json:"visible_tags,omitempty"`
198243
}{}
199244
if err = datadog.Unmarshal(bytes, &all); err != nil {
200245
return datadog.Unmarshal(bytes, &o.UnparsedObject)
201246
}
202247
additionalProperties := make(map[string]interface{})
203248
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
204-
datadog.DeleteKeys(additionalProperties, &[]string{"default_value", "name", "prefix", "visible_tags"})
249+
datadog.DeleteKeys(additionalProperties, &[]string{"default_value", "name", "prefix", "type", "visible_tags"})
205250
} else {
206251
return err
207252
}
208253
o.DefaultValue = all.DefaultValue
209254
o.Name = all.Name
210255
o.Prefix = all.Prefix
256+
o.Type = all.Type
211257
o.VisibleTags = all.VisibleTags
212258

213259
if len(additionalProperties) > 0 {
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Create a new dashboard with template variable type field returns "OK" response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
body := datadogV1.Dashboard{
17+
Description: *datadog.NewNullableString(nil),
18+
LayoutType: datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,
19+
NotifyList: *datadog.NewNullableList(&[]string{}),
20+
ReflowType: datadogV1.DASHBOARDREFLOWTYPE_AUTO.Ptr(),
21+
RestrictedRoles: []string{},
22+
TemplateVariables: []datadogV1.DashboardTemplateVariable{
23+
{
24+
AvailableValues: *datadog.NewNullableList(&[]string{
25+
"service",
26+
"datacenter",
27+
"env",
28+
}),
29+
Defaults: []string{
30+
"service",
31+
"datacenter",
32+
},
33+
Name: "group_by_var",
34+
Type: *datadog.NewNullableString(datadog.PtrString("group")),
35+
},
36+
},
37+
Title: "",
38+
Widgets: []datadogV1.Widget{
39+
{
40+
Definition: datadogV1.WidgetDefinition{
41+
HostMapWidgetDefinition: &datadogV1.HostMapWidgetDefinition{
42+
Requests: datadogV1.HostMapWidgetDefinitionRequests{
43+
Fill: &datadogV1.HostMapRequest{
44+
Q: datadog.PtrString("avg:system.cpu.user{*}"),
45+
},
46+
},
47+
Type: datadogV1.HOSTMAPWIDGETDEFINITIONTYPE_HOSTMAP,
48+
}},
49+
},
50+
},
51+
}
52+
ctx := datadog.NewDefaultContext(context.Background())
53+
configuration := datadog.NewConfiguration()
54+
apiClient := datadog.NewAPIClient(configuration)
55+
api := datadogV1.NewDashboardsApi(apiClient)
56+
resp, r, err := api.CreateDashboard(ctx, body)
57+
58+
if err != nil {
59+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err)
60+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
61+
}
62+
63+
responseContent, _ := json.MarshalIndent(resp, "", " ")
64+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreateDashboard`:\n%s\n", responseContent)
65+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Create a shared dashboard with a group template variable returns "OK" response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
// there is a valid "dashboard" in the system
17+
DashboardID := os.Getenv("DASHBOARD_ID")
18+
19+
body := datadogV1.SharedDashboard{
20+
DashboardId: DashboardID,
21+
DashboardType: datadogV1.DASHBOARDTYPE_CUSTOM_TIMEBOARD,
22+
ShareType: *datadogV1.NewNullableDashboardShareType(datadogV1.DASHBOARDSHARETYPE_OPEN.Ptr()),
23+
GlobalTime: &datadogV1.DashboardGlobalTime{
24+
LiveSpan: datadogV1.DASHBOARDGLOBALTIMELIVESPAN_PAST_ONE_HOUR.Ptr(),
25+
},
26+
SelectableTemplateVars: []datadogV1.SelectableTemplateVariableItems{
27+
{
28+
DefaultValue: datadog.PtrString("*"),
29+
Name: datadog.PtrString("group_by_var"),
30+
Type: *datadog.NewNullableString(datadog.PtrString("group")),
31+
VisibleTags: *datadog.NewNullableList(&[]string{
32+
"selectableValue1",
33+
"selectableValue2",
34+
}),
35+
},
36+
},
37+
}
38+
ctx := datadog.NewDefaultContext(context.Background())
39+
configuration := datadog.NewConfiguration()
40+
apiClient := datadog.NewAPIClient(configuration)
41+
api := datadogV1.NewDashboardsApi(apiClient)
42+
resp, r, err := api.CreatePublicDashboard(ctx, body)
43+
44+
if err != nil {
45+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreatePublicDashboard`: %v\n", err)
46+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
47+
}
48+
49+
responseContent, _ := json.MarshalIndent(resp, "", " ")
50+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreatePublicDashboard`:\n%s\n", responseContent)
51+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Update a shared dashboard with selectable_template_vars returns "OK" response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
// there is a valid "shared_dashboard" in the system
17+
SharedDashboardToken := os.Getenv("SHARED_DASHBOARD_TOKEN")
18+
19+
body := datadogV1.SharedDashboardUpdateRequest{
20+
GlobalTime: *datadogV1.NewNullableSharedDashboardUpdateRequestGlobalTime(&datadogV1.SharedDashboardUpdateRequestGlobalTime{
21+
LiveSpan: datadogV1.DASHBOARDGLOBALTIMELIVESPAN_PAST_FIFTEEN_MINUTES.Ptr(),
22+
}),
23+
ShareList: *datadog.NewNullableList(&[]string{}),
24+
ShareType: *datadogV1.NewNullableDashboardShareType(datadogV1.DASHBOARDSHARETYPE_OPEN.Ptr()),
25+
SelectableTemplateVars: []datadogV1.SelectableTemplateVariableItems{
26+
{
27+
DefaultValue: datadog.PtrString("*"),
28+
Name: datadog.PtrString("group_by_var"),
29+
Type: *datadog.NewNullableString(datadog.PtrString("group")),
30+
VisibleTags: *datadog.NewNullableList(&[]string{
31+
"selectableValue1",
32+
"selectableValue2",
33+
}),
34+
},
35+
},
36+
}
37+
ctx := datadog.NewDefaultContext(context.Background())
38+
configuration := datadog.NewConfiguration()
39+
apiClient := datadog.NewAPIClient(configuration)
40+
api := datadogV1.NewDashboardsApi(apiClient)
41+
resp, r, err := api.UpdatePublicDashboard(ctx, SharedDashboardToken, body)
42+
43+
if err != nil {
44+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.UpdatePublicDashboard`: %v\n", err)
45+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
46+
}
47+
48+
responseContent, _ := json.MarshalIndent(resp, "", " ")
49+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.UpdatePublicDashboard`:\n%s\n", responseContent)
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-06-30T15:47:16.966Z

0 commit comments

Comments
 (0)