incident_io_api 4.0.0 → 4.2.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 (72) 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/team_grouping_preferences_v3_api.rb +364 -0
  5. data/lib/incident_io/models/alert_grouping_conditional_branch_v3.rb +204 -0
  6. data/lib/incident_io/models/alert_grouping_default_branch_v3.rb +165 -0
  7. data/lib/incident_io/models/alert_grouping_preference_v3.rb +368 -0
  8. data/lib/incident_io/models/alert_grouping_preferences_create_payload_v3.rb +225 -0
  9. data/lib/incident_io/models/alert_grouping_preferences_create_result_v3.rb +164 -0
  10. data/lib/incident_io/models/alert_grouping_preferences_list_result_v3.rb +192 -0
  11. data/lib/incident_io/models/alert_grouping_preferences_show_result_v3.rb +164 -0
  12. data/lib/incident_io/models/alert_grouping_preferences_update_payload_v3.rb +198 -0
  13. data/lib/incident_io/models/alert_grouping_preferences_update_result_v3.rb +164 -0
  14. data/lib/incident_io/models/alert_grouping_settings_v3.rb +246 -0
  15. data/lib/incident_io/models/alert_rule_action_v3.rb +240 -0
  16. data/lib/incident_io/models/alert_rule_block_v3.rb +222 -0
  17. data/lib/incident_io/models/alert_rule_branch_v3.rb +254 -0
  18. data/lib/incident_io/models/alert_rule_create_incident_action_v3.rb +177 -0
  19. data/lib/incident_io/models/alert_rule_escalate_action_v3.rb +215 -0
  20. data/lib/incident_io/models/alert_rule_nested_branch_v3.rb +242 -0
  21. data/lib/incident_io/models/alert_rule_post_action_v3.rb +202 -0
  22. data/lib/incident_io/models/alert_rule_set_v3.rb +351 -0
  23. data/lib/incident_io/models/alert_rules_create_payload_v3.rb +225 -0
  24. data/lib/incident_io/models/alert_rules_create_result_v3.rb +164 -0
  25. data/lib/incident_io/models/alert_rules_list_result_v3.rb +192 -0
  26. data/lib/incident_io/models/alert_rules_show_result_v3.rb +164 -0
  27. data/lib/incident_io/models/alert_rules_update_payload_v3.rb +198 -0
  28. data/lib/incident_io/models/alert_rules_update_result_v3.rb +164 -0
  29. data/lib/incident_io/models/team_grouping_preference_v3.rb +300 -0
  30. data/lib/incident_io/models/team_grouping_preferences_create_payload_v3.rb +191 -0
  31. data/lib/incident_io/models/team_grouping_preferences_create_result_v3.rb +164 -0
  32. data/lib/incident_io/models/team_grouping_preferences_list_result_v3.rb +192 -0
  33. data/lib/incident_io/models/team_grouping_preferences_show_result_v3.rb +164 -0
  34. data/lib/incident_io/models/team_grouping_preferences_update_payload_v3.rb +191 -0
  35. data/lib/incident_io/models/team_grouping_preferences_update_result_v3.rb +164 -0
  36. data/lib/incident_io/models/webhooks_private_alert_created_v1_response_body.rb +1 -1
  37. data/lib/incident_io/models/webhooks_private_alert_resolved_v1_response_body.rb +1 -1
  38. data/lib/incident_io/models/webhooks_private_escalation_created_v1_response_body.rb +1 -1
  39. data/lib/incident_io/models/webhooks_private_escalation_status_updated_v1_response_body.rb +1 -1
  40. data/lib/incident_io/models/webhooks_private_incident_action_created_v1_response_body.rb +1 -1
  41. data/lib/incident_io/models/webhooks_private_incident_action_updated_v1_response_body.rb +1 -1
  42. data/lib/incident_io/models/webhooks_private_incident_follow_up_created_v1_response_body.rb +1 -1
  43. data/lib/incident_io/models/webhooks_private_incident_follow_up_created_v2_response_body.rb +1 -1
  44. data/lib/incident_io/models/webhooks_private_incident_follow_up_updated_v1_response_body.rb +1 -1
  45. data/lib/incident_io/models/webhooks_private_incident_follow_up_updated_v2_response_body.rb +1 -1
  46. data/lib/incident_io/models/webhooks_private_incident_incident_created_v2_response_body.rb +1 -1
  47. data/lib/incident_io/models/webhooks_private_incident_incident_updated_v2_response_body.rb +1 -1
  48. data/lib/incident_io/models/webhooks_private_incident_membership_granted_v1_response_body.rb +1 -1
  49. data/lib/incident_io/models/webhooks_private_incident_membership_revoked_v1_response_body.rb +1 -1
  50. data/lib/incident_io/models/webhooks_private_incident_postmortem_document_status_updated_v1_response_body.rb +1 -1
  51. data/lib/incident_io/models/webhooks_public_alert_created_v1_response_body.rb +1 -1
  52. data/lib/incident_io/models/webhooks_public_alert_resolved_v1_response_body.rb +1 -1
  53. data/lib/incident_io/models/webhooks_public_escalation_created_v1_response_body.rb +1 -1
  54. data/lib/incident_io/models/webhooks_public_escalation_status_updated_v1_response_body.rb +1 -1
  55. data/lib/incident_io/models/webhooks_public_incident_action_created_v1_response_body.rb +1 -1
  56. data/lib/incident_io/models/webhooks_public_incident_action_updated_v1_response_body.rb +1 -1
  57. data/lib/incident_io/models/webhooks_public_incident_follow_up_created_v1_response_body.rb +1 -1
  58. data/lib/incident_io/models/webhooks_public_incident_follow_up_created_v2_response_body.rb +1 -1
  59. data/lib/incident_io/models/webhooks_public_incident_follow_up_updated_v1_response_body.rb +1 -1
  60. data/lib/incident_io/models/webhooks_public_incident_follow_up_updated_v2_response_body.rb +1 -1
  61. data/lib/incident_io/models/webhooks_public_incident_incident_created_v2_response_body.rb +1 -1
  62. data/lib/incident_io/models/webhooks_public_incident_incident_status_updated_v2_response_body.rb +1 -1
  63. data/lib/incident_io/models/webhooks_public_incident_incident_updated_v2_response_body.rb +1 -1
  64. data/lib/incident_io/models/webhooks_public_incident_postmortem_document_status_updated_v1_response_body.rb +1 -1
  65. data/lib/incident_io/models/webhooks_schedule_created_v1_response_body.rb +1 -1
  66. data/lib/incident_io/models/webhooks_schedule_deleted_v1_response_body.rb +1 -1
  67. data/lib/incident_io/models/webhooks_schedule_shift_change_v1_response_body.rb +1 -1
  68. data/lib/incident_io/models/webhooks_schedule_updated_v1_response_body.rb +1 -1
  69. data/lib/incident_io/models/webhooks_status_page_incident_update_shared_v1_response_body.rb +1 -1
  70. data/lib/incident_io/version.rb +1 -1
  71. data/lib/incident_io.rb +34 -0
  72. metadata +36 -2
