ory-keto-client 0.5.6.alpha1 → 0.6.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +22 -31
- data/docs/AddOryAccessControlPolicyRoleMembersBody.md +8 -7
- data/docs/AuthorizationResult.md +8 -7
- data/docs/EnginesApi.md +319 -129
- data/docs/ExpandTree.md +22 -0
- data/docs/GetCheckResponse.md +18 -0
- data/docs/GetRelationTuplesResponse.md +20 -0
- data/docs/HealthApi.md +50 -15
- data/docs/HealthNotReadyStatus.md +8 -7
- data/docs/HealthStatus.md +8 -7
- data/docs/InlineResponse400.md +28 -0
- data/docs/InlineResponse500.md +18 -17
- data/docs/InternalRelationTuple.md +24 -0
- data/docs/OryAccessControlPolicy.md +20 -19
- data/docs/OryAccessControlPolicyAllowedInput.md +14 -13
- data/docs/OryAccessControlPolicyRole.md +10 -9
- data/docs/PatchDelta.md +20 -0
- data/docs/ReadApi.md +297 -0
- data/docs/Version.md +8 -7
- data/docs/VersionApi.md +26 -9
- data/docs/WriteApi.md +212 -0
- data/lib/ory-keto-client.rb +10 -9
- data/lib/ory-keto-client/api/engines_api.rb +46 -35
- data/lib/ory-keto-client/api/health_api.rb +10 -8
- data/lib/ory-keto-client/api/read_api.rb +324 -0
- data/lib/ory-keto-client/api/version_api.rb +6 -5
- data/lib/ory-keto-client/api/write_api.rb +225 -0
- data/lib/ory-keto-client/api_client.rb +50 -46
- data/lib/ory-keto-client/api_error.rb +2 -2
- data/lib/ory-keto-client/configuration.rb +34 -7
- data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_body.rb +20 -8
- data/lib/ory-keto-client/models/authorization_result.rb +20 -8
- data/lib/ory-keto-client/models/expand_tree.rb +282 -0
- data/lib/ory-keto-client/models/get_check_response.rb +225 -0
- data/lib/ory-keto-client/models/get_relation_tuples_response.rb +230 -0
- data/lib/ory-keto-client/models/health_not_ready_status.rb +20 -8
- data/lib/ory-keto-client/models/health_status.rb +20 -8
- data/lib/ory-keto-client/models/inline_response400.rb +265 -0
- data/lib/ory-keto-client/models/inline_response500.rb +20 -8
- data/lib/ory-keto-client/models/internal_relation_tuple.rb +268 -0
- data/lib/ory-keto-client/models/ory_access_control_policy.rb +20 -8
- data/lib/ory-keto-client/models/ory_access_control_policy_allowed_input.rb +20 -8
- data/lib/ory-keto-client/models/ory_access_control_policy_role.rb +20 -8
- data/lib/ory-keto-client/models/patch_delta.rb +227 -0
- data/lib/ory-keto-client/models/version.rb +20 -8
- data/lib/ory-keto-client/version.rb +3 -3
- data/ory-keto-client.gemspec +4 -5
- data/spec/api/read_api_spec.rb +94 -0
- data/spec/api/write_api_spec.rb +74 -0
- data/spec/api_client_spec.rb +4 -4
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/expand_tree_spec.rb +50 -0
- data/spec/models/get_check_response_spec.rb +34 -0
- data/spec/models/get_relation_tuples_response_spec.rb +40 -0
- data/spec/models/inline_response400_spec.rb +64 -0
- data/spec/models/internal_relation_tuple_spec.rb +52 -0
- data/spec/models/patch_delta_spec.rb +40 -0
- data/spec/spec_helper.rb +3 -3
- metadata +90 -78
@@ -0,0 +1,268 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Keto
|
3
|
+
|
4
|
+
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.6.0-alpha.1
|
7
|
+
Contact: hi@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OryHydraClient
|
17
|
+
class InternalRelationTuple
|
18
|
+
# Namespace of the Relation Tuple in: query
|
19
|
+
attr_accessor :namespace
|
20
|
+
|
21
|
+
# Object of the Relation Tuple in: query
|
22
|
+
attr_accessor :object
|
23
|
+
|
24
|
+
# Relation of the Relation Tuple in: query
|
25
|
+
attr_accessor :relation
|
26
|
+
|
27
|
+
attr_accessor :subject
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'namespace' => :'namespace',
|
33
|
+
:'object' => :'object',
|
34
|
+
:'relation' => :'relation',
|
35
|
+
:'subject' => :'subject'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns all the JSON keys this model knows about
|
40
|
+
def self.acceptable_attributes
|
41
|
+
attribute_map.values
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'namespace' => :'String',
|
48
|
+
:'object' => :'String',
|
49
|
+
:'relation' => :'String',
|
50
|
+
:'subject' => :'String'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# List of attributes with nullable: true
|
55
|
+
def self.openapi_nullable
|
56
|
+
Set.new([
|
57
|
+
])
|
58
|
+
end
|
59
|
+
|
60
|
+
# Initializes the object
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
62
|
+
def initialize(attributes = {})
|
63
|
+
if (!attributes.is_a?(Hash))
|
64
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::InternalRelationTuple` initialize method"
|
65
|
+
end
|
66
|
+
|
67
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
69
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::InternalRelationTuple`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
71
|
+
end
|
72
|
+
h[k.to_sym] = v
|
73
|
+
}
|
74
|
+
|
75
|
+
if attributes.key?(:'namespace')
|
76
|
+
self.namespace = attributes[:'namespace']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'object')
|
80
|
+
self.object = attributes[:'object']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'relation')
|
84
|
+
self.relation = attributes[:'relation']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'subject')
|
88
|
+
self.subject = attributes[:'subject']
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
93
|
+
# @return Array for valid properties with the reasons
|
94
|
+
def list_invalid_properties
|
95
|
+
invalid_properties = Array.new
|
96
|
+
if @namespace.nil?
|
97
|
+
invalid_properties.push('invalid value for "namespace", namespace cannot be nil.')
|
98
|
+
end
|
99
|
+
|
100
|
+
if @object.nil?
|
101
|
+
invalid_properties.push('invalid value for "object", object cannot be nil.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if @relation.nil?
|
105
|
+
invalid_properties.push('invalid value for "relation", relation cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @subject.nil?
|
109
|
+
invalid_properties.push('invalid value for "subject", subject cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
invalid_properties
|
113
|
+
end
|
114
|
+
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
return false if @namespace.nil?
|
119
|
+
return false if @object.nil?
|
120
|
+
return false if @relation.nil?
|
121
|
+
return false if @subject.nil?
|
122
|
+
true
|
123
|
+
end
|
124
|
+
|
125
|
+
# Checks equality by comparing each attribute.
|
126
|
+
# @param [Object] Object to be compared
|
127
|
+
def ==(o)
|
128
|
+
return true if self.equal?(o)
|
129
|
+
self.class == o.class &&
|
130
|
+
namespace == o.namespace &&
|
131
|
+
object == o.object &&
|
132
|
+
relation == o.relation &&
|
133
|
+
subject == o.subject
|
134
|
+
end
|
135
|
+
|
136
|
+
# @see the `==` method
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def eql?(o)
|
139
|
+
self == o
|
140
|
+
end
|
141
|
+
|
142
|
+
# Calculates hash code according to all attributes.
|
143
|
+
# @return [Integer] Hash code
|
144
|
+
def hash
|
145
|
+
[namespace, object, relation, subject].hash
|
146
|
+
end
|
147
|
+
|
148
|
+
# Builds the object from hash
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
+
# @return [Object] Returns the model itself
|
151
|
+
def self.build_from_hash(attributes)
|
152
|
+
new.build_from_hash(attributes)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def build_from_hash(attributes)
|
159
|
+
return nil unless attributes.is_a?(Hash)
|
160
|
+
self.class.openapi_types.each_pair do |key, type|
|
161
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
162
|
+
self.send("#{key}=", nil)
|
163
|
+
elsif type =~ /\AArray<(.*)>/i
|
164
|
+
# check to ensure the input is an array given that the attribute
|
165
|
+
# is documented as an array but the input is not
|
166
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
167
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
168
|
+
end
|
169
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
170
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
self
|
175
|
+
end
|
176
|
+
|
177
|
+
# Deserializes the data based on type
|
178
|
+
# @param string type Data type
|
179
|
+
# @param string value Value to be deserialized
|
180
|
+
# @return [Object] Deserialized data
|
181
|
+
def _deserialize(type, value)
|
182
|
+
case type.to_sym
|
183
|
+
when :Time
|
184
|
+
Time.parse(value)
|
185
|
+
when :Date
|
186
|
+
Date.parse(value)
|
187
|
+
when :String
|
188
|
+
value.to_s
|
189
|
+
when :Integer
|
190
|
+
value.to_i
|
191
|
+
when :Float
|
192
|
+
value.to_f
|
193
|
+
when :Boolean
|
194
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
195
|
+
true
|
196
|
+
else
|
197
|
+
false
|
198
|
+
end
|
199
|
+
when :Object
|
200
|
+
# generic object (usually a Hash), return directly
|
201
|
+
value
|
202
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
203
|
+
inner_type = Regexp.last_match[:inner_type]
|
204
|
+
value.map { |v| _deserialize(inner_type, v) }
|
205
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
206
|
+
k_type = Regexp.last_match[:k_type]
|
207
|
+
v_type = Regexp.last_match[:v_type]
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each do |k, v|
|
210
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
else # model
|
214
|
+
# models (e.g. Pet) or oneOf
|
215
|
+
klass = OryHydraClient.const_get(type)
|
216
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the string representation of the object
|
221
|
+
# @return [String] String presentation of the object
|
222
|
+
def to_s
|
223
|
+
to_hash.to_s
|
224
|
+
end
|
225
|
+
|
226
|
+
# to_body is an alias to to_hash (backward compatibility)
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
228
|
+
def to_body
|
229
|
+
to_hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the object in the form of hash
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_hash
|
235
|
+
hash = {}
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
237
|
+
value = self.send(attr)
|
238
|
+
if value.nil?
|
239
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
240
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
241
|
+
end
|
242
|
+
|
243
|
+
hash[param] = _to_hash(value)
|
244
|
+
end
|
245
|
+
hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Outputs non-array value in the form of hash
|
249
|
+
# For object, use to_hash. Otherwise, just return the value
|
250
|
+
# @param [Object] value Any valid value
|
251
|
+
# @return [Hash] Returns the value in the form of hash
|
252
|
+
def _to_hash(value)
|
253
|
+
if value.is_a?(Array)
|
254
|
+
value.compact.map { |v| _to_hash(v) }
|
255
|
+
elsif value.is_a?(Hash)
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
258
|
+
end
|
259
|
+
elsif value.respond_to? :to_hash
|
260
|
+
value.to_hash
|
261
|
+
else
|
262
|
+
value
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
267
|
+
|
268
|
+
end
|
@@ -3,14 +3,15 @@
|
|
3
3
|
|
4
4
|
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.58
|
7
7
|
Contact: hi@ory.sh
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module OryHydraClient
|
16
17
|
class OryAccessControlPolicy
|
@@ -48,6 +49,11 @@ module OryHydraClient
|
|
48
49
|
}
|
49
50
|
end
|
50
51
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
51
57
|
# Attribute type mapping.
|
52
58
|
def self.openapi_types
|
53
59
|
{
|
@@ -169,7 +175,9 @@ module OryHydraClient
|
|
169
175
|
def build_from_hash(attributes)
|
170
176
|
return nil unless attributes.is_a?(Hash)
|
171
177
|
self.class.openapi_types.each_pair do |key, type|
|
172
|
-
if
|
178
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
179
|
+
self.send("#{key}=", nil)
|
180
|
+
elsif type =~ /\AArray<(.*)>/i
|
173
181
|
# check to ensure the input is an array given that the attribute
|
174
182
|
# is documented as an array but the input is not
|
175
183
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -177,7 +185,7 @@ module OryHydraClient
|
|
177
185
|
end
|
178
186
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
179
187
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
180
|
-
end
|
188
|
+
end
|
181
189
|
end
|
182
190
|
|
183
191
|
self
|
@@ -189,8 +197,8 @@ module OryHydraClient
|
|
189
197
|
# @return [Object] Deserialized data
|
190
198
|
def _deserialize(type, value)
|
191
199
|
case type.to_sym
|
192
|
-
when :
|
193
|
-
|
200
|
+
when :Time
|
201
|
+
Time.parse(value)
|
194
202
|
when :Date
|
195
203
|
Date.parse(value)
|
196
204
|
when :String
|
@@ -220,7 +228,9 @@ module OryHydraClient
|
|
220
228
|
end
|
221
229
|
end
|
222
230
|
else # model
|
223
|
-
|
231
|
+
# models (e.g. Pet) or oneOf
|
232
|
+
klass = OryHydraClient.const_get(type)
|
233
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
224
234
|
end
|
225
235
|
end
|
226
236
|
|
@@ -246,7 +256,7 @@ module OryHydraClient
|
|
246
256
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
247
257
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
248
258
|
end
|
249
|
-
|
259
|
+
|
250
260
|
hash[param] = _to_hash(value)
|
251
261
|
end
|
252
262
|
hash
|
@@ -269,5 +279,7 @@ module OryHydraClient
|
|
269
279
|
value
|
270
280
|
end
|
271
281
|
end
|
282
|
+
|
272
283
|
end
|
284
|
+
|
273
285
|
end
|
@@ -3,14 +3,15 @@
|
|
3
3
|
|
4
4
|
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.58
|
7
7
|
Contact: hi@ory.sh
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module OryHydraClient
|
16
17
|
class OryAccessControlPolicyAllowedInput
|
@@ -36,6 +37,11 @@ module OryHydraClient
|
|
36
37
|
}
|
37
38
|
end
|
38
39
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
39
45
|
# Attribute type mapping.
|
40
46
|
def self.openapi_types
|
41
47
|
{
|
@@ -133,7 +139,9 @@ module OryHydraClient
|
|
133
139
|
def build_from_hash(attributes)
|
134
140
|
return nil unless attributes.is_a?(Hash)
|
135
141
|
self.class.openapi_types.each_pair do |key, type|
|
136
|
-
if
|
142
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
143
|
+
self.send("#{key}=", nil)
|
144
|
+
elsif type =~ /\AArray<(.*)>/i
|
137
145
|
# check to ensure the input is an array given that the attribute
|
138
146
|
# is documented as an array but the input is not
|
139
147
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -141,7 +149,7 @@ module OryHydraClient
|
|
141
149
|
end
|
142
150
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
143
151
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
144
|
-
end
|
152
|
+
end
|
145
153
|
end
|
146
154
|
|
147
155
|
self
|
@@ -153,8 +161,8 @@ module OryHydraClient
|
|
153
161
|
# @return [Object] Deserialized data
|
154
162
|
def _deserialize(type, value)
|
155
163
|
case type.to_sym
|
156
|
-
when :
|
157
|
-
|
164
|
+
when :Time
|
165
|
+
Time.parse(value)
|
158
166
|
when :Date
|
159
167
|
Date.parse(value)
|
160
168
|
when :String
|
@@ -184,7 +192,9 @@ module OryHydraClient
|
|
184
192
|
end
|
185
193
|
end
|
186
194
|
else # model
|
187
|
-
|
195
|
+
# models (e.g. Pet) or oneOf
|
196
|
+
klass = OryHydraClient.const_get(type)
|
197
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
198
|
end
|
189
199
|
end
|
190
200
|
|
@@ -210,7 +220,7 @@ module OryHydraClient
|
|
210
220
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
221
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
222
|
end
|
213
|
-
|
223
|
+
|
214
224
|
hash[param] = _to_hash(value)
|
215
225
|
end
|
216
226
|
hash
|
@@ -233,5 +243,7 @@ module OryHydraClient
|
|
233
243
|
value
|
234
244
|
end
|
235
245
|
end
|
246
|
+
|
236
247
|
end
|
248
|
+
|
237
249
|
end
|
@@ -3,14 +3,15 @@
|
|
3
3
|
|
4
4
|
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.58
|
7
7
|
Contact: hi@ory.sh
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module OryHydraClient
|
16
17
|
# oryAccessControlPolicyRole represents a group of users that share the same role. A role could be an administrator, a moderator, a regular user or some other sort of role.
|
@@ -29,6 +30,11 @@ module OryHydraClient
|
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
32
38
|
# Attribute type mapping.
|
33
39
|
def self.openapi_types
|
34
40
|
{
|
@@ -116,7 +122,9 @@ module OryHydraClient
|
|
116
122
|
def build_from_hash(attributes)
|
117
123
|
return nil unless attributes.is_a?(Hash)
|
118
124
|
self.class.openapi_types.each_pair do |key, type|
|
119
|
-
if
|
125
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
126
|
+
self.send("#{key}=", nil)
|
127
|
+
elsif type =~ /\AArray<(.*)>/i
|
120
128
|
# check to ensure the input is an array given that the attribute
|
121
129
|
# is documented as an array but the input is not
|
122
130
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -124,7 +132,7 @@ module OryHydraClient
|
|
124
132
|
end
|
125
133
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
134
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
127
|
-
end
|
135
|
+
end
|
128
136
|
end
|
129
137
|
|
130
138
|
self
|
@@ -136,8 +144,8 @@ module OryHydraClient
|
|
136
144
|
# @return [Object] Deserialized data
|
137
145
|
def _deserialize(type, value)
|
138
146
|
case type.to_sym
|
139
|
-
when :
|
140
|
-
|
147
|
+
when :Time
|
148
|
+
Time.parse(value)
|
141
149
|
when :Date
|
142
150
|
Date.parse(value)
|
143
151
|
when :String
|
@@ -167,7 +175,9 @@ module OryHydraClient
|
|
167
175
|
end
|
168
176
|
end
|
169
177
|
else # model
|
170
|
-
|
178
|
+
# models (e.g. Pet) or oneOf
|
179
|
+
klass = OryHydraClient.const_get(type)
|
180
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
181
|
end
|
172
182
|
end
|
173
183
|
|
@@ -193,7 +203,7 @@ module OryHydraClient
|
|
193
203
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
204
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
205
|
end
|
196
|
-
|
206
|
+
|
197
207
|
hash[param] = _to_hash(value)
|
198
208
|
end
|
199
209
|
hash
|
@@ -216,5 +226,7 @@ module OryHydraClient
|
|
216
226
|
value
|
217
227
|
end
|
218
228
|
end
|
229
|
+
|
219
230
|
end
|
231
|
+
|
220
232
|
end
|