Skip to content
Open
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
4 changes: 4 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31470,6 +31470,10 @@ components:
items:
$ref: '#/components/schemas/ObservabilityPipelineConfigSourceItem'
type: array
use_legacy_search_syntax:
description: Use this field to configure the pipeline's filter queries to
use the deprecated search syntax.
type: boolean
required:
- sources
- destinations
Expand Down
43 changes: 39 additions & 4 deletions api/datadogV2/model_observability_pipeline_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type ObservabilityPipelineConfig struct {
Processors []ObservabilityPipelineConfigProcessorItem `json:"processors,omitempty"`
// A list of configured data sources for the pipeline.
Sources []ObservabilityPipelineConfigSourceItem `json:"sources"`
// Use this field to configure the pipeline's filter queries to use the deprecated search syntax.
UseLegacySearchSyntax *bool `json:"use_legacy_search_syntax,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 @@ -116,6 +118,34 @@ func (o *ObservabilityPipelineConfig) SetSources(v []ObservabilityPipelineConfig
o.Sources = v
}

// GetUseLegacySearchSyntax returns the UseLegacySearchSyntax field value if set, zero value otherwise.
func (o *ObservabilityPipelineConfig) GetUseLegacySearchSyntax() bool {
if o == nil || o.UseLegacySearchSyntax == nil {
var ret bool
return ret
}
return *o.UseLegacySearchSyntax
}

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

// HasUseLegacySearchSyntax returns a boolean if a field has been set.
func (o *ObservabilityPipelineConfig) HasUseLegacySearchSyntax() bool {
return o != nil && o.UseLegacySearchSyntax != nil
}

// SetUseLegacySearchSyntax gets a reference to the given bool and assigns it to the UseLegacySearchSyntax field.
func (o *ObservabilityPipelineConfig) SetUseLegacySearchSyntax(v bool) {
o.UseLegacySearchSyntax = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o ObservabilityPipelineConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
Expand All @@ -127,6 +157,9 @@ func (o ObservabilityPipelineConfig) MarshalJSON() ([]byte, error) {
toSerialize["processors"] = o.Processors
}
toSerialize["sources"] = o.Sources
if o.UseLegacySearchSyntax != nil {
toSerialize["use_legacy_search_syntax"] = o.UseLegacySearchSyntax
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -137,9 +170,10 @@ func (o ObservabilityPipelineConfig) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *ObservabilityPipelineConfig) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Destinations *[]ObservabilityPipelineConfigDestinationItem `json:"destinations"`
Processors []ObservabilityPipelineConfigProcessorItem `json:"processors,omitempty"`
Sources *[]ObservabilityPipelineConfigSourceItem `json:"sources"`
Destinations *[]ObservabilityPipelineConfigDestinationItem `json:"destinations"`
Processors []ObservabilityPipelineConfigProcessorItem `json:"processors,omitempty"`
Sources *[]ObservabilityPipelineConfigSourceItem `json:"sources"`
UseLegacySearchSyntax *bool `json:"use_legacy_search_syntax,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -152,13 +186,14 @@ func (o *ObservabilityPipelineConfig) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"destinations", "processors", "sources"})
datadog.DeleteKeys(additionalProperties, &[]string{"destinations", "processors", "sources", "use_legacy_search_syntax"})
} else {
return err
}
o.Destinations = *all.Destinations
o.Processors = all.Processors
o.Sources = *all.Sources
o.UseLegacySearchSyntax = all.UseLegacySearchSyntax

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