incident_io_api 2.20.0 → 2.21.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 +4 -4
- data/lib/incident_io/api/managed_resources_v2_api.rb +90 -0
- data/lib/incident_io/models/managed_resource_v2.rb +258 -0
- data/lib/incident_io/models/managed_resources_create_managed_resource_payload_v2.rb +221 -0
- data/lib/incident_io/models/managed_resources_create_managed_resource_result_v2.rb +164 -0
- data/lib/incident_io/version.rb +1 -1
- data/lib/incident_io.rb +4 -0
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c59f8990c0ddc45735a373e4a3c74aa42ac348a536924bc76732fe4860dfdd3
|
|
4
|
+
data.tar.gz: 999001913a5e5f621d6684f553b604d6b8939bcae2b52e6502c5e5a9af63a690
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16c56c802ddafe6d9d3f31b22a13f9d21e9e6cba3332a5dd3f9c0edbe2a794c5d39ea955b288ead1ebf423dce6def541a7e7286a794ad10d362ba29957edf1e9
|
|
7
|
+
data.tar.gz: adc4ff38e1cc39b8c409899e4418691fa645a413be84200219474851bb460b9c4ceec4f95732394e484e4efe3be48f8ff91d98f037ed0c3d63f715af45b5b2b4
|
|
@@ -0,0 +1,90 @@
|
|
|
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 ManagedResourcesV2Api
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# CreateManagedResource Managed Resources V2
|
|
23
|
+
# Create or update the management record for a resource. This replaces any annotations already stored on it. The annotations set `managed_by`: - `incident.io/terraform/version` sets it to `terraform`. - `incident.io/is-managed-externally` sets it to `external`. If both keys are present, `external` wins. - Neither key sets it to `dashboard`. This doesn't change the resource's configuration, but `managed_by` controls whether it can be edited in the dashboard. Returning a schedule to `dashboard` also returns its sync rules and targets. The API key must have the update scope for the resource type, e.g. `schedules.update` for a schedule.
|
|
24
|
+
# @param managed_resources_create_managed_resource_payload_v2 [ManagedResourcesCreateManagedResourcePayloadV2]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [ManagedResourcesCreateManagedResourceResultV2]
|
|
27
|
+
def managed_resources_v2_create_managed_resource(managed_resources_create_managed_resource_payload_v2, opts = {})
|
|
28
|
+
data, _status_code, _headers = managed_resources_v2_create_managed_resource_with_http_info(managed_resources_create_managed_resource_payload_v2, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# CreateManagedResource Managed Resources V2
|
|
33
|
+
# Create or update the management record for a resource. This replaces any annotations already stored on it. The annotations set `managed_by`: - `incident.io/terraform/version` sets it to `terraform`. - `incident.io/is-managed-externally` sets it to `external`. If both keys are present, `external` wins. - Neither key sets it to `dashboard`. This doesn't change the resource's configuration, but `managed_by` controls whether it can be edited in the dashboard. Returning a schedule to `dashboard` also returns its sync rules and targets. The API key must have the update scope for the resource type, e.g. `schedules.update` for a schedule.
|
|
34
|
+
# @param managed_resources_create_managed_resource_payload_v2 [ManagedResourcesCreateManagedResourcePayloadV2]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(ManagedResourcesCreateManagedResourceResultV2, Integer, Hash)>] ManagedResourcesCreateManagedResourceResultV2 data, response status code and response headers
|
|
37
|
+
def managed_resources_v2_create_managed_resource_with_http_info(managed_resources_create_managed_resource_payload_v2, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ManagedResourcesV2Api.managed_resources_v2_create_managed_resource ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'managed_resources_create_managed_resource_payload_v2' is set
|
|
42
|
+
if @api_client.config.client_side_validation && managed_resources_create_managed_resource_payload_v2.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'managed_resources_create_managed_resource_payload_v2' when calling ManagedResourcesV2Api.managed_resources_v2_create_managed_resource"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v2/managed_resources'
|
|
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(managed_resources_create_managed_resource_payload_v2)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'ManagedResourcesCreateManagedResourceResultV2'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"ManagedResourcesV2Api.managed_resources_v2_create_managed_resource",
|
|
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: ManagedResourcesV2Api#managed_resources_v2_create_managed_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,258 @@
|
|
|
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 ManagedResourceV2 < ApiModelBase
|
|
18
|
+
# Annotations that track metadata about this resource
|
|
19
|
+
attr_accessor :annotations
|
|
20
|
+
|
|
21
|
+
# How is this resource managed Known values: `dashboard`, `terraform`, `external`
|
|
22
|
+
attr_accessor :managed_by
|
|
23
|
+
|
|
24
|
+
# The ID of the resource that this relates to
|
|
25
|
+
attr_accessor :resource_id
|
|
26
|
+
|
|
27
|
+
# Known values: `alert_route`, `alert_source`, `api_key`, `incident_form`, `incident_template`, `escalation_path`, `escalation_path_template`, `policy`, `schedule`, `schedule_sync_target`, `schedule_sync_rule`, `secret`, `status_page_component`, `status_page_structure`, `team_grouping_preference`, `workflow`
|
|
28
|
+
attr_accessor :resource_type
|
|
29
|
+
|
|
30
|
+
# The url of the external repository where this resource is managed (if there is one)
|
|
31
|
+
attr_accessor :source_url
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'annotations' => :'annotations',
|
|
37
|
+
:'managed_by' => :'managed_by',
|
|
38
|
+
:'resource_id' => :'resource_id',
|
|
39
|
+
:'resource_type' => :'resource_type',
|
|
40
|
+
:'source_url' => :'source_url'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns attribute mapping this model knows about
|
|
45
|
+
def self.acceptable_attribute_map
|
|
46
|
+
attribute_map
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns all the JSON keys this model knows about
|
|
50
|
+
def self.acceptable_attributes
|
|
51
|
+
acceptable_attribute_map.values
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute type mapping.
|
|
55
|
+
def self.openapi_types
|
|
56
|
+
{
|
|
57
|
+
:'annotations' => :'Hash<String, String>',
|
|
58
|
+
:'managed_by' => :'String',
|
|
59
|
+
:'resource_id' => :'String',
|
|
60
|
+
:'resource_type' => :'String',
|
|
61
|
+
:'source_url' => :'String'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::ManagedResourceV2` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::ManagedResourceV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'annotations')
|
|
88
|
+
if (value = attributes[:'annotations']).is_a?(Hash)
|
|
89
|
+
self.annotations = value
|
|
90
|
+
end
|
|
91
|
+
else
|
|
92
|
+
self.annotations = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'managed_by')
|
|
96
|
+
self.managed_by = attributes[:'managed_by']
|
|
97
|
+
else
|
|
98
|
+
self.managed_by = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'resource_id')
|
|
102
|
+
self.resource_id = attributes[:'resource_id']
|
|
103
|
+
else
|
|
104
|
+
self.resource_id = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'resource_type')
|
|
108
|
+
self.resource_type = attributes[:'resource_type']
|
|
109
|
+
else
|
|
110
|
+
self.resource_type = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'source_url')
|
|
114
|
+
self.source_url = attributes[:'source_url']
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
if @annotations.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "annotations", annotations cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if @managed_by.nil?
|
|
128
|
+
invalid_properties.push('invalid value for "managed_by", managed_by cannot be nil.')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if @resource_id.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "resource_id", resource_id cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @resource_type.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
invalid_properties
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Check to see if the all the properties in the model are valid
|
|
143
|
+
# @return true if the model is valid
|
|
144
|
+
def valid?
|
|
145
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
146
|
+
return false if @annotations.nil?
|
|
147
|
+
return false if @managed_by.nil?
|
|
148
|
+
return false if @resource_id.nil?
|
|
149
|
+
return false if @resource_type.nil?
|
|
150
|
+
true
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Custom attribute writer method with validation
|
|
154
|
+
# @param [Object] annotations Value to be assigned
|
|
155
|
+
def annotations=(annotations)
|
|
156
|
+
if annotations.nil?
|
|
157
|
+
fail ArgumentError, 'annotations cannot be nil'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
@annotations = annotations
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Custom attribute writer method with validation
|
|
164
|
+
# @param [Object] managed_by Value to be assigned
|
|
165
|
+
def managed_by=(managed_by)
|
|
166
|
+
if managed_by.nil?
|
|
167
|
+
fail ArgumentError, 'managed_by cannot be nil'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
@managed_by = managed_by
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] resource_id Value to be assigned
|
|
175
|
+
def resource_id=(resource_id)
|
|
176
|
+
if resource_id.nil?
|
|
177
|
+
fail ArgumentError, 'resource_id cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@resource_id = resource_id
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Custom attribute writer method with validation
|
|
184
|
+
# @param [Object] resource_type Value to be assigned
|
|
185
|
+
def resource_type=(resource_type)
|
|
186
|
+
if resource_type.nil?
|
|
187
|
+
fail ArgumentError, 'resource_type cannot be nil'
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
@resource_type = resource_type
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Checks equality by comparing each attribute.
|
|
194
|
+
# @param [Object] Object to be compared
|
|
195
|
+
def ==(o)
|
|
196
|
+
return true if self.equal?(o)
|
|
197
|
+
self.class == o.class &&
|
|
198
|
+
annotations == o.annotations &&
|
|
199
|
+
managed_by == o.managed_by &&
|
|
200
|
+
resource_id == o.resource_id &&
|
|
201
|
+
resource_type == o.resource_type &&
|
|
202
|
+
source_url == o.source_url
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# @see the `==` method
|
|
206
|
+
# @param [Object] Object to be compared
|
|
207
|
+
def eql?(o)
|
|
208
|
+
self == o
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Calculates hash code according to all attributes.
|
|
212
|
+
# @return [Integer] Hash code
|
|
213
|
+
def hash
|
|
214
|
+
[annotations, managed_by, resource_id, resource_type, source_url].hash
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Builds the object from hash
|
|
218
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
219
|
+
# @return [Object] Returns the model itself
|
|
220
|
+
def self.build_from_hash(attributes)
|
|
221
|
+
return nil unless attributes.is_a?(Hash)
|
|
222
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
223
|
+
transformed_hash = {}
|
|
224
|
+
openapi_types.each_pair do |key, type|
|
|
225
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
226
|
+
transformed_hash["#{key}"] = nil
|
|
227
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
228
|
+
# check to ensure the input is an array given that the attribute
|
|
229
|
+
# is documented as an array but the input is not
|
|
230
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
231
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
232
|
+
end
|
|
233
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
234
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
new(transformed_hash)
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Returns the object in the form of hash
|
|
241
|
+
# @return [Hash] Returns the object in the form of hash
|
|
242
|
+
def to_hash
|
|
243
|
+
hash = {}
|
|
244
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
245
|
+
value = self.send(attr)
|
|
246
|
+
if value.nil?
|
|
247
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
248
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
hash[param] = _to_hash(value)
|
|
252
|
+
end
|
|
253
|
+
hash
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
@@ -0,0 +1,221 @@
|
|
|
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 ManagedResourcesCreateManagedResourcePayloadV2 < ApiModelBase
|
|
18
|
+
# Annotations that track metadata about this resource
|
|
19
|
+
attr_accessor :annotations
|
|
20
|
+
|
|
21
|
+
# The ID of the resource that this relates to
|
|
22
|
+
attr_accessor :resource_id
|
|
23
|
+
|
|
24
|
+
# The type of the related resource Known values: `alert_route`, `alert_source`, `api_key`, `incident_form`, `incident_template`, `escalation_path`, `escalation_path_template`, `policy`, `schedule`, `schedule_sync_target`, `schedule_sync_rule`, `secret`, `status_page_component`, `status_page_structure`, `team_grouping_preference`, `workflow`
|
|
25
|
+
attr_accessor :resource_type
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'annotations' => :'annotations',
|
|
31
|
+
:'resource_id' => :'resource_id',
|
|
32
|
+
:'resource_type' => :'resource_type'
|
|
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
|
+
:'annotations' => :'Hash<String, String>',
|
|
50
|
+
:'resource_id' => :'String',
|
|
51
|
+
:'resource_type' => :'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::ManagedResourcesCreateManagedResourcePayloadV2` 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::ManagedResourcesCreateManagedResourcePayloadV2`. 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?(:'annotations')
|
|
78
|
+
if (value = attributes[:'annotations']).is_a?(Hash)
|
|
79
|
+
self.annotations = value
|
|
80
|
+
end
|
|
81
|
+
else
|
|
82
|
+
self.annotations = nil
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'resource_id')
|
|
86
|
+
self.resource_id = attributes[:'resource_id']
|
|
87
|
+
else
|
|
88
|
+
self.resource_id = nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'resource_type')
|
|
92
|
+
self.resource_type = attributes[:'resource_type']
|
|
93
|
+
else
|
|
94
|
+
self.resource_type = nil
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
99
|
+
# @return Array for valid properties with the reasons
|
|
100
|
+
def list_invalid_properties
|
|
101
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
102
|
+
invalid_properties = Array.new
|
|
103
|
+
if @annotations.nil?
|
|
104
|
+
invalid_properties.push('invalid value for "annotations", annotations cannot be nil.')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if @resource_id.nil?
|
|
108
|
+
invalid_properties.push('invalid value for "resource_id", resource_id cannot be nil.')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if @resource_type.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.')
|
|
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 @annotations.nil?
|
|
123
|
+
return false if @resource_id.nil?
|
|
124
|
+
return false if @resource_type.nil?
|
|
125
|
+
true
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Custom attribute writer method with validation
|
|
129
|
+
# @param [Object] annotations Value to be assigned
|
|
130
|
+
def annotations=(annotations)
|
|
131
|
+
if annotations.nil?
|
|
132
|
+
fail ArgumentError, 'annotations cannot be nil'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
@annotations = annotations
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Custom attribute writer method with validation
|
|
139
|
+
# @param [Object] resource_id Value to be assigned
|
|
140
|
+
def resource_id=(resource_id)
|
|
141
|
+
if resource_id.nil?
|
|
142
|
+
fail ArgumentError, 'resource_id cannot be nil'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
@resource_id = resource_id
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Custom attribute writer method with validation
|
|
149
|
+
# @param [Object] resource_type Value to be assigned
|
|
150
|
+
def resource_type=(resource_type)
|
|
151
|
+
if resource_type.nil?
|
|
152
|
+
fail ArgumentError, 'resource_type cannot be nil'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
@resource_type = resource_type
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Checks equality by comparing each attribute.
|
|
159
|
+
# @param [Object] Object to be compared
|
|
160
|
+
def ==(o)
|
|
161
|
+
return true if self.equal?(o)
|
|
162
|
+
self.class == o.class &&
|
|
163
|
+
annotations == o.annotations &&
|
|
164
|
+
resource_id == o.resource_id &&
|
|
165
|
+
resource_type == o.resource_type
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# @see the `==` method
|
|
169
|
+
# @param [Object] Object to be compared
|
|
170
|
+
def eql?(o)
|
|
171
|
+
self == o
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Calculates hash code according to all attributes.
|
|
175
|
+
# @return [Integer] Hash code
|
|
176
|
+
def hash
|
|
177
|
+
[annotations, resource_id, resource_type].hash
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Builds the object from hash
|
|
181
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
182
|
+
# @return [Object] Returns the model itself
|
|
183
|
+
def self.build_from_hash(attributes)
|
|
184
|
+
return nil unless attributes.is_a?(Hash)
|
|
185
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
186
|
+
transformed_hash = {}
|
|
187
|
+
openapi_types.each_pair do |key, type|
|
|
188
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
189
|
+
transformed_hash["#{key}"] = nil
|
|
190
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
191
|
+
# check to ensure the input is an array given that the attribute
|
|
192
|
+
# is documented as an array but the input is not
|
|
193
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
194
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
195
|
+
end
|
|
196
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
197
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
new(transformed_hash)
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Returns the object in the form of hash
|
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
|
205
|
+
def to_hash
|
|
206
|
+
hash = {}
|
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
208
|
+
value = self.send(attr)
|
|
209
|
+
if value.nil?
|
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
hash[param] = _to_hash(value)
|
|
215
|
+
end
|
|
216
|
+
hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
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 ManagedResourcesCreateManagedResourceResultV2 < ApiModelBase
|
|
18
|
+
attr_accessor :managed_resource
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'managed_resource' => :'managed_resource'
|
|
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
|
+
:'managed_resource' => :'ManagedResourceV2'
|
|
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::ManagedResourcesCreateManagedResourceResultV2` 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::ManagedResourcesCreateManagedResourceResultV2`. 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?(:'managed_resource')
|
|
67
|
+
self.managed_resource = attributes[:'managed_resource']
|
|
68
|
+
else
|
|
69
|
+
self.managed_resource = 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 @managed_resource.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "managed_resource", managed_resource 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 @managed_resource.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] managed_resource Value to be assigned
|
|
95
|
+
def managed_resource=(managed_resource)
|
|
96
|
+
if managed_resource.nil?
|
|
97
|
+
fail ArgumentError, 'managed_resource cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@managed_resource = managed_resource
|
|
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
|
+
managed_resource == o.managed_resource
|
|
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
|
+
[managed_resource].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
|
data/lib/incident_io/version.rb
CHANGED
data/lib/incident_io.rb
CHANGED
|
@@ -915,6 +915,9 @@ IncidentIo.autoload :MaintenanceWindowsListResultV1, 'incident_io/models/mainten
|
|
|
915
915
|
IncidentIo.autoload :MaintenanceWindowsShowResultV1, 'incident_io/models/maintenance_windows_show_result_v1'
|
|
916
916
|
IncidentIo.autoload :MaintenanceWindowsUpdatePayloadV1, 'incident_io/models/maintenance_windows_update_payload_v1'
|
|
917
917
|
IncidentIo.autoload :MaintenanceWindowsUpdateResultV1, 'incident_io/models/maintenance_windows_update_result_v1'
|
|
918
|
+
IncidentIo.autoload :ManagedResourceV2, 'incident_io/models/managed_resource_v2'
|
|
919
|
+
IncidentIo.autoload :ManagedResourcesCreateManagedResourcePayloadV2, 'incident_io/models/managed_resources_create_managed_resource_payload_v2'
|
|
920
|
+
IncidentIo.autoload :ManagedResourcesCreateManagedResourceResultV2, 'incident_io/models/managed_resources_create_managed_resource_result_v2'
|
|
918
921
|
IncidentIo.autoload :ManagementMetaV2, 'incident_io/models/management_meta_v2'
|
|
919
922
|
IncidentIo.autoload :NewSlackUserGroupPayloadV2, 'incident_io/models/new_slack_user_group_payload_v2'
|
|
920
923
|
IncidentIo.autoload :OnCallNotificationMethodPhoneDetailsPublicV2, 'incident_io/models/on_call_notification_method_phone_details_public_v2'
|
|
@@ -1285,6 +1288,7 @@ IncidentIo.autoload :IncidentUpdatesV2Api, 'incident_io/api/incident_updates_v2_
|
|
|
1285
1288
|
IncidentIo.autoload :IncidentsV1Api, 'incident_io/api/incidents_v1_api'
|
|
1286
1289
|
IncidentIo.autoload :IncidentsV2Api, 'incident_io/api/incidents_v2_api'
|
|
1287
1290
|
IncidentIo.autoload :MaintenanceWindowsV1Api, 'incident_io/api/maintenance_windows_v1_api'
|
|
1291
|
+
IncidentIo.autoload :ManagedResourcesV2Api, 'incident_io/api/managed_resources_v2_api'
|
|
1288
1292
|
IncidentIo.autoload :OnCallNotificationPausesV2Api, 'incident_io/api/on_call_notification_pauses_v2_api'
|
|
1289
1293
|
IncidentIo.autoload :PayConfigsV2Api, 'incident_io/api/pay_configs_v2_api'
|
|
1290
1294
|
IncidentIo.autoload :PayReportsV2Api, 'incident_io/api/pay_reports_v2_api'
|
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.
|
|
4
|
+
version: 2.21.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-
|
|
11
|
+
date: 2026-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -121,6 +121,7 @@ files:
|
|
|
121
121
|
- lib/incident_io/api/incidents_v2_api.rb
|
|
122
122
|
- lib/incident_io/api/ip_allowlists_v1_api.rb
|
|
123
123
|
- lib/incident_io/api/maintenance_windows_v1_api.rb
|
|
124
|
+
- lib/incident_io/api/managed_resources_v2_api.rb
|
|
124
125
|
- lib/incident_io/api/on_call_notification_pauses_v2_api.rb
|
|
125
126
|
- lib/incident_io/api/pay_configs_v2_api.rb
|
|
126
127
|
- lib/incident_io/api/pay_reports_v2_api.rb
|
|
@@ -1040,6 +1041,9 @@ files:
|
|
|
1040
1041
|
- lib/incident_io/models/maintenance_windows_show_result_v1.rb
|
|
1041
1042
|
- lib/incident_io/models/maintenance_windows_update_payload_v1.rb
|
|
1042
1043
|
- lib/incident_io/models/maintenance_windows_update_result_v1.rb
|
|
1044
|
+
- lib/incident_io/models/managed_resource_v2.rb
|
|
1045
|
+
- lib/incident_io/models/managed_resources_create_managed_resource_payload_v2.rb
|
|
1046
|
+
- lib/incident_io/models/managed_resources_create_managed_resource_result_v2.rb
|
|
1043
1047
|
- lib/incident_io/models/management_meta_v2.rb
|
|
1044
1048
|
- lib/incident_io/models/new_slack_user_group_payload_v2.rb
|
|
1045
1049
|
- lib/incident_io/models/on_call_notification_method_phone_details_public_v2.rb
|