incident_io_api 2.7.0 → 2.9.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 (23) hide show
  1. checksums.yaml +4 -4
  2. data/lib/incident_io/api/incident_forms_v3_api.rb +361 -0
  3. data/lib/incident_io/api/status_page_components_v2_api.rb +347 -0
  4. data/lib/incident_io/models/incident_form_lifecycle_element_config_v3.rb +148 -0
  5. data/lib/incident_io/models/incident_form_lifecycle_element_payload_v3.rb +287 -0
  6. data/lib/incident_io/models/incident_form_lifecycle_element_v3.rb +287 -0
  7. data/lib/incident_io/models/incident_form_v3.rb +297 -0
  8. data/lib/incident_io/models/incident_forms_create_payload_v3.rb +216 -0
  9. data/lib/incident_io/models/incident_forms_create_result_v3.rb +164 -0
  10. data/lib/incident_io/models/incident_forms_list_result_v3.rb +192 -0
  11. data/lib/incident_io/models/incident_forms_show_result_v3.rb +164 -0
  12. data/lib/incident_io/models/incident_forms_update_payload_v3.rb +216 -0
  13. data/lib/incident_io/models/incident_forms_update_result_v3.rb +164 -0
  14. data/lib/incident_io/models/status_page_component_v2.rb +229 -0
  15. data/lib/incident_io/models/status_page_components_create_payload_v2.rb +175 -0
  16. data/lib/incident_io/models/status_page_components_create_result_v2.rb +164 -0
  17. data/lib/incident_io/models/status_page_components_list_result_v2.rb +166 -0
  18. data/lib/incident_io/models/status_page_components_show_result_v2.rb +164 -0
  19. data/lib/incident_io/models/status_page_components_update_payload_v2.rb +175 -0
  20. data/lib/incident_io/models/status_page_components_update_result_v2.rb +164 -0
  21. data/lib/incident_io/version.rb +1 -1
  22. data/lib/incident_io.rb +19 -0
  23. metadata +20 -1
