@@ -12,14 +12,14 @@ 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"`
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"`
2323 // The processor type. The value should always be `add_fields`.
2424 Type ObservabilityPipelineAddFieldsProcessorType `json:"type"`
2525 // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -31,12 +31,12 @@ type ObservabilityPipelineAddFieldsProcessor struct {
3131// This constructor will assign default values to properties that have it defined,
3232// and makes sure properties required by API are set, but the set of arguments
3333// will change when the set of required properties is changed.
34- func NewObservabilityPipelineAddFieldsProcessor (fields []ObservabilityPipelineFieldValue , id string , include string , inputs [] string , typeVar ObservabilityPipelineAddFieldsProcessorType ) * ObservabilityPipelineAddFieldsProcessor {
34+ func NewObservabilityPipelineAddFieldsProcessor (enabled bool , fields []ObservabilityPipelineFieldValue , id string , include string , typeVar ObservabilityPipelineAddFieldsProcessorType ) * ObservabilityPipelineAddFieldsProcessor {
3535 this := ObservabilityPipelineAddFieldsProcessor {}
36+ this .Enabled = enabled
3637 this .Fields = fields
3738 this .Id = id
3839 this .Include = include
39- this .Inputs = inputs
4040 this .Type = typeVar
4141 return & this
4242}
@@ -51,6 +51,29 @@ func NewObservabilityPipelineAddFieldsProcessorWithDefaults() *ObservabilityPipe
5151 return & this
5252}
5353
54+ // GetEnabled returns the Enabled field value.
55+ func (o * ObservabilityPipelineAddFieldsProcessor ) GetEnabled () bool {
56+ if o == nil {
57+ var ret bool
58+ return ret
59+ }
60+ return o .Enabled
61+ }
62+
63+ // GetEnabledOk returns a tuple with the Enabled field value
64+ // and a boolean to check if the value has been set.
65+ func (o * ObservabilityPipelineAddFieldsProcessor ) GetEnabledOk () (* bool , bool ) {
66+ if o == nil {
67+ return nil , false
68+ }
69+ return & o .Enabled , true
70+ }
71+
72+ // SetEnabled sets field value.
73+ func (o * ObservabilityPipelineAddFieldsProcessor ) SetEnabled (v bool ) {
74+ o .Enabled = v
75+ }
76+
5477// GetFields returns the Fields field value.
5578func (o * ObservabilityPipelineAddFieldsProcessor ) GetFields () []ObservabilityPipelineFieldValue {
5679 if o == nil {
@@ -120,29 +143,6 @@ func (o *ObservabilityPipelineAddFieldsProcessor) SetInclude(v string) {
120143 o .Include = v
121144}
122145
123- // GetInputs returns the Inputs field value.
124- func (o * ObservabilityPipelineAddFieldsProcessor ) GetInputs () []string {
125- if o == nil {
126- var ret []string
127- return ret
128- }
129- return o .Inputs
130- }
131-
132- // GetInputsOk returns a tuple with the Inputs field value
133- // and a boolean to check if the value has been set.
134- func (o * ObservabilityPipelineAddFieldsProcessor ) GetInputsOk () (* []string , bool ) {
135- if o == nil {
136- return nil , false
137- }
138- return & o .Inputs , true
139- }
140-
141- // SetInputs sets field value.
142- func (o * ObservabilityPipelineAddFieldsProcessor ) SetInputs (v []string ) {
143- o .Inputs = v
144- }
145-
146146// GetType returns the Type field value.
147147func (o * ObservabilityPipelineAddFieldsProcessor ) GetType () ObservabilityPipelineAddFieldsProcessorType {
148148 if o == nil {
@@ -172,10 +172,10 @@ func (o ObservabilityPipelineAddFieldsProcessor) MarshalJSON() ([]byte, error) {
172172 if o .UnparsedObject != nil {
173173 return datadog .Marshal (o .UnparsedObject )
174174 }
175+ toSerialize ["enabled" ] = o .Enabled
175176 toSerialize ["fields" ] = o .Fields
176177 toSerialize ["id" ] = o .Id
177178 toSerialize ["include" ] = o .Include
178- toSerialize ["inputs" ] = o .Inputs
179179 toSerialize ["type" ] = o .Type
180180
181181 for key , value := range o .AdditionalProperties {
@@ -187,15 +187,18 @@ func (o ObservabilityPipelineAddFieldsProcessor) MarshalJSON() ([]byte, error) {
187187// UnmarshalJSON deserializes the given payload.
188188func (o * ObservabilityPipelineAddFieldsProcessor ) UnmarshalJSON (bytes []byte ) (err error ) {
189189 all := struct {
190+ Enabled * bool `json:"enabled"`
190191 Fields * []ObservabilityPipelineFieldValue `json:"fields"`
191192 Id * string `json:"id"`
192193 Include * string `json:"include"`
193- Inputs * []string `json:"inputs"`
194194 Type * ObservabilityPipelineAddFieldsProcessorType `json:"type"`
195195 }{}
196196 if err = datadog .Unmarshal (bytes , & all ); err != nil {
197197 return datadog .Unmarshal (bytes , & o .UnparsedObject )
198198 }
199+ if all .Enabled == nil {
200+ return fmt .Errorf ("required field enabled missing" )
201+ }
199202 if all .Fields == nil {
200203 return fmt .Errorf ("required field fields missing" )
201204 }
@@ -205,24 +208,21 @@ func (o *ObservabilityPipelineAddFieldsProcessor) UnmarshalJSON(bytes []byte) (e
205208 if all .Include == nil {
206209 return fmt .Errorf ("required field include missing" )
207210 }
208- if all .Inputs == nil {
209- return fmt .Errorf ("required field inputs missing" )
210- }
211211 if all .Type == nil {
212212 return fmt .Errorf ("required field type missing" )
213213 }
214214 additionalProperties := make (map [string ]interface {})
215215 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
216- datadog .DeleteKeys (additionalProperties , & []string {"fields " , "id " , "include " , "inputs " , "type" })
216+ datadog .DeleteKeys (additionalProperties , & []string {"enabled " , "fields " , "id " , "include " , "type" })
217217 } else {
218218 return err
219219 }
220220
221221 hasInvalidField := false
222+ o .Enabled = * all .Enabled
222223 o .Fields = * all .Fields
223224 o .Id = * all .Id
224225 o .Include = * all .Include
225- o .Inputs = * all .Inputs
226226 if ! all .Type .IsValid () {
227227 hasInvalidField = true
228228 } else {
0 commit comments