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 @@ -43,6 +43,7 @@ def openapi_types(_):
)

return {
"disabled": (bool,),
"filter": (str,),
"hash": (CloudWorkloadSecurityAgentRuleActionHash,),
"kill": (CloudWorkloadSecurityAgentRuleKill,),
Expand All @@ -51,6 +52,7 @@ def openapi_types(_):
}

attribute_map = {
"disabled": "disabled",
"filter": "filter",
"hash": "hash",
"kill": "kill",
Expand All @@ -60,6 +62,7 @@ def openapi_types(_):

def __init__(
self_,
disabled: Union[bool, UnsetType] = unset,
filter: Union[str, UnsetType] = unset,
hash: Union[CloudWorkloadSecurityAgentRuleActionHash, UnsetType] = unset,
kill: Union[CloudWorkloadSecurityAgentRuleKill, UnsetType] = unset,
Expand All @@ -70,6 +73,9 @@ def __init__(
"""
The action the rule can perform if triggered

:param disabled: Whether the action is disabled
:type disabled: bool, optional

:param filter: SECL expression used to target the container to apply the action on
:type filter: str, optional

Expand All @@ -85,6 +91,8 @@ def __init__(
:param set: The set action applied on the scope matching the rule
:type set: CloudWorkloadSecurityAgentRuleActionSet, optional
"""
if disabled is not unset:
kwargs["disabled"] = disabled
if filter is not unset:
kwargs["filter"] = filter
if hash is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def openapi_types(_):
return {
"actions": ([CloudWorkloadSecurityAgentRuleAction],),
"agent_constraint": (str,),
"agent_version": (str,),
"blocking": ([str],),
"category": (str,),
"creation_author_uu_id": (str,),
Expand All @@ -51,8 +52,10 @@ def openapi_types(_):
"description": (str,),
"disabled": ([str],),
"enabled": (bool,),
"every": (int,),
"expression": (str,),
"filters": ([str],),
"group_id": (str,),
"monitoring": ([str],),
"name": (str,),
"product_tags": ([str],),
Expand All @@ -67,6 +70,7 @@ def openapi_types(_):
attribute_map = {
"actions": "actions",
"agent_constraint": "agentConstraint",
"agent_version": "agent_version",
"blocking": "blocking",
"category": "category",
"creation_author_uu_id": "creationAuthorUuId",
Expand All @@ -76,8 +80,10 @@ def openapi_types(_):
"description": "description",
"disabled": "disabled",
"enabled": "enabled",
"every": "every",
"expression": "expression",
"filters": "filters",
"group_id": "group_id",
"monitoring": "monitoring",
"name": "name",
"product_tags": "product_tags",
Expand All @@ -93,6 +99,7 @@ def __init__(
self_,
actions: Union[List[CloudWorkloadSecurityAgentRuleAction], none_type, UnsetType] = unset,
agent_constraint: Union[str, UnsetType] = unset,
agent_version: Union[str, UnsetType] = unset,
blocking: Union[List[str], UnsetType] = unset,
category: Union[str, UnsetType] = unset,
creation_author_uu_id: Union[str, UnsetType] = unset,
Expand All @@ -102,8 +109,10 @@ def __init__(
description: Union[str, UnsetType] = unset,
disabled: Union[List[str], UnsetType] = unset,
enabled: Union[bool, UnsetType] = unset,
every: Union[int, UnsetType] = unset,
expression: Union[str, UnsetType] = unset,
filters: Union[List[str], UnsetType] = unset,
group_id: Union[str, UnsetType] = unset,
monitoring: Union[List[str], UnsetType] = unset,
name: Union[str, UnsetType] = unset,
product_tags: Union[List[str], UnsetType] = unset,
Expand All @@ -124,6 +133,9 @@ def __init__(
:param agent_constraint: The version of the Agent
:type agent_constraint: str, optional

:param agent_version: The version constraint of the Datadog Agent the rule applies to
:type agent_version: str, optional

:param blocking: The blocking policies that the rule belongs to
:type blocking: [str], optional

Expand Down Expand Up @@ -151,12 +163,18 @@ def __init__(
:param enabled: Whether the Agent rule is enabled
:type enabled: bool, optional

:param every: The rate limiting duration of the Agent rule, in nanoseconds
:type every: int, optional

:param expression: The SECL expression of the Agent rule
:type expression: str, optional

:param filters: The platforms the Agent rule is supported on
:type filters: [str], optional

:param group_id: The group of rules the Agent rule belongs to
:type group_id: str, optional

:param monitoring: The monitoring policies that the rule belongs to
:type monitoring: [str], optional

Expand Down Expand Up @@ -188,6 +206,8 @@ def __init__(
kwargs["actions"] = actions
if agent_constraint is not unset:
kwargs["agent_constraint"] = agent_constraint
if agent_version is not unset:
kwargs["agent_version"] = agent_version
if blocking is not unset:
kwargs["blocking"] = blocking
if category is not unset:
Expand All @@ -206,10 +226,14 @@ def __init__(
kwargs["disabled"] = disabled
if enabled is not unset:
kwargs["enabled"] = enabled
if every is not unset:
kwargs["every"] = every
if expression is not unset:
kwargs["expression"] = expression
if filters is not unset:
kwargs["filters"] = filters
if group_id is not unset:
kwargs["group_id"] = group_id
if monitoring is not unset:
kwargs["monitoring"] = monitoring
if name is not unset:
Expand Down
6 changes: 4 additions & 2 deletions tests/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