incident_io_api 2.64.0 → 2.66.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/models/api_key_v1.rb +11 -1
- data/lib/incident_io/models/api_keys_create_payload_v1.rb +11 -1
- data/lib/incident_io/models/api_keys_rotate_payload_v1.rb +11 -1
- data/lib/incident_io/models/audit_log_api_key_expiry_metadata_v2.rb +148 -0
- data/lib/incident_io/models/audit_log_api_key_expiry_policy_updated_metadata_v2.rb +175 -0
- data/lib/incident_io/models/audit_logs_api_key_created_v3.rb +326 -0
- data/lib/incident_io/models/audit_logs_api_key_expiry_policy_updated_v1.rb +326 -0
- data/lib/incident_io/models/audit_logs_api_key_rotated_v3.rb +326 -0
- data/lib/incident_io/models/audit_logs_user_api_key_created_v3.rb +326 -0
- data/lib/incident_io/version.rb +1 -1
- data/lib/incident_io.rb +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec5e8f5f92243f7e6a29aec6f1c32c6a0027c0970e07a0d7be966cf6cf6d6e2b
|
|
4
|
+
data.tar.gz: 7b982782fbd72cc7639f4c17c5baba0523a83a3c9cd1ee85f8544fcb1a76cf93
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a410189ec05401ff1ff8337da982f54112b62389175b0d89ce7b94836841fa8bab5d148b3395f5a71aa1a63f52453cfbb81274c2f6000e76292e83c2cbc5908
|
|
7
|
+
data.tar.gz: b78ae75d761b07e6d6e4d73c202a1f47c6a65897510dea215dda4c6df74df35b599e62d6acd2795e00dd1443d2041877dec2fb247806589ec981e6ff1a2714ba
|
|
@@ -23,6 +23,9 @@ module IncidentIo
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :creator
|
|
25
25
|
|
|
26
|
+
# When this API key stops working. If it's not set, the key never expires.
|
|
27
|
+
attr_accessor :expires_at
|
|
28
|
+
|
|
26
29
|
# Unique identifier for this API key
|
|
27
30
|
attr_accessor :id
|
|
28
31
|
|
|
@@ -50,6 +53,7 @@ module IncidentIo
|
|
|
50
53
|
:'comments' => :'comments',
|
|
51
54
|
:'created_at' => :'created_at',
|
|
52
55
|
:'creator' => :'creator',
|
|
56
|
+
:'expires_at' => :'expires_at',
|
|
53
57
|
:'id' => :'id',
|
|
54
58
|
:'last_used_at' => :'last_used_at',
|
|
55
59
|
:'name' => :'name',
|
|
@@ -76,6 +80,7 @@ module IncidentIo
|
|
|
76
80
|
:'comments' => :'String',
|
|
77
81
|
:'created_at' => :'Time',
|
|
78
82
|
:'creator' => :'ActorV1',
|
|
83
|
+
:'expires_at' => :'Time',
|
|
79
84
|
:'id' => :'String',
|
|
80
85
|
:'last_used_at' => :'Time',
|
|
81
86
|
:'name' => :'String',
|
|
@@ -124,6 +129,10 @@ module IncidentIo
|
|
|
124
129
|
self.creator = nil
|
|
125
130
|
end
|
|
126
131
|
|
|
132
|
+
if attributes.key?(:'expires_at')
|
|
133
|
+
self.expires_at = attributes[:'expires_at']
|
|
134
|
+
end
|
|
135
|
+
|
|
127
136
|
if attributes.key?(:'id')
|
|
128
137
|
self.id = attributes[:'id']
|
|
129
138
|
else
|
|
@@ -344,6 +353,7 @@ module IncidentIo
|
|
|
344
353
|
comments == o.comments &&
|
|
345
354
|
created_at == o.created_at &&
|
|
346
355
|
creator == o.creator &&
|
|
356
|
+
expires_at == o.expires_at &&
|
|
347
357
|
id == o.id &&
|
|
348
358
|
last_used_at == o.last_used_at &&
|
|
349
359
|
name == o.name &&
|
|
@@ -362,7 +372,7 @@ module IncidentIo
|
|
|
362
372
|
# Calculates hash code according to all attributes.
|
|
363
373
|
# @return [Integer] Hash code
|
|
364
374
|
def hash
|
|
365
|
-
[comments, created_at, creator, id, last_used_at, name, roles, team_ids, team_roles, token_last_issued_at].hash
|
|
375
|
+
[comments, created_at, creator, expires_at, id, last_used_at, name, roles, team_ids, team_roles, token_last_issued_at].hash
|
|
366
376
|
end
|
|
367
377
|
|
|
368
378
|
# Builds the object from hash
|
|
@@ -18,6 +18,9 @@ module IncidentIo
|
|
|
18
18
|
# Freeform notes about the API key
|
|
19
19
|
attr_accessor :comments
|
|
20
20
|
|
|
21
|
+
# When the API key stops working. Leave it out for a key that never expires. It must be in the future and within your organization's maximum lifetime for API keys.
|
|
22
|
+
attr_accessor :expires_at
|
|
23
|
+
|
|
21
24
|
# Human-readable name for the new API key
|
|
22
25
|
attr_accessor :name
|
|
23
26
|
|
|
@@ -34,6 +37,7 @@ module IncidentIo
|
|
|
34
37
|
def self.attribute_map
|
|
35
38
|
{
|
|
36
39
|
:'comments' => :'comments',
|
|
40
|
+
:'expires_at' => :'expires_at',
|
|
37
41
|
:'name' => :'name',
|
|
38
42
|
:'role_names' => :'role_names',
|
|
39
43
|
:'team_ids' => :'team_ids',
|
|
@@ -55,6 +59,7 @@ module IncidentIo
|
|
|
55
59
|
def self.openapi_types
|
|
56
60
|
{
|
|
57
61
|
:'comments' => :'String',
|
|
62
|
+
:'expires_at' => :'Time',
|
|
58
63
|
:'name' => :'String',
|
|
59
64
|
:'role_names' => :'Array<String>',
|
|
60
65
|
:'team_ids' => :'Array<String>',
|
|
@@ -88,6 +93,10 @@ module IncidentIo
|
|
|
88
93
|
self.comments = attributes[:'comments']
|
|
89
94
|
end
|
|
90
95
|
|
|
96
|
+
if attributes.key?(:'expires_at')
|
|
97
|
+
self.expires_at = attributes[:'expires_at']
|
|
98
|
+
end
|
|
99
|
+
|
|
91
100
|
if attributes.key?(:'name')
|
|
92
101
|
self.name = attributes[:'name']
|
|
93
102
|
else
|
|
@@ -248,6 +257,7 @@ module IncidentIo
|
|
|
248
257
|
return true if self.equal?(o)
|
|
249
258
|
self.class == o.class &&
|
|
250
259
|
comments == o.comments &&
|
|
260
|
+
expires_at == o.expires_at &&
|
|
251
261
|
name == o.name &&
|
|
252
262
|
role_names == o.role_names &&
|
|
253
263
|
team_ids == o.team_ids &&
|
|
@@ -263,7 +273,7 @@ module IncidentIo
|
|
|
263
273
|
# Calculates hash code according to all attributes.
|
|
264
274
|
# @return [Integer] Hash code
|
|
265
275
|
def hash
|
|
266
|
-
[comments, name, role_names, team_ids, team_role_names].hash
|
|
276
|
+
[comments, expires_at, name, role_names, team_ids, team_role_names].hash
|
|
267
277
|
end
|
|
268
278
|
|
|
269
279
|
# Builds the object from hash
|
|
@@ -15,12 +15,16 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module IncidentIo
|
|
17
17
|
class APIKeysRotatePayloadV1 < ApiModelBase
|
|
18
|
+
# A new expiry for the API key. Leave it blank to keep its current expiry. It must be in the future and within your organization's maximum lifetime for API keys.
|
|
19
|
+
attr_accessor :expires_at
|
|
20
|
+
|
|
18
21
|
# How many minutes to keep the old access token alive.
|
|
19
22
|
attr_accessor :grace_period_minutes
|
|
20
23
|
|
|
21
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
25
|
def self.attribute_map
|
|
23
26
|
{
|
|
27
|
+
:'expires_at' => :'expires_at',
|
|
24
28
|
:'grace_period_minutes' => :'grace_period_minutes'
|
|
25
29
|
}
|
|
26
30
|
end
|
|
@@ -38,6 +42,7 @@ module IncidentIo
|
|
|
38
42
|
# Attribute type mapping.
|
|
39
43
|
def self.openapi_types
|
|
40
44
|
{
|
|
45
|
+
:'expires_at' => :'Time',
|
|
41
46
|
:'grace_period_minutes' => :'Integer'
|
|
42
47
|
}
|
|
43
48
|
end
|
|
@@ -64,6 +69,10 @@ module IncidentIo
|
|
|
64
69
|
h[k.to_sym] = v
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
if attributes.key?(:'expires_at')
|
|
73
|
+
self.expires_at = attributes[:'expires_at']
|
|
74
|
+
end
|
|
75
|
+
|
|
67
76
|
if attributes.key?(:'grace_period_minutes')
|
|
68
77
|
self.grace_period_minutes = attributes[:'grace_period_minutes']
|
|
69
78
|
else
|
|
@@ -124,6 +133,7 @@ module IncidentIo
|
|
|
124
133
|
def ==(o)
|
|
125
134
|
return true if self.equal?(o)
|
|
126
135
|
self.class == o.class &&
|
|
136
|
+
expires_at == o.expires_at &&
|
|
127
137
|
grace_period_minutes == o.grace_period_minutes
|
|
128
138
|
end
|
|
129
139
|
|
|
@@ -136,7 +146,7 @@ module IncidentIo
|
|
|
136
146
|
# Calculates hash code according to all attributes.
|
|
137
147
|
# @return [Integer] Hash code
|
|
138
148
|
def hash
|
|
139
|
-
[grace_period_minutes].hash
|
|
149
|
+
[expires_at, grace_period_minutes].hash
|
|
140
150
|
end
|
|
141
151
|
|
|
142
152
|
# Builds the object from hash
|
|
@@ -0,0 +1,148 @@
|
|
|
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 AuditLogAPIKeyExpiryMetadataV2 < ApiModelBase
|
|
18
|
+
# When the key stops working. Absent when the key never expires.
|
|
19
|
+
attr_accessor :expires_at
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'expires_at' => :'expires_at'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'expires_at' => :'String'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AuditLogAPIKeyExpiryMetadataV2` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AuditLogAPIKeyExpiryMetadataV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'expires_at')
|
|
68
|
+
self.expires_at = attributes[:'expires_at']
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
73
|
+
# @return Array for valid properties with the reasons
|
|
74
|
+
def list_invalid_properties
|
|
75
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
76
|
+
invalid_properties = Array.new
|
|
77
|
+
invalid_properties
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Check to see if the all the properties in the model are valid
|
|
81
|
+
# @return true if the model is valid
|
|
82
|
+
def valid?
|
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
84
|
+
true
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Checks equality by comparing each attribute.
|
|
88
|
+
# @param [Object] Object to be compared
|
|
89
|
+
def ==(o)
|
|
90
|
+
return true if self.equal?(o)
|
|
91
|
+
self.class == o.class &&
|
|
92
|
+
expires_at == o.expires_at
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# @see the `==` method
|
|
96
|
+
# @param [Object] Object to be compared
|
|
97
|
+
def eql?(o)
|
|
98
|
+
self == o
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Calculates hash code according to all attributes.
|
|
102
|
+
# @return [Integer] Hash code
|
|
103
|
+
def hash
|
|
104
|
+
[expires_at].hash
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Builds the object from hash
|
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
|
+
# @return [Object] Returns the model itself
|
|
110
|
+
def self.build_from_hash(attributes)
|
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
113
|
+
transformed_hash = {}
|
|
114
|
+
openapi_types.each_pair do |key, type|
|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
116
|
+
transformed_hash["#{key}"] = nil
|
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
118
|
+
# check to ensure the input is an array given that the attribute
|
|
119
|
+
# is documented as an array but the input is not
|
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
121
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
122
|
+
end
|
|
123
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
new(transformed_hash)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Returns the object in the form of hash
|
|
131
|
+
# @return [Hash] Returns the object in the form of hash
|
|
132
|
+
def to_hash
|
|
133
|
+
hash = {}
|
|
134
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
135
|
+
value = self.send(attr)
|
|
136
|
+
if value.nil?
|
|
137
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
138
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
hash[param] = _to_hash(value)
|
|
142
|
+
end
|
|
143
|
+
hash
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
end
|
|
@@ -0,0 +1,175 @@
|
|
|
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 AuditLogAPIKeyExpiryPolicyUpdatedMetadataV2 < ApiModelBase
|
|
18
|
+
# Whether new API keys must have an expiry after the update
|
|
19
|
+
attr_accessor :expiry_required
|
|
20
|
+
|
|
21
|
+
# The longest lifetime, in days, a new key may have after the update. Absent when there is no limit.
|
|
22
|
+
attr_accessor :max_lifetime_days
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'expiry_required' => :'expiry_required',
|
|
28
|
+
:'max_lifetime_days' => :'max_lifetime_days'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'expiry_required' => :'String',
|
|
46
|
+
:'max_lifetime_days' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AuditLogAPIKeyExpiryPolicyUpdatedMetadataV2` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AuditLogAPIKeyExpiryPolicyUpdatedMetadataV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'expiry_required')
|
|
73
|
+
self.expiry_required = attributes[:'expiry_required']
|
|
74
|
+
else
|
|
75
|
+
self.expiry_required = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'max_lifetime_days')
|
|
79
|
+
self.max_lifetime_days = attributes[:'max_lifetime_days']
|
|
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 @expiry_required.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "expiry_required", expiry_required cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
|
+
return false if @expiry_required.nil?
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Custom attribute writer method with validation
|
|
104
|
+
# @param [Object] expiry_required Value to be assigned
|
|
105
|
+
def expiry_required=(expiry_required)
|
|
106
|
+
if expiry_required.nil?
|
|
107
|
+
fail ArgumentError, 'expiry_required cannot be nil'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@expiry_required = expiry_required
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
expiry_required == o.expiry_required &&
|
|
119
|
+
max_lifetime_days == o.max_lifetime_days
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @see the `==` method
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def eql?(o)
|
|
125
|
+
self == o
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Calculates hash code according to all attributes.
|
|
129
|
+
# @return [Integer] Hash code
|
|
130
|
+
def hash
|
|
131
|
+
[expiry_required, max_lifetime_days].hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def self.build_from_hash(attributes)
|
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
140
|
+
transformed_hash = {}
|
|
141
|
+
openapi_types.each_pair do |key, type|
|
|
142
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = nil
|
|
144
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
145
|
+
# check to ensure the input is an array given that the attribute
|
|
146
|
+
# is documented as an array but the input is not
|
|
147
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
148
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
149
|
+
end
|
|
150
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
new(transformed_hash)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the object in the form of hash
|
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
|
159
|
+
def to_hash
|
|
160
|
+
hash = {}
|
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
162
|
+
value = self.send(attr)
|
|
163
|
+
if value.nil?
|
|
164
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
165
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
hash[param] = _to_hash(value)
|
|
169
|
+
end
|
|
170
|
+
hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
end
|