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