incident_io_api 2.22.0 → 2.24.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: 7c17f2227b4d29663755fb7e211d871e0b7641a5ec4747c2f679db8fbf83f9a0
4
- data.tar.gz: 1a91bb901241bcc337d0f7c0896de115171c9feb7a7648b8017062d9c9d6e6d5
3
+ metadata.gz: 5f86ae894fe065c7d6f3326280a8b37b10f8688972307d2fe094ae3d36199a2b
4
+ data.tar.gz: 10664d9e60096b37614941758d788478ea00319cb80941b6aa5eb395be7c7ddd
5
5
  SHA512:
6
- metadata.gz: 8f78bc27dd6a66d618902d2e38dcb2bc1008b17394f7da78106898076984abb6f84e5c0e1ed7ca6d31f2675ac53ba6b66fe8f40b7829c988c87f517910604091
7
- data.tar.gz: 30fdd4e5135712f5e52c50bbff7454b24f5b51f4cf8ba00f92520ad565764f74a953c8fb1e8e3a9d1c820d4d52478dcd32f10f071243ca62a7ac01671f25e46d
6
+ metadata.gz: a28e72e1f83e16118a162494f9820ec5a46bb55a9b5c05b8d3ef06d8a1861139e0987c99499b18e3c61e56009d9bf1a31cebf53ba6a260a058d96a3af37572c1
7
+ data.tar.gz: 1ac1c1771181c620883bf475af82a6e045f4fd67fa30d175ba654110a2bc3fb97e2970809b23cc38f7f3f595e45e8a2883dd8cb69772b1b0027e65e5724ddbe2
@@ -0,0 +1,432 @@
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 GlossaryEntriesV2Api
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Glossary Entries V2
23
+ # Create a glossary entry. It is appended to the end of the glossary unless after names an existing entry to insert it after.
24
+ # @param glossary_entries_create_payload_v2 [GlossaryEntriesCreatePayloadV2]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [GlossaryEntriesCreateResultV2]
27
+ def glossary_entries_v2_create(glossary_entries_create_payload_v2, opts = {})
28
+ data, _status_code, _headers = glossary_entries_v2_create_with_http_info(glossary_entries_create_payload_v2, opts)
29
+ data
30
+ end
31
+
32
+ # Create Glossary Entries V2
33
+ # Create a glossary entry. It is appended to the end of the glossary unless after names an existing entry to insert it after.
34
+ # @param glossary_entries_create_payload_v2 [GlossaryEntriesCreatePayloadV2]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(GlossaryEntriesCreateResultV2, Integer, Hash)>] GlossaryEntriesCreateResultV2 data, response status code and response headers
37
+ def glossary_entries_v2_create_with_http_info(glossary_entries_create_payload_v2, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: GlossaryEntriesV2Api.glossary_entries_v2_create ...'
40
+ end
41
+ # verify the required parameter 'glossary_entries_create_payload_v2' is set
42
+ if @api_client.config.client_side_validation && glossary_entries_create_payload_v2.nil?
43
+ fail ArgumentError, "Missing the required parameter 'glossary_entries_create_payload_v2' when calling GlossaryEntriesV2Api.glossary_entries_v2_create"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v2/glossary_entries'
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(glossary_entries_create_payload_v2)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'GlossaryEntriesCreateResultV2'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"GlossaryEntriesV2Api.glossary_entries_v2_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: GlossaryEntriesV2Api#glossary_entries_v2_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Destroy Glossary Entries V2
91
+ # Delete a glossary entry. The entry is archived, which frees its term so the same item can be added again later.
92
+ # @param id [String] Unique identifier for this glossary entry
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [nil]
95
+ def glossary_entries_v2_destroy(id, opts = {})
96
+ glossary_entries_v2_destroy_with_http_info(id, opts)
97
+ nil
98
+ end
99
+
100
+ # Destroy Glossary Entries V2
101
+ # Delete a glossary entry. The entry is archived, which frees its term so the same item can be added again later.
102
+ # @param id [String] Unique identifier for this glossary entry
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
105
+ def glossary_entries_v2_destroy_with_http_info(id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: GlossaryEntriesV2Api.glossary_entries_v2_destroy ...'
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 GlossaryEntriesV2Api.glossary_entries_v2_destroy"
112
+ end
113
+ # resource path
114
+ local_var_path = '/v2/glossary_entries/{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 => :"GlossaryEntriesV2Api.glossary_entries_v2_destroy",
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: GlossaryEntriesV2Api#glossary_entries_v2_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # List Glossary Entries V2
154
+ # List glossary entries for this organisation, in rank order.
155
+ # @param [Hash] opts the optional parameters
156
+ # @option opts [Integer] :page_size Number of glossary entries to return per page (default to 25)
157
+ # @option opts [String] :after A glossary entry&#39;s ID. This endpoint returns entries after this one. Without search, that is later in rank order. With search, it is the next hit after this entry.
158
+ # @option opts [String] :search Filter to entries whose term or description contains this value (case-insensitive)
159
+ # @return [GlossaryEntriesListResultV2]
160
+ def glossary_entries_v2_list(opts = {})
161
+ data, _status_code, _headers = glossary_entries_v2_list_with_http_info(opts)
162
+ data
163
+ end
164
+
165
+ # List Glossary Entries V2
166
+ # List glossary entries for this organisation, in rank order.
167
+ # @param [Hash] opts the optional parameters
168
+ # @option opts [Integer] :page_size Number of glossary entries to return per page (default to 25)
169
+ # @option opts [String] :after A glossary entry&#39;s ID. This endpoint returns entries after this one. Without search, that is later in rank order. With search, it is the next hit after this entry.
170
+ # @option opts [String] :search Filter to entries whose term or description contains this value (case-insensitive)
171
+ # @return [Array<(GlossaryEntriesListResultV2, Integer, Hash)>] GlossaryEntriesListResultV2 data, response status code and response headers
172
+ def glossary_entries_v2_list_with_http_info(opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: GlossaryEntriesV2Api.glossary_entries_v2_list ...'
175
+ end
176
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 250
177
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling GlossaryEntriesV2Api.glossary_entries_v2_list, must be smaller than or equal to 250.'
178
+ end
179
+
180
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
181
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling GlossaryEntriesV2Api.glossary_entries_v2_list, must be greater than or equal to 1.'
182
+ end
183
+
184
+ # resource path
185
+ local_var_path = '/v2/glossary_entries'
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
190
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
191
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
192
+
193
+ # header parameters
194
+ header_params = opts[:header_params] || {}
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
197
+
198
+ # form parameters
199
+ form_params = opts[:form_params] || {}
200
+
201
+ # http body (model)
202
+ post_body = opts[:debug_body]
203
+
204
+ # return_type
205
+ return_type = opts[:debug_return_type] || 'GlossaryEntriesListResultV2'
206
+
207
+ # auth_names
208
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
209
+
210
+ new_options = opts.merge(
211
+ :operation => :"GlossaryEntriesV2Api.glossary_entries_v2_list",
212
+ :header_params => header_params,
213
+ :query_params => query_params,
214
+ :form_params => form_params,
215
+ :body => post_body,
216
+ :auth_names => auth_names,
217
+ :return_type => return_type
218
+ )
219
+
220
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: GlossaryEntriesV2Api#glossary_entries_v2_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+
227
+ # Show Glossary Entries V2
228
+ # Get a single glossary entry.
229
+ # @param id [String] Unique identifier for this glossary entry
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [GlossaryEntriesShowResultV2]
232
+ def glossary_entries_v2_show(id, opts = {})
233
+ data, _status_code, _headers = glossary_entries_v2_show_with_http_info(id, opts)
234
+ data
235
+ end
236
+
237
+ # Show Glossary Entries V2
238
+ # Get a single glossary entry.
239
+ # @param id [String] Unique identifier for this glossary entry
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Array<(GlossaryEntriesShowResultV2, Integer, Hash)>] GlossaryEntriesShowResultV2 data, response status code and response headers
242
+ def glossary_entries_v2_show_with_http_info(id, opts = {})
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug 'Calling API: GlossaryEntriesV2Api.glossary_entries_v2_show ...'
245
+ end
246
+ # verify the required parameter 'id' is set
247
+ if @api_client.config.client_side_validation && id.nil?
248
+ fail ArgumentError, "Missing the required parameter 'id' when calling GlossaryEntriesV2Api.glossary_entries_v2_show"
249
+ end
250
+ # resource path
251
+ local_var_path = '/v2/glossary_entries/{id}'.sub('{id}', CGI.escape(id.to_s))
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+
264
+ # http body (model)
265
+ post_body = opts[:debug_body]
266
+
267
+ # return_type
268
+ return_type = opts[:debug_return_type] || 'GlossaryEntriesShowResultV2'
269
+
270
+ # auth_names
271
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
272
+
273
+ new_options = opts.merge(
274
+ :operation => :"GlossaryEntriesV2Api.glossary_entries_v2_show",
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => return_type
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: GlossaryEntriesV2Api#glossary_entries_v2_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
290
+ # Update Glossary Entries V2
291
+ # Update a glossary entry's term or description. Rank is unchanged; use the reorder action for that.
292
+ # @param id [String] Unique identifier for this glossary entry
293
+ # @param glossary_entries_update_payload_v2 [GlossaryEntriesUpdatePayloadV2]
294
+ # @param [Hash] opts the optional parameters
295
+ # @return [GlossaryEntriesUpdateResultV2]
296
+ def glossary_entries_v2_update(id, glossary_entries_update_payload_v2, opts = {})
297
+ data, _status_code, _headers = glossary_entries_v2_update_with_http_info(id, glossary_entries_update_payload_v2, opts)
298
+ data
299
+ end
300
+
301
+ # Update Glossary Entries V2
302
+ # Update a glossary entry&#39;s term or description. Rank is unchanged; use the reorder action for that.
303
+ # @param id [String] Unique identifier for this glossary entry
304
+ # @param glossary_entries_update_payload_v2 [GlossaryEntriesUpdatePayloadV2]
305
+ # @param [Hash] opts the optional parameters
306
+ # @return [Array<(GlossaryEntriesUpdateResultV2, Integer, Hash)>] GlossaryEntriesUpdateResultV2 data, response status code and response headers
307
+ def glossary_entries_v2_update_with_http_info(id, glossary_entries_update_payload_v2, opts = {})
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug 'Calling API: GlossaryEntriesV2Api.glossary_entries_v2_update ...'
310
+ end
311
+ # verify the required parameter 'id' is set
312
+ if @api_client.config.client_side_validation && id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'id' when calling GlossaryEntriesV2Api.glossary_entries_v2_update"
314
+ end
315
+ # verify the required parameter 'glossary_entries_update_payload_v2' is set
316
+ if @api_client.config.client_side_validation && glossary_entries_update_payload_v2.nil?
317
+ fail ArgumentError, "Missing the required parameter 'glossary_entries_update_payload_v2' when calling GlossaryEntriesV2Api.glossary_entries_v2_update"
318
+ end
319
+ # resource path
320
+ local_var_path = '/v2/glossary_entries/{id}'.sub('{id}', CGI.escape(id.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+ # HTTP header 'Accept' (if needed)
328
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
329
+ # HTTP header 'Content-Type'
330
+ content_type = @api_client.select_header_content_type(['application/json'])
331
+ if !content_type.nil?
332
+ header_params['Content-Type'] = content_type
333
+ end
334
+
335
+ # form parameters
336
+ form_params = opts[:form_params] || {}
337
+
338
+ # http body (model)
339
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(glossary_entries_update_payload_v2)
340
+
341
+ # return_type
342
+ return_type = opts[:debug_return_type] || 'GlossaryEntriesUpdateResultV2'
343
+
344
+ # auth_names
345
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
346
+
347
+ new_options = opts.merge(
348
+ :operation => :"GlossaryEntriesV2Api.glossary_entries_v2_update",
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: GlossaryEntriesV2Api#glossary_entries_v2_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+
364
+ # UpdateRanks Glossary Entries V2
365
+ # Reorder glossary entries. Every live entry must be included exactly once.
366
+ # @param glossary_entries_update_ranks_payload_v2 [GlossaryEntriesUpdateRanksPayloadV2]
367
+ # @param [Hash] opts the optional parameters
368
+ # @return [GlossaryEntriesUpdateRanksResultV2]
369
+ def glossary_entries_v2_update_ranks(glossary_entries_update_ranks_payload_v2, opts = {})
370
+ data, _status_code, _headers = glossary_entries_v2_update_ranks_with_http_info(glossary_entries_update_ranks_payload_v2, opts)
371
+ data
372
+ end
373
+
374
+ # UpdateRanks Glossary Entries V2
375
+ # Reorder glossary entries. Every live entry must be included exactly once.
376
+ # @param glossary_entries_update_ranks_payload_v2 [GlossaryEntriesUpdateRanksPayloadV2]
377
+ # @param [Hash] opts the optional parameters
378
+ # @return [Array<(GlossaryEntriesUpdateRanksResultV2, Integer, Hash)>] GlossaryEntriesUpdateRanksResultV2 data, response status code and response headers
379
+ def glossary_entries_v2_update_ranks_with_http_info(glossary_entries_update_ranks_payload_v2, opts = {})
380
+ if @api_client.config.debugging
381
+ @api_client.config.logger.debug 'Calling API: GlossaryEntriesV2Api.glossary_entries_v2_update_ranks ...'
382
+ end
383
+ # verify the required parameter 'glossary_entries_update_ranks_payload_v2' is set
384
+ if @api_client.config.client_side_validation && glossary_entries_update_ranks_payload_v2.nil?
385
+ fail ArgumentError, "Missing the required parameter 'glossary_entries_update_ranks_payload_v2' when calling GlossaryEntriesV2Api.glossary_entries_v2_update_ranks"
386
+ end
387
+ # resource path
388
+ local_var_path = '/v2/glossary_entries/actions/update_ranks'
389
+
390
+ # query parameters
391
+ query_params = opts[:query_params] || {}
392
+
393
+ # header parameters
394
+ header_params = opts[:header_params] || {}
395
+ # HTTP header 'Accept' (if needed)
396
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
397
+ # HTTP header 'Content-Type'
398
+ content_type = @api_client.select_header_content_type(['application/json'])
399
+ if !content_type.nil?
400
+ header_params['Content-Type'] = content_type
401
+ end
402
+
403
+ # form parameters
404
+ form_params = opts[:form_params] || {}
405
+
406
+ # http body (model)
407
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(glossary_entries_update_ranks_payload_v2)
408
+
409
+ # return_type
410
+ return_type = opts[:debug_return_type] || 'GlossaryEntriesUpdateRanksResultV2'
411
+
412
+ # auth_names
413
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
414
+
415
+ new_options = opts.merge(
416
+ :operation => :"GlossaryEntriesV2Api.glossary_entries_v2_update_ranks",
417
+ :header_params => header_params,
418
+ :query_params => query_params,
419
+ :form_params => form_params,
420
+ :body => post_body,
421
+ :auth_names => auth_names,
422
+ :return_type => return_type
423
+ )
424
+
425
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
426
+ if @api_client.config.debugging
427
+ @api_client.config.logger.debug "API called: GlossaryEntriesV2Api#glossary_entries_v2_update_ranks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
428
+ end
429
+ return data, status_code, headers
430
+ end
431
+ end
432
+ end
@@ -20,7 +20,7 @@ module IncidentIo
20
20
  @api_client = api_client
21
21
  end
22
22
  # ConnectExternalIssue Incidents V2
23
- # Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident's fields into the issue. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident's full ID, or the numeric part of its reference.
23
+ # Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident's fields into the issue. This works whether or not automatic incident ticket creation is turned on. While it is off, no tickets are created for other incidents, and the incident's fields are not written into this issue until it is turned on. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident's full ID, or the numeric part of its reference.
24
24
  # @param id [String] The unique identifier of the incident
25
25
  # @param incidents_connect_external_issue_payload_v2 [IncidentsConnectExternalIssuePayloadV2]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module IncidentIo
31
31
  end
32
32
 
33
33
  # ConnectExternalIssue Incidents V2
34
- # Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident&#39;s fields into the issue. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident&#39;s full ID, or the numeric part of its reference.
34
+ # Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident&#39;s fields into the issue. This works whether or not automatic incident ticket creation is turned on. While it is off, no tickets are created for other incidents, and the incident&#39;s fields are not written into this issue until it is turned on. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident&#39;s full ID, or the numeric part of its reference.
35
35
  # @param id [String] The unique identifier of the incident
36
36
  # @param incidents_connect_external_issue_payload_v2 [IncidentsConnectExternalIssuePayloadV2]
37
37
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,220 @@
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 GlossaryEntriesCreatePayloadV2 < ApiModelBase
18
+ # ID of a live glossary entry. The new entry is inserted immediately after it. Omit to append the entry to the end.
19
+ attr_accessor :after
20
+
21
+ # What the term means
22
+ attr_accessor :description
23
+
24
+ # The term, for example an acronym or service name. Unique among live entries, ignoring case.
25
+ attr_accessor :item
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'after' => :'after',
31
+ :'description' => :'description',
32
+ :'item' => :'item'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'after' => :'String',
50
+ :'description' => :'String',
51
+ :'item' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::GlossaryEntriesCreatePayloadV2` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::GlossaryEntriesCreatePayloadV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'after')
78
+ self.after = attributes[:'after']
79
+ end
80
+
81
+ if attributes.key?(:'description')
82
+ self.description = attributes[:'description']
83
+ else
84
+ self.description = nil
85
+ end
86
+
87
+ if attributes.key?(:'item')
88
+ self.item = attributes[:'item']
89
+ else
90
+ self.item = nil
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ if @description.nil?
100
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
101
+ end
102
+
103
+ if @description.to_s.length > 2000
104
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2000.')
105
+ end
106
+
107
+ if @item.nil?
108
+ invalid_properties.push('invalid value for "item", item cannot be nil.')
109
+ end
110
+
111
+ if @item.to_s.length > 128
112
+ invalid_properties.push('invalid value for "item", the character length must be smaller than or equal to 128.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ return false if @description.nil?
123
+ return false if @description.to_s.length > 2000
124
+ return false if @item.nil?
125
+ return false if @item.to_s.length > 128
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] description Value to be assigned
131
+ def description=(description)
132
+ if description.nil?
133
+ fail ArgumentError, 'description cannot be nil'
134
+ end
135
+
136
+ if description.to_s.length > 2000
137
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2000.'
138
+ end
139
+
140
+ @description = description
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] item Value to be assigned
145
+ def item=(item)
146
+ if item.nil?
147
+ fail ArgumentError, 'item cannot be nil'
148
+ end
149
+
150
+ if item.to_s.length > 128
151
+ fail ArgumentError, 'invalid value for "item", the character length must be smaller than or equal to 128.'
152
+ end
153
+
154
+ @item = item
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ after == o.after &&
163
+ description == o.description &&
164
+ item == o.item
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [after, description, item].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end