incident_io_api 2.0.0 → 2.2.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/incident_team_memberships_v1_api.rb +158 -0
- data/lib/incident_io/models/incident_team_membership_v1.rb +272 -0
- data/lib/incident_io/models/incident_team_memberships_create_payload_v1.rb +190 -0
- data/lib/incident_io/models/incident_team_memberships_create_result_v1.rb +164 -0
- data/lib/incident_io/models/incident_team_memberships_revoke_payload_v1.rb +191 -0
- data/lib/incident_io/models/incident_team_v1.rb +192 -0
- data/lib/incident_io/models/policy_finding_shift_conflict_shift_v2.rb +239 -0
- data/lib/incident_io/models/policy_finding_shift_conflict_v2.rb +249 -0
- data/lib/incident_io/models/policy_finding_v2.rb +10 -1
- data/lib/incident_io/version.rb +1 -1
- data/lib/incident_io.rb +8 -0
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbcc5e4de61ae28dc7d613447ba0929af006fb965b13894890dc453290613a0a
|
|
4
|
+
data.tar.gz: bd3b7cc7abe1768fb4ca20d72da9e3696f0e905238f8d68cce7ed183c644b5b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5413e03b0843bb2d24ed4d5e02550575fb97effdb9cef8cb85a75884973dcba09d9cc626beeb5d79bce04314a7c12cadf51f5c49e0d419a8b9025789b4a509d
|
|
7
|
+
data.tar.gz: a222edd8171c69d6fede2f22151b4b54d9f3d6ad117ab2dfbe8a193a280afc4b8a7a34acaab29de08ebf7dc5c12a56dd4f2f62a0ffae11b6a13f1baca4bcb0f5
|
|
@@ -0,0 +1,158 @@
|
|
|
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 IncidentTeamMembershipsV1Api
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create Incident Team Memberships V1
|
|
23
|
+
# Grants a team access to a private incident
|
|
24
|
+
# @param incident_team_memberships_create_payload_v1 [IncidentTeamMembershipsCreatePayloadV1]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [IncidentTeamMembershipsCreateResultV1]
|
|
27
|
+
def incident_team_memberships_v1_create(incident_team_memberships_create_payload_v1, opts = {})
|
|
28
|
+
data, _status_code, _headers = incident_team_memberships_v1_create_with_http_info(incident_team_memberships_create_payload_v1, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create Incident Team Memberships V1
|
|
33
|
+
# Grants a team access to a private incident
|
|
34
|
+
# @param incident_team_memberships_create_payload_v1 [IncidentTeamMembershipsCreatePayloadV1]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(IncidentTeamMembershipsCreateResultV1, Integer, Hash)>] IncidentTeamMembershipsCreateResultV1 data, response status code and response headers
|
|
37
|
+
def incident_team_memberships_v1_create_with_http_info(incident_team_memberships_create_payload_v1, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: IncidentTeamMembershipsV1Api.incident_team_memberships_v1_create ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'incident_team_memberships_create_payload_v1' is set
|
|
42
|
+
if @api_client.config.client_side_validation && incident_team_memberships_create_payload_v1.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'incident_team_memberships_create_payload_v1' when calling IncidentTeamMembershipsV1Api.incident_team_memberships_v1_create"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/incident_team_memberships'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(incident_team_memberships_create_payload_v1)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'IncidentTeamMembershipsCreateResultV1'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"IncidentTeamMembershipsV1Api.incident_team_memberships_v1_create",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: IncidentTeamMembershipsV1Api#incident_team_memberships_v1_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Revoke Incident Team Memberships V1
|
|
91
|
+
# Revoke a team's access to a private incident. Members who only had access through this team lose it too; directly-added members and members still covered by another team keep theirs.
|
|
92
|
+
# @param incident_team_memberships_revoke_payload_v1 [IncidentTeamMembershipsRevokePayloadV1]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [nil]
|
|
95
|
+
def incident_team_memberships_v1_revoke(incident_team_memberships_revoke_payload_v1, opts = {})
|
|
96
|
+
incident_team_memberships_v1_revoke_with_http_info(incident_team_memberships_revoke_payload_v1, opts)
|
|
97
|
+
nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Revoke Incident Team Memberships V1
|
|
101
|
+
# Revoke a team's access to a private incident. Members who only had access through this team lose it too; directly-added members and members still covered by another team keep theirs.
|
|
102
|
+
# @param incident_team_memberships_revoke_payload_v1 [IncidentTeamMembershipsRevokePayloadV1]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
105
|
+
def incident_team_memberships_v1_revoke_with_http_info(incident_team_memberships_revoke_payload_v1, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: IncidentTeamMembershipsV1Api.incident_team_memberships_v1_revoke ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'incident_team_memberships_revoke_payload_v1' is set
|
|
110
|
+
if @api_client.config.client_side_validation && incident_team_memberships_revoke_payload_v1.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'incident_team_memberships_revoke_payload_v1' when calling IncidentTeamMembershipsV1Api.incident_team_memberships_v1_revoke"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/incident_team_memberships/actions/revoke'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(incident_team_memberships_revoke_payload_v1)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type]
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"IncidentTeamMembershipsV1Api.incident_team_memberships_v1_revoke",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: IncidentTeamMembershipsV1Api#incident_team_memberships_v1_revoke\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
@@ -0,0 +1,272 @@
|
|
|
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 IncidentTeamMembershipV1 < ApiModelBase
|
|
18
|
+
# When the team membership was created
|
|
19
|
+
attr_accessor :created_at
|
|
20
|
+
|
|
21
|
+
# Unique identifier of this incident team membership
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
# Unique identifier of the incident
|
|
25
|
+
attr_accessor :incident_id
|
|
26
|
+
|
|
27
|
+
attr_accessor :team
|
|
28
|
+
|
|
29
|
+
# When the team membership was last updated
|
|
30
|
+
attr_accessor :updated_at
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'created_at' => :'created_at',
|
|
36
|
+
:'id' => :'id',
|
|
37
|
+
:'incident_id' => :'incident_id',
|
|
38
|
+
:'team' => :'team',
|
|
39
|
+
:'updated_at' => :'updated_at'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'created_at' => :'Time',
|
|
57
|
+
:'id' => :'String',
|
|
58
|
+
:'incident_id' => :'String',
|
|
59
|
+
:'team' => :'IncidentTeamV1',
|
|
60
|
+
:'updated_at' => :'Time'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# List of attributes with nullable: true
|
|
65
|
+
def self.openapi_nullable
|
|
66
|
+
Set.new([
|
|
67
|
+
])
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Initializes the object
|
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
72
|
+
def initialize(attributes = {})
|
|
73
|
+
if (!attributes.is_a?(Hash))
|
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentTeamMembershipV1` initialize method"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
78
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentTeamMembershipV1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'created_at')
|
|
87
|
+
self.created_at = attributes[:'created_at']
|
|
88
|
+
else
|
|
89
|
+
self.created_at = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'id')
|
|
93
|
+
self.id = attributes[:'id']
|
|
94
|
+
else
|
|
95
|
+
self.id = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'incident_id')
|
|
99
|
+
self.incident_id = attributes[:'incident_id']
|
|
100
|
+
else
|
|
101
|
+
self.incident_id = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'team')
|
|
105
|
+
self.team = attributes[:'team']
|
|
106
|
+
else
|
|
107
|
+
self.team = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'updated_at')
|
|
111
|
+
self.updated_at = attributes[:'updated_at']
|
|
112
|
+
else
|
|
113
|
+
self.updated_at = nil
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
118
|
+
# @return Array for valid properties with the reasons
|
|
119
|
+
def list_invalid_properties
|
|
120
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
121
|
+
invalid_properties = Array.new
|
|
122
|
+
if @created_at.nil?
|
|
123
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if @id.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if @incident_id.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "incident_id", incident_id cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if @team.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "team", team cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @updated_at.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
invalid_properties
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Check to see if the all the properties in the model are valid
|
|
146
|
+
# @return true if the model is valid
|
|
147
|
+
def valid?
|
|
148
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
149
|
+
return false if @created_at.nil?
|
|
150
|
+
return false if @id.nil?
|
|
151
|
+
return false if @incident_id.nil?
|
|
152
|
+
return false if @team.nil?
|
|
153
|
+
return false if @updated_at.nil?
|
|
154
|
+
true
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] created_at Value to be assigned
|
|
159
|
+
def created_at=(created_at)
|
|
160
|
+
if created_at.nil?
|
|
161
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@created_at = created_at
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Custom attribute writer method with validation
|
|
168
|
+
# @param [Object] id Value to be assigned
|
|
169
|
+
def id=(id)
|
|
170
|
+
if id.nil?
|
|
171
|
+
fail ArgumentError, 'id cannot be nil'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
@id = id
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Custom attribute writer method with validation
|
|
178
|
+
# @param [Object] incident_id Value to be assigned
|
|
179
|
+
def incident_id=(incident_id)
|
|
180
|
+
if incident_id.nil?
|
|
181
|
+
fail ArgumentError, 'incident_id cannot be nil'
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
@incident_id = incident_id
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] team Value to be assigned
|
|
189
|
+
def team=(team)
|
|
190
|
+
if team.nil?
|
|
191
|
+
fail ArgumentError, 'team cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@team = team
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] updated_at Value to be assigned
|
|
199
|
+
def updated_at=(updated_at)
|
|
200
|
+
if updated_at.nil?
|
|
201
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@updated_at = updated_at
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Checks equality by comparing each attribute.
|
|
208
|
+
# @param [Object] Object to be compared
|
|
209
|
+
def ==(o)
|
|
210
|
+
return true if self.equal?(o)
|
|
211
|
+
self.class == o.class &&
|
|
212
|
+
created_at == o.created_at &&
|
|
213
|
+
id == o.id &&
|
|
214
|
+
incident_id == o.incident_id &&
|
|
215
|
+
team == o.team &&
|
|
216
|
+
updated_at == o.updated_at
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# @see the `==` method
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def eql?(o)
|
|
222
|
+
self == o
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Calculates hash code according to all attributes.
|
|
226
|
+
# @return [Integer] Hash code
|
|
227
|
+
def hash
|
|
228
|
+
[created_at, id, incident_id, team, updated_at].hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Builds the object from hash
|
|
232
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
233
|
+
# @return [Object] Returns the model itself
|
|
234
|
+
def self.build_from_hash(attributes)
|
|
235
|
+
return nil unless attributes.is_a?(Hash)
|
|
236
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
237
|
+
transformed_hash = {}
|
|
238
|
+
openapi_types.each_pair do |key, type|
|
|
239
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
240
|
+
transformed_hash["#{key}"] = nil
|
|
241
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
242
|
+
# check to ensure the input is an array given that the attribute
|
|
243
|
+
# is documented as an array but the input is not
|
|
244
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
245
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
246
|
+
end
|
|
247
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
248
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
new(transformed_hash)
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Returns the object in the form of hash
|
|
255
|
+
# @return [Hash] Returns the object in the form of hash
|
|
256
|
+
def to_hash
|
|
257
|
+
hash = {}
|
|
258
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
259
|
+
value = self.send(attr)
|
|
260
|
+
if value.nil?
|
|
261
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
262
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
hash[param] = _to_hash(value)
|
|
266
|
+
end
|
|
267
|
+
hash
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
end
|
|
@@ -0,0 +1,190 @@
|
|
|
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 IncidentTeamMembershipsCreatePayloadV1 < ApiModelBase
|
|
18
|
+
attr_accessor :incident_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :team_id
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'incident_id' => :'incident_id',
|
|
26
|
+
:'team_id' => :'team_id'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'incident_id' => :'String',
|
|
44
|
+
:'team_id' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::IncidentTeamMembershipsCreatePayloadV1` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::IncidentTeamMembershipsCreatePayloadV1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'incident_id')
|
|
71
|
+
self.incident_id = attributes[:'incident_id']
|
|
72
|
+
else
|
|
73
|
+
self.incident_id = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'team_id')
|
|
77
|
+
self.team_id = attributes[:'team_id']
|
|
78
|
+
else
|
|
79
|
+
self.team_id = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @incident_id.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "incident_id", incident_id cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @team_id.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "team_id", team_id cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @incident_id.nil?
|
|
104
|
+
return false if @team_id.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] incident_id Value to be assigned
|
|
110
|
+
def incident_id=(incident_id)
|
|
111
|
+
if incident_id.nil?
|
|
112
|
+
fail ArgumentError, 'incident_id cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@incident_id = incident_id
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] team_id Value to be assigned
|
|
120
|
+
def team_id=(team_id)
|
|
121
|
+
if team_id.nil?
|
|
122
|
+
fail ArgumentError, 'team_id cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@team_id = team_id
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
incident_id == o.incident_id &&
|
|
134
|
+
team_id == o.team_id
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[incident_id, team_id].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|