incident_io_api 2.8.0 → 2.10.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,297 @@
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 IncidentFormV3 < ApiModelBase
18
+ # When this incident form was created
19
+ attr_accessor :created_at
20
+
21
+ # Expressions available to every element's conditions and defaults. Referenced by reference, not by ID.
22
+ attr_accessor :expressions
23
+
24
+ # Which form this is. Escalate forms are not part of this API. Known values: `declare`, `accept`, `update`, `resolve`, `retrospective`, `custom-fields`
25
+ attr_accessor :form_type
26
+
27
+ # Unique identifier for this incident form
28
+ attr_accessor :id
29
+
30
+ # The incident type this form belongs to. Unset for the organisation's default form of this type.
31
+ attr_accessor :incident_type_id
32
+
33
+ # Elements on this form, in display order. List position is the order: there is no separate rank.
34
+ attr_accessor :lifecycle_elements
35
+
36
+ # When this incident form was last updated
37
+ attr_accessor :updated_at
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'created_at' => :'created_at',
43
+ :'expressions' => :'expressions',
44
+ :'form_type' => :'form_type',
45
+ :'id' => :'id',
46
+ :'incident_type_id' => :'incident_type_id',
47
+ :'lifecycle_elements' => :'lifecycle_elements',
48
+ :'updated_at' => :'updated_at'
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
+ :'created_at' => :'Time',
66
+ :'expressions' => :'Array<ExpressionV3>',
67
+ :'form_type' => :'String',
68
+ :'id' => :'String',
69
+ :'incident_type_id' => :'String',
70
+ :'lifecycle_elements' => :'Array<IncidentFormLifecycleElementV3>',
71
+ :'updated_at' => :'Time'
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::IncidentFormV3` 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::IncidentFormV3`. 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?(:'created_at')
98
+ self.created_at = attributes[:'created_at']
99
+ else
100
+ self.created_at = nil
101
+ end
102
+
103
+ if attributes.key?(:'expressions')
104
+ if (value = attributes[:'expressions']).is_a?(Array)
105
+ self.expressions = value
106
+ end
107
+ else
108
+ self.expressions = nil
109
+ end
110
+
111
+ if attributes.key?(:'form_type')
112
+ self.form_type = attributes[:'form_type']
113
+ else
114
+ self.form_type = nil
115
+ end
116
+
117
+ if attributes.key?(:'id')
118
+ self.id = attributes[:'id']
119
+ else
120
+ self.id = nil
121
+ end
122
+
123
+ if attributes.key?(:'incident_type_id')
124
+ self.incident_type_id = attributes[:'incident_type_id']
125
+ end
126
+
127
+ if attributes.key?(:'lifecycle_elements')
128
+ if (value = attributes[:'lifecycle_elements']).is_a?(Array)
129
+ self.lifecycle_elements = value
130
+ end
131
+ end
132
+
133
+ if attributes.key?(:'updated_at')
134
+ self.updated_at = attributes[:'updated_at']
135
+ else
136
+ self.updated_at = nil
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
144
+ invalid_properties = Array.new
145
+ if @created_at.nil?
146
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
147
+ end
148
+
149
+ if @expressions.nil?
150
+ invalid_properties.push('invalid value for "expressions", expressions cannot be nil.')
151
+ end
152
+
153
+ if @form_type.nil?
154
+ invalid_properties.push('invalid value for "form_type", form_type cannot be nil.')
155
+ end
156
+
157
+ if @id.nil?
158
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
159
+ end
160
+
161
+ if @updated_at.nil?
162
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ warn '[DEPRECATED] the `valid?` method is obsolete'
172
+ return false if @created_at.nil?
173
+ return false if @expressions.nil?
174
+ return false if @form_type.nil?
175
+ return false if @id.nil?
176
+ return false if @updated_at.nil?
177
+ true
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] created_at Value to be assigned
182
+ def created_at=(created_at)
183
+ if created_at.nil?
184
+ fail ArgumentError, 'created_at cannot be nil'
185
+ end
186
+
187
+ @created_at = created_at
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] expressions Value to be assigned
192
+ def expressions=(expressions)
193
+ if expressions.nil?
194
+ fail ArgumentError, 'expressions cannot be nil'
195
+ end
196
+
197
+ @expressions = expressions
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] form_type Value to be assigned
202
+ def form_type=(form_type)
203
+ if form_type.nil?
204
+ fail ArgumentError, 'form_type cannot be nil'
205
+ end
206
+
207
+ @form_type = form_type
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] id Value to be assigned
212
+ def id=(id)
213
+ if id.nil?
214
+ fail ArgumentError, 'id cannot be nil'
215
+ end
216
+
217
+ @id = id
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] updated_at Value to be assigned
222
+ def updated_at=(updated_at)
223
+ if updated_at.nil?
224
+ fail ArgumentError, 'updated_at cannot be nil'
225
+ end
226
+
227
+ @updated_at = updated_at
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ created_at == o.created_at &&
236
+ expressions == o.expressions &&
237
+ form_type == o.form_type &&
238
+ id == o.id &&
239
+ incident_type_id == o.incident_type_id &&
240
+ lifecycle_elements == o.lifecycle_elements &&
241
+ updated_at == o.updated_at
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(o)
247
+ self == o
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Integer] Hash code
252
+ def hash
253
+ [created_at, expressions, form_type, id, incident_type_id, lifecycle_elements, updated_at].hash
254
+ end
255
+
256
+ # Builds the object from hash
257
+ # @param [Hash] attributes Model attributes in the form of hash
258
+ # @return [Object] Returns the model itself
259
+ def self.build_from_hash(attributes)
260
+ return nil unless attributes.is_a?(Hash)
261
+ attributes = attributes.transform_keys(&:to_sym)
262
+ transformed_hash = {}
263
+ openapi_types.each_pair do |key, type|
264
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
265
+ transformed_hash["#{key}"] = nil
266
+ elsif type =~ /\AArray<(.*)>/i
267
+ # check to ensure the input is an array given that the attribute
268
+ # is documented as an array but the input is not
269
+ if attributes[attribute_map[key]].is_a?(Array)
270
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
271
+ end
272
+ elsif !attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
274
+ end
275
+ end
276
+ new(transformed_hash)
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -0,0 +1,216 @@
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 IncidentFormsCreatePayloadV3 < ApiModelBase
18
+ # Expressions available to every element's conditions and defaults. Referenced by reference, not by ID.
19
+ attr_accessor :expressions
20
+
21
+ # Which form this is. Escalate forms are not part of this API. Known values: `declare`, `accept`, `update`, `resolve`, `retrospective`, `custom-fields`
22
+ attr_accessor :form_type
23
+
24
+ # The incident type this form belongs to. Leave unset for the organisation's default form of this type.
25
+ attr_accessor :incident_type_id
26
+
27
+ # Elements on this form, in display order. List position is the order: there is no separate rank.
28
+ attr_accessor :lifecycle_elements
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'expressions' => :'expressions',
34
+ :'form_type' => :'form_type',
35
+ :'incident_type_id' => :'incident_type_id',
36
+ :'lifecycle_elements' => :'lifecycle_elements'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'expressions' => :'Array<ExpressionPayloadV3>',
54
+ :'form_type' => :'String',
55
+ :'incident_type_id' => :'String',
56
+ :'lifecycle_elements' => :'Array<IncidentFormLifecycleElementPayloadV3>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentFormsCreatePayloadV3` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentFormsCreatePayloadV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'expressions')
83
+ if (value = attributes[:'expressions']).is_a?(Array)
84
+ self.expressions = value
85
+ end
86
+ else
87
+ self.expressions = nil
88
+ end
89
+
90
+ if attributes.key?(:'form_type')
91
+ self.form_type = attributes[:'form_type']
92
+ else
93
+ self.form_type = nil
94
+ end
95
+
96
+ if attributes.key?(:'incident_type_id')
97
+ self.incident_type_id = attributes[:'incident_type_id']
98
+ end
99
+
100
+ if attributes.key?(:'lifecycle_elements')
101
+ if (value = attributes[:'lifecycle_elements']).is_a?(Array)
102
+ self.lifecycle_elements = value
103
+ end
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @expressions.nil?
113
+ invalid_properties.push('invalid value for "expressions", expressions cannot be nil.')
114
+ end
115
+
116
+ if @form_type.nil?
117
+ invalid_properties.push('invalid value for "form_type", form_type cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @expressions.nil?
128
+ return false if @form_type.nil?
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] expressions Value to be assigned
134
+ def expressions=(expressions)
135
+ if expressions.nil?
136
+ fail ArgumentError, 'expressions cannot be nil'
137
+ end
138
+
139
+ @expressions = expressions
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] form_type Value to be assigned
144
+ def form_type=(form_type)
145
+ if form_type.nil?
146
+ fail ArgumentError, 'form_type cannot be nil'
147
+ end
148
+
149
+ @form_type = form_type
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ expressions == o.expressions &&
158
+ form_type == o.form_type &&
159
+ incident_type_id == o.incident_type_id &&
160
+ lifecycle_elements == o.lifecycle_elements
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [expressions, form_type, incident_type_id, lifecycle_elements].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,164 @@
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 IncidentFormsCreateResultV3 < ApiModelBase
18
+ attr_accessor :incident_form
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'incident_form' => :'incident_form'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'incident_form' => :'IncidentFormV3'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentFormsCreateResultV3` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentFormsCreateResultV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'incident_form')
67
+ self.incident_form = attributes[:'incident_form']
68
+ else
69
+ self.incident_form = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @incident_form.nil?
79
+ invalid_properties.push('invalid value for "incident_form", incident_form cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @incident_form.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] incident_form Value to be assigned
95
+ def incident_form=(incident_form)
96
+ if incident_form.nil?
97
+ fail ArgumentError, 'incident_form cannot be nil'
98
+ end
99
+
100
+ @incident_form = incident_form
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ incident_form == o.incident_form
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [incident_form].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end