incident_io_api 2.21.0 → 2.23.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: 9c59f8990c0ddc45735a373e4a3c74aa42ac348a536924bc76732fe4860dfdd3
4
- data.tar.gz: 999001913a5e5f621d6684f553b604d6b8939bcae2b52e6502c5e5a9af63a690
3
+ metadata.gz: 3c11fe241a77504154d7122ebfc330fade678ade0ec21fd62a105b104abb9dd3
4
+ data.tar.gz: df8da2aa6995fe8afa18ca6961891afc6ff45a11d31eb813924e7ce599b5b005
5
5
  SHA512:
6
- metadata.gz: 16c56c802ddafe6d9d3f31b22a13f9d21e9e6cba3332a5dd3f9c0edbe2a794c5d39ea955b288ead1ebf423dce6def541a7e7286a794ad10d362ba29957edf1e9
7
- data.tar.gz: adc4ff38e1cc39b8c409899e4418691fa645a413be84200219474851bb460b9c4ceec4f95732394e484e4efe3be48f8ff91d98f037ed0c3d63f715af45b5b2b4
6
+ metadata.gz: 0e038699f484bca48c61d1d3ec78e6443d62893b9c40452e5ed8362ef41708c202b7f8a2f4b50b4df4b2f7bc37962b00d1cddb3928be1d343217cc3ccb272406
7
+ data.tar.gz: 66e74980778818746989c627ef4fbef0df5a2f75798ab79d9ab92482fe76dba686b7e3251097f782c7d19408b854f4bde991e8733104e01d30e927b244cb5488
@@ -19,6 +19,80 @@ module IncidentIo
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
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 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
+ # @param id [String] The unique identifier of the incident
25
+ # @param incidents_connect_external_issue_payload_v2 [IncidentsConnectExternalIssuePayloadV2]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [nil]
28
+ def incidents_v2_connect_external_issue(id, incidents_connect_external_issue_payload_v2, opts = {})
29
+ incidents_v2_connect_external_issue_with_http_info(id, incidents_connect_external_issue_payload_v2, opts)
30
+ nil
31
+ end
32
+
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'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.
35
+ # @param id [String] The unique identifier of the incident
36
+ # @param incidents_connect_external_issue_payload_v2 [IncidentsConnectExternalIssuePayloadV2]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def incidents_v2_connect_external_issue_with_http_info(id, incidents_connect_external_issue_payload_v2, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: IncidentsV2Api.incidents_v2_connect_external_issue ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsV2Api.incidents_v2_connect_external_issue"
46
+ end
47
+ # verify the required parameter 'incidents_connect_external_issue_payload_v2' is set
48
+ if @api_client.config.client_side_validation && incidents_connect_external_issue_payload_v2.nil?
49
+ fail ArgumentError, "Missing the required parameter 'incidents_connect_external_issue_payload_v2' when calling IncidentsV2Api.incidents_v2_connect_external_issue"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v2/incidents/{id}/actions/connect_external_issue'.sub('{id}', CGI.escape(id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(incidents_connect_external_issue_payload_v2)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type]
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"IncidentsV2Api.incidents_v2_connect_external_issue",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: IncidentsV2Api#incidents_v2_connect_external_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
22
96
  # Create Incidents V2
23
97
  # Create a new incident. Note that if the incident mode is set to \"retrospective\" then the new incident will not be announced in Slack.
24
98
  # @param incidents_create_payload_v2 [IncidentsCreatePayloadV2]
