Skip to content

Commit a71f051

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f28e269 of spec repo
1 parent 651b5c0 commit a71f051

File tree

32 files changed

+4112
-188
lines changed

32 files changed

+4112
-188
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 451 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Returns list of Secrets rules returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_secrets_rules".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
p api_instance.get_secrets_rules()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Ruleset get multiple returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_multiple_rulesets".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
9+
body = DatadogAPIClient::V2::GetMultipleRulesetsRequest.new({
10+
data: DatadogAPIClient::V2::GetMultipleRulesetsRequestData.new({
11+
attributes: DatadogAPIClient::V2::GetMultipleRulesetsRequestDataAttributes.new({
12+
rulesets: [],
13+
}),
14+
type: DatadogAPIClient::V2::GetMultipleRulesetsRequestDataType::GET_MULTIPLE_RULESETS_REQUEST,
15+
}),
16+
})
17+
p api_instance.list_multiple_rulesets(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,9 @@
15301530
"page_cursor" => "String",
15311531
"page_limit" => "Integer",
15321532
},
1533+
"v2.ListMultipleRulesets" => {
1534+
"body" => "GetMultipleRulesetsRequest",
1535+
},
15331536
"v2.ListContainerImages" => {
15341537
"filter_tags" => "String",
15351538
"group_by" => "String",

features/v2/security_monitoring.feature

Lines changed: 571 additions & 188 deletions
Large diffs are not rendered by default.

features/v2/undo.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,6 +3780,20 @@
37803780
"type": "safe"
37813781
}
37823782
},
3783+
"ListMultipleRulesets": {
3784+
"tag": "Security Monitoring",
3785+
"undo": {
3786+
"operationId": "TODO",
3787+
"parameters": [],
3788+
"type": "unsafe"
3789+
}
3790+
},
3791+
"GetSecretsRules": {
3792+
"tag": "Security Monitoring",
3793+
"undo": {
3794+
"type": "safe"
3795+
}
3796+
},
37833797
"GetOnDemandConcurrencyCap": {
37843798
"tag": "Synthetics",
37853799
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,13 @@ def initialize
201201
"v2.get_historical_job": false,
202202
"v2.get_rule_version_history": false,
203203
"v2.get_sbom": false,
204+
"v2.get_secrets_rules": false,
204205
"v2.get_security_monitoring_histsignal": false,
205206
"v2.get_security_monitoring_histsignals_by_job_id": false,
206207
"v2.list_assets_sbo_ms": false,
207208
"v2.list_findings": false,
208209
"v2.list_historical_jobs": false,
210+
"v2.list_multiple_rulesets": false,
209211
"v2.list_security_monitoring_histsignals": false,
210212
"v2.list_vulnerabilities": false,
211213
"v2.list_vulnerable_assets": false,

lib/datadog_api_client/inflector.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,6 +2146,22 @@ def overrides
21462146
"v2.get_interfaces_data" => "GetInterfacesData",
21472147
"v2.get_interfaces_response" => "GetInterfacesResponse",
21482148
"v2.get_issue_include_query_parameter_item" => "GetIssueIncludeQueryParameterItem",
2149+
"v2.get_multiple_rulesets_request" => "GetMultipleRulesetsRequest",
2150+
"v2.get_multiple_rulesets_request_data" => "GetMultipleRulesetsRequestData",
2151+
"v2.get_multiple_rulesets_request_data_attributes" => "GetMultipleRulesetsRequestDataAttributes",
2152+
"v2.get_multiple_rulesets_request_data_type" => "GetMultipleRulesetsRequestDataType",
2153+
"v2.get_multiple_rulesets_response" => "GetMultipleRulesetsResponse",
2154+
"v2.get_multiple_rulesets_response_data" => "GetMultipleRulesetsResponseData",
2155+
"v2.get_multiple_rulesets_response_data_attributes" => "GetMultipleRulesetsResponseDataAttributes",
2156+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItems",
2157+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_data" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsData",
2158+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_data_type" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType",
2159+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems",
2160+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_arguments_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems",
2161+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData",
2162+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data_type" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType",
2163+
"v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_tests_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems",
2164+
"v2.get_multiple_rulesets_response_data_type" => "GetMultipleRulesetsResponseDataType",
21492165
"v2.get_resource_evaluation_filters_response" => "GetResourceEvaluationFiltersResponse",
21502166
"v2.get_resource_evaluation_filters_response_data" => "GetResourceEvaluationFiltersResponseData",
21512167
"v2.get_rule_version_history_data" => "GetRuleVersionHistoryData",
@@ -3518,6 +3534,13 @@ def overrides
35183534
"v2.schedule_user_type" => "ScheduleUserType",
35193535
"v2.scorecard_type" => "ScorecardType",
35203536
"v2.search_issues_include_query_parameter_item" => "SearchIssuesIncludeQueryParameterItem",
3537+
"v2.secret_rule_array" => "SecretRuleArray",
3538+
"v2.secret_rule_data" => "SecretRuleData",
3539+
"v2.secret_rule_data_attributes" => "SecretRuleDataAttributes",
3540+
"v2.secret_rule_data_attributes_match_validation" => "SecretRuleDataAttributesMatchValidation",
3541+
"v2.secret_rule_data_attributes_match_validation_invalid_http_status_code_items" => "SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems",
3542+
"v2.secret_rule_data_attributes_match_validation_valid_http_status_code_items" => "SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems",
3543+
"v2.secret_rule_data_type" => "SecretRuleDataType",
35213544
"v2.security_filter" => "SecurityFilter",
35223545
"v2.security_filter_attributes" => "SecurityFilterAttributes",
35233546
"v2.security_filter_create_attributes" => "SecurityFilterCreateAttributes",

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,72 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
18301830
return data, status_code, headers
18311831
end
18321832

1833+
# Returns list of Secrets rules.
1834+
#
1835+
# @see #get_secrets_rules_with_http_info
1836+
def get_secrets_rules(opts = {})
1837+
data, _status_code, _headers = get_secrets_rules_with_http_info(opts)
1838+
data
1839+
end
1840+
1841+
# Returns list of Secrets rules.
1842+
#
1843+
# Returns list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID
1844+
#
1845+
# @param opts [Hash] the optional parameters
1846+
# @return [Array<(SecretRuleArray, Integer, Hash)>] SecretRuleArray data, response status code and response headers
1847+
def get_secrets_rules_with_http_info(opts = {})
1848+
unstable_enabled = @api_client.config.unstable_operations["v2.get_secrets_rules".to_sym]
1849+
if unstable_enabled
1850+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_secrets_rules")
1851+
else
1852+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_secrets_rules"))
1853+
end
1854+
1855+
if @api_client.config.debugging
1856+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_secrets_rules ...'
1857+
end
1858+
# resource path
1859+
local_var_path = '/api/v2/static-analysis/secrets/rules'
1860+
1861+
# query parameters
1862+
query_params = opts[:query_params] || {}
1863+
1864+
# header parameters
1865+
header_params = opts[:header_params] || {}
1866+
# HTTP header 'Accept' (if needed)
1867+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1868+
1869+
# form parameters
1870+
form_params = opts[:form_params] || {}
1871+
1872+
# http body (model)
1873+
post_body = opts[:debug_body]
1874+
1875+
# return_type
1876+
return_type = opts[:debug_return_type] || 'SecretRuleArray'
1877+
1878+
# auth_names
1879+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1880+
1881+
new_options = opts.merge(
1882+
:operation => :get_secrets_rules,
1883+
:header_params => header_params,
1884+
:query_params => query_params,
1885+
:form_params => form_params,
1886+
:body => post_body,
1887+
:auth_names => auth_names,
1888+
:return_type => return_type,
1889+
:api_version => "V2"
1890+
)
1891+
1892+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
1893+
if @api_client.config.debugging
1894+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_secrets_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1895+
end
1896+
return data, status_code, headers
1897+
end
1898+
18331899
# Get a security filter.
18341900
#
18351901
# @see #get_security_filter_with_http_info
@@ -2993,6 +3059,79 @@ def list_historical_jobs_with_http_info(opts = {})
29933059
return data, status_code, headers
29943060
end
29953061

3062+
# Ruleset get multiple.
3063+
#
3064+
# @see #list_multiple_rulesets_with_http_info
3065+
def list_multiple_rulesets(body, opts = {})
3066+
data, _status_code, _headers = list_multiple_rulesets_with_http_info(body, opts)
3067+
data
3068+
end
3069+
3070+
# Ruleset get multiple.
3071+
#
3072+
# Get rules for multiple rulesets in batch.
3073+
#
3074+
# @param body [GetMultipleRulesetsRequest]
3075+
# @param opts [Hash] the optional parameters
3076+
# @return [Array<(GetMultipleRulesetsResponse, Integer, Hash)>] GetMultipleRulesetsResponse data, response status code and response headers
3077+
def list_multiple_rulesets_with_http_info(body, opts = {})
3078+
unstable_enabled = @api_client.config.unstable_operations["v2.list_multiple_rulesets".to_sym]
3079+
if unstable_enabled
3080+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_multiple_rulesets")
3081+
else
3082+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_multiple_rulesets"))
3083+
end
3084+
3085+
if @api_client.config.debugging
3086+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_multiple_rulesets ...'
3087+
end
3088+
# verify the required parameter 'body' is set
3089+
if @api_client.config.client_side_validation && body.nil?
3090+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.list_multiple_rulesets"
3091+
end
3092+
# resource path
3093+
local_var_path = '/api/v2/static-analysis/rulesets'
3094+
3095+
# query parameters
3096+
query_params = opts[:query_params] || {}
3097+
3098+
# header parameters
3099+
header_params = opts[:header_params] || {}
3100+
# HTTP header 'Accept' (if needed)
3101+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
3102+
# HTTP header 'Content-Type'
3103+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
3104+
3105+
# form parameters
3106+
form_params = opts[:form_params] || {}
3107+
3108+
# http body (model)
3109+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
3110+
3111+
# return_type
3112+
return_type = opts[:debug_return_type] || 'GetMultipleRulesetsResponse'
3113+
3114+
# auth_names
3115+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
3116+
3117+
new_options = opts.merge(
3118+
:operation => :list_multiple_rulesets,
3119+
:header_params => header_params,
3120+
:query_params => query_params,
3121+
:form_params => form_params,
3122+
:body => post_body,
3123+
:auth_names => auth_names,
3124+
:return_type => return_type,
3125+
:api_version => "V2"
3126+
)
3127+
3128+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
3129+
if @api_client.config.debugging
3130+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_multiple_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3131+
end
3132+
return data, status_code, headers
3133+
end
3134+
29963135
# Get all security filters.
29973136
#
29983137
# @see #list_security_filters_with_http_info
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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 definition of `GetMultipleRulesetsRequest` object.
21+
class GetMultipleRulesetsRequest
22+
include BaseGenericModel
23+
24+
# The definition of `GetMultipleRulesetsRequestData` object.
25+
attr_accessor :data
26+
27+
attr_accessor :additional_properties
28+
29+
# Attribute mapping from ruby-style variable name to JSON key.
30+
# @!visibility private
31+
def self.attribute_map
32+
{
33+
:'data' => :'data'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'data' => :'GetMultipleRulesetsRequestData'
42+
}
43+
end
44+
45+
# Initializes the object
46+
# @param attributes [Hash] Model attributes in the form of hash
47+
# @!visibility private
48+
def initialize(attributes = {})
49+
if (!attributes.is_a?(Hash))
50+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsRequest` initialize method"
51+
end
52+
53+
self.additional_properties = {}
54+
# check to see if the attribute exists and convert string to symbol for hash key
55+
attributes = attributes.each_with_object({}) { |(k, v), h|
56+
if (!self.class.attribute_map.key?(k.to_sym))
57+
self.additional_properties[k.to_sym] = v
58+
else
59+
h[k.to_sym] = v
60+
end
61+
}
62+
63+
if attributes.key?(:'data')
64+
self.data = attributes[:'data']
65+
end
66+
end
67+
68+
# Returns the object in the form of hash, with additionalProperties support.
69+
# @return [Hash] Returns the object in the form of hash
70+
# @!visibility private
71+
def to_hash
72+
hash = {}
73+
self.class.attribute_map.each_pair do |attr, param|
74+
value = self.send(attr)
75+
if value.nil?
76+
is_nullable = self.class.openapi_nullable.include?(attr)
77+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
78+
end
79+
80+
hash[param] = _to_hash(value)
81+
end
82+
self.additional_properties.each_pair do |attr, value|
83+
hash[attr] = value
84+
end
85+
hash
86+
end
87+
88+
# Checks equality by comparing each attribute.
89+
# @param o [Object] Object to be compared
90+
# @!visibility private
91+
def ==(o)
92+
return true if self.equal?(o)
93+
self.class == o.class &&
94+
data == o.data &&
95+
additional_properties == o.additional_properties
96+
end
97+
98+
# Calculates hash code according to all attributes.
99+
# @return [Integer] Hash code
100+
# @!visibility private
101+
def hash
102+
[data, additional_properties].hash
103+
end
104+
end
105+
end

0 commit comments

Comments
 (0)