incident_io_api 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/incident_io/api/alert_grouping_preferences_v3_api.rb +367 -0
  3. data/lib/incident_io/api/alert_rules_v3_api.rb +367 -0
  4. data/lib/incident_io/api/catalog_v3_api.rb +68 -0
  5. data/lib/incident_io/api/team_grouping_preferences_v3_api.rb +364 -0
  6. data/lib/incident_io/models/alert_grouping_conditional_branch_v3.rb +204 -0
  7. data/lib/incident_io/models/alert_grouping_default_branch_v3.rb +165 -0
  8. data/lib/incident_io/models/alert_grouping_preference_v3.rb +368 -0
  9. data/lib/incident_io/models/alert_grouping_preferences_create_payload_v3.rb +225 -0
  10. data/lib/incident_io/models/alert_grouping_preferences_create_result_v3.rb +164 -0
  11. data/lib/incident_io/models/alert_grouping_preferences_list_result_v3.rb +192 -0
  12. data/lib/incident_io/models/alert_grouping_preferences_show_result_v3.rb +164 -0
  13. data/lib/incident_io/models/alert_grouping_preferences_update_payload_v3.rb +198 -0
  14. data/lib/incident_io/models/alert_grouping_preferences_update_result_v3.rb +164 -0
  15. data/lib/incident_io/models/alert_grouping_settings_v3.rb +246 -0
  16. data/lib/incident_io/models/alert_rule_action_v3.rb +240 -0
  17. data/lib/incident_io/models/alert_rule_block_v3.rb +222 -0
  18. data/lib/incident_io/models/alert_rule_branch_v3.rb +254 -0
  19. data/lib/incident_io/models/alert_rule_create_incident_action_v3.rb +177 -0
  20. data/lib/incident_io/models/alert_rule_escalate_action_v3.rb +215 -0
  21. data/lib/incident_io/models/alert_rule_nested_branch_v3.rb +242 -0
  22. data/lib/incident_io/models/alert_rule_post_action_v3.rb +202 -0
  23. data/lib/incident_io/models/alert_rule_set_v3.rb +351 -0
  24. data/lib/incident_io/models/alert_rules_create_payload_v3.rb +225 -0
  25. data/lib/incident_io/models/alert_rules_create_result_v3.rb +164 -0
  26. data/lib/incident_io/models/alert_rules_list_result_v3.rb +192 -0
  27. data/lib/incident_io/models/alert_rules_show_result_v3.rb +164 -0
  28. data/lib/incident_io/models/alert_rules_update_payload_v3.rb +198 -0
  29. data/lib/incident_io/models/alert_rules_update_result_v3.rb +164 -0
  30. data/lib/incident_io/models/catalog_bulk_archive_entries_payload_v3.rb +212 -0
  31. data/lib/incident_io/models/team_grouping_preference_v3.rb +300 -0
  32. data/lib/incident_io/models/team_grouping_preferences_create_payload_v3.rb +191 -0
  33. data/lib/incident_io/models/team_grouping_preferences_create_result_v3.rb +164 -0
  34. data/lib/incident_io/models/team_grouping_preferences_list_result_v3.rb +192 -0
  35. data/lib/incident_io/models/team_grouping_preferences_show_result_v3.rb +164 -0
  36. data/lib/incident_io/models/team_grouping_preferences_update_payload_v3.rb +191 -0
  37. data/lib/incident_io/models/team_grouping_preferences_update_result_v3.rb +164 -0
  38. data/lib/incident_io/version.rb +1 -1
  39. data/lib/incident_io.rb +35 -0
  40. metadata +37 -2
