Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19330,6 +19330,10 @@ components:
CloudWorkloadSecurityAgentRuleAction:
description: "The action the rule can perform if triggered"
properties:
disabled:
description: "Whether the action is disabled"
example: false
type: boolean
filter:
description: "SECL expression used to target the container to apply the action on"
type: string
Expand Down Expand Up @@ -19419,6 +19423,10 @@ components:
agentConstraint:
description: "The version of the Agent"
type: string
agent_version:
description: "The version constraint of the Datadog Agent the rule applies to"
example: ">=7.62"
type: string
blocking:
description: "The blocking policies that the rule belongs to"
items:
Expand Down Expand Up @@ -19458,6 +19466,11 @@ components:
description: "Whether the Agent rule is enabled"
example: true
type: boolean
every:
description: "The rate limiting duration of the Agent rule, in nanoseconds"
example: 60000000000
format: int64
type: integer
expression:
description: "The SECL expression of the Agent rule"
example: 'exec.file.name == "sh"'
Expand All @@ -19468,6 +19481,10 @@ components:
description: "A platform filter that the Agent rule is supported on."
type: string
type: array
group_id:
description: "The group of rules the Agent rule belongs to"
example: "group_id"
type: string
monitoring:
description: "The monitoring policies that the rule belongs to"
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

