From 9cd4e258cad4b3ba8aa87dd46102ad72eac077d7 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:42:38 +0100 Subject: [PATCH 1/2] Regenerate client from commit fcf2546 of spec repo (#2832) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 63 +++++++++++++++++-- ...ed-with-the-provided-token-response.frozen | 2 +- ...iated-with-the-provided-token-response.yml | 5 +- ...vulnerabilities-returns-OK-response.frozen | 2 +- ...st-vulnerabilities-returns-OK-response.yml | 2 +- .../v2/security-monitoring/GetSecretsRules.rb | 2 +- features/scenarios_model_mapping.rb | 1 + features/v2/security_monitoring.feature | 38 +++++------ .../v2/api/security_monitoring_api.rb | 12 ++-- lib/datadog_api_client/v2/models/library.rb | 14 ++++- .../v2/models/vulnerability_attributes.rb | 12 +++- .../v2/models/vulnerability_ecosystem.rb | 7 ++- .../v2/models/vulnerability_tool.rb | 1 + 13 files changed, 122 insertions(+), 39 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b2eda9a1b02a..b3287b1f9ff1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29976,6 +29976,13 @@ components: Library: description: Vulnerability library. properties: + additional_names: + description: Related library or package names (such as child packages or + affected binary paths). + items: + example: linux-tools-common + type: string + type: array name: description: Vulnerability library name. example: linux-aws-5.15 @@ -57353,6 +57360,12 @@ components: type: array risks: $ref: '#/components/schemas/VulnerabilityRisks' + running_kernel: + description: "True if the vulnerability affects a package in the host\u2019s + running kernel, false if it affects a non-running kernel, and omit if + it is not kernel-related." + example: true + type: boolean status: $ref: '#/components/schemas/VulnerabilityStatus' title: @@ -57413,10 +57426,15 @@ components: - RubyGems - Go - Packagist - - Ddeb + - Deb - Rpm - Apk - Windows + - Generic + - MacOs + - Oci + - BottleRocket + - None type: string x-enum-varnames: - PYPI @@ -57426,10 +57444,15 @@ components: - RUBY_GEMS - GO - PACKAGIST - - D_DEB + - DEB - RPM - APK - WINDOWS + - GENERIC + - MAC_OS + - OCI + - BOTTLE_ROCKET + - NONE VulnerabilityRelationships: description: Related entities object. properties: @@ -57530,12 +57553,14 @@ components: - IAST - SCA - Infra + - SAST example: SCA type: string x-enum-varnames: - IAST - SCA - INFRA + - SAST VulnerabilityType: description: The vulnerability type. enum: @@ -80296,6 +80321,10 @@ paths: summary: List assets SBOMs tags: - Security Monitoring + x-permission: + operator: OR + permissions: + - appsec_vm_read x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' @@ -80367,6 +80396,10 @@ paths: summary: Get SBOM tags: - Security Monitoring + x-permission: + operator: OR + permissions: + - appsec_vm_read x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' @@ -80481,6 +80514,10 @@ paths: summary: List scanned assets metadata tags: - Security Monitoring + x-permission: + operator: OR + permissions: + - appsec_vm_read x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' @@ -80909,6 +80946,14 @@ paths: required: false schema: type: string + - description: Filter for whether the vulnerability affects a running kernel + (for vulnerabilities related to a `Host` asset). + example: true + in: query + name: filter[running_kernel] + required: false + schema: + type: boolean - description: Filter by asset name. This field supports the usage of wildcards (*). example: datadog-agent @@ -81052,6 +81097,10 @@ paths: summary: List vulnerabilities tags: - Security Monitoring + x-permission: + operator: OR + permissions: + - appsec_vm_read x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' @@ -81410,6 +81459,10 @@ paths: summary: List vulnerable assets tags: - Security Monitoring + x-permission: + operator: OR + permissions: + - appsec_vm_read x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' @@ -84547,8 +84600,8 @@ paths: x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/static-analysis/secrets/rules: get: - description: Returns list of Secrets rules with ID, Pattern, Description, Priority, - and SDS ID + description: Returns a list of Secrets rules with ID, Pattern, Description, + Priority, and SDS ID. operationId: GetSecretsRules responses: '200': @@ -84564,7 +84617,7 @@ paths: appKeyAuth: [] - AuthZ: - code_analysis_read - summary: Returns list of Secrets rules + summary: Returns a list of Secrets rules tags: - Security Monitoring x-unstable: '**Note**: This endpoint may be subject to changes.' diff --git a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen index bebe5144844d..ae0101c9ee39 100644 --- a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen +++ b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen @@ -1 +1 @@ -2025-01-31T12:04:28.397Z \ No newline at end of file +2025-12-12T14:36:04.169Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml index 73aad7955cb7..1a5d8273fc5e 100644 --- a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml +++ b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Fri, 31 Jan 2025 12:04:28 GMT +- recorded_at: Fri, 12 Dec 2025 14:36:04 GMT request: body: null headers: @@ -10,8 +10,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"errors":[{"title":"Generic Error","detail":"rpc error: code = Internal - desc = no cached result set found for queryID: unknown"}]}' + string: '{"errors":[{"status":"404","title":"Unexpected internal error"}]}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.frozen index 9ddcdc5dd297..e3e6312eec9a 100644 --- a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.frozen +++ b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.frozen @@ -1 +1 @@ -2025-01-31T12:04:39.730Z \ No newline at end of file +2025-12-12T14:36:49.310Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.yml index ce36d8703e22..3fd5db6884de 100644 --- a/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.yml +++ b/cassettes/features/v2/security_monitoring/List-vulnerabilities-returns-OK-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Fri, 31 Jan 2025 12:04:39 GMT +- recorded_at: Fri, 12 Dec 2025 14:36:49 GMT request: body: null headers: diff --git a/examples/v2/security-monitoring/GetSecretsRules.rb b/examples/v2/security-monitoring/GetSecretsRules.rb index 8618c0801d5b..81abeff8809d 100644 --- a/examples/v2/security-monitoring/GetSecretsRules.rb +++ b/examples/v2/security-monitoring/GetSecretsRules.rb @@ -1,4 +1,4 @@ -# Returns list of Secrets rules returns "OK" response +# Returns a list of Secrets rules returns "OK" response require "datadog_api_client" DatadogAPIClient.configure do |config| diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9c9af472c3b5..62c0ad7188e5 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1465,6 +1465,7 @@ "filter_fix_available" => "Boolean", "filter_repo_digests" => "String", "filter_origin" => "String", + "filter_running_kernel" => "Boolean", "filter_asset_name" => "String", "filter_asset_type" => "AssetType", "filter_asset_version_first" => "String", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index b6d8bf921cb5..b9ccb0427dae 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -733,7 +733,7 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/asm-vm + @generated @skip @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetSBOM" enabled And new "GetSBOM" request @@ -742,7 +742,7 @@ Feature: Security Monitoring When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "Not found: asset not found" response Given operation "GetSBOM" enabled And new "GetSBOM" request @@ -751,7 +751,7 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not found: asset not found - @skip @team:DataDog/asm-vm + @skip @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "OK" response Given operation "GetSBOM" enabled And new "GetSBOM" request @@ -1134,14 +1134,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 The list of notification rules. - @generated @skip @team:DataDog/asm-vm + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Not found: There is no request associated with the provided token." response Given operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request @@ -1150,14 +1150,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not found: There is no request associated with the provided token. - @generated @skip @team:DataDog/asm-vm + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Not found: asset not found" response Given operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request When the request is sent Then the response status is 404 Not found: asset not found - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "OK" response Given operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request @@ -1269,14 +1269,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK - @skip @team:DataDog/asm-vm + @skip @team:DataDog/k9-cloud-vm Scenario: List scanned assets metadata returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListScannedAssetsMetadata" enabled And new "ListScannedAssetsMetadata" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List scanned assets metadata returns "Not found: asset not found" response Given operation "ListScannedAssetsMetadata" enabled And new "ListScannedAssetsMetadata" request @@ -1285,7 +1285,7 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not found: asset not found - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List scanned assets metadata returns "OK" response Given operation "ListScannedAssetsMetadata" enabled And new "ListScannedAssetsMetadata" request @@ -1306,14 +1306,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/asm-vm + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListVulnerabilities" enabled And new "ListVulnerabilities" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List vulnerabilities returns "Not found: There is no request associated with the provided token." response Given operation "ListVulnerabilities" enabled And new "ListVulnerabilities" request @@ -1322,7 +1322,7 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not found: There is no request associated with the provided token. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List vulnerabilities returns "OK" response Given operation "ListVulnerabilities" enabled And new "ListVulnerabilities" request @@ -1332,14 +1332,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/asm-vm + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List vulnerable assets returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListVulnerableAssets" enabled And new "ListVulnerableAssets" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List vulnerable assets returns "Not found: There is no request associated with the provided token." response Given operation "ListVulnerableAssets" enabled And new "ListVulnerableAssets" request @@ -1348,7 +1348,7 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not found: There is no request associated with the provided token. - @team:DataDog/asm-vm + @team:DataDog/k9-cloud-vm Scenario: List vulnerable assets returns "OK" response Given operation "ListVulnerableAssets" enabled And new "ListVulnerableAssets" request @@ -1482,14 +1482,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. - @generated @skip @team:DataDog/asm-vm - Scenario: Returns list of Secrets rules returns "OK" response + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Returns a list of Secrets rules returns "OK" response Given operation "GetSecretsRules" enabled And new "GetSecretsRules" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/asm-vm + @generated @skip @team:DataDog/k9-vm-ast Scenario: Ruleset get multiple returns "OK" response Given operation "ListMultipleRulesets" enabled And new "ListMultipleRulesets" request diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 279c9473db17..1335b461614d 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -2132,7 +2132,7 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) return data, status_code, headers end - # Returns list of Secrets rules. + # Returns a list of Secrets rules. # # @see #get_secrets_rules_with_http_info def get_secrets_rules(opts = {}) @@ -2140,9 +2140,9 @@ def get_secrets_rules(opts = {}) data end - # Returns list of Secrets rules. + # Returns a list of Secrets rules. # - # Returns list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID + # Returns a list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID. # # @param opts [Hash] the optional parameters # @return [Array<(SecretRuleArray, Integer, Hash)>] SecretRuleArray data, response status code and response headers @@ -4134,6 +4134,7 @@ def list_vulnerabilities(opts = {}) # @option opts [Boolean] :filter_fix_available Filter by fix availability. # @option opts [String] :filter_repo_digests Filter by vulnerability `repo_digest` (when the vulnerability is related to `Image` asset). # @option opts [String] :filter_origin Filter by origin. + # @option opts [Boolean] :filter_running_kernel Filter for whether the vulnerability affects a running kernel (for vulnerabilities related to a `Host` asset). # @option opts [String] :filter_asset_name Filter by asset name. This field supports the usage of wildcards (*). # @option opts [AssetType] :filter_asset_type Filter by asset type. # @option opts [String] :filter_asset_version_first Filter by the first version of the asset this vulnerability has been detected on. @@ -4192,7 +4193,7 @@ def list_vulnerabilities_with_http_info(opts = {}) if @api_client.config.client_side_validation && opts[:'filter_status'] && !allowable_values.include?(opts[:'filter_status']) fail ArgumentError, "invalid value for \"filter_status\", must be one of #{allowable_values}" end - allowable_values = ['IAST', 'SCA', 'Infra'] + allowable_values = ['IAST', 'SCA', 'Infra', 'SAST'] if @api_client.config.client_side_validation && opts[:'filter_tool'] && !allowable_values.include?(opts[:'filter_tool']) fail ArgumentError, "invalid value for \"filter_tool\", must be one of #{allowable_values}" end @@ -4206,7 +4207,7 @@ def list_vulnerabilities_with_http_info(opts = {}) if @api_client.config.client_side_validation && opts[:'filter_risks_epss_severity'] && !allowable_values.include?(opts[:'filter_risks_epss_severity']) fail ArgumentError, "invalid value for \"filter_risks_epss_severity\", must be one of #{allowable_values}" end - allowable_values = ['PyPI', 'Maven', 'NuGet', 'Npm', 'RubyGems', 'Go', 'Packagist', 'Ddeb', 'Rpm', 'Apk', 'Windows'] + allowable_values = ['PyPI', 'Maven', 'NuGet', 'Npm', 'RubyGems', 'Go', 'Packagist', 'Deb', 'Rpm', 'Apk', 'Windows', 'Generic', 'MacOs', 'Oci', 'BottleRocket', 'None'] if @api_client.config.client_side_validation && opts[:'filter_ecosystem'] && !allowable_values.include?(opts[:'filter_ecosystem']) fail ArgumentError, "invalid value for \"filter_ecosystem\", must be one of #{allowable_values}" end @@ -4246,6 +4247,7 @@ def list_vulnerabilities_with_http_info(opts = {}) query_params[:'filter[fix_available]'] = opts[:'filter_fix_available'] if !opts[:'filter_fix_available'].nil? query_params[:'filter[repo_digests]'] = opts[:'filter_repo_digests'] if !opts[:'filter_repo_digests'].nil? query_params[:'filter[origin]'] = opts[:'filter_origin'] if !opts[:'filter_origin'].nil? + query_params[:'filter[running_kernel]'] = opts[:'filter_running_kernel'] if !opts[:'filter_running_kernel'].nil? query_params[:'filter[asset.name]'] = opts[:'filter_asset_name'] if !opts[:'filter_asset_name'].nil? query_params[:'filter[asset.type]'] = opts[:'filter_asset_type'] if !opts[:'filter_asset_type'].nil? query_params[:'filter[asset.version.first]'] = opts[:'filter_asset_version_first'] if !opts[:'filter_asset_version_first'].nil? diff --git a/lib/datadog_api_client/v2/models/library.rb b/lib/datadog_api_client/v2/models/library.rb index 00338bf39c28..9778d56d1fc5 100644 --- a/lib/datadog_api_client/v2/models/library.rb +++ b/lib/datadog_api_client/v2/models/library.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V2 class Library include BaseGenericModel + # Related library or package names (such as child packages or affected binary paths). + attr_accessor :additional_names + # Vulnerability library name. attr_reader :name @@ -33,6 +36,7 @@ class Library # @!visibility private def self.attribute_map { + :'additional_names' => :'additional_names', :'name' => :'name', :'version' => :'version' } @@ -42,6 +46,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'additional_names' => :'Array', :'name' => :'String', :'version' => :'String' } @@ -65,6 +70,12 @@ def initialize(attributes = {}) end } + if attributes.key?(:'additional_names') + if (value = attributes[:'additional_names']).is_a?(Array) + self.additional_names = value + end + end + if attributes.key?(:'name') self.name = attributes[:'name'] end @@ -118,6 +129,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + additional_names == o.additional_names && name == o.name && version == o.version && additional_properties == o.additional_properties @@ -127,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [name, version, additional_properties].hash + [additional_names, name, version, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/vulnerability_attributes.rb b/lib/datadog_api_client/v2/models/vulnerability_attributes.rb index f28cac3f68cb..789b4c6b0f2f 100644 --- a/lib/datadog_api_client/v2/models/vulnerability_attributes.rb +++ b/lib/datadog_api_client/v2/models/vulnerability_attributes.rb @@ -75,6 +75,9 @@ class VulnerabilityAttributes # Vulnerability risks. attr_reader :risks + # True if the vulnerability affects a package in the host’s running kernel, false if it affects a non-running kernel, and omit if it is not kernel-related. + attr_accessor :running_kernel + # The vulnerability status. attr_reader :status @@ -111,6 +114,7 @@ def self.attribute_map :'remediations' => :'remediations', :'repo_digests' => :'repo_digests', :'risks' => :'risks', + :'running_kernel' => :'running_kernel', :'status' => :'status', :'title' => :'title', :'tool' => :'tool', @@ -140,6 +144,7 @@ def self.openapi_types :'remediations' => :'Array', :'repo_digests' => :'Array', :'risks' => :'VulnerabilityRisks', + :'running_kernel' => :'Boolean', :'status' => :'VulnerabilityStatus', :'title' => :'String', :'tool' => :'VulnerabilityTool', @@ -245,6 +250,10 @@ def initialize(attributes = {}) self.risks = attributes[:'risks'] end + if attributes.key?(:'running_kernel') + self.running_kernel = attributes[:'running_kernel'] + end + if attributes.key?(:'status') self.status = attributes[:'status'] end @@ -478,6 +487,7 @@ def ==(o) remediations == o.remediations && repo_digests == o.repo_digests && risks == o.risks && + running_kernel == o.running_kernel && status == o.status && title == o.title && tool == o.tool && @@ -489,7 +499,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [advisory, advisory_id, code_location, cve_list, cvss, dependency_locations, description, ecosystem, exposure_time, first_detection, fix_available, language, last_detection, library, origin, remediations, repo_digests, risks, status, title, tool, type, additional_properties].hash + [advisory, advisory_id, code_location, cve_list, cvss, dependency_locations, description, ecosystem, exposure_time, first_detection, fix_available, language, last_detection, library, origin, remediations, repo_digests, risks, running_kernel, status, title, tool, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/vulnerability_ecosystem.rb b/lib/datadog_api_client/v2/models/vulnerability_ecosystem.rb index db3bd550bcdc..d867821f10a3 100644 --- a/lib/datadog_api_client/v2/models/vulnerability_ecosystem.rb +++ b/lib/datadog_api_client/v2/models/vulnerability_ecosystem.rb @@ -28,9 +28,14 @@ class VulnerabilityEcosystem RUBY_GEMS = "RubyGems".freeze GO = "Go".freeze PACKAGIST = "Packagist".freeze - D_DEB = "Ddeb".freeze + DEB = "Deb".freeze RPM = "Rpm".freeze APK = "Apk".freeze WINDOWS = "Windows".freeze + GENERIC = "Generic".freeze + MAC_OS = "MacOs".freeze + OCI = "Oci".freeze + BOTTLE_ROCKET = "BottleRocket".freeze + NONE = "None".freeze end end diff --git a/lib/datadog_api_client/v2/models/vulnerability_tool.rb b/lib/datadog_api_client/v2/models/vulnerability_tool.rb index 936aaccd93dd..690c6e59d3ee 100644 --- a/lib/datadog_api_client/v2/models/vulnerability_tool.rb +++ b/lib/datadog_api_client/v2/models/vulnerability_tool.rb @@ -24,5 +24,6 @@ class VulnerabilityTool IAST = "IAST".freeze SCA = "SCA".freeze INFRA = "Infra".freeze + SAST = "SAST".freeze end end From 7ed176cc7780c7445a227f6c49559fdcfcbe8b60 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:13:36 +0000 Subject: [PATCH 2/2] add suppression version history (#2801) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 140 ++++++++++++++---- ...-history-returns-Not-Found-response.frozen | 1 + ...ion-history-returns-Not-Found-response.yml | 20 +++ ...version-history-returns-OK-response.frozen | 1 + ...-s-version-history-returns-OK-response.yml | 58 ++++++++ .../GetSuppressionVersionHistory.rb | 8 + features/scenarios_model_mapping.rb | 5 + features/v2/incidents.feature | 6 +- features/v2/security_monitoring.feature | 15 ++ features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 3 + lib/datadog_api_client/inflector.rb | 9 +- .../v2/api/incidents_api.rb | 18 +++ .../v2/api/security_monitoring_api.rb | 69 +++++++++ .../get_suppression_version_history_data.rb | 125 ++++++++++++++++ ...t_suppression_version_history_data_type.rb | 26 ++++ ...et_suppression_version_history_response.rb | 105 +++++++++++++ .../v2/models/rule_versions.rb | 2 +- .../v2/models/suppression_version_history.rb | 133 +++++++++++++++++ .../v2/models/suppression_versions.rb | 117 +++++++++++++++ ...on_update.rb => version_history_update.rb} | 6 +- ...type.rb => version_history_update_type.rb} | 2 +- 22 files changed, 840 insertions(+), 35 deletions(-) create mode 100644 cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml create mode 100644 examples/v2/security-monitoring/GetSuppressionVersionHistory.rb create mode 100644 lib/datadog_api_client/v2/models/get_suppression_version_history_data.rb create mode 100644 lib/datadog_api_client/v2/models/get_suppression_version_history_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/get_suppression_version_history_response.rb create mode 100644 lib/datadog_api_client/v2/models/suppression_version_history.rb create mode 100644 lib/datadog_api_client/v2/models/suppression_versions.rb rename lib/datadog_api_client/v2/models/{rule_version_update.rb => version_history_update.rb} (95%) rename lib/datadog_api_client/v2/models/{rule_version_update_type.rb => version_history_update_type.rb} (95%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b3287b1f9ff1..5d738d0d1f0e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24779,6 +24779,30 @@ components: required: - data type: object + GetSuppressionVersionHistoryData: + description: Data for the suppression version history. + properties: + attributes: + $ref: '#/components/schemas/SuppressionVersionHistory' + id: + description: ID of the suppression. + type: string + type: + $ref: '#/components/schemas/GetSuppressionVersionHistoryDataType' + type: object + GetSuppressionVersionHistoryDataType: + description: Type of data. + enum: + - suppression_version_history + type: string + x-enum-varnames: + - SUPPRESSIONVERSIONHISTORY + GetSuppressionVersionHistoryResponse: + description: Response for getting the suppression version history. + properties: + data: + $ref: '#/components/schemas/GetSuppressionVersionHistoryData' + type: object GetTeamMembershipsSort: description: Specifies the order of returned team memberships enum: @@ -44242,38 +44266,13 @@ components: description: The `RuleVersionHistory` `data`. type: object type: object - RuleVersionUpdate: - description: A change in a rule version. - properties: - change: - description: The new value of the field. - example: cloud_provider:aws - type: string - field: - description: The field that was changed. - example: Tags - type: string - type: - $ref: '#/components/schemas/RuleVersionUpdateType' - type: object - RuleVersionUpdateType: - description: The type of change. - enum: - - create - - update - - delete - type: string - x-enum-varnames: - - CREATE - - UPDATE - - DELETE RuleVersions: description: A rule version with a list of updates. properties: changes: description: A list of changes. items: - $ref: '#/components/schemas/RuleVersionUpdate' + $ref: '#/components/schemas/VersionHistoryUpdate' type: array rule: $ref: '#/components/schemas/SecurityMonitoringRuleResponse' @@ -52833,6 +52832,32 @@ components: format: double type: number type: object + SuppressionVersionHistory: + description: Response object containing the version history of a suppression. + properties: + count: + description: The number of suppression versions. + format: int32 + maximum: 2147483647 + type: integer + data: + additionalProperties: + $ref: '#/components/schemas/SuppressionVersions' + description: A suppression version with a list of updates. + description: The version history of a suppression. + type: object + type: object + SuppressionVersions: + description: A suppression version with a list of updates. + properties: + changes: + description: A list of changes. + items: + $ref: '#/components/schemas/VersionHistoryUpdate' + type: array + suppression: + $ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes' + type: object TableResultV2: description: A reference table resource containing its full configuration and state. @@ -57163,6 +57188,31 @@ components: example: 1 format: int64 type: integer + VersionHistoryUpdate: + description: A change in a rule version. + properties: + change: + description: The new value of the field. + example: cloud_provider:aws + type: string + field: + description: The field that was changed. + example: Tags + type: string + type: + $ref: '#/components/schemas/VersionHistoryUpdateType' + type: object + VersionHistoryUpdateType: + description: The type of change. + enum: + - create + - update + - delete + type: string + x-enum-varnames: + - CREATE + - UPDATE + - DELETE VirusTotalAPIKey: description: The definition of the `VirusTotalAPIKey` object. properties: @@ -69034,6 +69084,9 @@ paths: operator: OR permissions: - incident_read + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: description: Create an impact for an incident. operationId: CreateIncidentImpact @@ -69077,6 +69130,9 @@ paths: operator: OR permissions: - incident_write + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/impacts/{impact_id}: delete: description: Delete an incident impact. @@ -69107,6 +69163,9 @@ paths: operator: OR permissions: - incident_write + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/relationships/integrations: get: description: Get all integration metadata for an incident. @@ -82039,6 +82098,35 @@ paths: summary: Update a suppression rule tags: - Security Monitoring + /api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history: + get: + description: Get a suppression's version history. + operationId: GetSuppressionVersionHistory + parameters: + - $ref: '#/components/parameters/SecurityMonitoringSuppressionID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetSuppressionVersionHistoryResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_suppressions_read + summary: Get a suppression's version history + tags: + - Security Monitoring /api/v2/security_monitoring/rules: get: description: List rules. diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..24bfeae8d402 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-26T13:33:06.081Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.yml new file mode 100644 index 000000000000..b47fae6320e9 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/this-does-not-exist/version_history + response: + body: + encoding: UTF-8 + string: '{"errors":["not_found(Suppression with ID this-does-not-exist not found)"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen new file mode 100644 index 000000000000..d0d5ccec313b --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-26T13:33:06.482Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml new file mode 100644 index 000000000000..84c317daea05 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","enabled":true,"name":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"456-piv-74h","type":"suppressions","attributes":{"creation_date":1764163986851,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","editable":true,"enabled":true,"name":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1764163986851,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/456-piv-74h/version_history + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"456-piv-74h","type":"suppression_version_history","attributes":{"count":1,"data":{"1":{"suppression":{"id":"456-piv-74h","name":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","enabled":true,"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986","rule_query":"source:cloudtrail","suppression_query":"env:test","data_exclusion_query":"","version":1,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"updater":{"handle":"frog@datadoghq.com","name":"frog"},"creation_date":1764163986851,"update_date":1764163986851,"editable":true,"tags":["source:cloudtrail","technique:T1110-brute-force"]},"changes":[]}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 26 Nov 2025 13:33:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/456-piv-74h + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/security-monitoring/GetSuppressionVersionHistory.rb b/examples/v2/security-monitoring/GetSuppressionVersionHistory.rb new file mode 100644 index 000000000000..ffd45c6fa65f --- /dev/null +++ b/examples/v2/security-monitoring/GetSuppressionVersionHistory.rb @@ -0,0 +1,8 @@ +# Get a suppression's version history returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "suppression" in the system +SUPPRESSION_DATA_ID = ENV["SUPPRESSION_DATA_ID"] +p api_instance.get_suppression_version_history(SUPPRESSION_DATA_ID) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 62c0ad7188e5..881252db3d6b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1552,6 +1552,11 @@ "suppression_id" => "String", "body" => "SecurityMonitoringSuppressionUpdateRequest", }, + "v2.GetSuppressionVersionHistory" => { + "suppression_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + }, "v2.ListSecurityMonitoringRules" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 12ab3e2f5ba5..74ae965968fd 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -806,14 +806,16 @@ Feature: Incidents @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Bad Request" response - Given new "ListIncidentImpacts" request + Given operation "ListIncidentImpacts" enabled + And new "ListIncidentImpacts" request And request contains "incident_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Not Found" response - Given new "ListIncidentImpacts" request + Given operation "ListIncidentImpacts" enabled + And new "ListIncidentImpacts" request And request contains "incident_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index b9ccb0427dae..9fe6168328fc 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -1020,6 +1020,21 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" has the same value as "suppression.data.attributes.rule_query" And the response "data.attributes.suppression_query" is equal to "env:test" + @team:DataDog/k9-cloud-security-platform + Scenario: Get a suppression's version history returns "Not Found" response + Given new "GetSuppressionVersionHistory" request + And request contains "suppression_id" parameter with value "this-does-not-exist" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-cloud-security-platform + Scenario: Get a suppression's version history returns "OK" response + Given new "GetSuppressionVersionHistory" request + And there is a valid "suppression" in the system + And request contains "suppression_id" parameter from "suppression.data.id" + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Get all security filters returns "OK" response Given new "ListSecurityFilters" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 4d590026bd7d..56977a4c301f 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3979,6 +3979,12 @@ "type": "idempotent" } }, + "GetSuppressionVersionHistory": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 707078fa9174..358c6549b86c 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -249,12 +249,14 @@ def initialize "v2.update_deployment_gate": false, "v2.update_deployment_rule": false, "v2.create_incident": false, + "v2.create_incident_impact": false, "v2.create_incident_integration": false, "v2.create_incident_notification_rule": false, "v2.create_incident_notification_template": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, "v2.delete_incident": false, + "v2.delete_incident_impact": false, "v2.delete_incident_integration": false, "v2.delete_incident_notification_rule": false, "v2.delete_incident_notification_template": false, @@ -267,6 +269,7 @@ def initialize "v2.get_incident_todo": false, "v2.get_incident_type": false, "v2.list_incident_attachments": false, + "v2.list_incident_impacts": false, "v2.list_incident_integrations": false, "v2.list_incident_notification_rules": false, "v2.list_incident_notification_templates": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7563ce9aaa78..26a9fcd42e83 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2436,6 +2436,9 @@ def overrides "v2.get_rule_version_history_data_type" => "GetRuleVersionHistoryDataType", "v2.get_rule_version_history_response" => "GetRuleVersionHistoryResponse", "v2.get_sbom_response" => "GetSBOMResponse", + "v2.get_suppression_version_history_data" => "GetSuppressionVersionHistoryData", + "v2.get_suppression_version_history_data_type" => "GetSuppressionVersionHistoryDataType", + "v2.get_suppression_version_history_response" => "GetSuppressionVersionHistoryResponse", "v2.get_team_memberships_sort" => "GetTeamMembershipsSort", "v2.get_workflow_response" => "GetWorkflowResponse", "v2.github_webhook_trigger" => "GithubWebhookTrigger", @@ -3713,8 +3716,6 @@ def overrides "v2.rule_user" => "RuleUser", "v2.rule_version_history" => "RuleVersionHistory", "v2.rule_versions" => "RuleVersions", - "v2.rule_version_update" => "RuleVersionUpdate", - "v2.rule_version_update_type" => "RuleVersionUpdateType", "v2.rum_aggregate_bucket_value" => "RUMAggregateBucketValue", "v2.rum_aggregate_bucket_value_timeseries_point" => "RUMAggregateBucketValueTimeseriesPoint", "v2.rum_aggregate_request" => "RUMAggregateRequest", @@ -4272,6 +4273,8 @@ def overrides "v2.step" => "Step", "v2.step_display" => "StepDisplay", "v2.step_display_bounds" => "StepDisplayBounds", + "v2.suppression_version_history" => "SuppressionVersionHistory", + "v2.suppression_versions" => "SuppressionVersions", "v2.table_result_v2" => "TableResultV2", "v2.table_result_v2_array" => "TableResultV2Array", "v2.table_result_v2_data" => "TableResultV2Data", @@ -4558,6 +4561,8 @@ def overrides "v2.validation_error" => "ValidationError", "v2.validation_error_meta" => "ValidationErrorMeta", "v2.validation_response" => "ValidationResponse", + "v2.version_history_update" => "VersionHistoryUpdate", + "v2.version_history_update_type" => "VersionHistoryUpdateType", "v2.virus_total_api_key" => "VirusTotalAPIKey", "v2.virus_total_api_key_type" => "VirusTotalAPIKeyType", "v2.virus_total_api_key_update" => "VirusTotalAPIKeyUpdate", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index a1f004c3f4be..6c19ac5d3bc8 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -114,6 +114,12 @@ def create_incident_impact(incident_id, body, opts = {}) # @option opts [Array] :include Specifies which related resources should be included in the response. # @return [Array<(IncidentImpactResponse, Integer, Hash)>] IncidentImpactResponse data, response status code and response headers def create_incident_impact_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_impact".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_impact") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_impact")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_impact ...' @@ -633,6 +639,12 @@ def delete_incident_impact(incident_id, impact_id, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_incident_impact_with_http_info(incident_id, impact_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_impact".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_impact") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_impact")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_impact ...' @@ -1589,6 +1601,12 @@ def list_incident_impacts(incident_id, opts = {}) # @option opts [Array] :include Specifies which related resources should be included in the response. # @return [Array<(IncidentImpactsResponse, Integer, Hash)>] IncidentImpactsResponse data, response status code and response headers def list_incident_impacts_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_impacts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_impacts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_impacts")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impacts ...' diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 1335b461614d..72c954d50b25 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -2879,6 +2879,75 @@ def get_suppressions_affecting_rule_with_http_info(rule_id, opts = {}) return data, status_code, headers end + # Get a suppression's version history. + # + # @see #get_suppression_version_history_with_http_info + def get_suppression_version_history(suppression_id, opts = {}) + data, _status_code, _headers = get_suppression_version_history_with_http_info(suppression_id, opts) + data + end + + # Get a suppression's version history. + # + # Get a suppression's version history. + # + # @param suppression_id [String] The ID of the suppression rule + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(GetSuppressionVersionHistoryResponse, Integer, Hash)>] GetSuppressionVersionHistoryResponse data, response status code and response headers + def get_suppression_version_history_with_http_info(suppression_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_suppression_version_history ...' + end + # verify the required parameter 'suppression_id' is set + if @api_client.config.client_side_validation && suppression_id.nil? + fail ArgumentError, "Missing the required parameter 'suppression_id' when calling SecurityMonitoringAPI.get_suppression_version_history" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history'.sub('{suppression_id}', CGI.escape(suppression_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSuppressionVersionHistoryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_suppression_version_history, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_suppression_version_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a job's details. # # @see #get_threat_hunting_job_with_http_info diff --git a/lib/datadog_api_client/v2/models/get_suppression_version_history_data.rb b/lib/datadog_api_client/v2/models/get_suppression_version_history_data.rb new file mode 100644 index 000000000000..f9ea2d284621 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_suppression_version_history_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the suppression version history. + class GetSuppressionVersionHistoryData + include BaseGenericModel + + # Response object containing the version history of a suppression. + attr_accessor :attributes + + # ID of the suppression. + attr_accessor :id + + # Type of data. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SuppressionVersionHistory', + :'id' => :'String', + :'type' => :'GetSuppressionVersionHistoryDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetSuppressionVersionHistoryData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_suppression_version_history_data_type.rb b/lib/datadog_api_client/v2/models/get_suppression_version_history_data_type.rb new file mode 100644 index 000000000000..e59004061891 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_suppression_version_history_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of data. + class GetSuppressionVersionHistoryDataType + include BaseEnumModel + + SUPPRESSIONVERSIONHISTORY = "suppression_version_history".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/get_suppression_version_history_response.rb b/lib/datadog_api_client/v2/models/get_suppression_version_history_response.rb new file mode 100644 index 000000000000..8546c6e8e051 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_suppression_version_history_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for getting the suppression version history. + class GetSuppressionVersionHistoryResponse + include BaseGenericModel + + # Data for the suppression version history. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetSuppressionVersionHistoryData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetSuppressionVersionHistoryResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rule_versions.rb b/lib/datadog_api_client/v2/models/rule_versions.rb index c6386c89a111..6c41bd976946 100644 --- a/lib/datadog_api_client/v2/models/rule_versions.rb +++ b/lib/datadog_api_client/v2/models/rule_versions.rb @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'changes' => :'Array', + :'changes' => :'Array', :'rule' => :'SecurityMonitoringRuleResponse' } end diff --git a/lib/datadog_api_client/v2/models/suppression_version_history.rb b/lib/datadog_api_client/v2/models/suppression_version_history.rb new file mode 100644 index 000000000000..c79ace9a70b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/suppression_version_history.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response object containing the version history of a suppression. + class SuppressionVersionHistory + include BaseGenericModel + + # The number of suppression versions. + attr_reader :count + + # The version history of a suppression. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'data' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SuppressionVersionHistory` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@count.nil? && @count > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if !count.nil? && count > 2147483647 + fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 2147483647.' + end + @count = count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + count == o.count && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/suppression_versions.rb b/lib/datadog_api_client/v2/models/suppression_versions.rb new file mode 100644 index 000000000000..812c3d9aa93b --- /dev/null +++ b/lib/datadog_api_client/v2/models/suppression_versions.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A suppression version with a list of updates. + class SuppressionVersions + include BaseGenericModel + + # A list of changes. + attr_accessor :changes + + # The attributes of the suppression rule. + attr_accessor :suppression + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'changes' => :'changes', + :'suppression' => :'suppression' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'changes' => :'Array', + :'suppression' => :'SecurityMonitoringSuppressionAttributes' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SuppressionVersions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'changes') + if (value = attributes[:'changes']).is_a?(Array) + self.changes = value + end + end + + if attributes.key?(:'suppression') + self.suppression = attributes[:'suppression'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + changes == o.changes && + suppression == o.suppression && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [changes, suppression, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rule_version_update.rb b/lib/datadog_api_client/v2/models/version_history_update.rb similarity index 95% rename from lib/datadog_api_client/v2/models/rule_version_update.rb rename to lib/datadog_api_client/v2/models/version_history_update.rb index 5ab6a7ce5b35..ed2abcba8c34 100644 --- a/lib/datadog_api_client/v2/models/rule_version_update.rb +++ b/lib/datadog_api_client/v2/models/version_history_update.rb @@ -18,7 +18,7 @@ module DatadogAPIClient::V2 # A change in a rule version. - class RuleVersionUpdate + class VersionHistoryUpdate include BaseGenericModel # The new value of the field. @@ -48,7 +48,7 @@ def self.openapi_types { :'change' => :'String', :'field' => :'String', - :'type' => :'RuleVersionUpdateType' + :'type' => :'VersionHistoryUpdateType' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RuleVersionUpdate` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::VersionHistoryUpdate` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/rule_version_update_type.rb b/lib/datadog_api_client/v2/models/version_history_update_type.rb similarity index 95% rename from lib/datadog_api_client/v2/models/rule_version_update_type.rb rename to lib/datadog_api_client/v2/models/version_history_update_type.rb index a109d358c7c5..ecb53f88ca21 100644 --- a/lib/datadog_api_client/v2/models/rule_version_update_type.rb +++ b/lib/datadog_api_client/v2/models/version_history_update_type.rb @@ -18,7 +18,7 @@ module DatadogAPIClient::V2 # The type of change. - class RuleVersionUpdateType + class VersionHistoryUpdateType include BaseEnumModel CREATE = "create".freeze