Skip to content

Commit fb6acf6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Adding when full option to the Memory Buffer options as well (#3691)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 353864b commit fb6acf6

3 files changed

Lines changed: 94 additions & 4 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40869,6 +40869,8 @@ components:
4086940869
type: integer
4087040870
type:
4087140871
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
40872+
when_full:
40873+
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
4087240874
type: object
4087340875
ObservabilityPipelineMemoryBufferSizeOptions:
4087440876
description: Options for configuring a memory buffer by queue length.
@@ -40880,6 +40882,8 @@ components:
4088040882
type: integer
4088140883
type:
4088240884
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
40885+
when_full:
40886+
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
4088340887
type: object
4088440888
ObservabilityPipelineMetadataEntry:
4088540889
description: A custom metadata entry.

api/datadogV2/model_observability_pipeline_memory_buffer_options.go

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
100134
func (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.
119156
func (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

api/datadogV2/model_observability_pipeline_memory_buffer_size_options.go

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type ObservabilityPipelineMemoryBufferSizeOptions struct {
1414
MaxEvents *int64 `json:"max_events,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 NewObservabilityPipelineMemoryBufferSizeOptions() *ObservabilityPipelineMem
2729
this := ObservabilityPipelineMemoryBufferSizeOptions{}
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 NewObservabilityPipelineMemoryBufferSizeOptionsWithDefaults() *Observabilit
3741
this := ObservabilityPipelineMemoryBufferSizeOptions{}
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 *ObservabilityPipelineMemoryBufferSizeOptions) SetType(v ObservabilityPi
96102
o.Type = &v
97103
}
98104

105+
// GetWhenFull returns the WhenFull field value if set, zero value otherwise.
106+
func (o *ObservabilityPipelineMemoryBufferSizeOptions) 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 *ObservabilityPipelineMemoryBufferSizeOptions) 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 *ObservabilityPipelineMemoryBufferSizeOptions) 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 *ObservabilityPipelineMemoryBufferSizeOptions) SetWhenFull(v ObservabilityPipelineBufferOptionsWhenFull) {
130+
o.WhenFull = &v
131+
}
132+
99133
// MarshalJSON serializes the struct using spec logic.
100134
func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, error) {
101135
toSerialize := map[string]interface{}{}
@@ -108,6 +142,9 @@ func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, err
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
@@ -120,13 +157,14 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byt
120157
all := struct {
121158
MaxEvents *int64 `json:"max_events,omitempty"`
122159
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_events", "type"})
167+
datadog.DeleteKeys(additionalProperties, &[]string{"max_events", "type", "when_full"})
130168
} else {
131169
return err
132170
}
@@ -138,6 +176,11 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byt
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

Comments
 (0)