@@ -0,0 +1,231 @@
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 IncidentsConnectExternalIssuePayloadV2 < ApiModelBase
18
+ # ID of the incident ticket template to sync the issue with
19
+ attr_accessor :issue_template_id
20
+
21
+ # The issue tracker provider the issue belongs to. It must match the provider of the incident ticket template. Known values: `asana`, `azure_devops`, `click_up`, `freshservice`, `linear`, `jira`, `salesforce`, `jira_server`, `github`, `gitlab`, `service_now`, `shortcut`, `notion`
22
+ attr_accessor :provider
23
+
24
+ # Whether to replace the incident's current external issue, if it has a different one
25
+ attr_accessor :replace
26
+
27
+ # URL of the issue in the issue tracker
28
+ attr_accessor :url
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'issue_template_id' => :'issue_template_id',
34
+ :'provider' => :'provider',
35
+ :'replace' => :'replace',
36
+ :'url' => :'url'
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
+ :'issue_template_id' => :'String',
54
+ :'provider' => :'String',
55
+ :'replace' => :'Boolean',
56
+ :'url' => :'String'
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::IncidentsConnectExternalIssuePayloadV2` 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::IncidentsConnectExternalIssuePayloadV2`. 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?(:'issue_template_id')
83
+ self.issue_template_id = attributes[:'issue_template_id']
84
+ else
85
+ self.issue_template_id = nil
86
+ end
87
+
88
+ if attributes.key?(:'provider')
89
+ self.provider = attributes[:'provider']
90
+ else
91
+ self.provider = nil
92
+ end
93
+
94
+ if attributes.key?(:'replace')
95
+ self.replace = attributes[:'replace']
96
+ else
97
+ self.replace = false
98
+ end
99
+
100
+ if attributes.key?(:'url')
101
+ self.url = attributes[:'url']
102
+ else
103
+ self.url = nil
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 @issue_template_id.nil?
113
+ invalid_properties.push('invalid value for "issue_template_id", issue_template_id cannot be nil.')
114
+ end
115
+
116
+ if @provider.nil?
117
+ invalid_properties.push('invalid value for "provider", provider cannot be nil.')
118
+ end
119
+
120
+ if @url.nil?
121
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @issue_template_id.nil?
132
+ return false if @provider.nil?
133
+ return false if @url.nil?
134
+ true
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] issue_template_id Value to be assigned
139
+ def issue_template_id=(issue_template_id)
140
+ if issue_template_id.nil?
141
+ fail ArgumentError, 'issue_template_id cannot be nil'
142
+ end
143
+
144
+ @issue_template_id = issue_template_id
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] provider Value to be assigned
149
+ def provider=(provider)
150
+ if provider.nil?
151
+ fail ArgumentError, 'provider cannot be nil'
152
+ end
153
+
154
+ @provider = provider
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] url Value to be assigned
159
+ def url=(url)
160
+ if url.nil?
161
+ fail ArgumentError, 'url cannot be nil'
162
+ end
163
+
164
+ @url = url
165
+ end
166
+
167
+ # Checks equality by comparing each attribute.
168
+ # @param [Object] Object to be compared
169
+ def ==(o)
170
+ return true if self.equal?(o)
171
+ self.class == o.class &&
172
+ issue_template_id == o.issue_template_id &&
173
+ provider == o.provider &&
174
+ replace == o.replace &&
175
+ url == o.url
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [issue_template_id, provider, replace, url].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
205
+ end
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
209
+ end
210
+ new(transformed_hash)
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -4,5 +4,5 @@ module IncidentIo
4
4
  # The release workflow sets this before building, so it tracks whatever we
5
5
  # last published. Listed in .openapi-generator-ignore so regeneration can't
6
6
  # reset it.
7
- VERSION = "2.21.0"
7
+ VERSION = "2.23.0"
8
8
  end
data/lib/incident_io.rb CHANGED
@@ -891,6 +891,7 @@ IncidentIo.autoload :IncidentUpdatesListResultV2, 'incident_io/models/incident_u
891
891
  IncidentIo.autoload :IncidentV1, 'incident_io/models/incident_v1'
892
892
  IncidentIo.autoload :IncidentV2, 'incident_io/models/incident_v2'
893
893
  IncidentIo.autoload :IncidentWithStatusChangeV2, 'incident_io/models/incident_with_status_change_v2'
894
+ IncidentIo.autoload :IncidentsConnectExternalIssuePayloadV2, 'incident_io/models/incidents_connect_external_issue_payload_v2'
894
895
  IncidentIo.autoload :IncidentsCreatePayloadV1, 'incident_io/models/incidents_create_payload_v1'
895
896
  IncidentIo.autoload :IncidentsCreatePayloadV2, 'incident_io/models/incidents_create_payload_v2'
896
897
  IncidentIo.autoload :IncidentsCreateResultV1, 'incident_io/models/incidents_create_result_v1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: incident_io_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.0
4
+ version: 2.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - incident.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-22 00:00:00.000000000 Z
11
+ date: 2026-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -1011,6 +1011,7 @@ files:
1011
1011
  - lib/incident_io/models/incident_v1.rb
1012
1012
  - lib/incident_io/models/incident_v2.rb
1013
1013
  - lib/incident_io/models/incident_with_status_change_v2.rb
1014
+ - lib/incident_io/models/incidents_connect_external_issue_payload_v2.rb
1014
1015
  - lib/incident_io/models/incidents_create_payload_v1.rb
1015
1016
  - lib/incident_io/models/incidents_create_payload_v2.rb
1016
1017
  - lib/incident_io/models/incidents_create_result_v1.rb