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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 754c359d331c3c2915e2e2f976cb275811c672a8e30ebfde71bb4144431046a9
4
- data.tar.gz: 19ad13c29f33fe0459eb0126c485a7b18e4e379a2e10f622b7777947927c0d0f
3
+ metadata.gz: 042dc0ebc895dba1a981bede7ee341dd036cdd6494037e3dc98768f17e4cad2e
4
+ data.tar.gz: dafbc91e94c7e3638acb1d87b0a562312f10f6fb984a9a469d939d905b4f0d9e
5
5
  SHA512:
6
- metadata.gz: '08abaa68086d2f8a36e9c110fc87d8fbad8e34e7433fcbee65ba6445e1c9988c4f1b052484939e3bf24e289fedf6db371011b7fb89adc4dd46aae19a711f20aa'
7
- data.tar.gz: 916edbfebaf0318b91a9331810e1a1f471e0d8254199b3ada9ad1275feb3aea83abb1fa9cdce66c2ad627cb8452d937bb48c2443f85260445542ef4182db08af
6
+ metadata.gz: e8c3387db062ecd66f07fd44af6334f69e73b62e1074133b08485f4fe322daf01dcd68261de85607f9fc890ef92a26d0d86eb043381654c5722742f911e39684
7
+ data.tar.gz: 5c51d11cae0d1415662c1d8c09ad692ac3907406ee32b875c0cf69f081929f588494e2deb116542d7a4d27a7de056078d7b51fc6d25401c9f733868a76e10c26
@@ -0,0 +1,361 @@
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 'cgi'
14
+
15
+ module IncidentIo
16
+ class IncidentFormsV3Api
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Incident Forms V3
23
+ # Create an incident form for an incident type. A form that already exists for that form type and incident type is rejected.
24
+ # @param incident_forms_create_payload_v3 [IncidentFormsCreatePayloadV3]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [IncidentFormsCreateResultV3]
27
+ def incident_forms_v3_create(incident_forms_create_payload_v3, opts = {})
28
+ data, _status_code, _headers = incident_forms_v3_create_with_http_info(incident_forms_create_payload_v3, opts)
29
+ data
30
+ end
31
+
32
+ # Create Incident Forms V3
33
+ # Create an incident form for an incident type. A form that already exists for that form type and incident type is rejected.
34
+ # @param incident_forms_create_payload_v3 [IncidentFormsCreatePayloadV3]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(IncidentFormsCreateResultV3, Integer, Hash)>] IncidentFormsCreateResultV3 data, response status code and response headers
37
+ def incident_forms_v3_create_with_http_info(incident_forms_create_payload_v3, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: IncidentFormsV3Api.incident_forms_v3_create ...'
40
+ end
41
+ # verify the required parameter 'incident_forms_create_payload_v3' is set
42
+ if @api_client.config.client_side_validation && incident_forms_create_payload_v3.nil?
43
+ fail ArgumentError, "Missing the required parameter 'incident_forms_create_payload_v3' when calling IncidentFormsV3Api.incident_forms_v3_create"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v3/incident_forms'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(incident_forms_create_payload_v3)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'IncidentFormsCreateResultV3'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"IncidentFormsV3Api.incident_forms_v3_create",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: IncidentFormsV3Api#incident_forms_v3_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Delete Incident Forms V3
91
+ # Archive an incident form. The organisation's default form of a type cannot be archived.
92
+ # @param id [String] Unique identifier for this incident form
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [nil]
95
+ def incident_forms_v3_delete(id, opts = {})
96
+ incident_forms_v3_delete_with_http_info(id, opts)
97
+ nil
98
+ end
99
+
100
+ # Delete Incident Forms V3
101
+ # Archive an incident form. The organisation&#39;s default form of a type cannot be archived.
102
+ # @param id [String] Unique identifier for this incident form
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
105
+ def incident_forms_v3_delete_with_http_info(id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: IncidentFormsV3Api.incident_forms_v3_delete ...'
108
+ end
109
+ # verify the required parameter 'id' is set
110
+ if @api_client.config.client_side_validation && id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'id' when calling IncidentFormsV3Api.incident_forms_v3_delete"
112
+ end
113
+ # resource path
114
+ local_var_path = '/v3/incident_forms/{id}'.sub('{id}', CGI.escape(id.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type]
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"IncidentFormsV3Api.incident_forms_v3_delete",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: IncidentFormsV3Api#incident_forms_v3_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # List Incident Forms V3
154
+ # List incident forms for your account, including their elements and expressions.
155
+ # @param [Hash] opts the optional parameters
156
+ # @option opts [Integer] :page_size Integer number of records to return (default to 25)
157
+ # @option opts [String] :after An incident form&#39;s ID. This endpoint will return a list of forms after this ID in relation to the API response order.
158
+ # @return [IncidentFormsListResultV3]
159
+ def incident_forms_v3_list(opts = {})
160
+ data, _status_code, _headers = incident_forms_v3_list_with_http_info(opts)
161
+ data
162
+ end
163
+
164
+ # List Incident Forms V3
165
+ # List incident forms for your account, including their elements and expressions.
166
+ # @param [Hash] opts the optional parameters
167
+ # @option opts [Integer] :page_size Integer number of records to return (default to 25)
168
+ # @option opts [String] :after An incident form&#39;s ID. This endpoint will return a list of forms after this ID in relation to the API response order.
169
+ # @return [Array<(IncidentFormsListResultV3, Integer, Hash)>] IncidentFormsListResultV3 data, response status code and response headers
170
+ def incident_forms_v3_list_with_http_info(opts = {})
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug 'Calling API: IncidentFormsV3Api.incident_forms_v3_list ...'
173
+ end
174
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 250
175
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IncidentFormsV3Api.incident_forms_v3_list, must be smaller than or equal to 250.'
176
+ end
177
+
178
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
179
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IncidentFormsV3Api.incident_forms_v3_list, must be greater than or equal to 1.'
180
+ end
181
+
182
+ # resource path
183
+ local_var_path = '/v3/incident_forms'
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
188
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
194
+
195
+ # form parameters
196
+ form_params = opts[:form_params] || {}
197
+
198
+ # http body (model)
199
+ post_body = opts[:debug_body]
200
+
201
+ # return_type
202
+ return_type = opts[:debug_return_type] || 'IncidentFormsListResultV3'
203
+
204
+ # auth_names
205
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
206
+
207
+ new_options = opts.merge(
208
+ :operation => :"IncidentFormsV3Api.incident_forms_v3_list",
209
+ :header_params => header_params,
210
+ :query_params => query_params,
211
+ :form_params => form_params,
212
+ :body => post_body,
213
+ :auth_names => auth_names,
214
+ :return_type => return_type
215
+ )
216
+
217
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
218
+ if @api_client.config.debugging
219
+ @api_client.config.logger.debug "API called: IncidentFormsV3Api#incident_forms_v3_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
220
+ end
221
+ return data, status_code, headers
222
+ end
223
+
224
+ # Show Incident Forms V3
225
+ # Get a single incident form, including its elements and expressions.
226
+ # @param id [String] Unique identifier for this incident form
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [IncidentFormsShowResultV3]
229
+ def incident_forms_v3_show(id, opts = {})
230
+ data, _status_code, _headers = incident_forms_v3_show_with_http_info(id, opts)
231
+ data
232
+ end
233
+
234
+ # Show Incident Forms V3
235
+ # Get a single incident form, including its elements and expressions.
236
+ # @param id [String] Unique identifier for this incident form
237
+ # @param [Hash] opts the optional parameters
238
+ # @return [Array<(IncidentFormsShowResultV3, Integer, Hash)>] IncidentFormsShowResultV3 data, response status code and response headers
239
+ def incident_forms_v3_show_with_http_info(id, opts = {})
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug 'Calling API: IncidentFormsV3Api.incident_forms_v3_show ...'
242
+ end
243
+ # verify the required parameter 'id' is set
244
+ if @api_client.config.client_side_validation && id.nil?
245
+ fail ArgumentError, "Missing the required parameter 'id' when calling IncidentFormsV3Api.incident_forms_v3_show"
246
+ end
247
+ # resource path
248
+ local_var_path = '/v3/incident_forms/{id}'.sub('{id}', CGI.escape(id.to_s))
249
+
250
+ # query parameters
251
+ query_params = opts[:query_params] || {}
252
+
253
+ # header parameters
254
+ header_params = opts[:header_params] || {}
255
+ # HTTP header 'Accept' (if needed)
256
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
257
+
258
+ # form parameters
259
+ form_params = opts[:form_params] || {}
260
+
261
+ # http body (model)
262
+ post_body = opts[:debug_body]
263
+
264
+ # return_type
265
+ return_type = opts[:debug_return_type] || 'IncidentFormsShowResultV3'
266
+
267
+ # auth_names
268
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
269
+
270
+ new_options = opts.merge(
271
+ :operation => :"IncidentFormsV3Api.incident_forms_v3_show",
272
+ :header_params => header_params,
273
+ :query_params => query_params,
274
+ :form_params => form_params,
275
+ :body => post_body,
276
+ :auth_names => auth_names,
277
+ :return_type => return_type
278
+ )
279
+
280
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
281
+ if @api_client.config.debugging
282
+ @api_client.config.logger.debug "API called: IncidentFormsV3Api#incident_forms_v3_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
283
+ end
284
+ return data, status_code, headers
285
+ end
286
+
287
+ # Update Incident Forms V3
288
+ # Replace an incident form, including its elements and expressions.
289
+ # @param id [String] Unique identifier of the incident form
290
+ # @param incident_forms_update_payload_v3 [IncidentFormsUpdatePayloadV3]
291
+ # @param [Hash] opts the optional parameters
292
+ # @return [IncidentFormsUpdateResultV3]
293
+ def incident_forms_v3_update(id, incident_forms_update_payload_v3, opts = {})
294
+ data, _status_code, _headers = incident_forms_v3_update_with_http_info(id, incident_forms_update_payload_v3, opts)
295
+ data
296
+ end
297
+
298
+ # Update Incident Forms V3
299
+ # Replace an incident form, including its elements and expressions.
300
+ # @param id [String] Unique identifier of the incident form
301
+ # @param incident_forms_update_payload_v3 [IncidentFormsUpdatePayloadV3]
302
+ # @param [Hash] opts the optional parameters
303
+ # @return [Array<(IncidentFormsUpdateResultV3, Integer, Hash)>] IncidentFormsUpdateResultV3 data, response status code and response headers
304
+ def incident_forms_v3_update_with_http_info(id, incident_forms_update_payload_v3, opts = {})
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug 'Calling API: IncidentFormsV3Api.incident_forms_v3_update ...'
307
+ end
308
+ # verify the required parameter 'id' is set
309
+ if @api_client.config.client_side_validation && id.nil?
310
+ fail ArgumentError, "Missing the required parameter 'id' when calling IncidentFormsV3Api.incident_forms_v3_update"
311
+ end
312
+ # verify the required parameter 'incident_forms_update_payload_v3' is set
313
+ if @api_client.config.client_side_validation && incident_forms_update_payload_v3.nil?
314
+ fail ArgumentError, "Missing the required parameter 'incident_forms_update_payload_v3' when calling IncidentFormsV3Api.incident_forms_v3_update"
315
+ end
316
+ # resource path
317
+ local_var_path = '/v3/incident_forms/{id}'.sub('{id}', CGI.escape(id.to_s))
318
+
319
+ # query parameters
320
+ query_params = opts[:query_params] || {}
321
+
322
+ # header parameters
323
+ header_params = opts[:header_params] || {}
324
+ # HTTP header 'Accept' (if needed)
325
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
326
+ # HTTP header 'Content-Type'
327
+ content_type = @api_client.select_header_content_type(['application/json'])
328
+ if !content_type.nil?
329
+ header_params['Content-Type'] = content_type
330
+ end
331
+
332
+ # form parameters
333
+ form_params = opts[:form_params] || {}
334
+
335
+ # http body (model)
336
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(incident_forms_update_payload_v3)
337
+
338
+ # return_type
339
+ return_type = opts[:debug_return_type] || 'IncidentFormsUpdateResultV3'
340
+
341
+ # auth_names
342
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
343
+
344
+ new_options = opts.merge(
345
+ :operation => :"IncidentFormsV3Api.incident_forms_v3_update",
346
+ :header_params => header_params,
347
+ :query_params => query_params,
348
+ :form_params => form_params,
349
+ :body => post_body,
350
+ :auth_names => auth_names,
351
+ :return_type => return_type
352
+ )
353
+
354
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug "API called: IncidentFormsV3Api#incident_forms_v3_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
357
+ end
358
+ return data, status_code, headers
359
+ end
360
+ end
361
+ end
@@ -0,0 +1,148 @@
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 IncidentFormLifecycleElementConfigV3 < ApiModelBase
18
+ # Whether the free-text comment must be filled in, for anyone giving investigation feedback
19
+ attr_accessor :require_comment
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'require_comment' => :'require_comment'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'require_comment' => :'Boolean'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentFormLifecycleElementConfigV3` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentFormLifecycleElementConfigV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'require_comment')
68
+ self.require_comment = attributes[:'require_comment']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ require_comment == o.require_comment
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [require_comment].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = self.send(attr)
136
+ if value.nil?
137
+ is_nullable = self.class.openapi_nullable.include?(attr)
138
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
139
+ end
140
+
141
+ hash[param] = _to_hash(value)
142
+ end
143
+ hash
144
+ end
145
+
146
+ end
147
+
148
+ end