@@ -0,0 +1,254 @@
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 branch of a block, with the conditions that select it and the actions it takes
18
+ class AlertRuleBranchV3 < ApiModelBase
19
+ # The actions to take when the branch holds
20
+ attr_accessor :actions
21
+
22
+ # Branches nested one level deep. Each runs when this branch ran and its own conditions hold, and cannot nest further.
23
+ attr_accessor :branches
24
+
25
+ # The branch holds when every condition in any one group holds. A branch with no groups always holds.
26
+ attr_accessor :condition_groups
27
+
28
+ # Identifier for this branch, unique within the set. Choose a readable key and send the same one on every update: alert groups are keyed on it.
29
+ attr_accessor :id
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'actions' => :'actions',
35
+ :'branches' => :'branches',
36
+ :'condition_groups' => :'condition_groups',
37
+ :'id' => :'id'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'actions' => :'Array<AlertRuleActionV3>',
55
+ :'branches' => :'Array<AlertRuleNestedBranchV3>',
56
+ :'condition_groups' => :'Array<ConditionGroupPayloadV3>',
57
+ :'id' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertRuleBranchV3` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertRuleBranchV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'actions')
84
+ if (value = attributes[:'actions']).is_a?(Array)
85
+ self.actions = value
86
+ end
87
+ else
88
+ self.actions = nil
89
+ end
90
+
91
+ if attributes.key?(:'branches')
92
+ if (value = attributes[:'branches']).is_a?(Array)
93
+ self.branches = value
94
+ end
95
+ end
96
+
97
+ if attributes.key?(:'condition_groups')
98
+ if (value = attributes[:'condition_groups']).is_a?(Array)
99
+ self.condition_groups = value
100
+ end
101
+ else
102
+ self.condition_groups = nil
103
+ end
104
+
105
+ if attributes.key?(:'id')
106
+ self.id = attributes[:'id']
107
+ else
108
+ self.id = nil
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @actions.nil?
118
+ invalid_properties.push('invalid value for "actions", actions cannot be nil.')
119
+ end
120
+
121
+ if @condition_groups.nil?
122
+ invalid_properties.push('invalid value for "condition_groups", condition_groups cannot be nil.')
123
+ end
124
+
125
+ if @id.nil?
126
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
127
+ end
128
+
129
+ if @id.to_s.length > 128
130
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 128.')
131
+ end
132
+
133
+ if @id.to_s.length < 1
134
+ invalid_properties.push('invalid value for "id", the character length must be greater than or equal to 1.')
135
+ end
136
+
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ warn '[DEPRECATED] the `valid?` method is obsolete'
144
+ return false if @actions.nil?
145
+ return false if @condition_groups.nil?
146
+ return false if @id.nil?
147
+ return false if @id.to_s.length > 128
148
+ return false if @id.to_s.length < 1
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] actions Value to be assigned
154
+ def actions=(actions)
155
+ if actions.nil?
156
+ fail ArgumentError, 'actions cannot be nil'
157
+ end
158
+
159
+ @actions = actions
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] condition_groups Value to be assigned
164
+ def condition_groups=(condition_groups)
165
+ if condition_groups.nil?
166
+ fail ArgumentError, 'condition_groups cannot be nil'
167
+ end
168
+
169
+ @condition_groups = condition_groups
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] id Value to be assigned
174
+ def id=(id)
175
+ if id.nil?
176
+ fail ArgumentError, 'id cannot be nil'
177
+ end
178
+
179
+ if id.to_s.length > 128
180
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 128.'
181
+ end
182
+
183
+ if id.to_s.length < 1
184
+ fail ArgumentError, 'invalid value for "id", the character length must be greater than or equal to 1.'
185
+ end
186
+
187
+ @id = id
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ actions == o.actions &&
196
+ branches == o.branches &&
197
+ condition_groups == o.condition_groups &&
198
+ id == o.id
199
+ end
200
+
201
+ # @see the `==` method
202
+ # @param [Object] Object to be compared
203
+ def eql?(o)
204
+ self == o
205
+ end
206
+
207
+ # Calculates hash code according to all attributes.
208
+ # @return [Integer] Hash code
209
+ def hash
210
+ [actions, branches, condition_groups, id].hash
211
+ end
212
+
213
+ # Builds the object from hash
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @return [Object] Returns the model itself
216
+ def self.build_from_hash(attributes)
217
+ return nil unless attributes.is_a?(Hash)
218
+ attributes = attributes.transform_keys(&:to_sym)
219
+ transformed_hash = {}
220
+ openapi_types.each_pair do |key, type|
221
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
222
+ transformed_hash["#{key}"] = nil
223
+ elsif type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[attribute_map[key]].is_a?(Array)
227
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
228
+ end
229
+ elsif !attributes[attribute_map[key]].nil?
230
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
231
+ end
232
+ end
233
+ new(transformed_hash)
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ end
253
+
254
+ end
@@ -0,0 +1,177 @@
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
+ # Create an incident from the alert, or attach it to the incident its group already has
18
+ class AlertRuleCreateIncidentActionV3 < ApiModelBase
19
+ # Decline the incident if its alerts resolve before anyone accepts it. Defaults to false.
20
+ attr_accessor :auto_decline
21
+
22
+ attr_accessor :incident_template
23
+
24
+ # Create the incident as private. A private alert, or a template whose incident type allows only private incidents, makes it private anyway. Defaults to false.
25
+ attr_accessor :is_private
26
+
27
+ attr_accessor :membership_teams
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'auto_decline' => :'auto_decline',
33
+ :'incident_template' => :'incident_template',
34
+ :'is_private' => :'is_private',
35
+ :'membership_teams' => :'membership_teams'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'auto_decline' => :'Boolean',
53
+ :'incident_template' => :'EngineParamBindingPayloadV3',
54
+ :'is_private' => :'Boolean',
55
+ :'membership_teams' => :'EngineParamBindingPayloadV3'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertRuleCreateIncidentActionV3` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertRuleCreateIncidentActionV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'auto_decline')
82
+ self.auto_decline = attributes[:'auto_decline']
83
+ end
84
+
85
+ if attributes.key?(:'incident_template')
86
+ self.incident_template = attributes[:'incident_template']
87
+ end
88
+
89
+ if attributes.key?(:'is_private')
90
+ self.is_private = attributes[:'is_private']
91
+ end
92
+
93
+ if attributes.key?(:'membership_teams')
94
+ self.membership_teams = attributes[:'membership_teams']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ auto_decline == o.auto_decline &&
119
+ incident_template == o.incident_template &&
120
+ is_private == o.is_private &&
121
+ membership_teams == o.membership_teams
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [auto_decline, incident_template, is_private, membership_teams].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ if value.nil?
166
+ is_nullable = self.class.openapi_nullable.include?(attr)
167
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
168
+ end
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -0,0 +1,215 @@
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
+ # Page escalation paths or users about the alert. Set escalation_paths, users, or both.
18
+ class AlertRuleEscalateActionV3 < ApiModelBase
19
+ # Cancel the escalation when the alert resolves, or when every alert in its group resolves. Defaults to false.
20
+ attr_accessor :auto_cancel
21
+
22
+ attr_accessor :escalation_paths
23
+
24
+ # How long an alert that joins a group with a live page waits before it pages. 0, the default, pages at once. Only used with on_each_new_alert.
25
+ attr_accessor :grace_period_seconds
26
+
27
+ # How an alert that joins a group pages. on_each_new_alert pages for every alert. on_priority_increase pages a target only when the alert's priority is above every live page the group already has to that target. Defaults to on_each_new_alert. Known values: `on_priority_increase`, `on_each_new_alert`
28
+ attr_accessor :mode
29
+
30
+ attr_accessor :urgency
31
+
32
+ attr_accessor :users
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'auto_cancel' => :'auto_cancel',
38
+ :'escalation_paths' => :'escalation_paths',
39
+ :'grace_period_seconds' => :'grace_period_seconds',
40
+ :'mode' => :'mode',
41
+ :'urgency' => :'urgency',
42
+ :'users' => :'users'
43
+ }
44
+ end
45
+
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ acceptable_attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'auto_cancel' => :'Boolean',
60
+ :'escalation_paths' => :'EngineParamBindingPayloadV3',
61
+ :'grace_period_seconds' => :'Integer',
62
+ :'mode' => :'String',
63
+ :'urgency' => :'EngineParamBindingPayloadV3',
64
+ :'users' => :'EngineParamBindingPayloadV3'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertRuleEscalateActionV3` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertRuleEscalateActionV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'auto_cancel')
91
+ self.auto_cancel = attributes[:'auto_cancel']
92
+ end
93
+
94
+ if attributes.key?(:'escalation_paths')
95
+ self.escalation_paths = attributes[:'escalation_paths']
96
+ end
97
+
98
+ if attributes.key?(:'grace_period_seconds')
99
+ self.grace_period_seconds = attributes[:'grace_period_seconds']
100
+ end
101
+
102
+ if attributes.key?(:'mode')
103
+ self.mode = attributes[:'mode']
104
+ end
105
+
106
+ if attributes.key?(:'urgency')
107
+ self.urgency = attributes[:'urgency']
108
+ end
109
+
110
+ if attributes.key?(:'users')
111
+ self.users = attributes[:'users']
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 !@grace_period_seconds.nil? && @grace_period_seconds < 0
121
+ invalid_properties.push('invalid value for "grace_period_seconds", must be greater than or equal to 0.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if !@grace_period_seconds.nil? && @grace_period_seconds < 0
132
+ true
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] grace_period_seconds Value to be assigned
137
+ def grace_period_seconds=(grace_period_seconds)
138
+ if grace_period_seconds.nil?
139
+ fail ArgumentError, 'grace_period_seconds cannot be nil'
140
+ end
141
+
142
+ if grace_period_seconds < 0
143
+ fail ArgumentError, 'invalid value for "grace_period_seconds", must be greater than or equal to 0.'
144
+ end
145
+
146
+ @grace_period_seconds = grace_period_seconds
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ auto_cancel == o.auto_cancel &&
155
+ escalation_paths == o.escalation_paths &&
156
+ grace_period_seconds == o.grace_period_seconds &&
157
+ mode == o.mode &&
158
+ urgency == o.urgency &&
159
+ users == o.users
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [auto_cancel, escalation_paths, grace_period_seconds, mode, urgency, users].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ end
214
+
215
+ end