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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +666 -156
  4. data/.generator/schemas/v2/openapi.yaml +774 -89
  5. data/.generator/src/generator/replacement.json +1 -1
  6. data/.github/CODEOWNERS +5 -5
  7. data/CHANGELOG.md +26 -0
  8. data/examples/v1/dashboards/CreateDashboard_1213075383.rb +10 -4
  9. data/examples/v1/dashboards/CreateDashboard_2336428357.rb +10 -4
  10. data/examples/v1/dashboards/CreateDashboard_2563642929.rb +66 -0
  11. data/examples/v1/dashboards/CreateDashboard_3669695268.rb +10 -4
  12. data/examples/v1/dashboards/CreateDashboard_915214113.rb +10 -4
  13. data/examples/v1/monitors/UpdateMonitor.rb +1 -0
  14. data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +1 -0
  15. data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +9 -4
  16. data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +15 -0
  17. data/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.rb +134 -0
  18. data/examples/v2/api-management/ListAPIs.rb +8 -0
  19. data/examples/v2/csm-threats/CreateCSMThreatsAgentRule.rb +3 -0
  20. data/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.rb +1 -0
  21. data/examples/v2/organizations/GetOrgConfig.rb +5 -0
  22. data/examples/v2/organizations/ListOrgConfigs.rb +5 -0
  23. data/examples/v2/organizations/UpdateOrgConfig.rb +14 -0
  24. data/examples/v2/security-monitoring/TestExistingSecurityMonitoringRule.rb +21 -0
  25. data/examples/v2/security-monitoring/TestSecurityMonitoringRule.rb +58 -0
  26. data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +1 -1
  27. data/lib/datadog_api_client/configuration.rb +1 -0
  28. data/lib/datadog_api_client/inflector.rb +37 -1
  29. data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
  30. data/lib/datadog_api_client/v1/models/event.rb +1 -1
  31. data/lib/datadog_api_client/v1/models/formula_type.rb +26 -0
  32. data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +14 -4
  33. data/lib/datadog_api_client/v1/models/group_type.rb +26 -0
  34. data/lib/datadog_api_client/v1/models/monitor.rb +1 -16
  35. data/lib/datadog_api_client/v1/models/monitor_update_request.rb +2 -23
  36. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +2 -2
  37. data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +37 -180
  38. data/lib/datadog_api_client/v1/models/synthetics_api_test_step.rb +206 -0
  39. data/lib/datadog_api_client/v1/models/{synthetics_api_step_subtype.rb → synthetics_api_test_step_subtype.rb} +2 -2
  40. data/lib/datadog_api_client/v1/models/synthetics_api_wait_step.rb +148 -0
  41. data/lib/datadog_api_client/v1/models/synthetics_api_wait_step_subtype.rb +26 -0
  42. data/lib/datadog_api_client/v1/models/synthetics_assertion.rb +1 -0
  43. data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_operator.rb +28 -0
  44. data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_target.rb +140 -0
  45. data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_type.rb +26 -0
  46. data/lib/datadog_api_client/v1/models/synthetics_assertion_json_path_target_target.rb +11 -1
  47. data/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb +0 -4
  48. data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +22 -1
  49. data/lib/datadog_api_client/v1/models/table_widget_request.rb +14 -4
  50. data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +11 -1
  51. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +7 -7
  52. data/lib/datadog_api_client/v1/models/usage_rum_sessions_response.rb +2 -2
  53. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +168 -18
  54. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +169 -19
  55. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +171 -21
  56. data/lib/datadog_api_client/v1/models/widget_formula_sort.rb +144 -0
  57. data/lib/datadog_api_client/v1/models/widget_group_sort.rb +140 -0
  58. data/lib/datadog_api_client/v1/models/widget_sort_by.rb +110 -0
  59. data/lib/datadog_api_client/v1/models/widget_sort_order_by.rb +63 -0
  60. data/lib/datadog_api_client/v2/api/api_management_api.rb +80 -2
  61. data/lib/datadog_api_client/v2/api/organizations_api.rb +197 -0
  62. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +140 -1
  63. data/lib/datadog_api_client/v2/models/cloud_configuration_rule_payload.rb +240 -0
  64. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb +13 -1
  65. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +1 -1
  66. data/lib/datadog_api_client/v2/models/events_group_by.rb +5 -4
  67. data/lib/datadog_api_client/v2/models/list_apis_response.rb +92 -0
  68. data/lib/datadog_api_client/v2/models/list_apis_response_data.rb +90 -0
  69. data/lib/datadog_api_client/v2/models/list_apis_response_data_attributes.rb +80 -0
  70. data/lib/datadog_api_client/v2/models/list_apis_response_meta.rb +80 -0
  71. data/lib/datadog_api_client/v2/models/list_apis_response_meta_pagination.rb +100 -0
  72. data/lib/datadog_api_client/v2/models/org_config_get_response.rb +98 -0
  73. data/lib/datadog_api_client/v2/models/org_config_list_response.rb +100 -0
  74. data/lib/datadog_api_client/v2/models/org_config_read.rb +140 -0
  75. data/lib/datadog_api_client/v2/models/org_config_read_attributes.rb +179 -0
  76. data/lib/datadog_api_client/v2/models/org_config_type.rb +26 -0
  77. data/lib/datadog_api_client/v2/models/org_config_write.rb +119 -0
  78. data/lib/datadog_api_client/v2/models/org_config_write_attributes.rb +98 -0
  79. data/lib/datadog_api_client/v2/models/org_config_write_request.rb +98 -0
  80. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload.rb +118 -0
  81. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload_data.rb +120 -0
  82. data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_payload.rb +62 -0
  83. data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_request.rb +92 -0
  84. data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_response.rb +84 -0
  85. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_test.rb +26 -0
  86. data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
  87. data/lib/datadog_api_client/v2/models/security_monitoring_rule_validate_payload.rb +64 -0
  88. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_payload.rb +251 -0
  89. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
  90. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_payload.rb +263 -0
  91. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
  92. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_test_payload.rb +263 -0
  93. data/lib/datadog_api_client/version.rb +1 -1
  94. metadata +47 -3
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Datadog API V1 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::V1
20
+ # The Test step used in a Synthetic multi-step API test.
21
+ class SyntheticsAPITestStep
22
+ include BaseGenericModel
23
+
24
+ # Determines whether or not to continue with test if this step fails.
25
+ attr_accessor :allow_failure
26
+
27
+ # Array of assertions used for the test.
28
+ attr_reader :assertions
29
+
30
+ # Array of values to parse and save as variables from the response.
31
+ attr_accessor :extracted_values
32
+
33
+ # Determines whether or not to consider the entire test as failed if this step fails.
34
+ # Can be used only if `allowFailure` is `true`.
35
+ attr_accessor :is_critical
36
+
37
+ # The name of the step.
38
+ attr_reader :name
39
+
40
+ # Object describing the Synthetic test request.
41
+ attr_reader :request
42
+
43
+ # Object describing the retry strategy to apply to a Synthetic test.
44
+ attr_accessor :_retry
45
+
46
+ # The subtype of the Synthetic multi-step API test step.
47
+ attr_reader :subtype
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ # @!visibility private
51
+ def self.attribute_map
52
+ {
53
+ :'allow_failure' => :'allowFailure',
54
+ :'assertions' => :'assertions',
55
+ :'extracted_values' => :'extractedValues',
56
+ :'is_critical' => :'isCritical',
57
+ :'name' => :'name',
58
+ :'request' => :'request',
59
+ :'_retry' => :'retry',
60
+ :'subtype' => :'subtype'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ # @!visibility private
66
+ def self.openapi_types
67
+ {
68
+ :'allow_failure' => :'Boolean',
69
+ :'assertions' => :'Array<SyntheticsAssertion>',
70
+ :'extracted_values' => :'Array<SyntheticsParsingOptions>',
71
+ :'is_critical' => :'Boolean',
72
+ :'name' => :'String',
73
+ :'request' => :'SyntheticsTestRequest',
74
+ :'_retry' => :'SyntheticsTestOptionsRetry',
75
+ :'subtype' => :'SyntheticsAPITestStepSubtype'
76
+ }
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param attributes [Hash] Model attributes in the form of hash
81
+ # @!visibility private
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsAPITestStep` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SyntheticsAPITestStep`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'allow_failure')
96
+ self.allow_failure = attributes[:'allow_failure']
97
+ end
98
+
99
+ if attributes.key?(:'assertions')
100
+ if (value = attributes[:'assertions']).is_a?(Array)
101
+ self.assertions = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'extracted_values')
106
+ if (value = attributes[:'extracted_values']).is_a?(Array)
107
+ self.extracted_values = value
108
+ end
109
+ end
110
+
111
+ if attributes.key?(:'is_critical')
112
+ self.is_critical = attributes[:'is_critical']
113
+ end
114
+
115
+ if attributes.key?(:'name')
116
+ self.name = attributes[:'name']
117
+ end
118
+
119
+ if attributes.key?(:'request')
120
+ self.request = attributes[:'request']
121
+ end
122
+
123
+ if attributes.key?(:'_retry')
124
+ self._retry = attributes[:'_retry']
125
+ end
126
+
127
+ if attributes.key?(:'subtype')
128
+ self.subtype = attributes[:'subtype']
129
+ end
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ # @!visibility private
135
+ def valid?
136
+ return false if @assertions.nil?
137
+ return false if @name.nil?
138
+ return false if @request.nil?
139
+ return false if @subtype.nil?
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param assertions [Object] Object to be assigned
145
+ # @!visibility private
146
+ def assertions=(assertions)
147
+ if assertions.nil?
148
+ fail ArgumentError, 'invalid value for "assertions", assertions cannot be nil.'
149
+ end
150
+ @assertions = assertions
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param name [Object] Object to be assigned
155
+ # @!visibility private
156
+ def name=(name)
157
+ if name.nil?
158
+ fail ArgumentError, 'invalid value for "name", name cannot be nil.'
159
+ end
160
+ @name = name
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param request [Object] Object to be assigned
165
+ # @!visibility private
166
+ def request=(request)
167
+ if request.nil?
168
+ fail ArgumentError, 'invalid value for "request", request cannot be nil.'
169
+ end
170
+ @request = request
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param subtype [Object] Object to be assigned
175
+ # @!visibility private
176
+ def subtype=(subtype)
177
+ if subtype.nil?
178
+ fail ArgumentError, 'invalid value for "subtype", subtype cannot be nil.'
179
+ end
180
+ @subtype = subtype
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param o [Object] Object to be compared
185
+ # @!visibility private
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ allow_failure == o.allow_failure &&
190
+ assertions == o.assertions &&
191
+ extracted_values == o.extracted_values &&
192
+ is_critical == o.is_critical &&
193
+ name == o.name &&
194
+ request == o.request &&
195
+ _retry == o._retry &&
196
+ subtype == o.subtype
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ # @!visibility private
202
+ def hash
203
+ [allow_failure, assertions, extracted_values, is_critical, name, request, _retry, subtype].hash
204
+ end
205
+ end
206
+ end
@@ -17,8 +17,8 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The subtype of the Synthetic multistep API test step, currently only supporting `http`.
21
- class SyntheticsAPIStepSubtype
20
+ # The subtype of the Synthetic multi-step API test step.
21
+ class SyntheticsAPITestStepSubtype
22
22
  include BaseEnumModel
