Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15786,6 +15786,8 @@ components:
$ref: "#/components/schemas/LogQueryDefinition"
deprecated: true
description: Deprecated - Use `queries` and `formulas` instead.
sort:
$ref: "#/components/schemas/WidgetSortBy"
style:
$ref: "#/components/schemas/WidgetStyle"
type: object
Expand Down Expand Up @@ -20475,6 +20477,10 @@ components:
type: array
response_format:
$ref: "#/components/schemas/FormulaAndFunctionResponseFormat"
sort:
$ref: "#/components/schemas/WidgetSortBy"
style:
$ref: "#/components/schemas/WidgetRequestStyle"
type: object
UsageAnalyzedLogsHour:
description: The number of analyzed logs for each hour for a given organization.
Expand Down
40 changes: 39 additions & 1 deletion api/datadogV1/model_sunburst_widget_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type SunburstWidgetRequest struct {
RumQuery *LogQueryDefinition `json:"rum_query,omitempty"`
// The log query.
SecurityQuery *LogQueryDefinition `json:"security_query,omitempty"`
// The controls for sorting the widget.
Sort *WidgetSortBy `json:"sort,omitempty"`
// Widget style definition.
Style *WidgetStyle `json:"style,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -428,6 +430,34 @@ func (o *SunburstWidgetRequest) SetSecurityQuery(v LogQueryDefinition) {
o.SecurityQuery = &v
}

// GetSort returns the Sort field value if set, zero value otherwise.
func (o *SunburstWidgetRequest) GetSort() WidgetSortBy {
if o == nil || o.Sort == nil {
var ret WidgetSortBy
return ret
}
return *o.Sort
}

// GetSortOk returns a tuple with the Sort field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SunburstWidgetRequest) GetSortOk() (*WidgetSortBy, bool) {
if o == nil || o.Sort == nil {
return nil, false
}
return o.Sort, true
}

// HasSort returns a boolean if a field has been set.
func (o *SunburstWidgetRequest) HasSort() bool {
return o != nil && o.Sort != nil
}

// SetSort gets a reference to the given WidgetSortBy and assigns it to the Sort field.
func (o *SunburstWidgetRequest) SetSort(v WidgetSortBy) {
o.Sort = &v
}

// GetStyle returns the Style field value if set, zero value otherwise.
func (o *SunburstWidgetRequest) GetStyle() WidgetStyle {
if o == nil || o.Style == nil {
Expand Down Expand Up @@ -501,6 +531,9 @@ func (o SunburstWidgetRequest) MarshalJSON() ([]byte, error) {
if o.SecurityQuery != nil {
toSerialize["security_query"] = o.SecurityQuery
}
if o.Sort != nil {
toSerialize["sort"] = o.Sort
}
if o.Style != nil {
toSerialize["style"] = o.Style
}
Expand All @@ -527,14 +560,15 @@ func (o *SunburstWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
ResponseFormat *FormulaAndFunctionResponseFormat `json:"response_format,omitempty"`
RumQuery *LogQueryDefinition `json:"rum_query,omitempty"`
SecurityQuery *LogQueryDefinition `json:"security_query,omitempty"`
Sort *WidgetSortBy `json:"sort,omitempty"`
Style *WidgetStyle `json:"style,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
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"})
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"})
} else {
return err
}
Expand Down Expand Up @@ -584,6 +618,10 @@ func (o *SunburstWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.SecurityQuery = all.SecurityQuery
if all.Sort != nil && all.Sort.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Sort = all.Sort
if all.Style != nil && all.Style.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
Expand Down
78 changes: 77 additions & 1 deletion api/datadogV1/model_tree_map_widget_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ type TreeMapWidgetRequest struct {
Queries []FormulaAndFunctionQueryDefinition `json:"queries,omitempty"`
// Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
ResponseFormat *FormulaAndFunctionResponseFormat `json:"response_format,omitempty"`
// The controls for sorting the widget.
Sort *WidgetSortBy `json:"sort,omitempty"`
// Define request widget style.
Style *WidgetRequestStyle `json:"style,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
Expand Down Expand Up @@ -156,6 +160,62 @@ func (o *TreeMapWidgetRequest) SetResponseFormat(v FormulaAndFunctionResponseFor
o.ResponseFormat = &v
}

// GetSort returns the Sort field value if set, zero value otherwise.
func (o *TreeMapWidgetRequest) GetSort() WidgetSortBy {
if o == nil || o.Sort == nil {
var ret WidgetSortBy
return ret
}
return *o.Sort
}

// GetSortOk returns a tuple with the Sort field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TreeMapWidgetRequest) GetSortOk() (*WidgetSortBy, bool) {
if o == nil || o.Sort == nil {
return nil, false
}
return o.Sort, true
}

// HasSort returns a boolean if a field has been set.
func (o *TreeMapWidgetRequest) HasSort() bool {
return o != nil && o.Sort != nil
}

// SetSort gets a reference to the given WidgetSortBy and assigns it to the Sort field.
func (o *TreeMapWidgetRequest) SetSort(v WidgetSortBy) {
o.Sort = &v
}

// GetStyle returns the Style field value if set, zero value otherwise.
func (o *TreeMapWidgetRequest) GetStyle() WidgetRequestStyle {
if o == nil || o.Style == nil {
var ret WidgetRequestStyle
return ret
}
return *o.Style
}

// GetStyleOk returns a tuple with the Style field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TreeMapWidgetRequest) GetStyleOk() (*WidgetRequestStyle, bool) {
if o == nil || o.Style == nil {
return nil, false
}
return o.Style, true
}

// HasStyle returns a boolean if a field has been set.
func (o *TreeMapWidgetRequest) HasStyle() bool {
return o != nil && o.Style != nil
}

// SetStyle gets a reference to the given WidgetRequestStyle and assigns it to the Style field.
func (o *TreeMapWidgetRequest) SetStyle(v WidgetRequestStyle) {
o.Style = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o TreeMapWidgetRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
Expand All @@ -174,6 +234,12 @@ func (o TreeMapWidgetRequest) MarshalJSON() ([]byte, error) {
if o.ResponseFormat != nil {
toSerialize["response_format"] = o.ResponseFormat
}
if o.Sort != nil {
toSerialize["sort"] = o.Sort
}
if o.Style != nil {
toSerialize["style"] = o.Style
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -188,13 +254,15 @@ func (o *TreeMapWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
Q *string `json:"q,omitempty"`
Queries []FormulaAndFunctionQueryDefinition `json:"queries,omitempty"`
ResponseFormat *FormulaAndFunctionResponseFormat `json:"response_format,omitempty"`
Sort *WidgetSortBy `json:"sort,omitempty"`
Style *WidgetRequestStyle `json:"style,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"formulas", "q", "queries", "response_format"})
datadog.DeleteKeys(additionalProperties, &[]string{"formulas", "q", "queries", "response_format", "sort", "style"})
} else {
return err
}
Expand All @@ -208,6 +276,14 @@ func (o *TreeMapWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
} else {
o.ResponseFormat = all.ResponseFormat
}
if all.Sort != nil && all.Sort.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Sort = all.Sort
if all.Style != nil && all.Style.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Style = all.Style

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
Expand Down
Loading