Skip to content

Commit f241375

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d383168 of spec repo
1 parent a71b122 commit f241375

5 files changed

Lines changed: 24 additions & 193 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64531,35 +64531,17 @@ components:
6453164531
type: object
6453264532
SecurityMonitoringRuleNewValueOptionsForgetAfter:
6453364533
description: The duration in days after which a learned value is forgotten.
64534-
enum:
64535-
- 1
64536-
- 2
64537-
- 7
64538-
- 14
64539-
- 21
64540-
- 28
6454164534
format: int32
64535+
maximum: 30
64536+
minimum: 1
6454264537
type: integer
64543-
x-enum-varnames:
64544-
- ONE_DAY
64545-
- TWO_DAYS
64546-
- ONE_WEEK
64547-
- TWO_WEEKS
64548-
- THREE_WEEKS
64549-
- FOUR_WEEKS
6455064538
SecurityMonitoringRuleNewValueOptionsLearningDuration:
6455164539
default: 0
6455264540
description: "The duration in days during which values are learned, and after which signals will be generated for values that\nweren't learned. If set to 0, a signal will be generated for all new values after the first value is learned."
64553-
enum:
64554-
- 0
64555-
- 1
64556-
- 7
6455764541
format: int32
64542+
maximum: 30
64543+
minimum: 0
6455864544
type: integer
64559-
x-enum-varnames:
64560-
- ZERO_DAYS
64561-
- ONE_DAY
64562-
- SEVEN_DAYS
6456364545
SecurityMonitoringRuleNewValueOptionsLearningMethod:
6456464546
default: duration
6456564547
description: The learning method used to determine when signals should be generated for values that weren't learned.

