incident_io_api 2.20.0 → 2.22.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/incidents_v2_api.rb +74 -0
- data/lib/incident_io/api/managed_resources_v2_api.rb +90 -0
- data/lib/incident_io/models/incidents_connect_external_issue_payload_v2.rb +231 -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 +5 -0
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c17f2227b4d29663755fb7e211d871e0b7641a5ec4747c2f679db8fbf83f9a0
|
|
4
|
+
data.tar.gz: 1a91bb901241bcc337d0f7c0896de115171c9feb7a7648b8017062d9c9d6e6d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f78bc27dd6a66d618902d2e38dcb2bc1008b17394f7da78106898076984abb6f84e5c0e1ed7ca6d31f2675ac53ba6b66fe8f40b7829c988c87f517910604091
|
|
7
|
+
data.tar.gz: 30fdd4e5135712f5e52c50bbff7454b24f5b51f4cf8ba00f92520ad565764f74a953c8fb1e8e3a9d1c820d4d52478dcd32f10f071243ca62a7ac01671f25e46d
|
|
@@ -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 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 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,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,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
|
|
@@ -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
|
@@ -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'
|
|
@@ -915,6 +916,9 @@ IncidentIo.autoload :MaintenanceWindowsListResultV1, 'incident_io/models/mainten
|
|
|
915
916
|
IncidentIo.autoload :MaintenanceWindowsShowResultV1, 'incident_io/models/maintenance_windows_show_result_v1'
|
|
916
917
|
IncidentIo.autoload :MaintenanceWindowsUpdatePayloadV1, 'incident_io/models/maintenance_windows_update_payload_v1'
|
|
917
918
|
IncidentIo.autoload :MaintenanceWindowsUpdateResultV1, 'incident_io/models/maintenance_windows_update_result_v1'
|
|
919
|
+
IncidentIo.autoload :ManagedResourceV2, 'incident_io/models/managed_resource_v2'
|
|
920
|
+
IncidentIo.autoload :ManagedResourcesCreateManagedResourcePayloadV2, 'incident_io/models/managed_resources_create_managed_resource_payload_v2'
|
|
921
|
+
IncidentIo.autoload :ManagedResourcesCreateManagedResourceResultV2, 'incident_io/models/managed_resources_create_managed_resource_result_v2'
|
|
918
922
|
IncidentIo.autoload :ManagementMetaV2, 'incident_io/models/management_meta_v2'
|
|
919
923
|
IncidentIo.autoload :NewSlackUserGroupPayloadV2, 'incident_io/models/new_slack_user_group_payload_v2'
|
|
920
924
|
IncidentIo.autoload :OnCallNotificationMethodPhoneDetailsPublicV2, 'incident_io/models/on_call_notification_method_phone_details_public_v2'
|
|
@@ -1285,6 +1289,7 @@ IncidentIo.autoload :IncidentUpdatesV2Api, 'incident_io/api/incident_updates_v2_
|
|
|
1285
1289
|
IncidentIo.autoload :IncidentsV1Api, 'incident_io/api/incidents_v1_api'
|
|
1286
1290
|
IncidentIo.autoload :IncidentsV2Api, 'incident_io/api/incidents_v2_api'
|
|
1287
1291
|
IncidentIo.autoload :MaintenanceWindowsV1Api, 'incident_io/api/maintenance_windows_v1_api'
|
|
1292
|
+
IncidentIo.autoload :ManagedResourcesV2Api, 'incident_io/api/managed_resources_v2_api'
|
|
1288
1293
|
IncidentIo.autoload :OnCallNotificationPausesV2Api, 'incident_io/api/on_call_notification_pauses_v2_api'
|
|
1289
1294
|
IncidentIo.autoload :PayConfigsV2Api, 'incident_io/api/pay_configs_v2_api'
|
|
1290
1295
|
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.22.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-23 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
|
|
@@ -1010,6 +1011,7 @@ files:
|
|
|
1010
1011
|
- lib/incident_io/models/incident_v1.rb
|
|
1011
1012
|
- lib/incident_io/models/incident_v2.rb
|
|
1012
1013
|
- lib/incident_io/models/incident_with_status_change_v2.rb
|
|
1014
|
+
- lib/incident_io/models/incidents_connect_external_issue_payload_v2.rb
|
|
1013
1015
|
- lib/incident_io/models/incidents_create_payload_v1.rb
|
|
1014
1016
|
- lib/incident_io/models/incidents_create_payload_v2.rb
|
|
1015
1017
|
- lib/incident_io/models/incidents_create_result_v1.rb
|
|
@@ -1040,6 +1042,9 @@ files:
|
|
|
1040
1042
|
- lib/incident_io/models/maintenance_windows_show_result_v1.rb
|
|
1041
1043
|
- lib/incident_io/models/maintenance_windows_update_payload_v1.rb
|
|
1042
1044
|
- lib/incident_io/models/maintenance_windows_update_result_v1.rb
|
|
1045
|
+
- lib/incident_io/models/managed_resource_v2.rb
|
|
1046
|
+
- lib/incident_io/models/managed_resources_create_managed_resource_payload_v2.rb
|
|
1047
|
+
- lib/incident_io/models/managed_resources_create_managed_resource_result_v2.rb
|
|
1043
1048
|
- lib/incident_io/models/management_meta_v2.rb
|
|
1044
1049
|
- lib/incident_io/models/new_slack_user_group_payload_v2.rb
|
|
1045
1050
|
- lib/incident_io/models/on_call_notification_method_phone_details_public_v2.rb
|