Skip to content

Commit

Permalink
Regenerate client from commit 82038586 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Sep 9, 2024
1 parent ad7f3f6 commit 2b5d36d
Show file tree
Hide file tree
Showing 20 changed files with 2,029 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-06 21:00:03.088699",
"spec_repo_commit": "3dff532a"
"regenerated": "2024-09-09 16:24:01.726594",
"spec_repo_commit": "82038586"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-06 21:00:03.109592",
"spec_repo_commit": "3dff532a"
"regenerated": "2024-09-09 16:24:01.746218",
"spec_repo_commit": "82038586"
}
}
}
206 changes: 206 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16740,6 +16740,212 @@ components:
$ref: '#/components/schemas/LogQueryDefinition'
sort:
$ref: '#/components/schemas/WidgetSortBy'
text_formats:
description: List of text formats for columns produced by tags.
items:
$ref: '#/components/schemas/TableWidgetTextFormat'
type: array
type: object
TableWidgetTextFormat:
description: Text format rules for a tag-based column within a table widget.
example:
- match:
type: is
value: fruit
replace:
type: all
with: vegetable
- match:
type: is
value: cake
palette: white_on_green
items:
$ref: '#/components/schemas/TableWidgetTextFormatRule'
minItems: 1
type: array
TableWidgetTextFormatCustomPaletteType:
description: Custom color-on-color palette.
enum:
- custom_bg
example: custom_bg
type: string
x-enum-varnames:
- CUSTOM_BG
TableWidgetTextFormatMatch:
description: Match rule for the table widget text format.
example:
type: is
value: fruit
properties:
type:
$ref: '#/components/schemas/TableWidgetTextFormatMatchType'
value:
description: Table Widget Match String.
example: Match Value
type: string
required:
- type
- value
type: object
TableWidgetTextFormatMatchType:
description: Match or compare option.
enum:
- is
- is_not
- contains
- does_not_contain
- starts_with
- ends_with
example: is
type: string
x-enum-varnames:
- IS
- IS_NOT
- CONTAINS
- DOES_NOT_CONTAIN
- STARTS_WITH
- ENDS_WITH
TableWidgetTextFormatPalette:
default: white_on_green
description: Color-on-color palette to highlight replaced text.
enum:
- white_on_red
- white_on_yellow
- white_on_green
- black_on_light_red
- black_on_light_yellow
- black_on_light_green
- red_on_white
- yellow_on_white
type: string
x-enum-varnames:
- WHITE_ON_RED
- WHITE_ON_YELLOW
- WHITE_ON_GREEN
- BLACK_ON_LIGHT_RED
- BLACK_ON_LIGHT_YELLOW
- BLACK_ON_LIGHT_GREEN
- RED_ON_WHITE
- YELLOW_ON_WHITE
TableWidgetTextFormatReplace:
description: Replace rule for the table widget text format.
example:
type: all
with: vegetable
oneOf:
- $ref: '#/components/schemas/TableWidgetTextFormatReplaceAll'
- $ref: '#/components/schemas/TableWidgetTextFormatReplaceSubstring'
TableWidgetTextFormatReplaceAll:
description: Match All definition.
example:
type: all
with: vegetable
properties:
type:
$ref: '#/components/schemas/TableWidgetTextFormatReplaceAllType'
with:
description: Replace All type.
example: all
type: string
required:
- type
- with
type: object
TableWidgetTextFormatReplaceAllType:
description: Table widget text format replace all type.
enum:
- all
example: all
type: string
x-enum-varnames:
- ALL
TableWidgetTextFormatReplaceSubstring:
description: Match Sub-string definition.
example:
substring: fruit
type: substring
with: vegetable
properties:
substring:
description: Text that will be replaced.
example: string to replace
type: string
type:
$ref: '#/components/schemas/TableWidgetTextFormatReplaceSubstringType'
with:
description: Text that will replace original sub-string.
example: replacement
type: string
required:
- type
- with
- substring
type: object
TableWidgetTextFormatReplaceSubstringType:
description: Table widget text format replace sub-string type.
enum:
- substring
example: substring
type: string
x-enum-varnames:
- SUBSTRING
TableWidgetTextFormatRule:
description: Text format rule.
example:
match:
type: is
value: apple
replace:
type: all
with: vegetable
oneOf:
- $ref: '#/components/schemas/TableWidgetTextFormatRuleMain'
- $ref: '#/components/schemas/TableWidgetTextFormatRuleCustomPalette'
TableWidgetTextFormatRuleCustomPalette:
description: Text format rule with custom palette.
example:
custom_bg_color: '#111111'
match:
type: is
value: fruit
palette: custom_bg
replace:
type: all
with: vegetable
properties:
custom_bg_color:
description: Hex representation of the custom background color.
example: '#111111'
type: string
match:
$ref: '#/components/schemas/TableWidgetTextFormatMatch'
palette:
$ref: '#/components/schemas/TableWidgetTextFormatCustomPaletteType'
replace:
$ref: '#/components/schemas/TableWidgetTextFormatReplace'
required:
- match
- palette
- custom_bg_color
type: object
TableWidgetTextFormatRuleMain:
description: Text format rule with preset palettes.
example:
match:
type: is
value: apple
replace:
type: all
with: vegetable
properties:
match:
$ref: '#/components/schemas/TableWidgetTextFormatMatch'
palette:
$ref: '#/components/schemas/TableWidgetTextFormatPalette'
replace:
$ref: '#/components/schemas/TableWidgetTextFormatReplace'
required:
- match
type: object
TagToHosts:
description: In this object, the key is the tag, the value is a list of host
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV1/model_table_widget_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type TableWidgetRequest struct {
SecurityQuery *LogQueryDefinition `json:"security_query,omitempty"`
// The controls for sorting the widget.
Sort *WidgetSortBy `json:"sort,omitempty"`
// List of text formats for columns produced by tags.
TextFormats [][]TableWidgetTextFormatRule `json:"text_formats,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 @@ -632,6 +634,34 @@ func (o *TableWidgetRequest) SetSort(v WidgetSortBy) {
o.Sort = &v
}

// GetTextFormats returns the TextFormats field value if set, zero value otherwise.
func (o *TableWidgetRequest) GetTextFormats() [][]TableWidgetTextFormatRule {
if o == nil || o.TextFormats == nil {
var ret [][]TableWidgetTextFormatRule
return ret
}
return o.TextFormats
}

// GetTextFormatsOk returns a tuple with the TextFormats field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TableWidgetRequest) GetTextFormatsOk() (*[][]TableWidgetTextFormatRule, bool) {
if o == nil || o.TextFormats == nil {
return nil, false
}
return &o.TextFormats, true
}

// HasTextFormats returns a boolean if a field has been set.
func (o *TableWidgetRequest) HasTextFormats() bool {
return o != nil && o.TextFormats != nil
}

// SetTextFormats gets a reference to the given [][]TableWidgetTextFormatRule and assigns it to the TextFormats field.
func (o *TableWidgetRequest) SetTextFormats(v [][]TableWidgetTextFormatRule) {
o.TextFormats = v
}

// MarshalJSON serializes the struct using spec logic.
func (o TableWidgetRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
Expand Down Expand Up @@ -698,6 +728,9 @@ func (o TableWidgetRequest) MarshalJSON() ([]byte, error) {
if o.Sort != nil {
toSerialize["sort"] = o.Sort
}
if o.TextFormats != nil {
toSerialize["text_formats"] = o.TextFormats
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand Down Expand Up @@ -728,13 +761,14 @@ func (o *TableWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
RumQuery *LogQueryDefinition `json:"rum_query,omitempty"`
SecurityQuery *LogQueryDefinition `json:"security_query,omitempty"`
Sort *WidgetSortBy `json:"sort,omitempty"`
TextFormats [][]TableWidgetTextFormatRule `json:"text_formats,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{"aggregator", "alias", "apm_query", "apm_stats_query", "cell_display_mode", "conditional_formats", "event_query", "formulas", "limit", "log_query", "network_query", "order", "process_query", "profile_metrics_query", "q", "queries", "response_format", "rum_query", "security_query", "sort"})
datadog.DeleteKeys(additionalProperties, &[]string{"aggregator", "alias", "apm_query", "apm_stats_query", "cell_display_mode", "conditional_formats", "event_query", "formulas", "limit", "log_query", "network_query", "order", "process_query", "profile_metrics_query", "q", "queries", "response_format", "rum_query", "security_query", "sort", "text_formats"})
} else {
return err
}
Expand Down Expand Up @@ -802,6 +836,7 @@ func (o *TableWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.Sort = all.Sort
o.TextFormats = all.TextFormats

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV1

import (
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// TableWidgetTextFormatCustomPaletteType Custom color-on-color palette.
type TableWidgetTextFormatCustomPaletteType string

// List of TableWidgetTextFormatCustomPaletteType.
const (
TABLEWIDGETTEXTFORMATCUSTOMPALETTETYPE_CUSTOM_BG TableWidgetTextFormatCustomPaletteType = "custom_bg"
)

var allowedTableWidgetTextFormatCustomPaletteTypeEnumValues = []TableWidgetTextFormatCustomPaletteType{
TABLEWIDGETTEXTFORMATCUSTOMPALETTETYPE_CUSTOM_BG,
}

// GetAllowedValues reeturns the list of possible values.
func (v *TableWidgetTextFormatCustomPaletteType) GetAllowedValues() []TableWidgetTextFormatCustomPaletteType {
return allowedTableWidgetTextFormatCustomPaletteTypeEnumValues
}

// UnmarshalJSON deserializes the given payload.
func (v *TableWidgetTextFormatCustomPaletteType) UnmarshalJSON(src []byte) error {
var value string
err := datadog.Unmarshal(src, &value)
if err != nil {
return err
}
*v = TableWidgetTextFormatCustomPaletteType(value)
return nil
}

// NewTableWidgetTextFormatCustomPaletteTypeFromValue returns a pointer to a valid TableWidgetTextFormatCustomPaletteType
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
func NewTableWidgetTextFormatCustomPaletteTypeFromValue(v string) (*TableWidgetTextFormatCustomPaletteType, error) {
ev := TableWidgetTextFormatCustomPaletteType(v)
if ev.IsValid() {
return &ev, nil
}
return nil, fmt.Errorf("invalid value '%v' for TableWidgetTextFormatCustomPaletteType: valid values are %v", v, allowedTableWidgetTextFormatCustomPaletteTypeEnumValues)
}

// IsValid return true if the value is valid for the enum, false otherwise.
func (v TableWidgetTextFormatCustomPaletteType) IsValid() bool {
for _, existing := range allowedTableWidgetTextFormatCustomPaletteTypeEnumValues {
if existing == v {
return true
}
}
return false
}

// Ptr returns reference to TableWidgetTextFormatCustomPaletteType value.
func (v TableWidgetTextFormatCustomPaletteType) Ptr() *TableWidgetTextFormatCustomPaletteType {
return &v
}
Loading

0 comments on commit 2b5d36d

Please sign in to comment.