23
23
 
24
24
  HTTP = "http".freeze
@@ -0,0 +1,148 @@
1
+ =begin
2
+ #Datadog API V1 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::V1
20
+ # The Wait step used in a Synthetic multi-step API test.
21
+ class SyntheticsAPIWaitStep
22
+ include BaseGenericModel
23
+
24
+ # The name of the step.
25
+ attr_reader :name
26
+
27
+ # The subtype of the Synthetic multi-step API wait step.
28
+ attr_reader :subtype
29
+
30
+ # The time to wait in seconds. Minimum value: 0. Maximum value: 180.
31
+ attr_reader :value
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ # @!visibility private
35
+ def self.attribute_map
36
+ {
37
+ :'name' => :'name',
38
+ :'subtype' => :'subtype',
39
+ :'value' => :'value'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'name' => :'String',
48
+ :'subtype' => :'SyntheticsAPIWaitStepSubtype',
49
+ :'value' => :'Integer'
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::V1::SyntheticsAPIWaitStep` 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::V1::SyntheticsAPIWaitStep`. 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?(:'name')
70
+ self.name = attributes[:'name']
71
+ end
72
+
73
+ if attributes.key?(:'subtype')
74
+ self.subtype = attributes[:'subtype']
75
+ end
76
+
77
+ if attributes.key?(:'value')
78
+ self.value = attributes[:'value']
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 @name.nil?
87
+ return false if @subtype.nil?
88
+ return false if @value.nil?
89
+ return false if @value > 180
90
+ return false if @value < 0
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param name [Object] Object to be assigned
96
+ # @!visibility private
97
+ def name=(name)
98
+ if name.nil?
99
+ fail ArgumentError, 'invalid value for "name", name cannot be nil.'
100
+ end
101
+ @name = name
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param subtype [Object] Object to be assigned
106
+ # @!visibility private
107
+ def subtype=(subtype)
108
+ if subtype.nil?
109
+ fail ArgumentError, 'invalid value for "subtype", subtype cannot be nil.'
110
+ end
111
+ @subtype = subtype
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param value [Object] Object to be assigned
116
+ # @!visibility private
117
+ def value=(value)
118
+ if value.nil?
119
+ fail ArgumentError, 'invalid value for "value", value cannot be nil.'
120
+ end
121
+ if value > 180
122
+ fail ArgumentError, 'invalid value for "value", must be smaller than or equal to 180.'
123
+ end
124
+ if value < 0
125
+ fail ArgumentError, 'invalid value for "value", must be greater than or equal to 0.'
126
+ end
127
+ @value = value
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param o [Object] Object to be compared
132
+ # @!visibility private
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ name == o.name &&
137
+ subtype == o.subtype &&
138
+ value == o.value
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ # @!visibility private
144
+ def hash
145
+ [name, subtype, value].hash
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ #Datadog API V1 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::V1
20
+ # The subtype of the Synthetic multi-step API wait step.
21
+ class SyntheticsAPIWaitStepSubtype
22
+ include BaseEnumModel
23
+
24
+ WAIT = "wait".freeze
25
+ end
26
+ end
@@ -28,6 +28,7 @@ module DatadogAPIClient::V1
28
28
  def openapi_one_of
29
29
  [
30
30
  :'SyntheticsAssertionTarget',
31
+ :'SyntheticsAssertionBodyHashTarget',
31
32
  :'SyntheticsAssertionJSONPathTarget',
32
33
  :'SyntheticsAssertionJSONSchemaTarget',
33
34
  :'SyntheticsAssertionXPathTarget'
@@ -0,0 +1,28 @@
1
+ =begin
2
+ #Datadog API V1 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::V1
20
+ # Assertion operator to apply.
21
+ class SyntheticsAssertionBodyHashOperator
22
+ include BaseEnumModel
23
+
24
+ MD5 = "md5".freeze
25
+ SHA1 = "sha1".freeze
26
+ SHA256 = "sha256".freeze
27
+ end
28
+ end
@@ -0,0 +1,140 @@
1
+ =begin
2
+ #Datadog API V1 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::V1
20
+ # An assertion which targets body hash.
21
+ class SyntheticsAssertionBodyHashTarget
22
+ include BaseGenericModel
23
+
24
+ # Assertion operator to apply.
25
+ attr_reader :operator
26
+
27
+ # Value used by the operator.
28
+ attr_reader :target
29
+
30
+ # Type of the assertion.
31
+ attr_reader :type
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ # @!visibility private
35
+ def self.attribute_map
36
+ {
37
+ :'operator' => :'operator',
38
+ :'target' => :'target',
39
+ :'type' => :'type'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'operator' => :'SyntheticsAssertionBodyHashOperator',
48
+ :'target' => :'Object',
49
+ :'type' => :'SyntheticsAssertionBodyHashType'
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::V1::SyntheticsAssertionBodyHashTarget` 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::V1::SyntheticsAssertionBodyHashTarget`. 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?(:'operator')
70
+ self.operator = attributes[:'operator']
71
+ end
72
+
73
+ if attributes.key?(:'target')
74
+ self.target = attributes[:'target']
75
+ end
76
+
77
+ if attributes.key?(:'type')
78
+ self.type = attributes[:'type']
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 @operator.nil?
87
+ return false if @target.nil?
88
+ return false if @type.nil?
89
+ true
90
+ end
91
+
92
+ # Custom attribute writer method with validation
93
+ # @param operator [Object] Object to be assigned
94
+ # @!visibility private
95
+ def operator=(operator)
96
+ if operator.nil?
97
+ fail ArgumentError, 'invalid value for "operator", operator cannot be nil.'
98
+ end
99
+ @operator = operator
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param target [Object] Object to be assigned
104
+ # @!visibility private
105
+ def target=(target)
106
+ if target.nil?
107
+ fail ArgumentError, 'invalid value for "target", target cannot be nil.'
108
+ end
109
+ @target = target
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param type [Object] Object to be assigned
114
+ # @!visibility private
115
+ def type=(type)
116
+ if type.nil?
117
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
118
+ end
119
+ @type = type
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param o [Object] Object to be compared
124
+ # @!visibility private
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ operator == o.operator &&
129
+ target == o.target &&
130
+ type == o.type
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ # @!visibility private
136
+ def hash
137
+ [operator, target, type].hash
138
+ end
139
+ end
140
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ #Datadog API V1 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::V1
20
+ # Type of the assertion.
21
+ class SyntheticsAssertionBodyHashType
22
+ include BaseEnumModel
23
+
24
+ BODY_HASH = "bodyHash".freeze
25
+ end
26
+ end
@@ -21,6 +21,9 @@ module DatadogAPIClient::V1
21
21
  class SyntheticsAssertionJSONPathTargetTarget
22
22
  include BaseGenericModel
23
23
 
24
+ # The element from the list of results to assert on. To choose from the first element in the list `firstElementMatches`, every element in the list `everyElementMatches`, at least one element in the list `atLeastOneElementMatches` or the serialized value of the list `serializationMatches`.
25
+ attr_accessor :elements_operator
26
+
24
27
  # The JSON path to assert.
25
28
  attr_accessor :json_path
26
29
 
@@ -34,6 +37,7 @@ module DatadogAPIClient::V1
34
37
  # @!visibility private
35
38
  def self.attribute_map
36
39
  {
40
+ :'elements_operator' => :'elementsOperator',
37
41
  :'json_path' => :'jsonPath',
38
42
  :'operator' => :'operator',
39
43
  :'target_value' => :'targetValue'
@@ -44,6 +48,7 @@ module DatadogAPIClient::V1
44
48
  # @!visibility private
45
49
  def self.openapi_types
46
50
  {
51
+ :'elements_operator' => :'String',
47
52
  :'json_path' => :'String',
48
53
  :'operator' => :'String',
49
54
  :'target_value' => :'Object'
@@ -66,6 +71,10 @@ module DatadogAPIClient::V1
66
71
  h[k.to_sym] = v
67
72
  }
68
73
 
74
+ if attributes.key?(:'elements_operator')
75
+ self.elements_operator = attributes[:'elements_operator']
76
+ end
77
+
69
78
  if attributes.key?(:'json_path')
70
79
  self.json_path = attributes[:'json_path']
71
80
  end
@@ -85,6 +94,7 @@ module DatadogAPIClient::V1
85
94
  def ==(o)
86
95
  return true if self.equal?(o)
87
96
  self.class == o.class &&
97
+ elements_operator == o.elements_operator &&
88
98
  json_path == o.json_path &&
89
99
  operator == o.operator &&
90
100
  target_value == o.target_value
@@ -94,7 +104,7 @@ module DatadogAPIClient::V1
94
104
  # @return [Integer] Hash code
95
105
  # @!visibility private
96
106
  def hash
97
- [json_path, operator, target_value].hash
107
+ [elements_operator, json_path, operator, target_value].hash
98
108
  end
99
109
  end
100
110
  end
@@ -67,7 +67,6 @@ module DatadogAPIClient::V1
67
67
  # @return true if the model is valid
68
68
  # @!visibility private
69
69
  def valid?
70
- return false if !@renotify_interval.nil? && @renotify_interval > 1440
71
70
  return false if !@renotify_interval.nil? && @renotify_interval < 0
72
71
  true
73
72
  end
@@ -76,9 +75,6 @@ module DatadogAPIClient::V1
76
75
  # @param renotify_interval [Object] Object to be assigned
77
76
  # @!visibility private
78
77
  def renotify_interval=(renotify_interval)
79
- if !renotify_interval.nil? && renotify_interval > 1440
80
- fail ArgumentError, 'invalid value for "renotify_interval", must be smaller than or equal to 1440.'
81
- end
82
78
  if !renotify_interval.nil? && renotify_interval < 0
83
79
  fail ArgumentError, 'invalid value for "renotify_interval", must be greater than or equal to 0.'
84
80
  end