Skip to content

Commit 6fdfe72

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Exposing set action on Terraform V2 (#3099)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 84fc502 commit 6fdfe72

65 files changed

Lines changed: 3372 additions & 1927 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-03 09:24:16.161506",
8-
"spec_repo_commit": "5906d277"
7+
"regenerated": "2025-06-04 09:10:35.424028",
8+
"spec_repo_commit": "6c99bb98"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-03 09:24:16.179321",
13-
"spec_repo_commit": "5906d277"
12+
"regenerated": "2025-06-04 09:10:35.440300",
13+
"spec_repo_commit": "6c99bb98"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7526,6 +7526,50 @@ components:
75267526
type: string
75277527
kill:
75287528
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
7529+
metadata:
7530+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
7531+
set:
7532+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
7533+
type: object
7534+
CloudWorkloadSecurityAgentRuleActionMetadata:
7535+
description: The metadata action applied on the scope matching the rule
7536+
properties:
7537+
image_tag:
7538+
description: The image tag of the metadata action
7539+
type: string
7540+
service:
7541+
description: The service of the metadata action
7542+
type: string
7543+
short_image:
7544+
description: The short image of the metadata action
7545+
type: string
7546+
type: object
7547+
CloudWorkloadSecurityAgentRuleActionSet:
7548+
description: The set action applied on the scope matching the rule
7549+
properties:
7550+
append:
7551+
description: Whether the value should be appended to the field
7552+
type: boolean
7553+
field:
7554+
description: The field of the set action
7555+
type: string
7556+
name:
7557+
description: The name of the set action
7558+
type: string
7559+
scope:
7560+
description: The scope of the set action
7561+
type: string
7562+
size:
7563+
description: The size of the set action
7564+
format: int64
7565+
type: integer
7566+
ttl:
7567+
description: The time to live of the set action
7568+
format: int64
7569+
type: integer
7570+
value:
7571+
description: The value of the set action
7572+
type: string
75297573
type: object
75307574
CloudWorkloadSecurityAgentRuleActions:
75317575
description: The array of actions the rule can perform if triggered
@@ -7541,6 +7585,11 @@ components:
75417585
agentConstraint:
75427586
description: The version of the Agent
75437587
type: string
7588+
blocking:
7589+
description: The blocking policies that the rule belongs to
7590+
items:
7591+
type: string
7592+
type: array
75447593
category:
75457594
description: The category of the Agent rule
75467595
example: Process Activity
@@ -7564,6 +7613,11 @@ components:
75647613
description: The description of the Agent rule
75657614
example: My Agent rule
75667615
type: string
7616+
disabled:
7617+
description: The disabled policies that the rule belongs to
7618+
items:
7619+
type: string
7620+
type: array
75677621
enabled:
75687622
description: Whether the Agent rule is enabled
75697623
example: true
@@ -7577,6 +7631,11 @@ components:
75777631
items:
75787632
type: string
75797633
type: array
7634+
monitoring:
7635+
description: The monitoring policies that the rule belongs to
7636+
items:
7637+
type: string
7638+
type: array
75807639
name:
75817640
description: The name of the Agent rule
75827641
example: my_agent_rule
@@ -7611,10 +7670,22 @@ components:
76117670
CloudWorkloadSecurityAgentRuleCreateAttributes:
76127671
description: Create a new Cloud Workload Security Agent rule.
76137672
properties:
7673+
actions:
7674+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7675+
blocking:
7676+
description: The blocking policies that the rule belongs to
7677+
items:
7678+
type: string
7679+
type: array
76147680
description:
76157681
description: The description of the Agent rule.
76167682
example: My Agent rule
76177683
type: string
7684+
disabled:
7685+
description: The disabled policies that the rule belongs to
7686+
items:
7687+
type: string
7688+
type: array
76187689
enabled:
76197690
description: Whether the Agent rule is enabled
76207691
example: true
@@ -7628,6 +7699,11 @@ components:
76287699
items:
76297700
type: string
76307701
type: array
7702+
monitoring:
7703+
description: The monitoring policies that the rule belongs to
7704+
items:
7705+
type: string
7706+
type: array
76317707
name:
76327708
description: The name of the Agent rule.
76337709
example: my_agent_rule
@@ -7718,10 +7794,22 @@ components:
77187794
CloudWorkloadSecurityAgentRuleUpdateAttributes:
77197795
description: Update an existing Cloud Workload Security Agent rule
77207796
properties:
7797+
actions:
7798+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7799+
blocking:
7800+
description: The blocking policies that the rule belongs to
7801+
items:
7802+
type: string
7803+
type: array
77217804
description:
77227805
description: The description of the Agent rule
77237806
example: My Agent rule
77247807
type: string
7808+
disabled:
7809+
description: The disabled policies that the rule belongs to
7810+
items:
7811+
type: string
7812+
type: array
77257813
enabled:
77267814
description: Whether the Agent rule is enabled
77277815
example: true
@@ -7730,6 +7818,11 @@ components:
77307818
description: The SECL expression of the Agent rule
77317819
example: exec.file.name == "sh"
77327820
type: string
7821+
monitoring:
7822+
description: The monitoring policies that the rule belongs to
7823+
items:
7824+
type: string
7825+
type: array
77337826
policy_id:
77347827
description: The ID of the policy where the Agent rule is saved
77357828
example: a8c8e364-6556-434d-b798-a4c23de29c0b

api/datadogV2/model_cloud_workload_security_agent_rule_action.go

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ type CloudWorkloadSecurityAgentRuleAction struct {
1414
Filter *string `json:"filter,omitempty"`
1515
// Kill system call applied on the container matching the rule
1616
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
17+
// The metadata action applied on the scope matching the rule
18+
Metadata *CloudWorkloadSecurityAgentRuleActionMetadata `json:"metadata,omitempty"`
19+
// The set action applied on the scope matching the rule
20+
Set *CloudWorkloadSecurityAgentRuleActionSet `json:"set,omitempty"`
1721
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1822
UnparsedObject map[string]interface{} `json:"-"`
1923
AdditionalProperties map[string]interface{} `json:"-"`
@@ -92,6 +96,62 @@ func (o *CloudWorkloadSecurityAgentRuleAction) SetKill(v CloudWorkloadSecurityAg
9296
o.Kill = &v
9397
}
9498

99+
// GetMetadata returns the Metadata field value if set, zero value otherwise.
100+
func (o *CloudWorkloadSecurityAgentRuleAction) GetMetadata() CloudWorkloadSecurityAgentRuleActionMetadata {
101+
if o == nil || o.Metadata == nil {
102+
var ret CloudWorkloadSecurityAgentRuleActionMetadata
103+
return ret
104+
}
105+
return *o.Metadata
106+
}
107+
108+
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
109+
// and a boolean to check if the value has been set.
110+
func (o *CloudWorkloadSecurityAgentRuleAction) GetMetadataOk() (*CloudWorkloadSecurityAgentRuleActionMetadata, bool) {
111+
if o == nil || o.Metadata == nil {
112+
return nil, false
113+
}
114+
return o.Metadata, true
115+
}
116+
117+
// HasMetadata returns a boolean if a field has been set.
118+
func (o *CloudWorkloadSecurityAgentRuleAction) HasMetadata() bool {
119+
return o != nil && o.Metadata != nil
120+
}
121+
122+
// SetMetadata gets a reference to the given CloudWorkloadSecurityAgentRuleActionMetadata and assigns it to the Metadata field.
123+
func (o *CloudWorkloadSecurityAgentRuleAction) SetMetadata(v CloudWorkloadSecurityAgentRuleActionMetadata) {
124+
o.Metadata = &v
125+
}
126+
127+
// GetSet returns the Set field value if set, zero value otherwise.
128+
func (o *CloudWorkloadSecurityAgentRuleAction) GetSet() CloudWorkloadSecurityAgentRuleActionSet {
129+
if o == nil || o.Set == nil {
130+
var ret CloudWorkloadSecurityAgentRuleActionSet
131+
return ret
132+
}
133+
return *o.Set
134+
}
135+
136+
// GetSetOk returns a tuple with the Set field value if set, nil otherwise
137+
// and a boolean to check if the value has been set.
138+
func (o *CloudWorkloadSecurityAgentRuleAction) GetSetOk() (*CloudWorkloadSecurityAgentRuleActionSet, bool) {
139+
if o == nil || o.Set == nil {
140+
return nil, false
141+
}
142+
return o.Set, true
143+
}
144+
145+
// HasSet returns a boolean if a field has been set.
146+
func (o *CloudWorkloadSecurityAgentRuleAction) HasSet() bool {
147+
return o != nil && o.Set != nil
148+
}
149+
150+
// SetSet gets a reference to the given CloudWorkloadSecurityAgentRuleActionSet and assigns it to the Set field.
151+
func (o *CloudWorkloadSecurityAgentRuleAction) SetSet(v CloudWorkloadSecurityAgentRuleActionSet) {
152+
o.Set = &v
153+
}
154+
95155
// MarshalJSON serializes the struct using spec logic.
96156
func (o CloudWorkloadSecurityAgentRuleAction) MarshalJSON() ([]byte, error) {
97157
toSerialize := map[string]interface{}{}
@@ -104,6 +164,12 @@ func (o CloudWorkloadSecurityAgentRuleAction) MarshalJSON() ([]byte, error) {
104164
if o.Kill != nil {
105165
toSerialize["kill"] = o.Kill
106166
}
167+
if o.Metadata != nil {
168+
toSerialize["metadata"] = o.Metadata
169+
}
170+
if o.Set != nil {
171+
toSerialize["set"] = o.Set
172+
}
107173

108174
for key, value := range o.AdditionalProperties {
109175
toSerialize[key] = value
@@ -114,15 +180,17 @@ func (o CloudWorkloadSecurityAgentRuleAction) MarshalJSON() ([]byte, error) {
114180
// UnmarshalJSON deserializes the given payload.
115181
func (o *CloudWorkloadSecurityAgentRuleAction) UnmarshalJSON(bytes []byte) (err error) {
116182
all := struct {
117-
Filter *string `json:"filter,omitempty"`
118-
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
183+
Filter *string `json:"filter,omitempty"`
184+
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
185+
Metadata *CloudWorkloadSecurityAgentRuleActionMetadata `json:"metadata,omitempty"`
186+
Set *CloudWorkloadSecurityAgentRuleActionSet `json:"set,omitempty"`
119187
}{}
120188
if err = datadog.Unmarshal(bytes, &all); err != nil {
121189
return datadog.Unmarshal(bytes, &o.UnparsedObject)
122190
}
123191
additionalProperties := make(map[string]interface{})
124192
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
125-
datadog.DeleteKeys(additionalProperties, &[]string{"filter", "kill"})
193+
datadog.DeleteKeys(additionalProperties, &[]string{"filter", "kill", "metadata", "set"})
126194
} else {
127195
return err
128196
}
@@ -133,6 +201,14 @@ func (o *CloudWorkloadSecurityAgentRuleAction) UnmarshalJSON(bytes []byte) (err
133201
hasInvalidField = true
134202
}
135203
o.Kill = all.Kill
204+
if all.Metadata != nil && all.Metadata.UnparsedObject != nil && o.UnparsedObject == nil {
205+
hasInvalidField = true
206+
}
207+
o.Metadata = all.Metadata
208+
if all.Set != nil && all.Set.UnparsedObject != nil && o.UnparsedObject == nil {
209+
hasInvalidField = true
210+
}
211+
o.Set = all.Set
136212

137213
if len(additionalProperties) > 0 {
138214
o.AdditionalProperties = additionalProperties

0 commit comments

Comments
 (0)