Skip to content
Closed
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
9 changes: 9 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19082,6 +19082,11 @@ components:
format: int32
maximum: 2147483647
type: integer
contentPackUpdateAvailable:
description: "Whether an update is available for the content pack this policy is based on"
example: false
nullable: true
type: boolean
datadogManaged:
description: "Whether the policy is managed by Datadog"
example: false
Expand Down Expand Up @@ -19148,6 +19153,10 @@ components:
format: int32
maximum: 2147483647
type: integer
sourceDefaultPolicyId:
description: "The ID of the Datadog managed policy this policy is derived from"
example: "default.policy"
type: string
updateDate:
description: "Timestamp in milliseconds when the policy was last updated"
example: 1624366480320
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.openapitools.jackson.nullable.JsonNullable;

/** A Cloud Workload Security Agent policy returned by the API */
@JsonPropertyOrder({
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_BLOCKING_RULES_COUNT,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_CONTENT_PACK_UPDATE_AVAILABLE,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_DATADOG_MANAGED,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_DESCRIPTION,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_DISABLED_RULES_COUNT,
Expand All @@ -34,6 +36,7 @@
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_POLICY_VERSION,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_PRIORITY,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_RULE_COUNT,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_SOURCE_DEFAULT_POLICY_ID,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_UPDATE_DATE,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_UPDATED_AT,
CloudWorkloadSecurityAgentPolicyAttributes.JSON_PROPERTY_UPDATER,
Expand All @@ -46,6 +49,10 @@ public class CloudWorkloadSecurityAgentPolicyAttributes {
public static final String JSON_PROPERTY_BLOCKING_RULES_COUNT = "blockingRulesCount";
private Integer blockingRulesCount;

public static final String JSON_PROPERTY_CONTENT_PACK_UPDATE_AVAILABLE =
"contentPackUpdateAvailable";
private JsonNullable<Boolean> contentPackUpdateAvailable = JsonNullable.<Boolean>undefined();

public static final String JSON_PROPERTY_DATADOG_MANAGED = "datadogManaged";
private Boolean datadogManaged;

Expand Down Expand Up @@ -85,6 +92,9 @@ public class CloudWorkloadSecurityAgentPolicyAttributes {
public static final String JSON_PROPERTY_RULE_COUNT = "ruleCount";
private Integer ruleCount;

public static final String JSON_PROPERTY_SOURCE_DEFAULT_POLICY_ID = "sourceDefaultPolicyId";
private String sourceDefaultPolicyId;

public static final String JSON_PROPERTY_UPDATE_DATE = "updateDate";
private Long updateDate;

Expand Down Expand Up @@ -118,6 +128,39 @@ public void setBlockingRulesCount(Integer blockingRulesCount) {
this.blockingRulesCount = blockingRulesCount;
}

public CloudWorkloadSecurityAgentPolicyAttributes contentPackUpdateAvailable(
Boolean contentPackUpdateAvailable) {
this.contentPackUpdateAvailable = JsonNullable.<Boolean>of(contentPackUpdateAvailable);
return this;
}

/**
* Whether an update is available for the content pack this policy is based on
*
* @return contentPackUpdateAvailable
*/
@jakarta.annotation.Nullable
@JsonIgnore
public Boolean getContentPackUpdateAvailable() {
return contentPackUpdateAvailable.orElse(null);
}

@JsonProperty(JSON_PROPERTY_CONTENT_PACK_UPDATE_AVAILABLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable<Boolean> getContentPackUpdateAvailable_JsonNullable() {
return contentPackUpdateAvailable;
}

@JsonProperty(JSON_PROPERTY_CONTENT_PACK_UPDATE_AVAILABLE)
public void setContentPackUpdateAvailable_JsonNullable(
JsonNullable<Boolean> contentPackUpdateAvailable) {
this.contentPackUpdateAvailable = contentPackUpdateAvailable;
}

public void setContentPackUpdateAvailable(Boolean contentPackUpdateAvailable) {
this.contentPackUpdateAvailable = JsonNullable.<Boolean>of(contentPackUpdateAvailable);
}

public CloudWorkloadSecurityAgentPolicyAttributes datadogManaged(Boolean datadogManaged) {
this.datadogManaged = datadogManaged;
return this;
Expand Down Expand Up @@ -411,6 +454,28 @@ public void setRuleCount(Integer ruleCount) {
this.ruleCount = ruleCount;
}

public CloudWorkloadSecurityAgentPolicyAttributes sourceDefaultPolicyId(
String sourceDefaultPolicyId) {
this.sourceDefaultPolicyId = sourceDefaultPolicyId;
return this;
}

/**
* The ID of the Datadog managed policy this policy is derived from
*
* @return sourceDefaultPolicyId
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SOURCE_DEFAULT_POLICY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSourceDefaultPolicyId() {
return sourceDefaultPolicyId;
}

public void setSourceDefaultPolicyId(String sourceDefaultPolicyId) {
this.sourceDefaultPolicyId = sourceDefaultPolicyId;
}

public CloudWorkloadSecurityAgentPolicyAttributes updateDate(Long updateDate) {
this.updateDate = updateDate;
return this;
Expand Down Expand Up @@ -581,6 +646,9 @@ public boolean equals(Object o) {
(CloudWorkloadSecurityAgentPolicyAttributes) o;
return Objects.equals(
this.blockingRulesCount, cloudWorkloadSecurityAgentPolicyAttributes.blockingRulesCount)
&& Objects.equals(
this.contentPackUpdateAvailable,
cloudWorkloadSecurityAgentPolicyAttributes.contentPackUpdateAvailable)
&& Objects.equals(
this.datadogManaged, cloudWorkloadSecurityAgentPolicyAttributes.datadogManaged)
&& Objects.equals(this.description, cloudWorkloadSecurityAgentPolicyAttributes.description)
Expand All @@ -600,6 +668,9 @@ public boolean equals(Object o) {
this.policyVersion, cloudWorkloadSecurityAgentPolicyAttributes.policyVersion)
&& Objects.equals(this.priority, cloudWorkloadSecurityAgentPolicyAttributes.priority)
&& Objects.equals(this.ruleCount, cloudWorkloadSecurityAgentPolicyAttributes.ruleCount)
&& Objects.equals(
this.sourceDefaultPolicyId,
cloudWorkloadSecurityAgentPolicyAttributes.sourceDefaultPolicyId)
&& Objects.equals(this.updateDate, cloudWorkloadSecurityAgentPolicyAttributes.updateDate)
&& Objects.equals(this.updatedAt, cloudWorkloadSecurityAgentPolicyAttributes.updatedAt)
&& Objects.equals(this.updater, cloudWorkloadSecurityAgentPolicyAttributes.updater)
Expand All @@ -613,6 +684,7 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
blockingRulesCount,
contentPackUpdateAvailable,
datadogManaged,
description,
disabledRulesCount,
Expand All @@ -626,6 +698,7 @@ public int hashCode() {
policyVersion,
priority,
ruleCount,
sourceDefaultPolicyId,
updateDate,
updatedAt,
updater,
Expand All @@ -638,6 +711,9 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudWorkloadSecurityAgentPolicyAttributes {\n");
sb.append(" blockingRulesCount: ").append(toIndentedString(blockingRulesCount)).append("\n");
sb.append(" contentPackUpdateAvailable: ")
.append(toIndentedString(contentPackUpdateAvailable))
.append("\n");
sb.append(" datadogManaged: ").append(toIndentedString(datadogManaged)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" disabledRulesCount: ").append(toIndentedString(disabledRulesCount)).append("\n");
Expand All @@ -653,6 +729,9 @@ public String toString() {
sb.append(" policyVersion: ").append(toIndentedString(policyVersion)).append("\n");
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
sb.append(" ruleCount: ").append(toIndentedString(ruleCount)).append("\n");
sb.append(" sourceDefaultPolicyId: ")
.append(toIndentedString(sourceDefaultPolicyId))
.append("\n");
sb.append(" updateDate: ").append(toIndentedString(updateDate)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" updater: ").append(toIndentedString(updater)).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