diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 81f698c5f32..fb313bb7bf4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7232,6 +7232,9 @@ components: description: The identifier of the user or system that created the rule. Server-assigned by the rulesets endpoints; ignored by this operation. readOnly: true type: string + creation_message: + description: The message associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + type: string cve: description: The CVE identifier associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. type: string @@ -7289,6 +7292,11 @@ components: should_use_ai_fix: description: Whether an AI-generated fix should be offered. Forwarded from the rulesets endpoints; ignored by this operation. type: boolean + tags: + description: Tags associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + items: + type: string + type: array tests: description: The test cases associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. items: @@ -7302,6 +7310,10 @@ components: description: The rule type indicating the detection mechanism (for example, `TREE_SITTER_QUERY`). example: TREE_SITTER_QUERY type: string + version_id: + description: The custom rule revision version. Forwarded from the custom rulesets endpoints; ignored by this operation. + format: int64 + type: integer required: - id - category @@ -29696,13 +29708,14 @@ components: - PERFORMANCE CustomRuleRevisionAttributesSeverity: description: Rule severity - enum: [ERROR, WARNING, NOTICE] + enum: [ERROR, WARNING, NOTICE, NONE] example: ERROR type: string x-enum-varnames: - ERROR - WARNING - NOTICE + - NONE CustomRuleRevisionDataType: description: Resource type enum: [custom_rule_revision] @@ -65192,6 +65205,18 @@ components: - PHP - KOTLIN - SWIFT + - DART + - DOCKERFILE + - ELIXIR + - JSON + - RUST + - TERRAFORM + - STARLARK + - BASH + - MARKDOWN + - APEX + - R + - SQL example: PYTHON type: string x-enum-varnames: @@ -65206,6 +65231,18 @@ components: - PHP - KOTLIN - SWIFT + - DART + - DOCKERFILE + - ELIXIR + - JSON + - RUST + - TERRAFORM + - STARLARK + - BASH + - MARKDOWN + - APEX + - R + - SQL LatestVersionMatchPolicy: description: The policy for matching the latest form version during an upsert operation. enum: diff --git a/src/main/java/com/datadog/api/client/v2/model/AnalysisRequestRule.java b/src/main/java/com/datadog/api/client/v2/model/AnalysisRequestRule.java index d99695c96d1..b1a59c4b5bf 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AnalysisRequestRule.java +++ b/src/main/java/com/datadog/api/client/v2/model/AnalysisRequestRule.java @@ -38,6 +38,7 @@ AnalysisRequestRule.JSON_PROPERTY_CODE, AnalysisRequestRule.JSON_PROPERTY_CREATED_AT, AnalysisRequestRule.JSON_PROPERTY_CREATED_BY, + AnalysisRequestRule.JSON_PROPERTY_CREATION_MESSAGE, AnalysisRequestRule.JSON_PROPERTY_CVE, AnalysisRequestRule.JSON_PROPERTY_CWE, AnalysisRequestRule.JSON_PROPERTY_DESCRIPTION, @@ -54,9 +55,11 @@ AnalysisRequestRule.JSON_PROPERTY_SEVERITY, AnalysisRequestRule.JSON_PROPERTY_SHORT_DESCRIPTION, AnalysisRequestRule.JSON_PROPERTY_SHOULD_USE_AI_FIX, + AnalysisRequestRule.JSON_PROPERTY_TAGS, AnalysisRequestRule.JSON_PROPERTY_TESTS, AnalysisRequestRule.JSON_PROPERTY_TREE_SITTER_QUERY, - AnalysisRequestRule.JSON_PROPERTY_TYPE + AnalysisRequestRule.JSON_PROPERTY_TYPE, + AnalysisRequestRule.JSON_PROPERTY_VERSION_ID }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -80,6 +83,9 @@ public class AnalysisRequestRule { public static final String JSON_PROPERTY_CREATED_BY = "created_by"; private String createdBy; + public static final String JSON_PROPERTY_CREATION_MESSAGE = "creation_message"; + private String creationMessage; + public static final String JSON_PROPERTY_CVE = "cve"; private String cve; @@ -128,6 +134,9 @@ public class AnalysisRequestRule { public static final String JSON_PROPERTY_SHOULD_USE_AI_FIX = "should_use_ai_fix"; private Boolean shouldUseAiFix; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public static final String JSON_PROPERTY_TESTS = "tests"; private List tests = null; @@ -137,6 +146,9 @@ public class AnalysisRequestRule { public static final String JSON_PROPERTY_TYPE = "type"; private String type; + public static final String JSON_PROPERTY_VERSION_ID = "version_id"; + private Long versionId; + public AnalysisRequestRule() {} @JsonCreator @@ -287,6 +299,28 @@ public String getCreatedBy() { return createdBy; } + public AnalysisRequestRule creationMessage(String creationMessage) { + this.creationMessage = creationMessage; + return this; + } + + /** + * The message associated with the custom rule revision. Forwarded from the custom rulesets + * endpoints; ignored by this operation. + * + * @return creationMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATION_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreationMessage() { + return creationMessage; + } + + public void setCreationMessage(String creationMessage) { + this.creationMessage = creationMessage; + } + public AnalysisRequestRule cve(String cve) { this.cve = cve; return this; @@ -634,6 +668,36 @@ public void setShouldUseAiFix(Boolean shouldUseAiFix) { this.shouldUseAiFix = shouldUseAiFix; } + public AnalysisRequestRule tags(List tags) { + this.tags = tags; + return this; + } + + public AnalysisRequestRule addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags associated with the custom rule revision. Forwarded from the custom rulesets endpoints; + * ignored by this operation. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + public AnalysisRequestRule tests(List tests) { this.tests = tests; if (tests != null) { @@ -715,6 +779,28 @@ public void setType(String type) { this.type = type; } + public AnalysisRequestRule versionId(Long versionId) { + this.versionId = versionId; + return this; + } + + /** + * The custom rule revision version. Forwarded from the custom rulesets endpoints; ignored by this + * operation. + * + * @return versionId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersionId() { + return versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -777,6 +863,7 @@ public boolean equals(Object o) { && Objects.equals(this.code, analysisRequestRule.code) && Objects.equals(this.createdAt, analysisRequestRule.createdAt) && Objects.equals(this.createdBy, analysisRequestRule.createdBy) + && Objects.equals(this.creationMessage, analysisRequestRule.creationMessage) && Objects.equals(this.cve, analysisRequestRule.cve) && Objects.equals(this.cwe, analysisRequestRule.cwe) && Objects.equals(this.description, analysisRequestRule.description) @@ -793,9 +880,11 @@ public boolean equals(Object o) { && Objects.equals(this.severity, analysisRequestRule.severity) && Objects.equals(this.shortDescription, analysisRequestRule.shortDescription) && Objects.equals(this.shouldUseAiFix, analysisRequestRule.shouldUseAiFix) + && Objects.equals(this.tags, analysisRequestRule.tags) && Objects.equals(this.tests, analysisRequestRule.tests) && Objects.equals(this.treeSitterQuery, analysisRequestRule.treeSitterQuery) && Objects.equals(this.type, analysisRequestRule.type) + && Objects.equals(this.versionId, analysisRequestRule.versionId) && Objects.equals(this.additionalProperties, analysisRequestRule.additionalProperties); } @@ -808,6 +897,7 @@ public int hashCode() { code, createdAt, createdBy, + creationMessage, cve, cwe, description, @@ -824,9 +914,11 @@ public int hashCode() { severity, shortDescription, shouldUseAiFix, + tags, tests, treeSitterQuery, type, + versionId, additionalProperties); } @@ -840,6 +932,7 @@ public String toString() { sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" creationMessage: ").append(toIndentedString(creationMessage)).append("\n"); sb.append(" cve: ").append(toIndentedString(cve)).append("\n"); sb.append(" cwe: ").append(toIndentedString(cwe)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); @@ -856,9 +949,11 @@ public String toString() { sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); sb.append(" shortDescription: ").append(toIndentedString(shortDescription)).append("\n"); sb.append(" shouldUseAiFix: ").append(toIndentedString(shouldUseAiFix)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" tests: ").append(toIndentedString(tests)).append("\n"); sb.append(" treeSitterQuery: ").append(toIndentedString(treeSitterQuery)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributesSeverity.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributesSeverity.java index aa433cc3728..0b9244e0e61 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributesSeverity.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributesSeverity.java @@ -25,7 +25,7 @@ public class CustomRuleRevisionAttributesSeverity extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("ERROR", "WARNING", "NOTICE")); + new HashSet(Arrays.asList("ERROR", "WARNING", "NOTICE", "NONE")); public static final CustomRuleRevisionAttributesSeverity ERROR = new CustomRuleRevisionAttributesSeverity("ERROR"); @@ -33,6 +33,8 @@ public class CustomRuleRevisionAttributesSeverity extends ModelEnum { new CustomRuleRevisionAttributesSeverity("WARNING"); public static final CustomRuleRevisionAttributesSeverity NOTICE = new CustomRuleRevisionAttributesSeverity("NOTICE"); + public static final CustomRuleRevisionAttributesSeverity NONE = + new CustomRuleRevisionAttributesSeverity("NONE"); CustomRuleRevisionAttributesSeverity(String value) { super(value, allowedValues); diff --git a/src/main/java/com/datadog/api/client/v2/model/Language.java b/src/main/java/com/datadog/api/client/v2/model/Language.java index 9bc4cf22973..ca00f5f817a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/Language.java +++ b/src/main/java/com/datadog/api/client/v2/model/Language.java @@ -35,7 +35,19 @@ public class Language extends ModelEnum { "CSHARP", "PHP", "KOTLIN", - "SWIFT")); + "SWIFT", + "DART", + "DOCKERFILE", + "ELIXIR", + "JSON", + "RUST", + "TERRAFORM", + "STARLARK", + "BASH", + "MARKDOWN", + "APEX", + "R", + "SQL")); public static final Language PYTHON = new Language("PYTHON"); public static final Language JAVASCRIPT = new Language("JAVASCRIPT"); @@ -48,6 +60,18 @@ public class Language extends ModelEnum { public static final Language PHP = new Language("PHP"); public static final Language KOTLIN = new Language("KOTLIN"); public static final Language SWIFT = new Language("SWIFT"); + public static final Language DART = new Language("DART"); + public static final Language DOCKERFILE = new Language("DOCKERFILE"); + public static final Language ELIXIR = new Language("ELIXIR"); + public static final Language JSON = new Language("JSON"); + public static final Language RUST = new Language("RUST"); + public static final Language TERRAFORM = new Language("TERRAFORM"); + public static final Language STARLARK = new Language("STARLARK"); + public static final Language BASH = new Language("BASH"); + public static final Language MARKDOWN = new Language("MARKDOWN"); + public static final Language APEX = new Language("APEX"); + public static final Language R = new Language("R"); + public static final Language SQL = new Language("SQL"); Language(String value) { super(value, allowedValues); diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index a72d703edd3..b625aec224d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -56,7 +56,7 @@ Feature: Security Monitoring Scenario: Analyze code returns "Bad Request" response Given operation "CreateStaticAnalysisServerAnalysis" enabled And new "CreateStaticAnalysisServerAnalysis" request - And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tags": [], "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} When the request is sent Then the response status is 400 Bad Request @@ -64,7 +64,7 @@ Feature: Security Monitoring Scenario: Analyze code returns "OK" response Given operation "CreateStaticAnalysisServerAnalysis" enabled And new "CreateStaticAnalysisServerAnalysis" request - And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tags": [], "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} When the request is sent Then the response status is 200 OK