@@ -0,0 +1,287 @@
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 IncidentFormLifecycleElementPayloadV3 < ApiModelBase
18
+ # Whether the user can explicitly choose no value. Only meaningful for custom field elements.
19
+ attr_accessor :can_select_no_value
20
+
21
+ attr_accessor :config
22
+
23
+ # The custom field this element edits. Set only when element_type is custom_field.
24
+ attr_accessor :custom_field_id
25
+
26
+ attr_accessor :default_value
27
+
28
+ # Description shown beside this element, as markdown
29
+ attr_accessor :description
30
+
31
+ # What this element captures Known values: `name`, `status`, `severity`, `incident_role`, `incident_type`, `summary`, `custom_field`, `timestamp`, `update_message`, `next_update_in`, `triage`, `visibility`, `divider`, `text`, `incident_attachments`, `slack_channel`, `announce_retro_incident`, `enter_post_incident_flow`, `investigation_feedback`
32
+ attr_accessor :element_type
33
+
34
+ # Identifier of an existing divider or text element. Omit when adding an element.
35
+ attr_accessor :id
36
+
37
+ # The incident role this element assigns. Set only when element_type is incident_role.
38
+ attr_accessor :incident_role_id
39
+
40
+ # The incident timestamp this element sets. Set only when element_type is timestamp.
41
+ attr_accessor :incident_timestamp_id
42
+
43
+ # Placeholder text shown in the empty field
44
+ attr_accessor :placeholder
45
+
46
+ # When this element must be filled in Known values: `check_engine_config`, `always_require`, `never_require`
47
+ attr_accessor :required_if
48
+
49
+ # Condition groups that make this element required. Used when required_if is check_engine_config.
50
+ attr_accessor :required_if_condition_groups
51
+
52
+ # The element is shown when any of these condition groups match. Unset means it is always shown.
53
+ attr_accessor :show_if_condition_groups
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'can_select_no_value' => :'can_select_no_value',
59
+ :'config' => :'config',
60
+ :'custom_field_id' => :'custom_field_id',
61
+ :'default_value' => :'default_value',
62
+ :'description' => :'description',
63
+ :'element_type' => :'element_type',
64
+ :'id' => :'id',
65
+ :'incident_role_id' => :'incident_role_id',
66
+ :'incident_timestamp_id' => :'incident_timestamp_id',
67
+ :'placeholder' => :'placeholder',
68
+ :'required_if' => :'required_if',
69
+ :'required_if_condition_groups' => :'required_if_condition_groups',
70
+ :'show_if_condition_groups' => :'show_if_condition_groups'
71
+ }
72
+ end
73
+
74
+ # Returns attribute mapping this model knows about
75
+ def self.acceptable_attribute_map
76
+ attribute_map
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ acceptable_attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'can_select_no_value' => :'Boolean',
88
+ :'config' => :'IncidentFormLifecycleElementConfigV3',
89
+ :'custom_field_id' => :'String',
90
+ :'default_value' => :'EngineParamBindingPayloadV3',
91
+ :'description' => :'String',
92
+ :'element_type' => :'String',
93
+ :'id' => :'String',
94
+ :'incident_role_id' => :'String',
95
+ :'incident_timestamp_id' => :'String',
96
+ :'placeholder' => :'String',
97
+ :'required_if' => :'String',
98
+ :'required_if_condition_groups' => :'Array<ConditionGroupPayloadV3>',
99
+ :'show_if_condition_groups' => :'Array<ConditionGroupPayloadV3>'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ ])
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ if (!attributes.is_a?(Hash))
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentFormLifecycleElementPayloadV3` initialize method"
114
+ end
115
+
116
+ # check to see if the attribute exists and convert string to symbol for hash key
117
+ acceptable_attribute_map = self.class.acceptable_attribute_map
118
+ attributes = attributes.each_with_object({}) { |(k, v), h|
119
+ if (!acceptable_attribute_map.key?(k.to_sym))
120
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentFormLifecycleElementPayloadV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
121
+ end
122
+ h[k.to_sym] = v
123
+ }
124
+
125
+ if attributes.key?(:'can_select_no_value')
126
+ self.can_select_no_value = attributes[:'can_select_no_value']
127
+ end
128
+
129
+ if attributes.key?(:'config')
130
+ self.config = attributes[:'config']
131
+ end
132
+
133
+ if attributes.key?(:'custom_field_id')
134
+ self.custom_field_id = attributes[:'custom_field_id']
135
+ end
136
+
137
+ if attributes.key?(:'default_value')
138
+ self.default_value = attributes[:'default_value']
139
+ end
140
+
141
+ if attributes.key?(:'description')
142
+ self.description = attributes[:'description']
143
+ end
144
+
145
+ if attributes.key?(:'element_type')
146
+ self.element_type = attributes[:'element_type']
147
+ else
148
+ self.element_type = nil
149
+ end
150
+
151
+ if attributes.key?(:'id')
152
+ self.id = attributes[:'id']
153
+ end
154
+
155
+ if attributes.key?(:'incident_role_id')
156
+ self.incident_role_id = attributes[:'incident_role_id']
157
+ end
158
+
159
+ if attributes.key?(:'incident_timestamp_id')
160
+ self.incident_timestamp_id = attributes[:'incident_timestamp_id']
161
+ end
162
+
163
+ if attributes.key?(:'placeholder')
164
+ self.placeholder = attributes[:'placeholder']
165
+ end
166
+
167
+ if attributes.key?(:'required_if')
168
+ self.required_if = attributes[:'required_if']
169
+ end
170
+
171
+ if attributes.key?(:'required_if_condition_groups')
172
+ if (value = attributes[:'required_if_condition_groups']).is_a?(Array)
173
+ self.required_if_condition_groups = value
174
+ end
175
+ end
176
+
177
+ if attributes.key?(:'show_if_condition_groups')
178
+ if (value = attributes[:'show_if_condition_groups']).is_a?(Array)
179
+ self.show_if_condition_groups = value
180
+ end
181
+ end
182
+ end
183
+
184
+ # Show invalid properties with the reasons. Usually used together with valid?
185
+ # @return Array for valid properties with the reasons
186
+ def list_invalid_properties
187
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
188
+ invalid_properties = Array.new
189
+ if @element_type.nil?
190
+ invalid_properties.push('invalid value for "element_type", element_type cannot be nil.')
191
+ end
192
+
193
+ invalid_properties
194
+ end
195
+
196
+ # Check to see if the all the properties in the model are valid
197
+ # @return true if the model is valid
198
+ def valid?
199
+ warn '[DEPRECATED] the `valid?` method is obsolete'
200
+ return false if @element_type.nil?
201
+ true
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] element_type Value to be assigned
206
+ def element_type=(element_type)
207
+ if element_type.nil?
208
+ fail ArgumentError, 'element_type cannot be nil'
209
+ end
210
+
211
+ @element_type = element_type
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ can_select_no_value == o.can_select_no_value &&
220
+ config == o.config &&
221
+ custom_field_id == o.custom_field_id &&
222
+ default_value == o.default_value &&
223
+ description == o.description &&
224
+ element_type == o.element_type &&
225
+ id == o.id &&
226
+ incident_role_id == o.incident_role_id &&
227
+ incident_timestamp_id == o.incident_timestamp_id &&
228
+ placeholder == o.placeholder &&
229
+ required_if == o.required_if &&
230
+ required_if_condition_groups == o.required_if_condition_groups &&
231
+ show_if_condition_groups == o.show_if_condition_groups
232
+ end
233
+
234
+ # @see the `==` method
235
+ # @param [Object] Object to be compared
236
+ def eql?(o)
237
+ self == o
238
+ end
239
+
240
+ # Calculates hash code according to all attributes.
241
+ # @return [Integer] Hash code
242
+ def hash
243
+ [can_select_no_value, config, custom_field_id, default_value, description, element_type, id, incident_role_id, incident_timestamp_id, placeholder, required_if, required_if_condition_groups, show_if_condition_groups].hash
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def self.build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ attributes = attributes.transform_keys(&:to_sym)
252
+ transformed_hash = {}
253
+ openapi_types.each_pair do |key, type|
254
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
255
+ transformed_hash["#{key}"] = nil
256
+ elsif type =~ /\AArray<(.*)>/i
257
+ # check to ensure the input is an array given that the attribute
258
+ # is documented as an array but the input is not
259
+ if attributes[attribute_map[key]].is_a?(Array)
260
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
261
+ end
262
+ elsif !attributes[attribute_map[key]].nil?
263
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
264
+ end
265
+ end
266
+ new(transformed_hash)
267
+ end
268
+
269
+ # Returns the object in the form of hash
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_hash
272
+ hash = {}
273
+ self.class.attribute_map.each_pair do |attr, param|
274
+ value = self.send(attr)
275
+ if value.nil?
276
+ is_nullable = self.class.openapi_nullable.include?(attr)
277
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
278
+ end
279
+
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ end
286
+
287
+ end
@@ -0,0 +1,287 @@
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 IncidentFormLifecycleElementV3 < ApiModelBase
18
+ # Whether the user can explicitly choose no value. Only meaningful for custom field elements.
19
+ attr_accessor :can_select_no_value
20
+
21
+ attr_accessor :config
22
+
23
+ # The custom field this element edits. Set only when element_type is custom_field.
24
+ attr_accessor :custom_field_id
25
+
26
+ attr_accessor :default_value
27
+
28
+ # Description shown beside this element, as markdown
29
+ attr_accessor :description
30
+
31
+ # What this element captures Known values: `name`, `status`, `severity`, `incident_role`, `incident_type`, `summary`, `custom_field`, `timestamp`, `update_message`, `next_update_in`, `triage`, `visibility`, `divider`, `text`, `incident_attachments`, `slack_channel`, `announce_retro_incident`, `enter_post_incident_flow`, `investigation_feedback`
32
+ attr_accessor :element_type
33
+
34
+ # Unique identifier for this element. divider and text elements are matched on this, because they have no natural key.
35
+ attr_accessor :id
36
+
37
+ # The incident role this element assigns. Set only when element_type is incident_role.
38
+ attr_accessor :incident_role_id
39
+
40
+ # The incident timestamp this element sets. Set only when element_type is timestamp.
41
+ attr_accessor :incident_timestamp_id
42
+
43
+ # Placeholder text shown in the empty field
44
+ attr_accessor :placeholder
45
+
46
+ # When this element must be filled in Known values: `check_engine_config`, `always_require`, `never_require`
47
+ attr_accessor :required_if
48
+
49
+ # Condition groups that make this element required. Used when required_if is check_engine_config.
50
+ attr_accessor :required_if_condition_groups
51
+
52
+ # The element is shown when any of these condition groups match. Unset means it is always shown.
53
+ attr_accessor :show_if_condition_groups
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'can_select_no_value' => :'can_select_no_value',
59
+ :'config' => :'config',
60
+ :'custom_field_id' => :'custom_field_id',
61
+ :'default_value' => :'default_value',
62
+ :'description' => :'description',
63
+ :'element_type' => :'element_type',
64
+ :'id' => :'id',
65
+ :'incident_role_id' => :'incident_role_id',
66
+ :'incident_timestamp_id' => :'incident_timestamp_id',
67
+ :'placeholder' => :'placeholder',
68
+ :'required_if' => :'required_if',
69
+ :'required_if_condition_groups' => :'required_if_condition_groups',
70
+ :'show_if_condition_groups' => :'show_if_condition_groups'
71
+ }
72
+ end
73
+
74
+ # Returns attribute mapping this model knows about
75
+ def self.acceptable_attribute_map
76
+ attribute_map
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ acceptable_attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'can_select_no_value' => :'Boolean',
88
+ :'config' => :'IncidentFormLifecycleElementConfigV3',
89
+ :'custom_field_id' => :'String',
90
+ :'default_value' => :'EngineParamBindingV3',
91
+ :'description' => :'String',
92
+ :'element_type' => :'String',
93
+ :'id' => :'String',
94
+ :'incident_role_id' => :'String',
95
+ :'incident_timestamp_id' => :'String',
96
+ :'placeholder' => :'String',
97
+ :'required_if' => :'String',
98
+ :'required_if_condition_groups' => :'Array<ConditionGroupV3>',
99
+ :'show_if_condition_groups' => :'Array<ConditionGroupV3>'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ ])
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ if (!attributes.is_a?(Hash))
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentFormLifecycleElementV3` initialize method"
114
+ end
115
+
116
+ # check to see if the attribute exists and convert string to symbol for hash key
117
+ acceptable_attribute_map = self.class.acceptable_attribute_map
118
+ attributes = attributes.each_with_object({}) { |(k, v), h|
119
+ if (!acceptable_attribute_map.key?(k.to_sym))
120
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentFormLifecycleElementV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
121
+ end
122
+ h[k.to_sym] = v
123
+ }
124
+
125
+ if attributes.key?(:'can_select_no_value')
126
+ self.can_select_no_value = attributes[:'can_select_no_value']
127
+ end
128
+
129
+ if attributes.key?(:'config')
130
+ self.config = attributes[:'config']
131
+ end
132
+
133
+ if attributes.key?(:'custom_field_id')
134
+ self.custom_field_id = attributes[:'custom_field_id']
135
+ end
136
+
137
+ if attributes.key?(:'default_value')
138
+ self.default_value = attributes[:'default_value']
139
+ end
140
+
141
+ if attributes.key?(:'description')
142
+ self.description = attributes[:'description']
143
+ end
144
+
145
+ if attributes.key?(:'element_type')
146
+ self.element_type = attributes[:'element_type']
147
+ else
148
+ self.element_type = nil
149
+ end
150
+
151
+ if attributes.key?(:'id')
152
+ self.id = attributes[:'id']
153
+ end
154
+
155
+ if attributes.key?(:'incident_role_id')
156
+ self.incident_role_id = attributes[:'incident_role_id']
157
+ end
158
+
159
+ if attributes.key?(:'incident_timestamp_id')
160
+ self.incident_timestamp_id = attributes[:'incident_timestamp_id']
161
+ end
162
+
163
+ if attributes.key?(:'placeholder')
164
+ self.placeholder = attributes[:'placeholder']
165
+ end
166
+
167
+ if attributes.key?(:'required_if')
168
+ self.required_if = attributes[:'required_if']
169
+ end
170
+
171
+ if attributes.key?(:'required_if_condition_groups')
172
+ if (value = attributes[:'required_if_condition_groups']).is_a?(Array)
173
+ self.required_if_condition_groups = value
174
+ end
175
+ end
176
+
177
+ if attributes.key?(:'show_if_condition_groups')
178
+ if (value = attributes[:'show_if_condition_groups']).is_a?(Array)
179
+ self.show_if_condition_groups = value
180
+ end
181
+ end
182
+ end
183
+
184
+ # Show invalid properties with the reasons. Usually used together with valid?
185
+ # @return Array for valid properties with the reasons
186
+ def list_invalid_properties
187
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
188
+ invalid_properties = Array.new
189
+ if @element_type.nil?
190
+ invalid_properties.push('invalid value for "element_type", element_type cannot be nil.')
191
+ end
192
+
193
+ invalid_properties
194
+ end
195
+
196
+ # Check to see if the all the properties in the model are valid
197
+ # @return true if the model is valid
198
+ def valid?
199
+ warn '[DEPRECATED] the `valid?` method is obsolete'
200
+ return false if @element_type.nil?
201
+ true
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] element_type Value to be assigned
206
+ def element_type=(element_type)
207
+ if element_type.nil?
208
+ fail ArgumentError, 'element_type cannot be nil'
209
+ end
210
+
211
+ @element_type = element_type
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ can_select_no_value == o.can_select_no_value &&
220
+ config == o.config &&
221
+ custom_field_id == o.custom_field_id &&
222
+ default_value == o.default_value &&
223
+ description == o.description &&
224
+ element_type == o.element_type &&
225
+ id == o.id &&
226
+ incident_role_id == o.incident_role_id &&
227
+ incident_timestamp_id == o.incident_timestamp_id &&
228
+ placeholder == o.placeholder &&
229
+ required_if == o.required_if &&
230
+ required_if_condition_groups == o.required_if_condition_groups &&
231
+ show_if_condition_groups == o.show_if_condition_groups
232
+ end
233
+
234
+ # @see the `==` method
235
+ # @param [Object] Object to be compared
236
+ def eql?(o)
237
+ self == o
238
+ end
239
+
240
+ # Calculates hash code according to all attributes.
241
+ # @return [Integer] Hash code
242
+ def hash
243
+ [can_select_no_value, config, custom_field_id, default_value, description, element_type, id, incident_role_id, incident_timestamp_id, placeholder, required_if, required_if_condition_groups, show_if_condition_groups].hash
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def self.build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ attributes = attributes.transform_keys(&:to_sym)
252
+ transformed_hash = {}
253
+ openapi_types.each_pair do |key, type|
254
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
255
+ transformed_hash["#{key}"] = nil
256
+ elsif type =~ /\AArray<(.*)>/i
257
+ # check to ensure the input is an array given that the attribute
258
+ # is documented as an array but the input is not
259
+ if attributes[attribute_map[key]].is_a?(Array)
260
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
261
+ end
262
+ elsif !attributes[attribute_map[key]].nil?
263
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
264
+ end
265
+ end
266
+ new(transformed_hash)
267
+ end
268
+
269
+ # Returns the object in the form of hash
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_hash
272
+ hash = {}
273
+ self.class.attribute_map.each_pair do |attr, param|
274
+ value = self.send(attr)
275
+ if value.nil?
276
+ is_nullable = self.class.openapi_nullable.include?(attr)
277
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
278
+ end
279
+
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ end
286
+
287
+ end