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
330 changes: 161 additions & 169 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (

// ObservabilityPipelineAddEnvVarsProcessor The `add_env_vars` processor adds environment variable values to log events.
type ObservabilityPipelineAddEnvVarsProcessor struct {
// Whether this processor is enabled.
Enabled bool `json:"enabled"`
// The unique identifier for this component. Used to reference this processor in the pipeline.
Id string `json:"id"`
// A Datadog search query used to determine which logs this processor targets.
Include string `json:"include"`
// A list of component IDs whose output is used as the input for this processor.
Inputs []string `json:"inputs"`
// The processor type. The value should always be `add_env_vars`.
Type ObservabilityPipelineAddEnvVarsProcessorType `json:"type"`
// A list of environment variable mappings to apply to log fields.
Expand All @@ -31,11 +31,11 @@ type ObservabilityPipelineAddEnvVarsProcessor struct {
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewObservabilityPipelineAddEnvVarsProcessor(id string, include string, inputs []string, typeVar ObservabilityPipelineAddEnvVarsProcessorType, variables []ObservabilityPipelineAddEnvVarsProcessorVariable) *ObservabilityPipelineAddEnvVarsProcessor {
func NewObservabilityPipelineAddEnvVarsProcessor(enabled bool, id string, include string, typeVar ObservabilityPipelineAddEnvVarsProcessorType, variables []ObservabilityPipelineAddEnvVarsProcessorVariable) *ObservabilityPipelineAddEnvVarsProcessor {
this := ObservabilityPipelineAddEnvVarsProcessor{}
this.Enabled = enabled
this.Id = id
this.Include = include
this.Inputs = inputs
this.Type = typeVar
this.Variables = variables
return &this
Expand All @@ -51,6 +51,29 @@ func NewObservabilityPipelineAddEnvVarsProcessorWithDefaults() *ObservabilityPip
return &this
}

// GetEnabled returns the Enabled field value.
func (o *ObservabilityPipelineAddEnvVarsProcessor) GetEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.Enabled
}

// GetEnabledOk returns a tuple with the Enabled field value
// and a boolean to check if the value has been set.
func (o *ObservabilityPipelineAddEnvVarsProcessor) GetEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Enabled, true
}

// SetEnabled sets field value.
func (o *ObservabilityPipelineAddEnvVarsProcessor) SetEnabled(v bool) {
o.Enabled = v
}

// GetId returns the Id field value.
func (o *ObservabilityPipelineAddEnvVarsProcessor) GetId() string {
if o == nil {
Expand Down Expand Up @@ -97,29 +120,6 @@ func (o *ObservabilityPipelineAddEnvVarsProcessor) SetInclude(v string) {
o.Include = v
}

// GetInputs returns the Inputs field value.
func (o *ObservabilityPipelineAddEnvVarsProcessor) GetInputs() []string {
if o == nil {
var ret []string
return ret
}
return o.Inputs
}

// GetInputsOk returns a tuple with the Inputs field value
// and a boolean to check if the value has been set.
func (o *ObservabilityPipelineAddEnvVarsProcessor) GetInputsOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Inputs, true
}

// SetInputs sets field value.
func (o *ObservabilityPipelineAddEnvVarsProcessor) SetInputs(v []string) {
o.Inputs = v
}

// GetType returns the Type field value.
func (o *ObservabilityPipelineAddEnvVarsProcessor) GetType() ObservabilityPipelineAddEnvVarsProcessorType {
if o == nil {
Expand Down Expand Up @@ -172,9 +172,9 @@ func (o ObservabilityPipelineAddEnvVarsProcessor) MarshalJSON() ([]byte, error)
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
toSerialize["enabled"] = o.Enabled
toSerialize["id"] = o.Id
toSerialize["include"] = o.Include
toSerialize["inputs"] = o.Inputs
toSerialize["type"] = o.Type
toSerialize["variables"] = o.Variables

Expand All @@ -187,24 +187,24 @@ func (o ObservabilityPipelineAddEnvVarsProcessor) MarshalJSON() ([]byte, error)
// UnmarshalJSON deserializes the given payload.
func (o *ObservabilityPipelineAddEnvVarsProcessor) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Enabled *bool `json:"enabled"`
Id *string `json:"id"`
Include *string `json:"include"`
Inputs *[]string `json:"inputs"`
Type *ObservabilityPipelineAddEnvVarsProcessorType `json:"type"`
Variables *[]ObservabilityPipelineAddEnvVarsProcessorVariable `json:"variables"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Enabled == nil {
return fmt.Errorf("required field enabled missing")
}
if all.Id == nil {
return fmt.Errorf("required field id missing")
}
if all.Include == nil {
return fmt.Errorf("required field include missing")
}
if all.Inputs == nil {
return fmt.Errorf("required field inputs missing")
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
Expand All @@ -213,15 +213,15 @@ func (o *ObservabilityPipelineAddEnvVarsProcessor) UnmarshalJSON(bytes []byte) (
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"id", "include", "inputs", "type", "variables"})
datadog.DeleteKeys(additionalProperties, &[]string{"enabled", "id", "include", "type", "variables"})
} else {
return err
}

hasInvalidField := false
o.Enabled = *all.Enabled
o.Id = *all.Id
o.Include = *all.Include
o.Inputs = *all.Inputs
if !all.Type.IsValid() {
hasInvalidField = true
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (

// ObservabilityPipelineAddFieldsProcessor The `add_fields` processor adds static key-value fields to logs.
type ObservabilityPipelineAddFieldsProcessor struct {
// Whether this processor is enabled.
Enabled bool `json:"enabled"`
// A list of static fields (key-value pairs) that is added to each log event processed by this component.
Fields []ObservabilityPipelineFieldValue `json:"fields"`
// The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components).
Id string `json:"id"`
// A Datadog search query used to determine which logs this processor targets.
Include string `json:"include"`
// A list of component IDs whose output is used as the `input` for this component.
Inputs []string `json:"inputs"`
// The processor type. The value should always be `add_fields`.
Type ObservabilityPipelineAddFieldsProcessorType `json:"type"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -31,12 +31,12 @@ type ObservabilityPipelineAddFieldsProcessor struct {
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewObservabilityPipelineAddFieldsProcessor(fields []ObservabilityPipelineFieldValue, id string, include string, inputs []string, typeVar ObservabilityPipelineAddFieldsProcessorType) *ObservabilityPipelineAddFieldsProcessor {
func NewObservabilityPipelineAddFieldsProcessor(enabled bool, fields []ObservabilityPipelineFieldValue, id string, include string, typeVar ObservabilityPipelineAddFieldsProcessorType) *ObservabilityPipelineAddFieldsProcessor {
this := ObservabilityPipelineAddFieldsProcessor{}
this.Enabled = enabled
this.Fields = fields
this.Id = id
this.Include = include
this.Inputs = inputs
this.Type = typeVar
return &this
}
Expand All @@ -51,6 +51,29 @@ func NewObservabilityPipelineAddFieldsProcessorWithDefaults() *ObservabilityPipe
return &this
}

// GetEnabled returns the Enabled field value.
func (o *ObservabilityPipelineAddFieldsProcessor) GetEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.Enabled
}

// GetEnabledOk returns a tuple with the Enabled field value
// and a boolean to check if the value has been set.
func (o *ObservabilityPipelineAddFieldsProcessor) GetEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Enabled, true
}

// SetEnabled sets field value.
func (o *ObservabilityPipelineAddFieldsProcessor) SetEnabled(v bool) {
o.Enabled = v
}

// GetFields returns the Fields field value.
func (o *ObservabilityPipelineAddFieldsProcessor) GetFields() []ObservabilityPipelineFieldValue {
if o == nil {
Expand Down Expand Up @@ -120,29 +143,6 @@ func (o *ObservabilityPipelineAddFieldsProcessor) SetInclude(v string) {
o.Include = v
}

// GetInputs returns the Inputs field value.
func (o *ObservabilityPipelineAddFieldsProcessor) GetInputs() []string {
if o == nil {
var ret []string
return ret
}
return o.Inputs
}

// GetInputsOk returns a tuple with the Inputs field value
// and a boolean to check if the value has been set.
func (o *ObservabilityPipelineAddFieldsProcessor) GetInputsOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Inputs, true
}

// SetInputs sets field value.
func (o *ObservabilityPipelineAddFieldsProcessor) SetInputs(v []string) {
o.Inputs = v
}

// GetType returns the Type field value.
func (o *ObservabilityPipelineAddFieldsProcessor) GetType() ObservabilityPipelineAddFieldsProcessorType {
if o == nil {
Expand Down Expand Up @@ -172,10 +172,10 @@ func (o ObservabilityPipelineAddFieldsProcessor) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
toSerialize["enabled"] = o.Enabled
toSerialize["fields"] = o.Fields
toSerialize["id"] = o.Id
toSerialize["include"] = o.Include
toSerialize["inputs"] = o.Inputs
toSerialize["type"] = o.Type

for key, value := range o.AdditionalProperties {
Expand All @@ -187,15 +187,18 @@ func (o ObservabilityPipelineAddFieldsProcessor) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *ObservabilityPipelineAddFieldsProcessor) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Enabled *bool `json:"enabled"`
Fields *[]ObservabilityPipelineFieldValue `json:"fields"`
Id *string `json:"id"`
Include *string `json:"include"`
Inputs *[]string `json:"inputs"`
Type *ObservabilityPipelineAddFieldsProcessorType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Enabled == nil {
return fmt.Errorf("required field enabled missing")
}
if all.Fields == nil {
return fmt.Errorf("required field fields missing")
}
Expand All @@ -205,24 +208,21 @@ func (o *ObservabilityPipelineAddFieldsProcessor) UnmarshalJSON(bytes []byte) (e
if all.Include == nil {
return fmt.Errorf("required field include missing")
}
if all.Inputs == nil {
return fmt.Errorf("required field inputs missing")
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"fields", "id", "include", "inputs", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"enabled", "fields", "id", "include", "type"})
} else {
return err
}

hasInvalidField := false
o.Enabled = *all.Enabled
o.Fields = *all.Fields
o.Id = *all.Id
o.Include = *all.Include
o.Inputs = *all.Inputs
if !all.Type.IsValid() {
hasInvalidField = true
} else {
Expand Down
16 changes: 8 additions & 8 deletions api/datadogV2/model_observability_pipeline_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
type ObservabilityPipelineConfig struct {
// A list of destination components where processed logs are sent.
Destinations []ObservabilityPipelineConfigDestinationItem `json:"destinations"`
// A list of processors that transform or enrich log data.
Processors []ObservabilityPipelineConfigProcessorItem `json:"processors,omitempty"`
// A list of processor groups that transform or enrich log data.
Processors []ObservabilityPipelineConfigProcessorGroup `json:"processors,omitempty"`
// A list of configured data sources for the pipeline.
Sources []ObservabilityPipelineConfigSourceItem `json:"sources"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -66,17 +66,17 @@ func (o *ObservabilityPipelineConfig) SetDestinations(v []ObservabilityPipelineC
}

// GetProcessors returns the Processors field value if set, zero value otherwise.
func (o *ObservabilityPipelineConfig) GetProcessors() []ObservabilityPipelineConfigProcessorItem {
func (o *ObservabilityPipelineConfig) GetProcessors() []ObservabilityPipelineConfigProcessorGroup {
if o == nil || o.Processors == nil {
var ret []ObservabilityPipelineConfigProcessorItem
var ret []ObservabilityPipelineConfigProcessorGroup
return ret
}
return o.Processors
}

// GetProcessorsOk returns a tuple with the Processors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ObservabilityPipelineConfig) GetProcessorsOk() (*[]ObservabilityPipelineConfigProcessorItem, bool) {
func (o *ObservabilityPipelineConfig) GetProcessorsOk() (*[]ObservabilityPipelineConfigProcessorGroup, bool) {
if o == nil || o.Processors == nil {
return nil, false
}
Expand All @@ -88,8 +88,8 @@ func (o *ObservabilityPipelineConfig) HasProcessors() bool {
return o != nil && o.Processors != nil
}

// SetProcessors gets a reference to the given []ObservabilityPipelineConfigProcessorItem and assigns it to the Processors field.
func (o *ObservabilityPipelineConfig) SetProcessors(v []ObservabilityPipelineConfigProcessorItem) {
// SetProcessors gets a reference to the given []ObservabilityPipelineConfigProcessorGroup and assigns it to the Processors field.
func (o *ObservabilityPipelineConfig) SetProcessors(v []ObservabilityPipelineConfigProcessorGroup) {
o.Processors = v
}

Expand Down Expand Up @@ -138,7 +138,7 @@ func (o ObservabilityPipelineConfig) MarshalJSON() ([]byte, error) {
func (o *ObservabilityPipelineConfig) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Destinations *[]ObservabilityPipelineConfigDestinationItem `json:"destinations"`
Processors []ObservabilityPipelineConfigProcessorItem `json:"processors,omitempty"`
Processors []ObservabilityPipelineConfigProcessorGroup `json:"processors,omitempty"`
Sources *[]ObservabilityPipelineConfigSourceItem `json:"sources"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
Expand Down
Loading