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,165 @@
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
+ # The fallback branch: how to group the alerts that no conditional branch matches
18
+ class AlertGroupingDefaultBranchV3 < ApiModelBase
19
+ attr_accessor :settings
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'settings' => :'settings'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'settings' => :'AlertGroupingSettingsV3'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertGroupingDefaultBranchV3` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertGroupingDefaultBranchV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'settings')
68
+ self.settings = attributes[:'settings']
69
+ else
70
+ self.settings = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @settings.nil?
80
+ invalid_properties.push('invalid value for "settings", settings cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @settings.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] settings Value to be assigned
96
+ def settings=(settings)
97
+ if settings.nil?
98
+ fail ArgumentError, 'settings cannot be nil'
99
+ end
100
+
101
+ @settings = settings
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ settings == o.settings
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [settings].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,368 @@
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
+ # An alert grouping preference: one team's, or the organisation's default
18
+ class AlertGroupingPreferenceV3 < ApiModelBase
19
+ # Grouping branches in order. Alert rules group an alert by the first branch whose conditions hold, else by the default. Alert routes only use the default.
20
+ attr_accessor :branches
21
+
22
+ # When this preference was created
23
+ attr_accessor :created_at
24
+
25
+ attr_accessor :default
26
+
27
+ # Expressions the branches' conditions test or compare against, as expressions[\"reference\"]
28
+ attr_accessor :expressions
29
+
30
+ # Unique identifier for this preference
31
+ attr_accessor :id
32
+
33
+ # Which preference this is. A team's preference groups the alerts of its team. The organisation's default groups alerts that no team's preference groups, and is used only by alert rules. Known values: `default`, `team`
34
+ attr_accessor :kind
35
+
36
+ # The catalog entry ID of the team, set only for a team's preference
37
+ attr_accessor :team_id
38
+
39
+ # When this preference was last updated
40
+ attr_accessor :updated_at
41
+
42
+ # The current version number. Every update writes the next version.
43
+ attr_accessor :version
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'branches' => :'branches',
49
+ :'created_at' => :'created_at',
50
+ :'default' => :'default',
51
+ :'expressions' => :'expressions',
52
+ :'id' => :'id',
53
+ :'kind' => :'kind',
54
+ :'team_id' => :'team_id',
55
+ :'updated_at' => :'updated_at',
56
+ :'version' => :'version'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'branches' => :'Array<AlertGroupingConditionalBranchV3>',
74
+ :'created_at' => :'Time',
75
+ :'default' => :'AlertGroupingDefaultBranchV3',
76
+ :'expressions' => :'Array<ExpressionPayloadV3>',
77
+ :'id' => :'String',
78
+ :'kind' => :'String',
79
+ :'team_id' => :'String',
80
+ :'updated_at' => :'Time',
81
+ :'version' => :'Integer'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertGroupingPreferenceV3` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ acceptable_attribute_map = self.class.acceptable_attribute_map
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!acceptable_attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertGroupingPreferenceV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'branches')
108
+ if (value = attributes[:'branches']).is_a?(Array)
109
+ self.branches = value
110
+ end
111
+ else
112
+ self.branches = nil
113
+ end
114
+
115
+ if attributes.key?(:'created_at')
116
+ self.created_at = attributes[:'created_at']
117
+ else
118
+ self.created_at = nil
119
+ end
120
+
121
+ if attributes.key?(:'default')
122
+ self.default = attributes[:'default']
123
+ else
124
+ self.default = nil
125
+ end
126
+
127
+ if attributes.key?(:'expressions')
128
+ if (value = attributes[:'expressions']).is_a?(Array)
129
+ self.expressions = value
130
+ end
131
+ else
132
+ self.expressions = nil
133
+ end
134
+
135
+ if attributes.key?(:'id')
136
+ self.id = attributes[:'id']
137
+ else
138
+ self.id = nil
139
+ end
140
+
141
+ if attributes.key?(:'kind')
142
+ self.kind = attributes[:'kind']
143
+ else
144
+ self.kind = nil
145
+ end
146
+
147
+ if attributes.key?(:'team_id')
148
+ self.team_id = attributes[:'team_id']
149
+ end
150
+
151
+ if attributes.key?(:'updated_at')
152
+ self.updated_at = attributes[:'updated_at']
153
+ else
154
+ self.updated_at = nil
155
+ end
156
+
157
+ if attributes.key?(:'version')
158
+ self.version = attributes[:'version']
159
+ else
160
+ self.version = nil
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @branches.nil?
170
+ invalid_properties.push('invalid value for "branches", branches cannot be nil.')
171
+ end
172
+
173
+ if @created_at.nil?
174
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
175
+ end
176
+
177
+ if @default.nil?
178
+ invalid_properties.push('invalid value for "default", default cannot be nil.')
179
+ end
180
+
181
+ if @expressions.nil?
182
+ invalid_properties.push('invalid value for "expressions", expressions cannot be nil.')
183
+ end
184
+
185
+ if @id.nil?
186
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
187
+ end
188
+
189
+ if @kind.nil?
190
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
191
+ end
192
+
193
+ if @updated_at.nil?
194
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
195
+ end
196
+
197
+ if @version.nil?
198
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
199
+ end
200
+
201
+ invalid_properties
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ warn '[DEPRECATED] the `valid?` method is obsolete'
208
+ return false if @branches.nil?
209
+ return false if @created_at.nil?
210
+ return false if @default.nil?
211
+ return false if @expressions.nil?
212
+ return false if @id.nil?
213
+ return false if @kind.nil?
214
+ return false if @updated_at.nil?
215
+ return false if @version.nil?
216
+ true
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] branches Value to be assigned
221
+ def branches=(branches)
222
+ if branches.nil?
223
+ fail ArgumentError, 'branches cannot be nil'
224
+ end
225
+
226
+ @branches = branches
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] created_at Value to be assigned
231
+ def created_at=(created_at)
232
+ if created_at.nil?
233
+ fail ArgumentError, 'created_at cannot be nil'
234
+ end
235
+
236
+ @created_at = created_at
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] default Value to be assigned
241
+ def default=(default)
242
+ if default.nil?
243
+ fail ArgumentError, 'default cannot be nil'
244
+ end
245
+
246
+ @default = default
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] expressions Value to be assigned
251
+ def expressions=(expressions)
252
+ if expressions.nil?
253
+ fail ArgumentError, 'expressions cannot be nil'
254
+ end
255
+
256
+ @expressions = expressions
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] id Value to be assigned
261
+ def id=(id)
262
+ if id.nil?
263
+ fail ArgumentError, 'id cannot be nil'
264
+ end
265
+
266
+ @id = id
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] kind Value to be assigned
271
+ def kind=(kind)
272
+ if kind.nil?
273
+ fail ArgumentError, 'kind cannot be nil'
274
+ end
275
+
276
+ @kind = kind
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] updated_at Value to be assigned
281
+ def updated_at=(updated_at)
282
+ if updated_at.nil?
283
+ fail ArgumentError, 'updated_at cannot be nil'
284
+ end
285
+
286
+ @updated_at = updated_at
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] version Value to be assigned
291
+ def version=(version)
292
+ if version.nil?
293
+ fail ArgumentError, 'version cannot be nil'
294
+ end
295
+
296
+ @version = version
297
+ end
298
+
299
+ # Checks equality by comparing each attribute.
300
+ # @param [Object] Object to be compared
301
+ def ==(o)
302
+ return true if self.equal?(o)
303
+ self.class == o.class &&
304
+ branches == o.branches &&
305
+ created_at == o.created_at &&
306
+ default == o.default &&
307
+ expressions == o.expressions &&
308
+ id == o.id &&
309
+ kind == o.kind &&
310
+ team_id == o.team_id &&
311
+ updated_at == o.updated_at &&
312
+ version == o.version
313
+ end
314
+
315
+ # @see the `==` method
316
+ # @param [Object] Object to be compared
317
+ def eql?(o)
318
+ self == o
319
+ end
320
+
321
+ # Calculates hash code according to all attributes.
322
+ # @return [Integer] Hash code
323
+ def hash
324
+ [branches, created_at, default, expressions, id, kind, team_id, updated_at, version].hash
325
+ end
326
+
327
+ # Builds the object from hash
328
+ # @param [Hash] attributes Model attributes in the form of hash
329
+ # @return [Object] Returns the model itself
330
+ def self.build_from_hash(attributes)
331
+ return nil unless attributes.is_a?(Hash)
332
+ attributes = attributes.transform_keys(&:to_sym)
333
+ transformed_hash = {}
334
+ openapi_types.each_pair do |key, type|
335
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
336
+ transformed_hash["#{key}"] = nil
337
+ elsif type =~ /\AArray<(.*)>/i
338
+ # check to ensure the input is an array given that the attribute
339
+ # is documented as an array but the input is not
340
+ if attributes[attribute_map[key]].is_a?(Array)
341
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
342
+ end
343
+ elsif !attributes[attribute_map[key]].nil?
344
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
345
+ end
346
+ end
347
+ new(transformed_hash)
348
+ end
349
+
350
+ # Returns the object in the form of hash
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_hash
353
+ hash = {}
354
+ self.class.attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ if value.nil?
357
+ is_nullable = self.class.openapi_nullable.include?(attr)
358
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
359
+ end
360
+
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ end
367
+
368
+ end