@@ -0,0 +1,364 @@
1
+ =begin
2
+ #incident.io
3
+
4
+ #Ruby client for the incident.io API.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IncidentIo
16
+ class TeamGroupingPreferencesV3Api
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Team Grouping Preferences V3
23
+ # Create a team's grouping preference. A team can have only one.
24
+ # @param team_grouping_preferences_create_payload_v3 [TeamGroupingPreferencesCreatePayloadV3]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [TeamGroupingPreferencesCreateResultV3]
27
+ def team_grouping_preferences_v3_create(team_grouping_preferences_create_payload_v3, opts = {})
28
+ data, _status_code, _headers = team_grouping_preferences_v3_create_with_http_info(team_grouping_preferences_create_payload_v3, opts)
29
+ data
30
+ end
31
+
32
+ # Create Team Grouping Preferences V3
33
+ # Create a team's grouping preference. A team can have only one.
34
+ # @param team_grouping_preferences_create_payload_v3 [TeamGroupingPreferencesCreatePayloadV3]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(TeamGroupingPreferencesCreateResultV3, Integer, Hash)>] TeamGroupingPreferencesCreateResultV3 data, response status code and response headers
37
+ def team_grouping_preferences_v3_create_with_http_info(team_grouping_preferences_create_payload_v3, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_create ...'
40
+ end
41
+ # verify the required parameter 'team_grouping_preferences_create_payload_v3' is set
42
+ if @api_client.config.client_side_validation && team_grouping_preferences_create_payload_v3.nil?
43
+ fail ArgumentError, "Missing the required parameter 'team_grouping_preferences_create_payload_v3' when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_create"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v3/team_grouping_preferences'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(team_grouping_preferences_create_payload_v3)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'TeamGroupingPreferencesCreateResultV3'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_create",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: TeamGroupingPreferencesV3Api#team_grouping_preferences_v3_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Delete Team Grouping Preferences V3
91
+ # Delete a team's grouping preference, so its alerts group by each route's own settings again.
92
+ # @param id [String] Unique identifier of the preference
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [nil]
95
+ def team_grouping_preferences_v3_delete(id, opts = {})
96
+ team_grouping_preferences_v3_delete_with_http_info(id, opts)
97
+ nil
98
+ end
99
+
100
+ # Delete Team Grouping Preferences V3
101
+ # Delete a team&#39;s grouping preference, so its alerts group by each route&#39;s own settings again.
102
+ # @param id [String] Unique identifier of the preference
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
105
+ def team_grouping_preferences_v3_delete_with_http_info(id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_delete ...'
108
+ end
109
+ # verify the required parameter 'id' is set
110
+ if @api_client.config.client_side_validation && id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'id' when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_delete"
112
+ end
113
+ # resource path
114
+ local_var_path = '/v3/team_grouping_preferences/{id}'.sub('{id}', CGI.escape(id.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type]
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_delete",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: TeamGroupingPreferencesV3Api#team_grouping_preferences_v3_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # List Team Grouping Preferences V3
154
+ # List the team grouping preferences in your account.
155
+ # @param [Hash] opts the optional parameters
156
+ # @option opts [Integer] :page_size Number of preferences to return per page (default to 25)
157
+ # @option opts [String] :after The ID of the last preference on the previous page
158
+ # @option opts [String] :team_id Return only this team&#39;s preference
159
+ # @return [TeamGroupingPreferencesListResultV3]
160
+ def team_grouping_preferences_v3_list(opts = {})
161
+ data, _status_code, _headers = team_grouping_preferences_v3_list_with_http_info(opts)
162
+ data
163
+ end
164
+
165
+ # List Team Grouping Preferences V3
166
+ # List the team grouping preferences in your account.
167
+ # @param [Hash] opts the optional parameters
168
+ # @option opts [Integer] :page_size Number of preferences to return per page (default to 25)
169
+ # @option opts [String] :after The ID of the last preference on the previous page
170
+ # @option opts [String] :team_id Return only this team&#39;s preference
171
+ # @return [Array<(TeamGroupingPreferencesListResultV3, Integer, Hash)>] TeamGroupingPreferencesListResultV3 data, response status code and response headers
172
+ def team_grouping_preferences_v3_list_with_http_info(opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_list ...'
175
+ end
176
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 250
177
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_list, must be smaller than or equal to 250.'
178
+ end
179
+
180
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
181
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_list, must be greater than or equal to 1.'
182
+ end
183
+
184
+ # resource path
185
+ local_var_path = '/v3/team_grouping_preferences'
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
190
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
191
+ query_params[:'team_id'] = opts[:'team_id'] if !opts[:'team_id'].nil?
192
+
193
+ # header parameters
194
+ header_params = opts[:header_params] || {}
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
197
+
198
+ # form parameters
199
+ form_params = opts[:form_params] || {}
200
+
201
+ # http body (model)
202
+ post_body = opts[:debug_body]
203
+
204
+ # return_type
205
+ return_type = opts[:debug_return_type] || 'TeamGroupingPreferencesListResultV3'
206
+
207
+ # auth_names
208
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
209
+
210
+ new_options = opts.merge(
211
+ :operation => :"TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_list",
212
+ :header_params => header_params,
213
+ :query_params => query_params,
214
+ :form_params => form_params,
215
+ :body => post_body,
216
+ :auth_names => auth_names,
217
+ :return_type => return_type
218
+ )
219
+
220
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: TeamGroupingPreferencesV3Api#team_grouping_preferences_v3_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+
227
+ # Show Team Grouping Preferences V3
228
+ # Load details about a specific team grouping preference in your account.
229
+ # @param id [String] Unique identifier of the preference
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [TeamGroupingPreferencesShowResultV3]
232
+ def team_grouping_preferences_v3_show(id, opts = {})
233
+ data, _status_code, _headers = team_grouping_preferences_v3_show_with_http_info(id, opts)
234
+ data
235
+ end
236
+
237
+ # Show Team Grouping Preferences V3
238
+ # Load details about a specific team grouping preference in your account.
239
+ # @param id [String] Unique identifier of the preference
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Array<(TeamGroupingPreferencesShowResultV3, Integer, Hash)>] TeamGroupingPreferencesShowResultV3 data, response status code and response headers
242
+ def team_grouping_preferences_v3_show_with_http_info(id, opts = {})
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug 'Calling API: TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_show ...'
245
+ end
246
+ # verify the required parameter 'id' is set
247
+ if @api_client.config.client_side_validation && id.nil?
248
+ fail ArgumentError, "Missing the required parameter 'id' when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_show"
249
+ end
250
+ # resource path
251
+ local_var_path = '/v3/team_grouping_preferences/{id}'.sub('{id}', CGI.escape(id.to_s))
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+
264
+ # http body (model)
265
+ post_body = opts[:debug_body]
266
+
267
+ # return_type
268
+ return_type = opts[:debug_return_type] || 'TeamGroupingPreferencesShowResultV3'
269
+
270
+ # auth_names
271
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
272
+
273
+ new_options = opts.merge(
274
+ :operation => :"TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_show",
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => return_type
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: TeamGroupingPreferencesV3Api#team_grouping_preferences_v3_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
290
+ # Update Team Grouping Preferences V3
291
+ # Update a team's grouping preference. The team cannot change: to move a preference, delete it and create another.
292
+ # @param id [String] Unique identifier of the preference
293
+ # @param team_grouping_preferences_update_payload_v3 [TeamGroupingPreferencesUpdatePayloadV3]
294
+ # @param [Hash] opts the optional parameters
295
+ # @return [TeamGroupingPreferencesUpdateResultV3]
296
+ def team_grouping_preferences_v3_update(id, team_grouping_preferences_update_payload_v3, opts = {})
297
+ data, _status_code, _headers = team_grouping_preferences_v3_update_with_http_info(id, team_grouping_preferences_update_payload_v3, opts)
298
+ data
299
+ end
300
+
301
+ # Update Team Grouping Preferences V3
302
+ # Update a team&#39;s grouping preference. The team cannot change: to move a preference, delete it and create another.
303
+ # @param id [String] Unique identifier of the preference
304
+ # @param team_grouping_preferences_update_payload_v3 [TeamGroupingPreferencesUpdatePayloadV3]
305
+ # @param [Hash] opts the optional parameters
306
+ # @return [Array<(TeamGroupingPreferencesUpdateResultV3, Integer, Hash)>] TeamGroupingPreferencesUpdateResultV3 data, response status code and response headers
307
+ def team_grouping_preferences_v3_update_with_http_info(id, team_grouping_preferences_update_payload_v3, opts = {})
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug 'Calling API: TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_update ...'
310
+ end
311
+ # verify the required parameter 'id' is set
312
+ if @api_client.config.client_side_validation && id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'id' when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_update"
314
+ end
315
+ # verify the required parameter 'team_grouping_preferences_update_payload_v3' is set
316
+ if @api_client.config.client_side_validation && team_grouping_preferences_update_payload_v3.nil?
317
+ fail ArgumentError, "Missing the required parameter 'team_grouping_preferences_update_payload_v3' when calling TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_update"
318
+ end
319
+ # resource path
320
+ local_var_path = '/v3/team_grouping_preferences/{id}'.sub('{id}', CGI.escape(id.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+ # HTTP header 'Accept' (if needed)
328
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
329
+ # HTTP header 'Content-Type'
330
+ content_type = @api_client.select_header_content_type(['application/json'])
331
+ if !content_type.nil?
332
+ header_params['Content-Type'] = content_type
333
+ end
334
+
335
+ # form parameters
336
+ form_params = opts[:form_params] || {}
337
+
338
+ # http body (model)
339
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(team_grouping_preferences_update_payload_v3)
340
+
341
+ # return_type
342
+ return_type = opts[:debug_return_type] || 'TeamGroupingPreferencesUpdateResultV3'
343
+
344
+ # auth_names
345
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
346
+
347
+ new_options = opts.merge(
348
+ :operation => :"TeamGroupingPreferencesV3Api.team_grouping_preferences_v3_update",
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: TeamGroupingPreferencesV3Api#team_grouping_preferences_v3_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+ end
364
+ end
@@ -0,0 +1,204 @@
1
+ =begin
2
+ #incident.io
3
+
4
+ #Ruby client for the incident.io API.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IncidentIo
17
+ # A grouping branch: the grouping settings for the alerts that match its conditions
18
+ class AlertGroupingConditionalBranchV3 < ApiModelBase
19
+ # The branch matches an alert when every condition in any one group holds
20
+ attr_accessor :condition_groups
21
+
22
+ # Identifier for this branch, a ULID. Omit it on a new branch and one is assigned. Send the ID you read back on every update: alert groups are keyed on it.
23
+ attr_accessor :id
24
+
25
+ attr_accessor :settings
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'condition_groups' => :'condition_groups',
31
+ :'id' => :'id',
32
+ :'settings' => :'settings'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'condition_groups' => :'Array<ConditionGroupPayloadV3>',
50
+ :'id' => :'String',
51
+ :'settings' => :'AlertGroupingSettingsV3'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertGroupingConditionalBranchV3` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertGroupingConditionalBranchV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'condition_groups')
78
+ if (value = attributes[:'condition_groups']).is_a?(Array)
79
+ self.condition_groups = value
80
+ end
81
+ else
82
+ self.condition_groups = nil
83
+ end
84
+
85
+ if attributes.key?(:'id')
86
+ self.id = attributes[:'id']
87
+ end
88
+
89
+ if attributes.key?(:'settings')
90
+ self.settings = attributes[:'settings']
91
+ else
92
+ self.settings = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @condition_groups.nil?
102
+ invalid_properties.push('invalid value for "condition_groups", condition_groups cannot be nil.')
103
+ end
104
+
105
+ if @settings.nil?
106
+ invalid_properties.push('invalid value for "settings", settings cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
+ return false if @condition_groups.nil?
117
+ return false if @settings.nil?
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] condition_groups Value to be assigned
123
+ def condition_groups=(condition_groups)
124
+ if condition_groups.nil?
125
+ fail ArgumentError, 'condition_groups cannot be nil'
126
+ end
127
+
128
+ @condition_groups = condition_groups
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] settings Value to be assigned
133
+ def settings=(settings)
134
+ if settings.nil?
135
+ fail ArgumentError, 'settings cannot be nil'
136
+ end
137
+
138
+ @settings = settings
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ condition_groups == o.condition_groups &&
147
+ id == o.id &&
148
+ settings == o.settings
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Integer] Hash code
159
+ def hash
160
+ [condition_groups, id, settings].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def self.build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
178
+ end
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
181
+ end
182
+ end
183
+ new(transformed_hash)
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ end
203
+
204
+ end