Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-17 13:26:11.488046",
"spec_repo_commit": "12ab5180"
"regenerated": "2025-04-18 16:37:12.793461",
"spec_repo_commit": "8ff9b6bd"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-17 13:26:11.504561",
"spec_repo_commit": "12ab5180"
"regenerated": "2025-04-18 16:37:12.809005",
"spec_repo_commit": "8ff9b6bd"
}
}
}
1 change: 0 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52698,7 +52698,6 @@ paths:
operator: OR
permissions:
- security_monitoring_rules_read
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.'
/api/v2/security_monitoring/signals:
get:
description: 'The list endpoint returns security signals that match a search
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/GetRuleVersionHistory.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Get a rule's version history returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_rule_version_history".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
p api_instance.get_rule_version_history("rule_id")
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Get rule version history returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_rule_version_history".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

# there is a valid "security_rule" in the system
Expand Down
12 changes: 4 additions & 8 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -604,24 +604,21 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Get a rule's version history returns "Bad Request" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And request contains "rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Get a rule's version history returns "Not Found" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And request contains "rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Get a rule's version history returns "OK" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And request contains "rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
Expand Down Expand Up @@ -737,8 +734,7 @@ Feature: Security Monitoring

@skip-go @skip-java @skip-ruby @team:DataDog/k9-cloud-security-platform
Scenario: Get rule version history returns "OK" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And there is a valid "security_rule" in the system
And request contains "rule_id" parameter from "security_rule.id"
When the request is sent
Expand Down
1 change: 0 additions & 1 deletion lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ def initialize
"v2.delete_historical_job": false,
"v2.get_finding": false,
"v2.get_historical_job": false,
"v2.get_rule_version_history": false,
"v2.get_sbom": false,
"v2.list_findings": false,
"v2.list_historical_jobs": false,
Expand Down
6 changes: 0 additions & 6 deletions lib/datadog_api_client/v2/api/security_monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1416,12 +1416,6 @@ def get_rule_version_history(rule_id, opts = {})
# @option opts [Integer] :page_number Specific page number to return.
# @return [Array<(GetRuleVersionHistoryResponse, Integer, Hash)>] GetRuleVersionHistoryResponse data, response status code and response headers
def get_rule_version_history_with_http_info(rule_id, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_rule_version_history".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_rule_version_history")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_rule_version_history"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_rule_version_history ...'
Expand Down
6 changes: 2 additions & 4 deletions lib/datadog_api_client/v2/model_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _deserialize(type, value)
# generic array, return directly
value
when :UUID
value
value.to_s
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
Expand Down Expand Up @@ -255,9 +255,7 @@ def find_and_cast_into_type(klass, data)
when 'Object' # "type: object"
return data if data.instance_of?(Hash)
when 'UUID'
raise TypeError, "Expected String, got #{uuid_string.class.name} instead." unless uuid_string.kind_of?(String)
raise ArgumentError, "Invalid UUID format." unless /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/.match?(data)
return data
return UUIDTools::UUID.parse(data)
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
if data.instance_of?(Array)
sub_type = Regexp.last_match[:sub_type]
Expand Down
Loading