Skip to content

Commit d2f38e7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add style and sort to TreeMapWidgetRequest and sort to SunburstWidgetRequest for Dashboards (#4022)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 22dc9a0 commit d2f38e7

3 files changed

Lines changed: 122 additions & 2 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15786,6 +15786,8 @@ components:
1578615786
$ref: "#/components/schemas/LogQueryDefinition"
1578715787
deprecated: true
1578815788
description: Deprecated - Use `queries` and `formulas` instead.
15789+
sort:
15790+
$ref: "#/components/schemas/WidgetSortBy"
1578915791
style:
1579015792
$ref: "#/components/schemas/WidgetStyle"
1579115793
type: object
@@ -20475,6 +20477,10 @@ components:
2047520477
type: array
2047620478
response_format:
2047720479
$ref: "#/components/schemas/FormulaAndFunctionResponseFormat"
20480+
sort:
20481+
$ref: "#/components/schemas/WidgetSortBy"
20482+
style:
20483+
$ref: "#/components/schemas/WidgetRequestStyle"
2047820484
type: object
2047920485
UsageAnalyzedLogsHour:
2048020486
description: The number of analyzed logs for each hour for a given organization.

api/datadogV1/model_sunburst_widget_request.go

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ type SunburstWidgetRequest struct {
3737
RumQuery *LogQueryDefinition `json:"rum_query,omitempty"`
3838
// The log query.
3939
SecurityQuery *LogQueryDefinition `json:"security_query,omitempty"`
40+
// The controls for sorting the widget.
41+
Sort *WidgetSortBy `json:"sort,omitempty"`
4042
// Widget style definition.
4143
Style *WidgetStyle `json:"style,omitempty"`
4244
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -428,6 +430,34 @@ func (o *SunburstWidgetRequest) SetSecurityQuery(v LogQueryDefinition) {
428430
o.SecurityQuery = &v
429431
}
430432

433+
// GetSort returns the Sort field value if set, zero value otherwise.
434+
func (o *SunburstWidgetRequest) GetSort() WidgetSortBy {
435+
if o == nil || o.Sort == nil {
436+
var ret WidgetSortBy
437+
return ret
438+
}
439+
return *o.Sort
440+
}
441+
442+
// GetSortOk returns a tuple with the Sort field value if set, nil otherwise
443+
// and a boolean to check if the value has been set.
444+
func (o *SunburstWidgetRequest) GetSortOk() (*WidgetSortBy, bool) {
445+
if o == nil || o.Sort == nil {
446+
return nil, false
447+
}
448+
return o.Sort, true
449+
}
450+
451+
// HasSort returns a boolean if a field has been set.
452+
func (o *SunburstWidgetRequest) HasSort() bool {
453+
return o != nil && o.Sort != nil
454+
}
455+
456+
// SetSort gets a reference to the given WidgetSortBy and assigns it to the Sort field.
457+
func (o *SunburstWidgetRequest) SetSort(v WidgetSortBy) {
458+
o.Sort = &v
459+
}
460+
431461
// GetStyle returns the Style field value if set, zero value otherwise.
432462
func (o *SunburstWidgetRequest) GetStyle() WidgetStyle {
433463
if o == nil || o.Style == nil {
@@ -501,6 +531,9 @@ func (o SunburstWidgetRequest) MarshalJSON() ([]byte, error) {
501531
if o.SecurityQuery != nil {
502532
toSerialize["security_query"] = o.SecurityQuery
503533
}
534+
if o.Sort != nil {
535+
toSerialize["sort"] = o.Sort
536+
}
504537
if o.Style != nil {
505538
toSerialize["style"] = o.Style
506539
}
@@ -527,14 +560,15 @@ func (o *SunburstWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
527560
ResponseFormat *FormulaAndFunctionResponseFormat `json:"response_format,omitempty"`
528561
RumQuery *LogQueryDefinition `json:"rum_query,omitempty"`
529562
SecurityQuery *LogQueryDefinition `json:"security_query,omitempty"`
563+
Sort *WidgetSortBy `json:"sort,omitempty"`
530564
Style *WidgetStyle `json:"style,omitempty"`
531565
}{}
532566
if err = datadog.Unmarshal(bytes, &all); err != nil {
533567
return datadog.Unmarshal(bytes, &o.UnparsedObject)
534568
}
535569
additionalProperties := make(map[string]interface{})
536570
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
537-
datadog.DeleteKeys(additionalProperties, &[]string{"apm_query", "audit_query", "event_query", "formulas", "log_query", "network_query", "process_query", "profile_metrics_query", "q", "queries", "response_format", "rum_query", "security_query", "style"})
571+
datadog.DeleteKeys(additionalProperties, &[]string{"apm_query", "audit_query", "event_query", "formulas", "log_query", "network_query", "process_query", "profile_metrics_query", "q", "queries", "response_format", "rum_query", "security_query", "sort", "style"})
538572
} else {
539573
return err
540574
}
@@ -584,6 +618,10 @@ func (o *SunburstWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
584618
hasInvalidField = true
585619
}
586620
o.SecurityQuery = all.SecurityQuery
621+
if all.Sort != nil && all.Sort.UnparsedObject != nil && o.UnparsedObject == nil {
622+
hasInvalidField = true
623+
}
624+
o.Sort = all.Sort
587625
if all.Style != nil && all.Style.UnparsedObject != nil && o.UnparsedObject == nil {
588626
hasInvalidField = true
589627
}

api/datadogV1/model_tree_map_widget_request.go

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ type TreeMapWidgetRequest struct {
1919
Queries []FormulaAndFunctionQueryDefinition `json:"queries,omitempty"`
2020
// Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
2121
ResponseFormat *FormulaAndFunctionResponseFormat `json:"response_format,omitempty"`
22+
// The controls for sorting the widget.
23+
Sort *WidgetSortBy `json:"sort,omitempty"`
24+
// Define request widget style.
25+
Style *WidgetRequestStyle `json:"style,omitempty"`
2226
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2327
UnparsedObject map[string]interface{} `json:"-"`
2428
AdditionalProperties map[string]interface{} `json:"-"`
@@ -156,6 +160,62 @@ func (o *TreeMapWidgetRequest) SetResponseFormat(v FormulaAndFunctionResponseFor
156160
o.ResponseFormat = &v
157161
}
158162

163+
// GetSort returns the Sort field value if set, zero value otherwise.
164+
func (o *TreeMapWidgetRequest) GetSort() WidgetSortBy {
165+
if o == nil || o.Sort == nil {
166+
var ret WidgetSortBy
167+
return ret
168+
}
169+
return *o.Sort
170+
}
171+
172+
// GetSortOk returns a tuple with the Sort field value if set, nil otherwise
173+
// and a boolean to check if the value has been set.
174+
func (o *TreeMapWidgetRequest) GetSortOk() (*WidgetSortBy, bool) {
175+
if o == nil || o.Sort == nil {
176+
return nil, false
177+
}
178+
return o.Sort, true
179+
}
180+
181+
// HasSort returns a boolean if a field has been set.
182+
func (o *TreeMapWidgetRequest) HasSort() bool {
183+
return o != nil && o.Sort != nil
184+
}
185+
186+
// SetSort gets a reference to the given WidgetSortBy and assigns it to the Sort field.
187+
func (o *TreeMapWidgetRequest) SetSort(v WidgetSortBy) {
188+
o.Sort = &v
189+
}
190+
191+
// GetStyle returns the Style field value if set, zero value otherwise.
192+
func (o *TreeMapWidgetRequest) GetStyle() WidgetRequestStyle {
193+
if o == nil || o.Style == nil {
194+
var ret WidgetRequestStyle
195+
return ret
196+
}
197+
return *o.Style
198+
}
199+
200+
// GetStyleOk returns a tuple with the Style field value if set, nil otherwise
201+
// and a boolean to check if the value has been set.
202+
func (o *TreeMapWidgetRequest) GetStyleOk() (*WidgetRequestStyle, bool) {
203+
if o == nil || o.Style == nil {
204+
return nil, false
205+
}
206+
return o.Style, true
207+
}
208+
209+
// HasStyle returns a boolean if a field has been set.
210+
func (o *TreeMapWidgetRequest) HasStyle() bool {
211+
return o != nil && o.Style != nil
212+
}
213+
214+
// SetStyle gets a reference to the given WidgetRequestStyle and assigns it to the Style field.
215+
func (o *TreeMapWidgetRequest) SetStyle(v WidgetRequestStyle) {
216+
o.Style = &v
217+
}
218+
159219
// MarshalJSON serializes the struct using spec logic.
160220
func (o TreeMapWidgetRequest) MarshalJSON() ([]byte, error) {
161221
toSerialize := map[string]interface{}{}
@@ -174,6 +234,12 @@ func (o TreeMapWidgetRequest) MarshalJSON() ([]byte, error) {
174234
if o.ResponseFormat != nil {
175235
toSerialize["response_format"] = o.ResponseFormat
176236
}
237+
if o.Sort != nil {
238+
toSerialize["sort"] = o.Sort
239+
}
240+
if o.Style != nil {
241+
toSerialize["style"] = o.Style
242+
}
177243

178244
for key, value := range o.AdditionalProperties {
179245
toSerialize[key] = value
@@ -188,13 +254,15 @@ func (o *TreeMapWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
188254
Q *string `json:"q,omitempty"`
189255
Queries []FormulaAndFunctionQueryDefinition `json:"queries,omitempty"`
190256
ResponseFormat *FormulaAndFunctionResponseFormat `json:"response_format,omitempty"`
257+
Sort *WidgetSortBy `json:"sort,omitempty"`
258+
Style *WidgetRequestStyle `json:"style,omitempty"`
191259
}{}
192260
if err = datadog.Unmarshal(bytes, &all); err != nil {
193261
return datadog.Unmarshal(bytes, &o.UnparsedObject)
194262
}
195263
additionalProperties := make(map[string]interface{})
196264
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
197-
datadog.DeleteKeys(additionalProperties, &[]string{"formulas", "q", "queries", "response_format"})
265+
datadog.DeleteKeys(additionalProperties, &[]string{"formulas", "q", "queries", "response_format", "sort", "style"})
198266
} else {
199267
return err
200268
}
@@ -208,6 +276,14 @@ func (o *TreeMapWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
208276
} else {
209277
o.ResponseFormat = all.ResponseFormat
210278
}
279+
if all.Sort != nil && all.Sort.UnparsedObject != nil && o.UnparsedObject == nil {
280+
hasInvalidField = true
281+
}
282+
o.Sort = all.Sort
283+
if all.Style != nil && all.Style.UnparsedObject != nil && o.UnparsedObject == nil {
284+
hasInvalidField = true
285+
}
286+
o.Style = all.Style
211287

212288
if len(additionalProperties) > 0 {
213289
o.AdditionalProperties = additionalProperties

0 commit comments

Comments
 (0)