Skip to content

Commit

Permalink
Regenerate client from commit 32bd4ce8 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed May 22, 2024
1 parent 971e8f2 commit cf02c14
Show file tree
Hide file tree
Showing 53 changed files with 60 additions and 4,543 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-05-20 18:10:24.268068",
"spec_repo_commit": "6340fda5"
"regenerated": "2024-05-22 17:00:52.719251",
"spec_repo_commit": "32bd4ce8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-05-20 18:10:24.286542",
"spec_repo_commit": "6340fda5"
"regenerated": "2024-05-22 17:00:52.742553",
"spec_repo_commit": "32bd4ce8"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4105,6 +4105,11 @@ components:
description: The SECL expression of the Agent rule.
example: exec.file.name == \"sh\"
type: string
filters:
description: The platforms the Agent rule is supported on.
items:
type: string
type: array
name:
description: The name of the Agent rule.
example: my_agent_rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type CloudWorkloadSecurityAgentRuleCreateAttributes struct {
Enabled *bool `json:"enabled,omitempty"`
// The SECL expression of the Agent rule.
Expression string `json:"expression"`
// The platforms the Agent rule is supported on.
Filters []string `json:"filters,omitempty"`
// The name of the Agent rule.
Name string `json:"name"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -123,6 +125,34 @@ func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) SetExpression(v string)
o.Expression = v
}

// GetFilters returns the Filters field value if set, zero value otherwise.
func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) GetFilters() []string {
if o == nil || o.Filters == nil {
var ret []string
return ret
}
return o.Filters
}

// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) GetFiltersOk() (*[]string, bool) {
if o == nil || o.Filters == nil {
return nil, false
}
return &o.Filters, true
}

// HasFilters returns a boolean if a field has been set.
func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) HasFilters() bool {
return o != nil && o.Filters != nil
}

// SetFilters gets a reference to the given []string and assigns it to the Filters field.
func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) SetFilters(v []string) {
o.Filters = v
}

// GetName returns the Name field value.
func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) GetName() string {
if o == nil {
Expand Down Expand Up @@ -159,6 +189,9 @@ func (o CloudWorkloadSecurityAgentRuleCreateAttributes) MarshalJSON() ([]byte, e
toSerialize["enabled"] = o.Enabled
}
toSerialize["expression"] = o.Expression
if o.Filters != nil {
toSerialize["filters"] = o.Filters
}
toSerialize["name"] = o.Name

for key, value := range o.AdditionalProperties {
Expand All @@ -170,10 +203,11 @@ func (o CloudWorkloadSecurityAgentRuleCreateAttributes) MarshalJSON() ([]byte, e
// UnmarshalJSON deserializes the given payload.
func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Expression *string `json:"expression"`
Name *string `json:"name"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Expression *string `json:"expression"`
Filters []string `json:"filters,omitempty"`
Name *string `json:"name"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -186,13 +220,14 @@ func (o *CloudWorkloadSecurityAgentRuleCreateAttributes) UnmarshalJSON(bytes []b
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"description", "enabled", "expression", "name"})
datadog.DeleteKeys(additionalProperties, &[]string{"description", "enabled", "expression", "filters", "name"})
} else {
return err
}
o.Description = all.Description
o.Enabled = all.Enabled
o.Expression = *all.Expression
o.Filters = all.Filters
o.Name = *all.Name

if len(additionalProperties) > 0 {
Expand Down
5 changes: 4 additions & 1 deletion examples/v2/csm-threats/CreateCSMThreatsAgentRule.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ func main() {
Description: datadog.PtrString("My Agent rule"),
Enabled: datadog.PtrBool(true),
Expression: `exec.file.name == "sh"`,
Name: "examplecsmthreat",
Filters: []string{
`os == "linux"`,
},
Name: "examplecsmthreat",
},
Type: datadogV2.CLOUDWORKLOADSECURITYAGENTRULETYPE_AGENT_RULE,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-04-23T17:57:44.371Z
2024-05-22T16:22:22.200Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"data":{"attributes":{"description":"My Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","name":"testcreateacsmthreatsagentrulereturnsokresponse1713895064"},"type":"agent_rule"}}
{"data":{"attributes":{"description":"My Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":["os == \"linux\""],"name":"testcreateacsmthreatsagentrulereturnsokresponse1716394942"},"type":"agent_rule"}}
form: {}
headers:
Accept:
Expand All @@ -12,10 +12,10 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules
response:
body: '{"data":{"id":"922-a60-32v","type":"agent_rule","attributes":{"category":"Process
Activity","creationDate":1713895064438,"creator":{"name":"","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
body: '{"data":{"id":"pn4-mo8-u5r","type":"agent_rule","attributes":{"category":"Process
Activity","creationDate":1716394942614,"creator":{"name":"","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":["os
== \"linux\""],"name":"testcreateacsmthreatsagentrulereturnsokresponse1713895064","updateDate":1713895064438,"updater":{"name":"","handle":"frog@datadoghq.com"}}}}'
== \"linux\""],"name":"testcreateacsmthreatsagentrulereturnsokresponse1716394942","updateDate":1716394942614,"updater":{"name":"","handle":"frog@datadoghq.com"}}}}'
code: 200
duration: 0ms
headers:
Expand All @@ -30,7 +30,7 @@ interactions:
- '*/*'
id: 1
method: DELETE
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/922-a60-32v
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/pn4-mo8-u5r
response:
body: ''
code: 204
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit cf02c14

Please sign in to comment.