Skip to content

Commit 2520d5c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[SIEM] Include ruleId in SecurityMonitoringRuleConvertResponse (#3345)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 6b5a96a commit 2520d5c

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39011,6 +39011,9 @@ components:
3901139011
SecurityMonitoringRuleConvertResponse:
3901239012
description: Result of the convert rule request containing Terraform content.
3901339013
properties:
39014+
ruleId:
39015+
description: the ID of the rule.
39016+
type: string
3901439017
terraformContent:
3901539018
description: Terraform string as a result of converting the rule from JSON.
3901639019
type: string

api/datadogV2/model_security_monitoring_rule_convert_response.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010

1111
// SecurityMonitoringRuleConvertResponse Result of the convert rule request containing Terraform content.
1212
type SecurityMonitoringRuleConvertResponse struct {
13+
// the ID of the rule.
14+
RuleId *string `json:"ruleId,omitempty"`
1315
// Terraform string as a result of converting the rule from JSON.
1416
TerraformContent *string `json:"terraformContent,omitempty"`
1517
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -34,6 +36,34 @@ func NewSecurityMonitoringRuleConvertResponseWithDefaults() *SecurityMonitoringR
3436
return &this
3537
}
3638

39+
// GetRuleId returns the RuleId field value if set, zero value otherwise.
40+
func (o *SecurityMonitoringRuleConvertResponse) GetRuleId() string {
41+
if o == nil || o.RuleId == nil {
42+
var ret string
43+
return ret
44+
}
45+
return *o.RuleId
46+
}
47+
48+
// GetRuleIdOk returns a tuple with the RuleId field value if set, nil otherwise
49+
// and a boolean to check if the value has been set.
50+
func (o *SecurityMonitoringRuleConvertResponse) GetRuleIdOk() (*string, bool) {
51+
if o == nil || o.RuleId == nil {
52+
return nil, false
53+
}
54+
return o.RuleId, true
55+
}
56+
57+
// HasRuleId returns a boolean if a field has been set.
58+
func (o *SecurityMonitoringRuleConvertResponse) HasRuleId() bool {
59+
return o != nil && o.RuleId != nil
60+
}
61+
62+
// SetRuleId gets a reference to the given string and assigns it to the RuleId field.
63+
func (o *SecurityMonitoringRuleConvertResponse) SetRuleId(v string) {
64+
o.RuleId = &v
65+
}
66+
3767
// GetTerraformContent returns the TerraformContent field value if set, zero value otherwise.
3868
func (o *SecurityMonitoringRuleConvertResponse) GetTerraformContent() string {
3969
if o == nil || o.TerraformContent == nil {
@@ -68,6 +98,9 @@ func (o SecurityMonitoringRuleConvertResponse) MarshalJSON() ([]byte, error) {
6898
if o.UnparsedObject != nil {
6999
return datadog.Marshal(o.UnparsedObject)
70100
}
101+
if o.RuleId != nil {
102+
toSerialize["ruleId"] = o.RuleId
103+
}
71104
if o.TerraformContent != nil {
72105
toSerialize["terraformContent"] = o.TerraformContent
73106
}
@@ -81,17 +114,19 @@ func (o SecurityMonitoringRuleConvertResponse) MarshalJSON() ([]byte, error) {
81114
// UnmarshalJSON deserializes the given payload.
82115
func (o *SecurityMonitoringRuleConvertResponse) UnmarshalJSON(bytes []byte) (err error) {
83116
all := struct {
117+
RuleId *string `json:"ruleId,omitempty"`
84118
TerraformContent *string `json:"terraformContent,omitempty"`
85119
}{}
86120
if err = datadog.Unmarshal(bytes, &all); err != nil {
87121
return datadog.Unmarshal(bytes, &o.UnparsedObject)
88122
}
89123
additionalProperties := make(map[string]interface{})
90124
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
91-
datadog.DeleteKeys(additionalProperties, &[]string{"terraformContent"})
125+
datadog.DeleteKeys(additionalProperties, &[]string{"ruleId", "terraformContent"})
92126
} else {
93127
return err
94128
}
129+
o.RuleId = all.RuleId
95130
o.TerraformContent = all.TerraformContent
96131

97132
if len(additionalProperties) > 0 {

0 commit comments

Comments
 (0)