incident_io_api 2.10.0 → 2.11.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.
@@ -0,0 +1,293 @@
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 AuditLogInvestigationTriggerMetadataV2 < ApiModelBase
18
+ # Whether the investigation waits for the trigger to finish before moving on (true, false)
19
+ attr_accessor :blocks
20
+
21
+ # Whether the trigger fires (true, false)
22
+ attr_accessor :enabled
23
+
24
+ # How often the trigger fires across one investigation
25
+ attr_accessor :frequency
26
+
27
+ # When in an investigation the trigger runs
28
+ attr_accessor :moment
29
+
30
+ # The extension plugin holding the skill the trigger runs, absent for a trigger that only gives a task
31
+ attr_accessor :plugin_id
32
+
33
+ # The skill directory the trigger runs, absent when the trigger leaves the choice of skill to the investigation
34
+ attr_accessor :skill
35
+
36
+ # Whether the trigger hands the agent a task of its own (true, false)
37
+ attr_accessor :task_set
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'blocks' => :'blocks',
43
+ :'enabled' => :'enabled',
44
+ :'frequency' => :'frequency',
45
+ :'moment' => :'moment',
46
+ :'plugin_id' => :'plugin_id',
47
+ :'skill' => :'skill',
48
+ :'task_set' => :'task_set'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'blocks' => :'String',
66
+ :'enabled' => :'String',
67
+ :'frequency' => :'String',
68
+ :'moment' => :'String',
69
+ :'plugin_id' => :'String',
70
+ :'skill' => :'String',
71
+ :'task_set' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AuditLogInvestigationTriggerMetadataV2` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AuditLogInvestigationTriggerMetadataV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'blocks')
98
+ self.blocks = attributes[:'blocks']
99
+ else
100
+ self.blocks = nil
101
+ end
102
+
103
+ if attributes.key?(:'enabled')
104
+ self.enabled = attributes[:'enabled']
105
+ else
106
+ self.enabled = nil
107
+ end
108
+
109
+ if attributes.key?(:'frequency')
110
+ self.frequency = attributes[:'frequency']
111
+ else
112
+ self.frequency = nil
113
+ end
114
+
115
+ if attributes.key?(:'moment')
116
+ self.moment = attributes[:'moment']
117
+ else
118
+ self.moment = nil
119
+ end
120
+
121
+ if attributes.key?(:'plugin_id')
122
+ self.plugin_id = attributes[:'plugin_id']
123
+ end
124
+
125
+ if attributes.key?(:'skill')
126
+ self.skill = attributes[:'skill']
127
+ end
128
+
129
+ if attributes.key?(:'task_set')
130
+ self.task_set = attributes[:'task_set']
131
+ else
132
+ self.task_set = nil
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
140
+ invalid_properties = Array.new
141
+ if @blocks.nil?
142
+ invalid_properties.push('invalid value for "blocks", blocks cannot be nil.')
143
+ end
144
+
145
+ if @enabled.nil?
146
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
147
+ end
148
+
149
+ if @frequency.nil?
150
+ invalid_properties.push('invalid value for "frequency", frequency cannot be nil.')
151
+ end
152
+
153
+ if @moment.nil?
154
+ invalid_properties.push('invalid value for "moment", moment cannot be nil.')
155
+ end
156
+
157
+ if @task_set.nil?
158
+ invalid_properties.push('invalid value for "task_set", task_set cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
+ return false if @blocks.nil?
169
+ return false if @enabled.nil?
170
+ return false if @frequency.nil?
171
+ return false if @moment.nil?
172
+ return false if @task_set.nil?
173
+ true
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] blocks Value to be assigned
178
+ def blocks=(blocks)
179
+ if blocks.nil?
180
+ fail ArgumentError, 'blocks cannot be nil'
181
+ end
182
+
183
+ @blocks = blocks
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] enabled Value to be assigned
188
+ def enabled=(enabled)
189
+ if enabled.nil?
190
+ fail ArgumentError, 'enabled cannot be nil'
191
+ end
192
+
193
+ @enabled = enabled
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] frequency Value to be assigned
198
+ def frequency=(frequency)
199
+ if frequency.nil?
200
+ fail ArgumentError, 'frequency cannot be nil'
201
+ end
202
+
203
+ @frequency = frequency
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] moment Value to be assigned
208
+ def moment=(moment)
209
+ if moment.nil?
210
+ fail ArgumentError, 'moment cannot be nil'
211
+ end
212
+
213
+ @moment = moment
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] task_set Value to be assigned
218
+ def task_set=(task_set)
219
+ if task_set.nil?
220
+ fail ArgumentError, 'task_set cannot be nil'
221
+ end
222
+
223
+ @task_set = task_set
224
+ end
225
+
226
+ # Checks equality by comparing each attribute.
227
+ # @param [Object] Object to be compared
228
+ def ==(o)
229
+ return true if self.equal?(o)
230
+ self.class == o.class &&
231
+ blocks == o.blocks &&
232
+ enabled == o.enabled &&
233
+ frequency == o.frequency &&
234
+ moment == o.moment &&
235
+ plugin_id == o.plugin_id &&
236
+ skill == o.skill &&
237
+ task_set == o.task_set
238
+ end
239
+
240
+ # @see the `==` method
241
+ # @param [Object] Object to be compared
242
+ def eql?(o)
243
+ self == o
244
+ end
245
+
246
+ # Calculates hash code according to all attributes.
247
+ # @return [Integer] Hash code
248
+ def hash
249
+ [blocks, enabled, frequency, moment, plugin_id, skill, task_set].hash
250
+ end
251
+
252
+ # Builds the object from hash
253
+ # @param [Hash] attributes Model attributes in the form of hash
254
+ # @return [Object] Returns the model itself
255
+ def self.build_from_hash(attributes)
256
+ return nil unless attributes.is_a?(Hash)
257
+ attributes = attributes.transform_keys(&:to_sym)
258
+ transformed_hash = {}
259
+ openapi_types.each_pair do |key, type|
260
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
261
+ transformed_hash["#{key}"] = nil
262
+ elsif type =~ /\AArray<(.*)>/i
263
+ # check to ensure the input is an array given that the attribute
264
+ # is documented as an array but the input is not
265
+ if attributes[attribute_map[key]].is_a?(Array)
266
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
267
+ end
268
+ elsif !attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
270
+ end
271
+ end
272
+ new(transformed_hash)
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ end
292
+
293
+ end
@@ -21,7 +21,7 @@ module IncidentIo
21
21
  # The name of the target
22
22
  attr_accessor :name
23
23
 
24
- # The type of target Known values: `api_key`, `alert`, `alert_chat_message_template`, `alert_route`, `alert_schema`, `alert_source`, `alert_priority`, `announcement_rule`, `announcement_post_template`, `catalog_type`, `catalog_entry`, `catalog_attribute`, `connector_config`, `custom_field`, `debrief_invite_rule`, `escalation`, `escalation_path`, `escalation_path_template`, `extension_connector`, `extension_connector_tool`, `follow_up_category`, `follow_up_priority`, `holiday_user_feed`, `hris_time_off_policy`, `incident`, `incident_call_transcription_session`, `incident_call_setting`, `incident_duration_metric`, `incident_template`, `maintenance_window`, `incident_role`, `incident_status`, `incident_timestamp`, `incident_timestamp_set_by_rule`, `incident_type`, `integration`, `internal_status_page`, `ip_allowlist`, `nudge`, `on_call_notification_method`, `on_call_notification_pause`, `organisation`, `organisation_settings`, `schedule_override`, `schedule_sync_rule`, `schedule_sync_target`, `policy`, `policy_report_schedule`, `post_incident_task`, `postmortem_template`, `postmortem_template_section`, `private_incident_membership`, `rbac_role`, `scim_group`, `schedule`, `team_role`, `secret`, `severity`, `status_page`, `status_page_sub_page`, `status_page_template`, `team_settings`, `telemetry_data_source`, `twilio_connection`, `user`, `user_api_key`, `workflow`, `activity_log`, `timeline_item`, `on_call_upsell_request`
24
+ # The type of target Known values: `api_key`, `alert`, `alert_chat_message_template`, `alert_route`, `alert_schema`, `alert_source`, `alert_priority`, `announcement_rule`, `announcement_post_template`, `catalog_type`, `catalog_entry`, `catalog_attribute`, `connector_config`, `custom_field`, `debrief_invite_rule`, `escalation`, `escalation_path`, `escalation_path_template`, `extension_connector`, `extension_connector_tool`, `extension_plugin`, `glossary_entry`, `investigation_trigger`, `follow_up_category`, `follow_up_priority`, `holiday_user_feed`, `hris_time_off_policy`, `incident`, `incident_call_transcription_session`, `incident_call_setting`, `incident_duration_metric`, `incident_template`, `maintenance_window`, `incident_role`, `incident_status`, `incident_timestamp`, `incident_timestamp_set_by_rule`, `incident_type`, `integration`, `internal_status_page`, `ip_allowlist`, `nudge`, `on_call_notification_method`, `on_call_notification_pause`, `organisation`, `organisation_settings`, `schedule_override`, `schedule_sync_rule`, `schedule_sync_target`, `policy`, `policy_report_schedule`, `post_incident_task`, `postmortem_template`, `postmortem_template_section`, `private_incident_membership`, `rbac_role`, `scim_group`, `schedule`, `team_role`, `secret`, `severity`, `status_page`, `status_page_sub_page`, `status_page_template`, `team_settings`, `telemetry_data_source`, `twilio_connection`, `user`, `user_api_key`, `workflow`, `activity_log`, `timeline_item`, `on_call_upsell_request`
25
25
  attr_accessor :type
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,326 @@
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 AuditLogsExtensionPluginCreatedV1 < ApiModelBase
18
+ # The type of log entry that this is
19
+ attr_accessor :action
20
+
21
+ attr_accessor :actor
22
+
23
+ attr_accessor :context
24
+
25
+ attr_accessor :metadata
26
+
27
+ # When the entry occurred
28
+ attr_accessor :occurred_at
29
+
30
+ # The custom field that was created
31
+ attr_accessor :targets
32
+
33
+ # Which version the event is
34
+ attr_accessor :version
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'action' => :'action',
40
+ :'actor' => :'actor',
41
+ :'context' => :'context',
42
+ :'metadata' => :'metadata',
43
+ :'occurred_at' => :'occurred_at',
44
+ :'targets' => :'targets',
45
+ :'version' => :'version'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'action' => :'String',
63
+ :'actor' => :'AuditLogActorV2',
64
+ :'context' => :'AuditLogEntryContextV2',
65
+ :'metadata' => :'AuditLogExtensionPluginCreatedMetadataV2',
66
+ :'occurred_at' => :'Time',
67
+ :'targets' => :'Array<AuditLogTargetV2>',
68
+ :'version' => :'Integer'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AuditLogsExtensionPluginCreatedV1` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AuditLogsExtensionPluginCreatedV1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'action')
95
+ self.action = attributes[:'action']
96
+ else
97
+ self.action = nil
98
+ end
99
+
100
+ if attributes.key?(:'actor')
101
+ self.actor = attributes[:'actor']
102
+ else
103
+ self.actor = nil
104
+ end
105
+
106
+ if attributes.key?(:'context')
107
+ self.context = attributes[:'context']
108
+ else
109
+ self.context = nil
110
+ end
111
+
112
+ if attributes.key?(:'metadata')
113
+ self.metadata = attributes[:'metadata']
114
+ else
115
+ self.metadata = nil
116
+ end
117
+
118
+ if attributes.key?(:'occurred_at')
119
+ self.occurred_at = attributes[:'occurred_at']
120
+ else
121
+ self.occurred_at = nil
122
+ end
123
+
124
+ if attributes.key?(:'targets')
125
+ if (value = attributes[:'targets']).is_a?(Array)
126
+ self.targets = value
127
+ end
128
+ else
129
+ self.targets = nil
130
+ end
131
+
132
+ if attributes.key?(:'version')
133
+ self.version = attributes[:'version']
134
+ else
135
+ self.version = nil
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
143
+ invalid_properties = Array.new
144
+ if @action.nil?
145
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
146
+ end
147
+
148
+ if @actor.nil?
149
+ invalid_properties.push('invalid value for "actor", actor cannot be nil.')
150
+ end
151
+
152
+ if @context.nil?
153
+ invalid_properties.push('invalid value for "context", context cannot be nil.')
154
+ end
155
+
156
+ if @metadata.nil?
157
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
158
+ end
159
+
160
+ if @occurred_at.nil?
161
+ invalid_properties.push('invalid value for "occurred_at", occurred_at cannot be nil.')
162
+ end
163
+
164
+ if @targets.nil?
165
+ invalid_properties.push('invalid value for "targets", targets cannot be nil.')
166
+ end
167
+
168
+ if @version.nil?
169
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
170
+ end
171
+
172
+ invalid_properties
173
+ end
174
+
175
+ # Check to see if the all the properties in the model are valid
176
+ # @return true if the model is valid
177
+ def valid?
178
+ warn '[DEPRECATED] the `valid?` method is obsolete'
179
+ return false if @action.nil?
180
+ return false if @actor.nil?
181
+ return false if @context.nil?
182
+ return false if @metadata.nil?
183
+ return false if @occurred_at.nil?
184
+ return false if @targets.nil?
185
+ return false if @version.nil?
186
+ true
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] action Value to be assigned
191
+ def action=(action)
192
+ if action.nil?
193
+ fail ArgumentError, 'action cannot be nil'
194
+ end
195
+
196
+ @action = action
197
+ end
198
+
199
+ # Custom attribute writer method with validation
200
+ # @param [Object] actor Value to be assigned
201
+ def actor=(actor)
202
+ if actor.nil?
203
+ fail ArgumentError, 'actor cannot be nil'
204
+ end
205
+
206
+ @actor = actor
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] context Value to be assigned
211
+ def context=(context)
212
+ if context.nil?
213
+ fail ArgumentError, 'context cannot be nil'
214
+ end
215
+
216
+ @context = context
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] metadata Value to be assigned
221
+ def metadata=(metadata)
222
+ if metadata.nil?
223
+ fail ArgumentError, 'metadata cannot be nil'
224
+ end
225
+
226
+ @metadata = metadata
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] occurred_at Value to be assigned
231
+ def occurred_at=(occurred_at)
232
+ if occurred_at.nil?
233
+ fail ArgumentError, 'occurred_at cannot be nil'
234
+ end
235
+
236
+ @occurred_at = occurred_at
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] targets Value to be assigned
241
+ def targets=(targets)
242
+ if targets.nil?
243
+ fail ArgumentError, 'targets cannot be nil'
244
+ end
245
+
246
+ @targets = targets
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] version Value to be assigned
251
+ def version=(version)
252
+ if version.nil?
253
+ fail ArgumentError, 'version cannot be nil'
254
+ end
255
+
256
+ @version = version
257
+ end
258
+
259
+ # Checks equality by comparing each attribute.
260
+ # @param [Object] Object to be compared
261
+ def ==(o)
262
+ return true if self.equal?(o)
263
+ self.class == o.class &&
264
+ action == o.action &&
265
+ actor == o.actor &&
266
+ context == o.context &&
267
+ metadata == o.metadata &&
268
+ occurred_at == o.occurred_at &&
269
+ targets == o.targets &&
270
+ version == o.version
271
+ end
272
+
273
+ # @see the `==` method
274
+ # @param [Object] Object to be compared
275
+ def eql?(o)
276
+ self == o
277
+ end
278
+
279
+ # Calculates hash code according to all attributes.
280
+ # @return [Integer] Hash code
281
+ def hash
282
+ [action, actor, context, metadata, occurred_at, targets, version].hash
283
+ end
284
+
285
+ # Builds the object from hash
286
+ # @param [Hash] attributes Model attributes in the form of hash
287
+ # @return [Object] Returns the model itself
288
+ def self.build_from_hash(attributes)
289
+ return nil unless attributes.is_a?(Hash)
290
+ attributes = attributes.transform_keys(&:to_sym)
291
+ transformed_hash = {}
292
+ openapi_types.each_pair do |key, type|
293
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
294
+ transformed_hash["#{key}"] = nil
295
+ elsif type =~ /\AArray<(.*)>/i
296
+ # check to ensure the input is an array given that the attribute
297
+ # is documented as an array but the input is not
298
+ if attributes[attribute_map[key]].is_a?(Array)
299
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
300
+ end
301
+ elsif !attributes[attribute_map[key]].nil?
302
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
303
+ end
304
+ end
305
+ new(transformed_hash)
306
+ end
307
+
308
+ # Returns the object in the form of hash
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_hash
311
+ hash = {}
312
+ self.class.attribute_map.each_pair do |attr, param|
313
+ value = self.send(attr)
314
+ if value.nil?
315
+ is_nullable = self.class.openapi_nullable.include?(attr)
316
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
+ end
318
+
319
+ hash[param] = _to_hash(value)
320
+ end
321
+ hash
322
+ end
323
+
324
+ end
325
+
326
+ end