Skip to content

Commit 8cadf7c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Workflow Automation - Add allowedValues to InputSchemaParameters (DataDog#3694)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent fb6acf6 commit 8cadf7c

4 files changed

Lines changed: 85 additions & 100 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31064,6 +31064,11 @@ components:
3106431064
InputSchemaParameters:
3106531065
description: The definition of `InputSchemaParameters` object.
3106631066
properties:
31067+
allowExtraValues:
31068+
description: The `InputSchemaParameters` `allowExtraValues`.
31069+
type: boolean
31070+
allowedValues:
31071+
description: The `InputSchemaParameters` `allowedValues`.
3106731072
defaultValue:
3106831073
description: The `InputSchemaParameters` `defaultValue`.
3106931074
description:
@@ -40869,8 +40874,6 @@ components:
4086940874
type: integer
4087040875
type:
4087140876
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
40872-
when_full:
40873-
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
4087440877
type: object
4087540878
ObservabilityPipelineMemoryBufferSizeOptions:
4087640879
description: Options for configuring a memory buffer by queue length.
@@ -40882,8 +40885,6 @@ components:
4088240885
type: integer
4088340886
type:
4088440887
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
40885-
when_full:
40886-
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
4088740888
type: object
4088840889
ObservabilityPipelineMetadataEntry:
4088940890
description: A custom metadata entry.

api/datadogV2/model_input_schema_parameters.go

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212

1313
// InputSchemaParameters The definition of `InputSchemaParameters` object.
1414
type InputSchemaParameters struct {
15+
// The `InputSchemaParameters` `allowExtraValues`.
16+
AllowExtraValues *bool `json:"allowExtraValues,omitempty"`
17+
// The `InputSchemaParameters` `allowedValues`.
18+
AllowedValues interface{} `json:"allowedValues,omitempty"`
1519
// The `InputSchemaParameters` `defaultValue`.
1620
DefaultValue interface{} `json:"defaultValue,omitempty"`
1721
// The `InputSchemaParameters` `description`.
@@ -46,6 +50,62 @@ func NewInputSchemaParametersWithDefaults() *InputSchemaParameters {
4650
return &this
4751
}
4852

53+
// GetAllowExtraValues returns the AllowExtraValues field value if set, zero value otherwise.
54+
func (o *InputSchemaParameters) GetAllowExtraValues() bool {
55+
if o == nil || o.AllowExtraValues == nil {
56+
var ret bool
57+
return ret
58+
}
59+
return *o.AllowExtraValues
60+
}
61+
62+
// GetAllowExtraValuesOk returns a tuple with the AllowExtraValues field value if set, nil otherwise
63+
// and a boolean to check if the value has been set.
64+
func (o *InputSchemaParameters) GetAllowExtraValuesOk() (*bool, bool) {
65+
if o == nil || o.AllowExtraValues == nil {
66+
return nil, false
67+
}
68+
return o.AllowExtraValues, true
69+
}
70+
71+
// HasAllowExtraValues returns a boolean if a field has been set.
72+
func (o *InputSchemaParameters) HasAllowExtraValues() bool {
73+
return o != nil && o.AllowExtraValues != nil
74+
}
75+
76+
// SetAllowExtraValues gets a reference to the given bool and assigns it to the AllowExtraValues field.
77+
func (o *InputSchemaParameters) SetAllowExtraValues(v bool) {
78+
o.AllowExtraValues = &v
79+
}
80+
81+
// GetAllowedValues returns the AllowedValues field value if set, zero value otherwise.
82+
func (o *InputSchemaParameters) GetAllowedValues() interface{} {
83+
if o == nil || o.AllowedValues == nil {
84+
var ret interface{}
85+
return ret
86+
}
87+
return o.AllowedValues
88+
}
89+
90+
// GetAllowedValuesOk returns a tuple with the AllowedValues field value if set, nil otherwise
91+
// and a boolean to check if the value has been set.
92+
func (o *InputSchemaParameters) GetAllowedValuesOk() (*interface{}, bool) {
93+
if o == nil || o.AllowedValues == nil {
94+
return nil, false
95+
}
96+
return &o.AllowedValues, true
97+
}
98+
99+
// HasAllowedValues returns a boolean if a field has been set.
100+
func (o *InputSchemaParameters) HasAllowedValues() bool {
101+
return o != nil && o.AllowedValues != nil
102+
}
103+
104+
// SetAllowedValues gets a reference to the given interface{} and assigns it to the AllowedValues field.
105+
func (o *InputSchemaParameters) SetAllowedValues(v interface{}) {
106+
o.AllowedValues = v
107+
}
108+
49109
// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise.
50110
func (o *InputSchemaParameters) GetDefaultValue() interface{} {
51111
if o == nil || o.DefaultValue == nil {
@@ -182,6 +242,12 @@ func (o InputSchemaParameters) MarshalJSON() ([]byte, error) {
182242
if o.UnparsedObject != nil {
183243
return datadog.Marshal(o.UnparsedObject)
184244
}
245+
if o.AllowExtraValues != nil {
246+
toSerialize["allowExtraValues"] = o.AllowExtraValues
247+
}
248+
if o.AllowedValues != nil {
249+
toSerialize["allowedValues"] = o.AllowedValues
250+
}
185251
if o.DefaultValue != nil {
186252
toSerialize["defaultValue"] = o.DefaultValue
187253
}
@@ -203,11 +269,13 @@ func (o InputSchemaParameters) MarshalJSON() ([]byte, error) {
203269
// UnmarshalJSON deserializes the given payload.
204270
func (o *InputSchemaParameters) UnmarshalJSON(bytes []byte) (err error) {
205271
all := struct {
206-
DefaultValue interface{} `json:"defaultValue,omitempty"`
207-
Description *string `json:"description,omitempty"`
208-
Label *string `json:"label,omitempty"`
209-
Name *string `json:"name"`
210-
Type *InputSchemaParametersType `json:"type"`
272+
AllowExtraValues *bool `json:"allowExtraValues,omitempty"`
273+
AllowedValues interface{} `json:"allowedValues,omitempty"`
274+
DefaultValue interface{} `json:"defaultValue,omitempty"`
275+
Description *string `json:"description,omitempty"`
276+
Label *string `json:"label,omitempty"`
277+
Name *string `json:"name"`
278+
Type *InputSchemaParametersType `json:"type"`
211279
}{}
212280
if err = datadog.Unmarshal(bytes, &all); err != nil {
213281
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -220,12 +288,14 @@ func (o *InputSchemaParameters) UnmarshalJSON(bytes []byte) (err error) {
220288
}
221289
additionalProperties := make(map[string]interface{})
222290
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
223-
datadog.DeleteKeys(additionalProperties, &[]string{"defaultValue", "description", "label", "name", "type"})
291+
datadog.DeleteKeys(additionalProperties, &[]string{"allowExtraValues", "allowedValues", "defaultValue", "description", "label", "name", "type"})
224292
} else {
225293
return err
226294
}
227295

228296
hasInvalidField := false
297+
o.AllowExtraValues = all.AllowExtraValues
298+
o.AllowedValues = all.AllowedValues
229299
o.DefaultValue = all.DefaultValue
230300
o.Description = all.Description
231301
o.Label = all.Label

api/datadogV2/model_observability_pipeline_memory_buffer_options.go

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ 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"`
1917
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2018
UnparsedObject map[string]interface{} `json:"-"`
2119
AdditionalProperties map[string]interface{} `json:"-"`
@@ -29,8 +27,6 @@ func NewObservabilityPipelineMemoryBufferOptions() *ObservabilityPipelineMemoryB
2927
this := ObservabilityPipelineMemoryBufferOptions{}
3028
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
3129
this.Type = &typeVar
32-
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
33-
this.WhenFull = &whenFull
3430
return &this
3531
}
3632

@@ -41,8 +37,6 @@ func NewObservabilityPipelineMemoryBufferOptionsWithDefaults() *ObservabilityPip
4137
this := ObservabilityPipelineMemoryBufferOptions{}
4238
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
4339
this.Type = &typeVar
44-
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
45-
this.WhenFull = &whenFull
4640
return &this
4741
}
4842

@@ -102,34 +96,6 @@ func (o *ObservabilityPipelineMemoryBufferOptions) SetType(v ObservabilityPipeli
10296
o.Type = &v
10397
}
10498

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-
13399
// MarshalJSON serializes the struct using spec logic.
134100
func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error) {
135101
toSerialize := map[string]interface{}{}
@@ -142,9 +108,6 @@ func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error)
142108
if o.Type != nil {
143109
toSerialize["type"] = o.Type
144110
}
145-
if o.WhenFull != nil {
146-
toSerialize["when_full"] = o.WhenFull
147-
}
148111

149112
for key, value := range o.AdditionalProperties {
150113
toSerialize[key] = value
@@ -155,16 +118,15 @@ func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error)
155118
// UnmarshalJSON deserializes the given payload.
156119
func (o *ObservabilityPipelineMemoryBufferOptions) UnmarshalJSON(bytes []byte) (err error) {
157120
all := struct {
158-
MaxSize *int64 `json:"max_size,omitempty"`
159-
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
160-
WhenFull *ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
121+
MaxSize *int64 `json:"max_size,omitempty"`
122+
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
161123
}{}
162124
if err = datadog.Unmarshal(bytes, &all); err != nil {
163125
return datadog.Unmarshal(bytes, &o.UnparsedObject)
164126
}
165127
additionalProperties := make(map[string]interface{})
166128
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
167-
datadog.DeleteKeys(additionalProperties, &[]string{"max_size", "type", "when_full"})
129+
datadog.DeleteKeys(additionalProperties, &[]string{"max_size", "type"})
168130
} else {
169131
return err
170132
}
@@ -176,11 +138,6 @@ func (o *ObservabilityPipelineMemoryBufferOptions) UnmarshalJSON(bytes []byte) (
176138
} else {
177139
o.Type = all.Type
178140
}
179-
if all.WhenFull != nil && !all.WhenFull.IsValid() {
180-
hasInvalidField = true
181-
} else {
182-
o.WhenFull = all.WhenFull
183-
}
184141

185142
if len(additionalProperties) > 0 {
186143
o.AdditionalProperties = additionalProperties

api/datadogV2/model_observability_pipeline_memory_buffer_size_options.go

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ 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"`
1917
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2018
UnparsedObject map[string]interface{} `json:"-"`
2119
AdditionalProperties map[string]interface{} `json:"-"`
@@ -29,8 +27,6 @@ func NewObservabilityPipelineMemoryBufferSizeOptions() *ObservabilityPipelineMem
2927
this := ObservabilityPipelineMemoryBufferSizeOptions{}
3028
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
3129
this.Type = &typeVar
32-
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
33-
this.WhenFull = &whenFull
3430
return &this
3531
}
3632

@@ -41,8 +37,6 @@ func NewObservabilityPipelineMemoryBufferSizeOptionsWithDefaults() *Observabilit
4137
this := ObservabilityPipelineMemoryBufferSizeOptions{}
4238
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
4339
this.Type = &typeVar
44-
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
45-
this.WhenFull = &whenFull
4640
return &this
4741
}
4842

@@ -102,34 +96,6 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) SetType(v ObservabilityPi
10296
o.Type = &v
10397
}
10498

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-
13399
// MarshalJSON serializes the struct using spec logic.
134100
func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, error) {
135101
toSerialize := map[string]interface{}{}
@@ -142,9 +108,6 @@ func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, err
142108
if o.Type != nil {
143109
toSerialize["type"] = o.Type
144110
}
145-
if o.WhenFull != nil {
146-
toSerialize["when_full"] = o.WhenFull
147-
}
148111

149112
for key, value := range o.AdditionalProperties {
150113
toSerialize[key] = value
@@ -157,14 +120,13 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byt
157120
all := struct {
158121
MaxEvents *int64 `json:"max_events,omitempty"`
159122
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
160-
WhenFull *ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
161123
}{}
162124
if err = datadog.Unmarshal(bytes, &all); err != nil {
163125
return datadog.Unmarshal(bytes, &o.UnparsedObject)
164126
}
165127
additionalProperties := make(map[string]interface{})
166128
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
167-
datadog.DeleteKeys(additionalProperties, &[]string{"max_events", "type", "when_full"})
129+
datadog.DeleteKeys(additionalProperties, &[]string{"max_events", "type"})
168130
} else {
169131
return err
170132
}
@@ -176,11 +138,6 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byt
176138
} else {
177139
o.Type = all.Type
178140
}
179-
if all.WhenFull != nil && !all.WhenFull.IsValid() {
180-
hasInvalidField = true
181-
} else {
182-
o.WhenFull = all.WhenFull
183-
}
184141

185142
if len(additionalProperties) > 0 {
186143
o.AdditionalProperties = additionalProperties

0 commit comments

Comments
 (0)