@@ -14,6 +14,8 @@ type ObservabilityPipelineMemoryBufferOptions struct {
1414 MaxSize * int64 `json:"max_size,omitempty"`
1515 // The type of the buffer that will be configured, a memory buffer.
1616 Type * ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
17+ // Behavior when the buffer is full (block and stop accepting new events, or drop new events)
18+ WhenFull * ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
1719 // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1820 UnparsedObject map [string ]interface {} `json:"-"`
1921 AdditionalProperties map [string ]interface {} `json:"-"`
@@ -27,6 +29,8 @@ func NewObservabilityPipelineMemoryBufferOptions() *ObservabilityPipelineMemoryB
2729 this := ObservabilityPipelineMemoryBufferOptions {}
2830 var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
2931 this .Type = & typeVar
32+ var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
33+ this .WhenFull = & whenFull
3034 return & this
3135}
3236
@@ -37,6 +41,8 @@ func NewObservabilityPipelineMemoryBufferOptionsWithDefaults() *ObservabilityPip
3741 this := ObservabilityPipelineMemoryBufferOptions {}
3842 var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
3943 this .Type = & typeVar
44+ var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
45+ this .WhenFull = & whenFull
4046 return & this
4147}
4248
@@ -96,6 +102,34 @@ func (o *ObservabilityPipelineMemoryBufferOptions) SetType(v ObservabilityPipeli
96102 o .Type = & v
97103}
98104
105+ // GetWhenFull returns the WhenFull field value if set, zero value otherwise.
106+ func (o * ObservabilityPipelineMemoryBufferOptions ) GetWhenFull () ObservabilityPipelineBufferOptionsWhenFull {
107+ if o == nil || o .WhenFull == nil {
108+ var ret ObservabilityPipelineBufferOptionsWhenFull
109+ return ret
110+ }
111+ return * o .WhenFull
112+ }
113+
114+ // GetWhenFullOk returns a tuple with the WhenFull field value if set, nil otherwise
115+ // and a boolean to check if the value has been set.
116+ func (o * ObservabilityPipelineMemoryBufferOptions ) GetWhenFullOk () (* ObservabilityPipelineBufferOptionsWhenFull , bool ) {
117+ if o == nil || o .WhenFull == nil {
118+ return nil , false
119+ }
120+ return o .WhenFull , true
121+ }
122+
123+ // HasWhenFull returns a boolean if a field has been set.
124+ func (o * ObservabilityPipelineMemoryBufferOptions ) HasWhenFull () bool {
125+ return o != nil && o .WhenFull != nil
126+ }
127+
128+ // SetWhenFull gets a reference to the given ObservabilityPipelineBufferOptionsWhenFull and assigns it to the WhenFull field.
129+ func (o * ObservabilityPipelineMemoryBufferOptions ) SetWhenFull (v ObservabilityPipelineBufferOptionsWhenFull ) {
130+ o .WhenFull = & v
131+ }
132+
99133// MarshalJSON serializes the struct using spec logic.
100134func (o ObservabilityPipelineMemoryBufferOptions ) MarshalJSON () ([]byte , error ) {
101135 toSerialize := map [string ]interface {}{}
@@ -108,6 +142,9 @@ func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error)
108142 if o .Type != nil {
109143 toSerialize ["type" ] = o .Type
110144 }
145+ if o .WhenFull != nil {
146+ toSerialize ["when_full" ] = o .WhenFull
147+ }
111148
112149 for key , value := range o .AdditionalProperties {
113150 toSerialize [key ] = value
@@ -118,15 +155,16 @@ func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error)
118155// UnmarshalJSON deserializes the given payload.
119156func (o * ObservabilityPipelineMemoryBufferOptions ) UnmarshalJSON (bytes []byte ) (err error ) {
120157 all := struct {
121- MaxSize * int64 `json:"max_size,omitempty"`
122- Type * ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
158+ MaxSize * int64 `json:"max_size,omitempty"`
159+ Type * ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
160+ WhenFull * ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
123161 }{}
124162 if err = datadog .Unmarshal (bytes , & all ); err != nil {
125163 return datadog .Unmarshal (bytes , & o .UnparsedObject )
126164 }
127165 additionalProperties := make (map [string ]interface {})
128166 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
129- datadog .DeleteKeys (additionalProperties , & []string {"max_size" , "type" })
167+ datadog .DeleteKeys (additionalProperties , & []string {"max_size" , "type" , "when_full" })
130168 } else {
131169 return err
132170 }
@@ -138,6 +176,11 @@ func (o *ObservabilityPipelineMemoryBufferOptions) UnmarshalJSON(bytes []byte) (
138176 } else {
139177 o .Type = all .Type
140178 }
179+ if all .WhenFull != nil && ! all .WhenFull .IsValid () {
180+ hasInvalidField = true
181+ } else {
182+ o .WhenFull = all .WhenFull
183+ }
141184
142185 if len (additionalProperties ) > 0 {
143186 o .AdditionalProperties = additionalProperties
0 commit comments