datadog_api_client 2.23.0 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/schemas/v1/openapi.yaml +666 -156
- data/.generator/schemas/v2/openapi.yaml +774 -89
- data/.generator/src/generator/replacement.json +1 -1
- data/.github/CODEOWNERS +5 -5
- data/CHANGELOG.md +26 -0
- data/examples/v1/dashboards/CreateDashboard_1213075383.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_2336428357.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_2563642929.rb +66 -0
- data/examples/v1/dashboards/CreateDashboard_3669695268.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_915214113.rb +10 -4
- data/examples/v1/monitors/UpdateMonitor.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +9 -4
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +15 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.rb +134 -0
- data/examples/v2/api-management/ListAPIs.rb +8 -0
- data/examples/v2/csm-threats/CreateCSMThreatsAgentRule.rb +3 -0
- data/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.rb +1 -0
- data/examples/v2/organizations/GetOrgConfig.rb +5 -0
- data/examples/v2/organizations/ListOrgConfigs.rb +5 -0
- data/examples/v2/organizations/UpdateOrgConfig.rb +14 -0
- data/examples/v2/security-monitoring/TestExistingSecurityMonitoringRule.rb +21 -0
- data/examples/v2/security-monitoring/TestSecurityMonitoringRule.rb +58 -0
- data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +1 -1
- data/lib/datadog_api_client/configuration.rb +1 -0
- data/lib/datadog_api_client/inflector.rb +37 -1
- data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
- data/lib/datadog_api_client/v1/models/event.rb +1 -1
- data/lib/datadog_api_client/v1/models/formula_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +14 -4
- data/lib/datadog_api_client/v1/models/group_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/monitor.rb +1 -16
- data/lib/datadog_api_client/v1/models/monitor_update_request.rb +2 -23
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +37 -180
- data/lib/datadog_api_client/v1/models/synthetics_api_test_step.rb +206 -0
- data/lib/datadog_api_client/v1/models/{synthetics_api_step_subtype.rb → synthetics_api_test_step_subtype.rb} +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_api_wait_step.rb +148 -0
- data/lib/datadog_api_client/v1/models/synthetics_api_wait_step_subtype.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_operator.rb +28 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_target.rb +140 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_json_path_target_target.rb +11 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb +0 -4
- data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +22 -1
- data/lib/datadog_api_client/v1/models/table_widget_request.rb +14 -4
- data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +7 -7
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_response.rb +2 -2
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +168 -18
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +169 -19
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +171 -21
- data/lib/datadog_api_client/v1/models/widget_formula_sort.rb +144 -0
- data/lib/datadog_api_client/v1/models/widget_group_sort.rb +140 -0
- data/lib/datadog_api_client/v1/models/widget_sort_by.rb +110 -0
- data/lib/datadog_api_client/v1/models/widget_sort_order_by.rb +63 -0
- data/lib/datadog_api_client/v2/api/api_management_api.rb +80 -2
- data/lib/datadog_api_client/v2/api/organizations_api.rb +197 -0
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +140 -1
- data/lib/datadog_api_client/v2/models/cloud_configuration_rule_payload.rb +240 -0
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb +13 -1
- data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v2/models/events_group_by.rb +5 -4
- data/lib/datadog_api_client/v2/models/list_apis_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_data_attributes.rb +80 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_meta.rb +80 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_meta_pagination.rb +100 -0
- data/lib/datadog_api_client/v2/models/org_config_get_response.rb +98 -0
- data/lib/datadog_api_client/v2/models/org_config_list_response.rb +100 -0
- data/lib/datadog_api_client/v2/models/org_config_read.rb +140 -0
- data/lib/datadog_api_client/v2/models/org_config_read_attributes.rb +179 -0
- data/lib/datadog_api_client/v2/models/org_config_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/org_config_write.rb +119 -0
- data/lib/datadog_api_client/v2/models/org_config_write_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/org_config_write_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload.rb +118 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload_data.rb +120 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_payload.rb +62 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_request.rb +92 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_response.rb +84 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_test.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_validate_payload.rb +64 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_payload.rb +251 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_payload.rb +263 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_test_payload.rb +263 -0
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +47 -3
@@ -0,0 +1,118 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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
|
+
# Payload to test a rule query with the expected result.
|
21
|
+
class SecurityMonitoringRuleQueryPayload
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# Expected result of the test.
|
25
|
+
attr_accessor :expected_result
|
26
|
+
|
27
|
+
# Index of the query under test.
|
28
|
+
attr_reader :index
|
29
|
+
|
30
|
+
# Payload used to test the rule query.
|
31
|
+
attr_accessor :payload
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
# @!visibility private
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'expected_result' => :'expectedResult',
|
38
|
+
:'index' => :'index',
|
39
|
+
:'payload' => :'payload'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
# @!visibility private
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'expected_result' => :'Boolean',
|
48
|
+
:'index' => :'Integer',
|
49
|
+
:'payload' => :'SecurityMonitoringRuleQueryPayloadData'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
55
|
+
# @!visibility private
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayload` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'expected_result')
|
70
|
+
self.expected_result = attributes[:'expected_result']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'index')
|
74
|
+
self.index = attributes[:'index']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'payload')
|
78
|
+
self.payload = attributes[:'payload']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
# @!visibility private
|
85
|
+
def valid?
|
86
|
+
return false if !@index.nil? && @index < 0
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Custom attribute writer method with validation
|
91
|
+
# @param index [Object] Object to be assigned
|
92
|
+
# @!visibility private
|
93
|
+
def index=(index)
|
94
|
+
if !index.nil? && index < 0
|
95
|
+
fail ArgumentError, 'invalid value for "index", must be greater than or equal to 0.'
|
96
|
+
end
|
97
|
+
@index = index
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param o [Object] Object to be compared
|
102
|
+
# @!visibility private
|
103
|
+
def ==(o)
|
104
|
+
return true if self.equal?(o)
|
105
|
+
self.class == o.class &&
|
106
|
+
expected_result == o.expected_result &&
|
107
|
+
index == o.index &&
|
108
|
+
payload == o.payload
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
# @!visibility private
|
114
|
+
def hash
|
115
|
+
[expected_result, index, payload].hash
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,120 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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
|
+
# Payload used to test the rule query.
|
21
|
+
class SecurityMonitoringRuleQueryPayloadData
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# Source of the payload.
|
25
|
+
attr_accessor :ddsource
|
26
|
+
|
27
|
+
# Tags associated with your data.
|
28
|
+
attr_accessor :ddtags
|
29
|
+
|
30
|
+
# The name of the originating host of the log.
|
31
|
+
attr_accessor :hostname
|
32
|
+
|
33
|
+
# The message of the payload.
|
34
|
+
attr_accessor :message
|
35
|
+
|
36
|
+
# The name of the application or service generating the data.
|
37
|
+
attr_accessor :service
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
# @!visibility private
|
41
|
+
def self.attribute_map
|
42
|
+
{
|
43
|
+
:'ddsource' => :'ddsource',
|
44
|
+
:'ddtags' => :'ddtags',
|
45
|
+
:'hostname' => :'hostname',
|
46
|
+
:'message' => :'message',
|
47
|
+
:'service' => :'service'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
# @!visibility private
|
53
|
+
def self.openapi_types
|
54
|
+
{
|
55
|
+
:'ddsource' => :'String',
|
56
|
+
:'ddtags' => :'String',
|
57
|
+
:'hostname' => :'String',
|
58
|
+
:'message' => :'String',
|
59
|
+
:'service' => :'String'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
65
|
+
# @!visibility private
|
66
|
+
def initialize(attributes = {})
|
67
|
+
if (!attributes.is_a?(Hash))
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayloadData` initialize method"
|
69
|
+
end
|
70
|
+
|
71
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
73
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayloadData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
75
|
+
end
|
76
|
+
h[k.to_sym] = v
|
77
|
+
}
|
78
|
+
|
79
|
+
if attributes.key?(:'ddsource')
|
80
|
+
self.ddsource = attributes[:'ddsource']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'ddtags')
|
84
|
+
self.ddtags = attributes[:'ddtags']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'hostname')
|
88
|
+
self.hostname = attributes[:'hostname']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'message')
|
92
|
+
self.message = attributes[:'message']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'service')
|
96
|
+
self.service = attributes[:'service']
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param o [Object] Object to be compared
|
102
|
+
# @!visibility private
|
103
|
+
def ==(o)
|
104
|
+
return true if self.equal?(o)
|
105
|
+
self.class == o.class &&
|
106
|
+
ddsource == o.ddsource &&
|
107
|
+
ddtags == o.ddtags &&
|
108
|
+
hostname == o.hostname &&
|
109
|
+
message == o.message &&
|
110
|
+
service == o.service
|
111
|
+
end
|
112
|
+
|
113
|
+
# Calculates hash code according to all attributes.
|
114
|
+
# @return [Integer] Hash code
|
115
|
+
# @!visibility private
|
116
|
+
def hash
|
117
|
+
[ddsource, ddtags, hostname, message, service].hash
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,62 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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
|
+
# Test a rule.
|
21
|
+
module SecurityMonitoringRuleTestPayload
|
22
|
+
class << self
|
23
|
+
include BaseOneOfModel
|
24
|
+
include BaseOneOfModelNoDiscriminator
|
25
|
+
|
26
|
+
# List of class defined in oneOf (OpenAPI v3)
|
27
|
+
def openapi_one_of
|
28
|
+
[
|
29
|
+
:'SecurityMonitoringStandardRuleTestPayload'
|
30
|
+
]
|
31
|
+
end
|
32
|
+
# Builds the object
|
33
|
+
# @param data [Mixed] Data to be matched against the list of oneOf items
|
34
|
+
# @return [Object] Returns the model or the data itself
|
35
|
+
def build(data)
|
36
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
37
|
+
# Note:
|
38
|
+
# - We do not attempt to check whether exactly one item matches.
|
39
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
40
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
41
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
42
|
+
# - TODO: logging when debugging is set.
|
43
|
+
openapi_one_of.each do |klass|
|
44
|
+
begin
|
45
|
+
next if klass == :AnyType # "nullable: true"
|
46
|
+
typed_data = find_and_cast_into_type(klass, data)
|
47
|
+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
|
48
|
+
return typed_data if typed_data
|
49
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
if openapi_one_of.include?(:AnyType)
|
54
|
+
data
|
55
|
+
else
|
56
|
+
self._unparsed = true
|
57
|
+
DatadogAPIClient::UnparsedObject.new(data)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,92 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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
|
+
# Test the rule queries of a rule (rule property is ignored when applied to an existing rule)
|
21
|
+
class SecurityMonitoringRuleTestRequest
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# Test a rule.
|
25
|
+
attr_accessor :rule
|
26
|
+
|
27
|
+
# Data payloads used to test rules query with the expected result.
|
28
|
+
attr_accessor :rule_query_payloads
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
# @!visibility private
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'rule' => :'rule',
|
35
|
+
:'rule_query_payloads' => :'ruleQueryPayloads'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
# @!visibility private
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'rule' => :'SecurityMonitoringRuleTestPayload',
|
44
|
+
:'rule_query_payloads' => :'Array<SecurityMonitoringRuleQueryPayload>'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Initializes the object
|
49
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
50
|
+
# @!visibility private
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleTestRequest` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleTestRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'rule')
|
65
|
+
self.rule = attributes[:'rule']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'rule_query_payloads')
|
69
|
+
if (value = attributes[:'rule_query_payloads']).is_a?(Array)
|
70
|
+
self.rule_query_payloads = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param o [Object] Object to be compared
|
77
|
+
# @!visibility private
|
78
|
+
def ==(o)
|
79
|
+
return true if self.equal?(o)
|
80
|
+
self.class == o.class &&
|
81
|
+
rule == o.rule &&
|
82
|
+
rule_query_payloads == o.rule_query_payloads
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Integer] Hash code
|
87
|
+
# @!visibility private
|
88
|
+
def hash
|
89
|
+
[rule, rule_query_payloads].hash
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,84 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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
|
+
# Result of the test of the rule queries.
|
21
|
+
class SecurityMonitoringRuleTestResponse
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# Assert results are returned in the same order as the rule query payloads.
|
25
|
+
# For each payload, it returns True if the result matched the expected result,
|
26
|
+
# False otherwise.
|
27
|
+
attr_accessor :results
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
# @!visibility private
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'results' => :'results'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
# @!visibility private
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'results' => :'Array<Boolean>'
|
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::SecurityMonitoringRuleTestResponse` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleTestResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'results')
|
62
|
+
if (value = attributes[:'results']).is_a?(Array)
|
63
|
+
self.results = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Checks equality by comparing each attribute.
|
69
|
+
# @param o [Object] Object to be compared
|
70
|
+
# @!visibility private
|
71
|
+
def ==(o)
|
72
|
+
return true if self.equal?(o)
|
73
|
+
self.class == o.class &&
|
74
|
+
results == o.results
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Integer] Hash code
|
79
|
+
# @!visibility private
|
80
|
+
def hash
|
81
|
+
[results].hash
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,26 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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 rule type.
|
21
|
+
class SecurityMonitoringRuleTypeTest
|
22
|
+
include BaseEnumModel
|
23
|
+
|
24
|
+
LOG_DETECTION = "log_detection".freeze
|
25
|
+
end
|
26
|
+
end
|
@@ -51,7 +51,7 @@ module DatadogAPIClient::V2
|
|
51
51
|
# Tags for generated signals.
|
52
52
|
attr_accessor :tags
|
53
53
|
|
54
|
-
# Cases for generating signals from third
|
54
|
+
# Cases for generating signals from third-party rules. Only available for third-party rules.
|
55
55
|
attr_accessor :third_party_cases
|
56
56
|
|
57
57
|
# The version of the rule being updated.
|
@@ -0,0 +1,64 @@
|
|
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
|
+
Contact: support@datadoghq.com
|
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
|
+
# Validate a rule.
|
21
|
+
module SecurityMonitoringRuleValidatePayload
|
22
|
+
class << self
|
23
|
+
include BaseOneOfModel
|
24
|
+
include BaseOneOfModelNoDiscriminator
|
25
|
+
|
26
|
+
# List of class defined in oneOf (OpenAPI v3)
|
27
|
+
def openapi_one_of
|
28
|
+
[
|
29
|
+
:'SecurityMonitoringStandardRulePayload',
|
30
|
+
:'SecurityMonitoringSignalRulePayload',
|
31
|
+
:'CloudConfigurationRulePayload'
|
32
|
+
]
|
33
|
+
end
|
34
|
+
# Builds the object
|
35
|
+
# @param data [Mixed] Data to be matched against the list of oneOf items
|
36
|
+
# @return [Object] Returns the model or the data itself
|
37
|
+
def build(data)
|
38
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
39
|
+
# Note:
|
40
|
+
# - We do not attempt to check whether exactly one item matches.
|
41
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
42
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
43
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
44
|
+
# - TODO: logging when debugging is set.
|
45
|
+
openapi_one_of.each do |klass|
|
46
|
+
begin
|
47
|
+
next if klass == :AnyType # "nullable: true"
|
48
|
+
typed_data = find_and_cast_into_type(klass, data)
|
49
|
+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
|
50
|
+
return typed_data if typed_data
|
51
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
if openapi_one_of.include?(:AnyType)
|
56
|
+
data
|
57
|
+
else
|
58
|
+
self._unparsed = true
|
59
|
+
DatadogAPIClient::UnparsedObject.new(data)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|