api/datadogV2/model_security_monitoring_rule_new_value_options.go

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import (
1111
// SecurityMonitoringRuleNewValueOptions Options on new value detection method.
1212
type SecurityMonitoringRuleNewValueOptions struct {
1313
// The duration in days after which a learned value is forgotten.
14-
ForgetAfter *SecurityMonitoringRuleNewValueOptionsForgetAfter `json:"forgetAfter,omitempty"`
14+
ForgetAfter *int32 `json:"forgetAfter,omitempty"`
1515
// When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
1616
InstantaneousBaseline *bool `json:"instantaneousBaseline,omitempty"`
1717
// The duration in days during which values are learned, and after which signals will be generated for values that
1818
// weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
19-
LearningDuration *SecurityMonitoringRuleNewValueOptionsLearningDuration `json:"learningDuration,omitempty"`
19+
LearningDuration *int32 `json:"learningDuration,omitempty"`
2020
// The learning method used to determine when signals should be generated for values that weren't learned.
2121
LearningMethod *SecurityMonitoringRuleNewValueOptionsLearningMethod `json:"learningMethod,omitempty"`
2222
// A number of occurrences after which signals will be generated for values that weren't learned.
@@ -32,7 +32,7 @@ type SecurityMonitoringRuleNewValueOptions struct {
3232
// will change when the set of required properties is changed.
3333
func NewSecurityMonitoringRuleNewValueOptions() *SecurityMonitoringRuleNewValueOptions {
3434
this := SecurityMonitoringRuleNewValueOptions{}
35-
var learningDuration SecurityMonitoringRuleNewValueOptionsLearningDuration = SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGDURATION_ZERO_DAYS
35+
var learningDuration int32 = 0
3636
this.LearningDuration = &learningDuration
3737
var learningMethod SecurityMonitoringRuleNewValueOptionsLearningMethod = SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGMETHOD_DURATION
3838
this.LearningMethod = &learningMethod
@@ -46,7 +46,7 @@ func NewSecurityMonitoringRuleNewValueOptions() *SecurityMonitoringRuleNewValueO
4646
// but it doesn't guarantee that properties required by API are set.
4747
func NewSecurityMonitoringRuleNewValueOptionsWithDefaults() *SecurityMonitoringRuleNewValueOptions {
4848
this := SecurityMonitoringRuleNewValueOptions{}
49-
var learningDuration SecurityMonitoringRuleNewValueOptionsLearningDuration = SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGDURATION_ZERO_DAYS
49+
var learningDuration int32 = 0
5050
this.LearningDuration = &learningDuration
5151
var learningMethod SecurityMonitoringRuleNewValueOptionsLearningMethod = SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGMETHOD_DURATION
5252
this.LearningMethod = &learningMethod
@@ -56,17 +56,17 @@ func NewSecurityMonitoringRuleNewValueOptionsWithDefaults() *SecurityMonitoringR
5656
}
5757

5858
// GetForgetAfter returns the ForgetAfter field value if set, zero value otherwise.
59-
func (o *SecurityMonitoringRuleNewValueOptions) GetForgetAfter() SecurityMonitoringRuleNewValueOptionsForgetAfter {
59+
func (o *SecurityMonitoringRuleNewValueOptions) GetForgetAfter() int32 {
6060
if o == nil || o.ForgetAfter == nil {
61-
var ret SecurityMonitoringRuleNewValueOptionsForgetAfter
61+
var ret int32
6262
return ret
6363
}
6464
return *o.ForgetAfter
6565
}
6666

6767
// GetForgetAfterOk returns a tuple with the ForgetAfter field value if set, nil otherwise
6868
// and a boolean to check if the value has been set.
69-
func (o *SecurityMonitoringRuleNewValueOptions) GetForgetAfterOk() (*SecurityMonitoringRuleNewValueOptionsForgetAfter, bool) {
69+
func (o *SecurityMonitoringRuleNewValueOptions) GetForgetAfterOk() (*int32, bool) {
7070
if o == nil || o.ForgetAfter == nil {
7171
return nil, false
7272
}
@@ -78,8 +78,8 @@ func (o *SecurityMonitoringRuleNewValueOptions) HasForgetAfter() bool {
7878
return o != nil && o.ForgetAfter != nil
7979
}
8080

81-
// SetForgetAfter gets a reference to the given SecurityMonitoringRuleNewValueOptionsForgetAfter and assigns it to the ForgetAfter field.
82-
func (o *SecurityMonitoringRuleNewValueOptions) SetForgetAfter(v SecurityMonitoringRuleNewValueOptionsForgetAfter) {
81+
// SetForgetAfter gets a reference to the given int32 and assigns it to the ForgetAfter field.
82+
func (o *SecurityMonitoringRuleNewValueOptions) SetForgetAfter(v int32) {
8383
o.ForgetAfter = &v
8484
}
8585

@@ -112,17 +112,17 @@ func (o *SecurityMonitoringRuleNewValueOptions) SetInstantaneousBaseline(v bool)
112112
}
113113

114114
// GetLearningDuration returns the LearningDuration field value if set, zero value otherwise.
115-
func (o *SecurityMonitoringRuleNewValueOptions) GetLearningDuration() SecurityMonitoringRuleNewValueOptionsLearningDuration {
115+
func (o *SecurityMonitoringRuleNewValueOptions) GetLearningDuration() int32 {
116116
if o == nil || o.LearningDuration == nil {
117-
var ret SecurityMonitoringRuleNewValueOptionsLearningDuration
117+
var ret int32
118118
return ret
119119
}
120120
return *o.LearningDuration
121121
}
122122

123123
// GetLearningDurationOk returns a tuple with the LearningDuration field value if set, nil otherwise
124124
// and a boolean to check if the value has been set.
125-
func (o *SecurityMonitoringRuleNewValueOptions) GetLearningDurationOk() (*SecurityMonitoringRuleNewValueOptionsLearningDuration, bool) {
125+
func (o *SecurityMonitoringRuleNewValueOptions) GetLearningDurationOk() (*int32, bool) {
126126
if o == nil || o.LearningDuration == nil {
127127
return nil, false
128128
}
@@ -134,8 +134,8 @@ func (o *SecurityMonitoringRuleNewValueOptions) HasLearningDuration() bool {
134134
return o != nil && o.LearningDuration != nil
135135
}
136136

137-
// SetLearningDuration gets a reference to the given SecurityMonitoringRuleNewValueOptionsLearningDuration and assigns it to the LearningDuration field.
138-
func (o *SecurityMonitoringRuleNewValueOptions) SetLearningDuration(v SecurityMonitoringRuleNewValueOptionsLearningDuration) {
137+
// SetLearningDuration gets a reference to the given int32 and assigns it to the LearningDuration field.
138+
func (o *SecurityMonitoringRuleNewValueOptions) SetLearningDuration(v int32) {
139139
o.LearningDuration = &v
140140
}
141141

@@ -226,9 +226,9 @@ func (o SecurityMonitoringRuleNewValueOptions) MarshalJSON() ([]byte, error) {
226226
// UnmarshalJSON deserializes the given payload.
227227
func (o *SecurityMonitoringRuleNewValueOptions) UnmarshalJSON(bytes []byte) (err error) {
228228
all := struct {
229-
ForgetAfter *SecurityMonitoringRuleNewValueOptionsForgetAfter `json:"forgetAfter,omitempty"`
229+
ForgetAfter *int32 `json:"forgetAfter,omitempty"`
230230
InstantaneousBaseline *bool `json:"instantaneousBaseline,omitempty"`
231-
LearningDuration *SecurityMonitoringRuleNewValueOptionsLearningDuration `json:"learningDuration,omitempty"`
231+
LearningDuration *int32 `json:"learningDuration,omitempty"`
232232
LearningMethod *SecurityMonitoringRuleNewValueOptionsLearningMethod `json:"learningMethod,omitempty"`
233233
LearningThreshold *SecurityMonitoringRuleNewValueOptionsLearningThreshold `json:"learningThreshold,omitempty"`
234234
}{}
@@ -243,17 +243,9 @@ func (o *SecurityMonitoringRuleNewValueOptions) UnmarshalJSON(bytes []byte) (err
243243
}
244244

245245
hasInvalidField := false
246-
if all.ForgetAfter != nil && !all.ForgetAfter.IsValid() {
247-
hasInvalidField = true
248-
} else {
249-
o.ForgetAfter = all.ForgetAfter
250-
}
246+
o.ForgetAfter = all.ForgetAfter
251247
o.InstantaneousBaseline = all.InstantaneousBaseline
252-
if all.LearningDuration != nil && !all.LearningDuration.IsValid() {
253-
hasInvalidField = true
254-
} else {
255-
o.LearningDuration = all.LearningDuration
256-
}
248+
o.LearningDuration = all.LearningDuration
257249
if all.LearningMethod != nil && !all.LearningMethod.IsValid() {
258250
hasInvalidField = true
259251
} else {

api/datadogV2/model_security_monitoring_rule_new_value_options_forget_after.go

Lines changed: 0 additions & 74 deletions
This file was deleted.

api/datadogV2/model_security_monitoring_rule_new_value_options_learning_duration.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

examples/v2/security-monitoring/ValidateSecurityMonitoringRule_2609327779.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ func main() {
3232
MaxSignalDuration: datadogV2.SECURITYMONITORINGRULEMAXSIGNALDURATION_TEN_MINUTES.Ptr(),
3333
DetectionMethod: datadogV2.SECURITYMONITORINGRULEDETECTIONMETHOD_NEW_VALUE.Ptr(),
3434
NewValueOptions: &datadogV2.SecurityMonitoringRuleNewValueOptions{
35-
ForgetAfter: datadogV2.SECURITYMONITORINGRULENEWVALUEOPTIONSFORGETAFTER_ONE_WEEK.Ptr(),
35+
ForgetAfter: datadog.PtrInt32(7),
3636
InstantaneousBaseline: datadog.PtrBool(true),
37-
LearningDuration: datadogV2.SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGDURATION_ONE_DAY.Ptr(),
37+
LearningDuration: datadog.PtrInt32(1),
3838
LearningThreshold: datadogV2.SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGTHRESHOLD_ZERO_OCCURRENCES.Ptr(),
3939
LearningMethod: datadogV2.SECURITYMONITORINGRULENEWVALUEOPTIONSLEARNINGMETHOD_DURATION.Ptr(),
4040
},

0 commit comments

Comments
 (0)