ory-keto-client 0.5.3.alpha1 → 0.6.0.alpha1

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