Skip to content

Commit 9075671

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4da98699 of spec repo
1 parent 40077f2 commit 9075671

File tree

10 files changed

+105
-4
lines changed

10 files changed

+105
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-09-26 19:34:33.342614",
8-
"spec_repo_commit": "83debf9e"
7+
"regenerated": "2024-09-27 20:18:37.325765",
8+
"spec_repo_commit": "4da98699"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-26 19:34:33.356783",
13-
"spec_repo_commit": "83debf9e"
12+
"regenerated": "2024-09-27 20:18:37.340016",
13+
"spec_repo_commit": "4da98699"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9183,6 +9183,20 @@ components:
91839183
tags:
91849184
$ref: '#/components/schemas/FindingTags'
91859185
type: object
9186+
FindingDetectionType:
9187+
description: The detection type of the finding.
9188+
enum:
9189+
- misconfiguration
9190+
- attack_path
9191+
- identity_risk
9192+
- api_security
9193+
example: misconfiguration
9194+
type: string
9195+
x-enum-varnames:
9196+
- MISCONFIGURATION
9197+
- ATTACK_PATH
9198+
- IDENTITY_RISK
9199+
- API_SECURITY
91869200
FindingEvaluation:
91879201
description: The evaluation of the finding.
91889202
enum:
@@ -33704,6 +33718,17 @@ paths:
3370433718
required: false
3370533719
schema:
3370633720
type: string
33721+
- description: Return findings that match the selected detection types (repeatable).
33722+
example:
33723+
- misconfiguration
33724+
explode: true
33725+
in: query
33726+
name: filter[detection_type]
33727+
required: false
33728+
schema:
33729+
items:
33730+
$ref: '#/components/schemas/FindingDetectionType'
33731+
type: array
3370733732
- description: Return findings that have these associated tags (repeatable).
3370833733
example: filter[tags]=cloud_provider:aws&filter[tags]=aws_account:999999999999
3370933734
in: query
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2024-09-27T19:24:51.188Z

cassettes/features/v2/security_monitoring/List-findings-with-detection-type-query-param-returns-OK-response.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# List findings with detection_type query param returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_findings".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
opts = {
9+
filter_detection_type: [
10+
FindingDetectionType::MISCONFIGURATION,
11+
FindingDetectionType::ATTACK_PATH,
12+
],
13+
}
14+
p api_instance.list_findings(opts)

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,7 @@
16421642
"page_limit" => "Integer",
16431643
"snapshot_timestamp" => "Integer",
16441644
"page_cursor" => "String",
1645+
"filter_detection_type" => "Array<FindingDetectionType>",
16451646
"filter_tags" => "String",
16461647
"filter_evaluation_changed_at" => "String",
16471648
"filter_muted" => "Boolean",

features/v2/security_monitoring.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@ Feature: Security Monitoring
484484
When the request with pagination is sent
485485
Then the response status is 200 OK
486486

487+
@team:DataDog/cloud-security-posture-management
488+
Scenario: List findings with detection_type query param returns "OK" response
489+
Given operation "ListFindings" enabled
490+
And new "ListFindings" request
491+
And request contains "filter[detection_type]" parameter with value ["misconfiguration", "attack_path"]
492+
When the request is sent
493+
Then the response status is 200 OK
494+
487495
@generated @skip @team:DataDog/k9-cloud-security-platform
488496
Scenario: List rules returns "Bad Request" response
489497
Given new "ListSecurityMonitoringRules" request

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ def overrides
14091409
"v2.fastly_service_type" => "FastlyServiceType",
14101410
"v2.finding" => "Finding",
14111411
"v2.finding_attributes" => "FindingAttributes",
1412+
"v2.finding_detection_type" => "FindingDetectionType",
14121413
"v2.finding_evaluation" => "FindingEvaluation",
14131414
"v2.finding_mute" => "FindingMute",
14141415
"v2.finding_mute_reason" => "FindingMuteReason",

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ def list_findings(opts = {})
11571157
# @option opts [Integer] :page_limit Limit the number of findings returned. Must be <= 1000.
11581158
# @option opts [Integer] :snapshot_timestamp Return findings for a given snapshot of time (Unix ms).
11591159
# @option opts [String] :page_cursor Return the next page of findings pointed to by the cursor.
1160+
# @option opts [Array<FindingDetectionType>] :filter_detection_type Return findings that match the selected detection types (repeatable).
11601161
# @option opts [String] :filter_tags Return findings that have these associated tags (repeatable).
11611162
# @option opts [String] :filter_evaluation_changed_at Return findings that have changed from pass to fail or vice versa on a specified date (Unix ms) or date range (using comparison operators).
11621163
# @option opts [Boolean] :filter_muted Set to `true` to return findings that are muted. Set to `false` to return unmuted findings.
@@ -1203,6 +1204,7 @@ def list_findings_with_http_info(opts = {})
12031204
query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
12041205
query_params[:'snapshot_timestamp'] = opts[:'snapshot_timestamp'] if !opts[:'snapshot_timestamp'].nil?
12051206
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
1207+
query_params[:'filter[detection_type]'] = @api_client.build_collection_param(opts[:'filter_detection_type'], :multi) if !opts[:'filter_detection_type'].nil?
12061208
query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil?
12071209
query_params[:'filter[evaluation_changed_at]'] = opts[:'filter_evaluation_changed_at'] if !opts[:'filter_evaluation_changed_at'].nil?
12081210
query_params[:'filter[muted]'] = opts[:'filter_muted'] if !opts[:'filter_muted'].nil?
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The detection type of the finding.
21+
class FindingDetectionType
22+
include BaseEnumModel
23+
24+
MISCONFIGURATION = "misconfiguration".freeze
25+
ATTACK_PATH = "attack_path".freeze
26+
IDENTITY_RISK = "identity_risk".freeze
27+
API_SECURITY = "api_security".freeze
28+
end
29+
end

0 commit comments

Comments
 (0)