@@ -12,14 +12,16 @@ import (
1212
1313// ObservabilityPipelineAddFieldsProcessor The `add_fields` processor adds static key-value fields to logs.
1414type ObservabilityPipelineAddFieldsProcessor struct {
15+ // Whether this processor is enabled.
16+ Enabled * bool `json:"enabled,omitempty"`
1517 // A list of static fields (key-value pairs) that is added to each log event processed by this component.
1618 Fields []ObservabilityPipelineFieldValue `json:"fields"`
1719 // 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).
1820 Id string `json:"id"`
1921 // A Datadog search query used to determine which logs this processor targets.
2022 Include string `json:"include"`
21- // A list of component IDs whose output is used as the ` input` for this component .
22- Inputs []string `json:"inputs"`
23+ // A list of component IDs whose output is used as input for this processor. Required when used as a standalone processor, omit when used within a processor group .
24+ Inputs []string `json:"inputs,omitempty "`
2325 // The processor type. The value should always be `add_fields`.
2426 Type ObservabilityPipelineAddFieldsProcessorType `json:"type"`
2527 // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -31,12 +33,11 @@ type ObservabilityPipelineAddFieldsProcessor struct {
3133// This constructor will assign default values to properties that have it defined,
3234// and makes sure properties required by API are set, but the set of arguments
3335// will change when the set of required properties is changed.
34- func NewObservabilityPipelineAddFieldsProcessor (fields []ObservabilityPipelineFieldValue , id string , include string , inputs [] string , typeVar ObservabilityPipelineAddFieldsProcessorType ) * ObservabilityPipelineAddFieldsProcessor {
36+ func NewObservabilityPipelineAddFieldsProcessor (fields []ObservabilityPipelineFieldValue , id string , include string , typeVar ObservabilityPipelineAddFieldsProcessorType ) * ObservabilityPipelineAddFieldsProcessor {
3537 this := ObservabilityPipelineAddFieldsProcessor {}
3638 this .Fields = fields
3739 this .Id = id
3840 this .Include = include
39- this .Inputs = inputs
4041 this .Type = typeVar
4142 return & this
4243}
@@ -51,6 +52,34 @@ func NewObservabilityPipelineAddFieldsProcessorWithDefaults() *ObservabilityPipe
5152 return & this
5253}
5354
55+ // GetEnabled returns the Enabled field value if set, zero value otherwise.
56+ func (o * ObservabilityPipelineAddFieldsProcessor ) GetEnabled () bool {
57+ if o == nil || o .Enabled == nil {
58+ var ret bool
59+ return ret
60+ }
61+ return * o .Enabled
62+ }
63+
64+ // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
65+ // and a boolean to check if the value has been set.
66+ func (o * ObservabilityPipelineAddFieldsProcessor ) GetEnabledOk () (* bool , bool ) {
67+ if o == nil || o .Enabled == nil {
68+ return nil , false
69+ }
70+ return o .Enabled , true
71+ }
72+
73+ // HasEnabled returns a boolean if a field has been set.
74+ func (o * ObservabilityPipelineAddFieldsProcessor ) HasEnabled () bool {
75+ return o != nil && o .Enabled != nil
76+ }
77+
78+ // SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
79+ func (o * ObservabilityPipelineAddFieldsProcessor ) SetEnabled (v bool ) {
80+ o .Enabled = & v
81+ }
82+
5483// GetFields returns the Fields field value.
5584func (o * ObservabilityPipelineAddFieldsProcessor ) GetFields () []ObservabilityPipelineFieldValue {
5685 if o == nil {
@@ -120,25 +149,30 @@ func (o *ObservabilityPipelineAddFieldsProcessor) SetInclude(v string) {
120149 o .Include = v
121150}
122151
123- // GetInputs returns the Inputs field value.
152+ // GetInputs returns the Inputs field value if set, zero value otherwise .
124153func (o * ObservabilityPipelineAddFieldsProcessor ) GetInputs () []string {
125- if o == nil {
154+ if o == nil || o . Inputs == nil {
126155 var ret []string
127156 return ret
128157 }
129158 return o .Inputs
130159}
131160
132- // GetInputsOk returns a tuple with the Inputs field value
161+ // GetInputsOk returns a tuple with the Inputs field value if set, nil otherwise
133162// and a boolean to check if the value has been set.
134163func (o * ObservabilityPipelineAddFieldsProcessor ) GetInputsOk () (* []string , bool ) {
135- if o == nil {
164+ if o == nil || o . Inputs == nil {
136165 return nil , false
137166 }
138167 return & o .Inputs , true
139168}
140169
141- // SetInputs sets field value.
170+ // HasInputs returns a boolean if a field has been set.
171+ func (o * ObservabilityPipelineAddFieldsProcessor ) HasInputs () bool {
172+ return o != nil && o .Inputs != nil
173+ }
174+
175+ // SetInputs gets a reference to the given []string and assigns it to the Inputs field.
142176func (o * ObservabilityPipelineAddFieldsProcessor ) SetInputs (v []string ) {
143177 o .Inputs = v
144178}
@@ -172,10 +206,15 @@ func (o ObservabilityPipelineAddFieldsProcessor) MarshalJSON() ([]byte, error) {
172206 if o .UnparsedObject != nil {
173207 return datadog .Marshal (o .UnparsedObject )
174208 }
209+ if o .Enabled != nil {
210+ toSerialize ["enabled" ] = o .Enabled
211+ }
175212 toSerialize ["fields" ] = o .Fields
176213 toSerialize ["id" ] = o .Id
177214 toSerialize ["include" ] = o .Include
178- toSerialize ["inputs" ] = o .Inputs
215+ if o .Inputs != nil {
216+ toSerialize ["inputs" ] = o .Inputs
217+ }
179218 toSerialize ["type" ] = o .Type
180219
181220 for key , value := range o .AdditionalProperties {
@@ -187,10 +226,11 @@ func (o ObservabilityPipelineAddFieldsProcessor) MarshalJSON() ([]byte, error) {
187226// UnmarshalJSON deserializes the given payload.
188227func (o * ObservabilityPipelineAddFieldsProcessor ) UnmarshalJSON (bytes []byte ) (err error ) {
189228 all := struct {
229+ Enabled * bool `json:"enabled,omitempty"`
190230 Fields * []ObservabilityPipelineFieldValue `json:"fields"`
191231 Id * string `json:"id"`
192232 Include * string `json:"include"`
193- Inputs * []string `json:"inputs"`
233+ Inputs []string `json:"inputs,omitempty "`
194234 Type * ObservabilityPipelineAddFieldsProcessorType `json:"type"`
195235 }{}
196236 if err = datadog .Unmarshal (bytes , & all ); err != nil {
@@ -205,24 +245,22 @@ func (o *ObservabilityPipelineAddFieldsProcessor) UnmarshalJSON(bytes []byte) (e
205245 if all .Include == nil {
206246 return fmt .Errorf ("required field include missing" )
207247 }
208- if all .Inputs == nil {
209- return fmt .Errorf ("required field inputs missing" )
210- }
211248 if all .Type == nil {
212249 return fmt .Errorf ("required field type missing" )
213250 }
214251 additionalProperties := make (map [string ]interface {})
215252 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
216- datadog .DeleteKeys (additionalProperties , & []string {"fields" , "id" , "include" , "inputs" , "type" })
253+ datadog .DeleteKeys (additionalProperties , & []string {"enabled" , " fields" , "id" , "include" , "inputs" , "type" })
217254 } else {
218255 return err
219256 }
220257
221258 hasInvalidField := false
259+ o .Enabled = all .Enabled
222260 o .Fields = * all .Fields
223261 o .Id = * all .Id
224262 o .Include = * all .Include
225- o .Inputs = * all .Inputs
263+ o .Inputs = all .Inputs
226264 if ! all .Type .IsValid () {
227265 hasInvalidField = true
228266 } else {
0 commit comments