diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 81f698c5f321..fb313bb7bf43 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/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb b/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb index 1de89727f308..bbe04a76ab4e 100644 --- a/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb +++ b/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb @@ -27,6 +27,7 @@ name: "no-exit", regex: nil, severity: "WARNING", + tags: [], tests: [ DatadogAPIClient::V2::AnalysisRequestRuleTest.new({}), ], diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index a72d703edd34..b625aec224da 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/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 diff --git a/lib/datadog_api_client/v2/models/analysis_request_rule.rb b/lib/datadog_api_client/v2/models/analysis_request_rule.rb index 33ad08aad61d..2b58bc76ccf7 100644 --- a/lib/datadog_api_client/v2/models/analysis_request_rule.rb +++ b/lib/datadog_api_client/v2/models/analysis_request_rule.rb @@ -45,6 +45,9 @@ class AnalysisRequestRule # The identifier of the user or system that created the rule. Server-assigned by the rulesets endpoints; ignored by this operation. attr_accessor :created_by + # The message associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + attr_accessor :creation_message + # The CVE identifier associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. attr_accessor :cve @@ -93,6 +96,9 @@ class AnalysisRequestRule # Whether an AI-generated fix should be offered. Forwarded from the rulesets endpoints; ignored by this operation. attr_accessor :should_use_ai_fix + # Tags associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + attr_accessor :tags + # The test cases associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. attr_accessor :tests @@ -102,6 +108,9 @@ class AnalysisRequestRule # The rule type indicating the detection mechanism (for example, `TREE_SITTER_QUERY`). attr_reader :type + # The custom rule revision version. Forwarded from the custom rulesets endpoints; ignored by this operation. + attr_accessor :version_id + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -114,6 +123,7 @@ def self.attribute_map :'code' => :'code', :'created_at' => :'created_at', :'created_by' => :'created_by', + :'creation_message' => :'creation_message', :'cve' => :'cve', :'cwe' => :'cwe', :'description' => :'description', @@ -130,9 +140,11 @@ def self.attribute_map :'severity' => :'severity', :'short_description' => :'short_description', :'should_use_ai_fix' => :'should_use_ai_fix', + :'tags' => :'tags', :'tests' => :'tests', :'tree_sitter_query' => :'tree_sitter_query', - :'type' => :'type' + :'type' => :'type', + :'version_id' => :'version_id' } end @@ -146,6 +158,7 @@ def self.openapi_types :'code' => :'String', :'created_at' => :'Time', :'created_by' => :'String', + :'creation_message' => :'String', :'cve' => :'String', :'cwe' => :'String', :'description' => :'String', @@ -162,9 +175,11 @@ def self.openapi_types :'severity' => :'String', :'short_description' => :'String', :'should_use_ai_fix' => :'Boolean', + :'tags' => :'Array', :'tests' => :'Array', :'tree_sitter_query' => :'String', - :'type' => :'String' + :'type' => :'String', + :'version_id' => :'Integer' } end @@ -221,6 +236,10 @@ def initialize(attributes = {}) self.created_by = attributes[:'created_by'] end + if attributes.key?(:'creation_message') + self.creation_message = attributes[:'creation_message'] + end + if attributes.key?(:'cve') self.cve = attributes[:'cve'] end @@ -285,6 +304,12 @@ def initialize(attributes = {}) self.should_use_ai_fix = attributes[:'should_use_ai_fix'] end + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + if attributes.key?(:'tests') if (value = attributes[:'tests']).is_a?(Array) self.tests = value @@ -298,6 +323,10 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] end + + if attributes.key?(:'version_id') + self.version_id = attributes[:'version_id'] + end end # Check to see if the all the properties in the model are valid @@ -427,6 +456,7 @@ def ==(o) code == o.code && created_at == o.created_at && created_by == o.created_by && + creation_message == o.creation_message && cve == o.cve && cwe == o.cwe && description == o.description && @@ -443,9 +473,11 @@ def ==(o) severity == o.severity && short_description == o.short_description && should_use_ai_fix == o.should_use_ai_fix && + tags == o.tags && tests == o.tests && tree_sitter_query == o.tree_sitter_query && type == o.type && + version_id == o.version_id && additional_properties == o.additional_properties end @@ -453,7 +485,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [arguments, category, checksum, code, created_at, created_by, cve, cwe, description, documentation_url, entity_checked, id, is_published, is_testing, language, last_updated_at, last_updated_by, name, regex, severity, short_description, should_use_ai_fix, tests, tree_sitter_query, type, additional_properties].hash + [arguments, category, checksum, code, created_at, created_by, creation_message, cve, cwe, description, documentation_url, entity_checked, id, is_published, is_testing, language, last_updated_at, last_updated_by, name, regex, severity, short_description, should_use_ai_fix, tags, tests, tree_sitter_query, type, version_id, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/custom_rule_revision_attributes_severity.rb b/lib/datadog_api_client/v2/models/custom_rule_revision_attributes_severity.rb index cb1de2ae71d4..b729c30875b9 100644 --- a/lib/datadog_api_client/v2/models/custom_rule_revision_attributes_severity.rb +++ b/lib/datadog_api_client/v2/models/custom_rule_revision_attributes_severity.rb @@ -24,5 +24,6 @@ class CustomRuleRevisionAttributesSeverity ERROR = "ERROR".freeze WARNING = "WARNING".freeze NOTICE = "NOTICE".freeze + NONE = "NONE".freeze end end diff --git a/lib/datadog_api_client/v2/models/language.rb b/lib/datadog_api_client/v2/models/language.rb index bad7afd65a7f..f58c04306e51 100644 --- a/lib/datadog_api_client/v2/models/language.rb +++ b/lib/datadog_api_client/v2/models/language.rb @@ -32,5 +32,17 @@ class Language PHP = "PHP".freeze KOTLIN = "KOTLIN".freeze SWIFT = "SWIFT".freeze + DART = "DART".freeze + DOCKERFILE = "DOCKERFILE".freeze + ELIXIR = "ELIXIR".freeze + JSON = "JSON".freeze + RUST = "RUST".freeze + TERRAFORM = "TERRAFORM".freeze + STARLARK = "STARLARK".freeze + BASH = "BASH".freeze + MARKDOWN = "MARKDOWN".freeze + APEX = "APEX".freeze + R = "R".freeze + SQL = "SQL".freeze end end