/** The action the rule can perform if triggered */
@JsonPropertyOrder({
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_DISABLED,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_FILTER,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_HASH,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_KILL,
Expand All @@ -28,6 +29,9 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class CloudWorkloadSecurityAgentRuleAction {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_DISABLED = "disabled";
private Boolean disabled;

public static final String JSON_PROPERTY_FILTER = "filter";
private String filter;

Expand All @@ -43,6 +47,27 @@ public class CloudWorkloadSecurityAgentRuleAction {
public static final String JSON_PROPERTY_SET = "set";
private CloudWorkloadSecurityAgentRuleActionSet set;

public CloudWorkloadSecurityAgentRuleAction disabled(Boolean disabled) {
this.disabled = disabled;
return this;
}

/**
* Whether the action is disabled
*
* @return disabled
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DISABLED)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getDisabled() {
return disabled;
}

public void setDisabled(Boolean disabled) {
this.disabled = disabled;
}

public CloudWorkloadSecurityAgentRuleAction filter(String filter) {
this.filter = filter;
return this;
Expand Down Expand Up @@ -222,7 +247,8 @@ public boolean equals(Object o) {
}
CloudWorkloadSecurityAgentRuleAction cloudWorkloadSecurityAgentRuleAction =
(CloudWorkloadSecurityAgentRuleAction) o;
return Objects.equals(this.filter, cloudWorkloadSecurityAgentRuleAction.filter)
return Objects.equals(this.disabled, cloudWorkloadSecurityAgentRuleAction.disabled)
&& Objects.equals(this.filter, cloudWorkloadSecurityAgentRuleAction.filter)
&& Objects.equals(this.hash, cloudWorkloadSecurityAgentRuleAction.hash)
&& Objects.equals(this.kill, cloudWorkloadSecurityAgentRuleAction.kill)
&& Objects.equals(this.metadata, cloudWorkloadSecurityAgentRuleAction.metadata)
Expand All @@ -233,13 +259,14 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(filter, hash, kill, metadata, set, additionalProperties);
return Objects.hash(disabled, filter, hash, kill, metadata, set, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudWorkloadSecurityAgentRuleAction {\n");
sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n");
sb.append(" filter: ").append(toIndentedString(filter)).append("\n");
sb.append(" hash: ").append(toIndentedString(hash)).append("\n");
sb.append(" kill: ").append(toIndentedString(kill)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@JsonPropertyOrder({
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_ACTIONS,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_AGENT_CONSTRAINT,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_AGENT_VERSION,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_BLOCKING,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_CATEGORY,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_CREATION_AUTHOR_UU_ID,
Expand All @@ -32,8 +33,10 @@
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_DESCRIPTION,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_DISABLED,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_ENABLED,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_EVERY,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_EXPRESSION,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_FILTERS,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_GROUP_ID,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_MONITORING,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_NAME,
CloudWorkloadSecurityAgentRuleAttributes.JSON_PROPERTY_PRODUCT_TAGS,
Expand All @@ -55,6 +58,9 @@ public class CloudWorkloadSecurityAgentRuleAttributes {
public static final String JSON_PROPERTY_AGENT_CONSTRAINT = "agentConstraint";
private String agentConstraint;

public static final String JSON_PROPERTY_AGENT_VERSION = "agent_version";
private String agentVersion;

public static final String JSON_PROPERTY_BLOCKING = "blocking";
private List<String> blocking = null;

Expand Down Expand Up @@ -82,12 +88,18 @@ public class CloudWorkloadSecurityAgentRuleAttributes {
public static final String JSON_PROPERTY_ENABLED = "enabled";
private Boolean enabled;

public static final String JSON_PROPERTY_EVERY = "every";
private Long every;

public static final String JSON_PROPERTY_EXPRESSION = "expression";
private String expression;

public static final String JSON_PROPERTY_FILTERS = "filters";
private List<String> filters = null;

public static final String JSON_PROPERTY_GROUP_ID = "group_id";
private String groupId;

public static final String JSON_PROPERTY_MONITORING = "monitoring";
private List<String> monitoring = null;

Expand Down Expand Up @@ -182,6 +194,27 @@ public void setAgentConstraint(String agentConstraint) {
this.agentConstraint = agentConstraint;
}

public CloudWorkloadSecurityAgentRuleAttributes agentVersion(String agentVersion) {
this.agentVersion = agentVersion;
return this;
}

/**
* The version constraint of the Datadog Agent the rule applies to
*
* @return agentVersion
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_AGENT_VERSION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getAgentVersion() {
return agentVersion;
}

public void setAgentVersion(String agentVersion) {
this.agentVersion = agentVersion;
}

public CloudWorkloadSecurityAgentRuleAttributes blocking(List<String> blocking) {
this.blocking = blocking;
return this;
Expand Down Expand Up @@ -392,6 +425,27 @@ public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}

public CloudWorkloadSecurityAgentRuleAttributes every(Long every) {
this.every = every;
return this;
}

/**
* The rate limiting duration of the Agent rule, in nanoseconds
*
* @return every
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_EVERY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getEvery() {
return every;
}

public void setEvery(Long every) {
this.every = every;
}

public CloudWorkloadSecurityAgentRuleAttributes expression(String expression) {
this.expression = expression;
return this;
Expand Down Expand Up @@ -442,6 +496,27 @@ public void setFilters(List<String> filters) {
this.filters = filters;
}

public CloudWorkloadSecurityAgentRuleAttributes groupId(String groupId) {
this.groupId = groupId;
return this;
}

/**
* The group of rules the Agent rule belongs to
*
* @return groupId
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_GROUP_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getGroupId() {
return groupId;
}

public void setGroupId(String groupId) {
this.groupId = groupId;
}

public CloudWorkloadSecurityAgentRuleAttributes monitoring(List<String> monitoring) {
this.monitoring = monitoring;
return this;
Expand Down Expand Up @@ -712,6 +787,7 @@ public boolean equals(Object o) {
return Objects.equals(this.actions, cloudWorkloadSecurityAgentRuleAttributes.actions)
&& Objects.equals(
this.agentConstraint, cloudWorkloadSecurityAgentRuleAttributes.agentConstraint)
&& Objects.equals(this.agentVersion, cloudWorkloadSecurityAgentRuleAttributes.agentVersion)
&& Objects.equals(this.blocking, cloudWorkloadSecurityAgentRuleAttributes.blocking)
&& Objects.equals(this.category, cloudWorkloadSecurityAgentRuleAttributes.category)
&& Objects.equals(
Expand All @@ -722,8 +798,10 @@ public boolean equals(Object o) {
&& Objects.equals(this.description, cloudWorkloadSecurityAgentRuleAttributes.description)
&& Objects.equals(this.disabled, cloudWorkloadSecurityAgentRuleAttributes.disabled)
&& Objects.equals(this.enabled, cloudWorkloadSecurityAgentRuleAttributes.enabled)
&& Objects.equals(this.every, cloudWorkloadSecurityAgentRuleAttributes.every)
&& Objects.equals(this.expression, cloudWorkloadSecurityAgentRuleAttributes.expression)
&& Objects.equals(this.filters, cloudWorkloadSecurityAgentRuleAttributes.filters)
&& Objects.equals(this.groupId, cloudWorkloadSecurityAgentRuleAttributes.groupId)
&& Objects.equals(this.monitoring, cloudWorkloadSecurityAgentRuleAttributes.monitoring)
&& Objects.equals(this.name, cloudWorkloadSecurityAgentRuleAttributes.name)
&& Objects.equals(this.productTags, cloudWorkloadSecurityAgentRuleAttributes.productTags)
Expand All @@ -744,6 +822,7 @@ public int hashCode() {
return Objects.hash(
actions,
agentConstraint,
agentVersion,
blocking,
category,
creationAuthorUuId,
Expand All @@ -753,8 +832,10 @@ public int hashCode() {
description,
disabled,
enabled,
every,
expression,
filters,
groupId,
monitoring,
name,
productTags,
Expand All @@ -773,6 +854,7 @@ public String toString() {
sb.append("class CloudWorkloadSecurityAgentRuleAttributes {\n");
sb.append(" actions: ").append(toIndentedString(actions)).append("\n");
sb.append(" agentConstraint: ").append(toIndentedString(agentConstraint)).append("\n");
sb.append(" agentVersion: ").append(toIndentedString(agentVersion)).append("\n");
sb.append(" blocking: ").append(toIndentedString(blocking)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" creationAuthorUuId: ").append(toIndentedString(creationAuthorUuId)).append("\n");
Expand All @@ -782,8 +864,10 @@ public String toString() {
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n");
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
sb.append(" every: ").append(toIndentedString(every)).append("\n");
sb.append(" expression: ").append(toIndentedString(expression)).append("\n");
sb.append(" filters: ").append(toIndentedString(filters)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
sb.append(" monitoring: ").append(toIndentedString(monitoring)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" productTags: ").append(toIndentedString(productTags)).append("\n");
Expand Down
6 changes: 4 additions & 2 deletions src/test/resources/generated-test/test-server
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ def _json_contains(actual: Any, expected: Any) -> bool:
return all(key in actual and _json_contains(actual[key], value) for key, value in expected.items())
if isinstance(expected, list) and isinstance(actual, list):
return len(expected) == len(actual) and all(
_json_contains(actual_item, expected_item) for actual_item, expected_item in zip(actual, expected)
_json_contains(actual_item, expected_item)
for actual_item, expected_item in zip(actual, expected, strict=False)
)
return actual == expected

Expand All @@ -460,7 +461,8 @@ def _slug(value: str) -> str:


def _now_iso() -> str:
return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
# datetime.UTC is Python 3.11+; this standalone runtime supports Python 3.10.
return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z") # noqa: UP017


def _read_json(path: Path) -> dict[str, Any]:
Expand Down
Loading