ory-keto-client 0.8.0.alpha1 → 0.8.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +7 -24
  4. data/docs/ExpandTree.md +3 -3
  5. data/docs/GenericError.md +6 -6
  6. data/docs/GetRelationTuplesResponse.md +1 -1
  7. data/docs/PatchDelta.md +1 -1
  8. data/lib/ory-keto-client/api/metadata_api.rb +3 -3
  9. data/lib/ory-keto-client/api/read_api.rb +3 -3
  10. data/lib/ory-keto-client/api/write_api.rb +3 -3
  11. data/lib/ory-keto-client/api_client.rb +3 -3
  12. data/lib/ory-keto-client/api_error.rb +3 -3
  13. data/lib/ory-keto-client/configuration.rb +3 -3
  14. data/lib/ory-keto-client/models/expand_tree.rb +5 -9
  15. data/lib/ory-keto-client/models/generic_error.rb +4 -10
  16. data/lib/ory-keto-client/models/get_check_response.rb +3 -3
  17. data/lib/ory-keto-client/models/get_relation_tuples_response.rb +3 -5
  18. data/lib/ory-keto-client/models/health_not_ready_status.rb +3 -3
  19. data/lib/ory-keto-client/models/health_status.rb +3 -4
  20. data/lib/ory-keto-client/models/inline_response200.rb +3 -3
  21. data/lib/ory-keto-client/models/inline_response2001.rb +3 -3
  22. data/lib/ory-keto-client/models/inline_response503.rb +3 -3
  23. data/lib/ory-keto-client/models/internal_relation_tuple.rb +3 -3
  24. data/lib/ory-keto-client/models/patch_delta.rb +5 -7
  25. data/lib/ory-keto-client/models/relation_query.rb +3 -4
  26. data/lib/ory-keto-client/models/subject_set.rb +3 -3
  27. data/lib/ory-keto-client/models/version.rb +3 -3
  28. data/lib/ory-keto-client/version.rb +4 -4
  29. data/lib/ory-keto-client.rb +3 -20
  30. data/ory-keto-client.gemspec +5 -5
  31. data/spec/api/metadata_api_spec.rb +3 -3
  32. data/spec/api/read_api_spec.rb +3 -3
  33. data/spec/api/write_api_spec.rb +3 -3
  34. data/spec/api_client_spec.rb +3 -3
  35. data/spec/configuration_spec.rb +3 -3
  36. data/spec/models/expand_tree_spec.rb +4 -4
  37. data/spec/models/generic_error_spec.rb +3 -3
  38. data/spec/models/get_check_response_spec.rb +3 -3
  39. data/spec/models/get_relation_tuples_response_spec.rb +3 -3
  40. data/spec/models/health_not_ready_status_spec.rb +3 -3
  41. data/spec/models/health_status_spec.rb +3 -3
  42. data/spec/models/inline_response2001_spec.rb +3 -3
  43. data/spec/models/inline_response200_spec.rb +3 -3
  44. data/spec/models/inline_response503_spec.rb +3 -3
  45. data/spec/models/internal_relation_tuple_spec.rb +3 -3
  46. data/spec/models/patch_delta_spec.rb +4 -4
  47. data/spec/models/relation_query_spec.rb +3 -3
  48. data/spec/models/subject_set_spec.rb +3 -3
  49. data/spec/models/version_spec.rb +3 -3
  50. data/spec/spec_helper.rb +3 -3
  51. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/byebug-11.1.3/gem_make.out +2 -2
  52. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/ffi-1.15.5/gem_make.out +2 -2
  53. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/jaro_winkler-1.5.4/gem_make.out +2 -2
  54. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/psych-4.0.3/gem_make.out +2 -2
  55. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/stringio-3.0.1/gem_make.out +2 -2
  56. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/stringio-3.0.1/mkmf.log +1 -1
  57. data/vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/ext/byebug/Makefile +2 -2
  58. data/vendor/bundle/ruby/2.5.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +2 -2
  59. data/vendor/bundle/ruby/2.5.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +2 -2
  60. data/vendor/bundle/ruby/2.5.0/gems/psych-4.0.3/ext/psych/Makefile +2 -2
  61. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.1/ext/stringio/Makefile +2 -2
  62. metadata +4 -72
  63. data/docs/CreateRelationTupleBadRequestBody.md +0 -28
  64. data/docs/CreateRelationTupleInternalServerErrorBody.md +0 -28
  65. data/docs/DeleteRelationTuplesBadRequestBody.md +0 -28
  66. data/docs/DeleteRelationTuplesInternalServerErrorBody.md +0 -28
  67. data/docs/GetCheckBadRequestBody.md +0 -28
  68. data/docs/GetCheckInternalServerErrorBody.md +0 -28
  69. data/docs/GetExpandBadRequestBody.md +0 -28
  70. data/docs/GetExpandInternalServerErrorBody.md +0 -28
  71. data/docs/GetExpandNotFoundBody.md +0 -28
  72. data/docs/GetRelationTuplesInternalServerErrorBody.md +0 -28
  73. data/docs/GetRelationTuplesNotFoundBody.md +0 -28
  74. data/docs/IsInstanceAliveInternalServerErrorBody.md +0 -28
  75. data/docs/PatchRelationTuplesBadRequestBody.md +0 -28
  76. data/docs/PatchRelationTuplesInternalServerErrorBody.md +0 -28
  77. data/docs/PatchRelationTuplesNotFoundBody.md +0 -28
  78. data/docs/PostCheckBadRequestBody.md +0 -28
  79. data/docs/PostCheckInternalServerErrorBody.md +0 -28
  80. data/lib/ory-keto-client/models/create_relation_tuple_bad_request_body.rb +0 -272
  81. data/lib/ory-keto-client/models/create_relation_tuple_internal_server_error_body.rb +0 -272
  82. data/lib/ory-keto-client/models/delete_relation_tuples_bad_request_body.rb +0 -272
  83. data/lib/ory-keto-client/models/delete_relation_tuples_internal_server_error_body.rb +0 -272
  84. data/lib/ory-keto-client/models/get_check_bad_request_body.rb +0 -272
  85. data/lib/ory-keto-client/models/get_check_internal_server_error_body.rb +0 -272
  86. data/lib/ory-keto-client/models/get_expand_bad_request_body.rb +0 -272
  87. data/lib/ory-keto-client/models/get_expand_internal_server_error_body.rb +0 -272
  88. data/lib/ory-keto-client/models/get_expand_not_found_body.rb +0 -272
  89. data/lib/ory-keto-client/models/get_relation_tuples_internal_server_error_body.rb +0 -272
  90. data/lib/ory-keto-client/models/get_relation_tuples_not_found_body.rb +0 -272
  91. data/lib/ory-keto-client/models/is_instance_alive_internal_server_error_body.rb +0 -272
  92. data/lib/ory-keto-client/models/patch_relation_tuples_bad_request_body.rb +0 -272
  93. data/lib/ory-keto-client/models/patch_relation_tuples_internal_server_error_body.rb +0 -272
  94. data/lib/ory-keto-client/models/patch_relation_tuples_not_found_body.rb +0 -272
  95. data/lib/ory-keto-client/models/post_check_bad_request_body.rb +0 -272
  96. data/lib/ory-keto-client/models/post_check_internal_server_error_body.rb +0 -272
  97. data/spec/models/create_relation_tuple_bad_request_body_spec.rb +0 -64
  98. data/spec/models/create_relation_tuple_internal_server_error_body_spec.rb +0 -64
  99. data/spec/models/delete_relation_tuples_bad_request_body_spec.rb +0 -64
  100. data/spec/models/delete_relation_tuples_internal_server_error_body_spec.rb +0 -64
  101. data/spec/models/get_check_bad_request_body_spec.rb +0 -64
  102. data/spec/models/get_check_internal_server_error_body_spec.rb +0 -64
  103. data/spec/models/get_expand_bad_request_body_spec.rb +0 -64
  104. data/spec/models/get_expand_internal_server_error_body_spec.rb +0 -64
  105. data/spec/models/get_expand_not_found_body_spec.rb +0 -64
  106. data/spec/models/get_relation_tuples_internal_server_error_body_spec.rb +0 -64
  107. data/spec/models/get_relation_tuples_not_found_body_spec.rb +0 -64
  108. data/spec/models/is_instance_alive_internal_server_error_body_spec.rb +0 -64
  109. data/spec/models/patch_relation_tuples_bad_request_body_spec.rb +0 -64
  110. data/spec/models/patch_relation_tuples_internal_server_error_body_spec.rb +0 -64
  111. data/spec/models/patch_relation_tuples_not_found_body_spec.rb +0 -64
  112. data/spec/models/post_check_bad_request_body_spec.rb +0 -64
  113. data/spec/models/post_check_internal_server_error_body_spec.rb +0 -64
@@ -1,272 +0,0 @@
1
- =begin
2
- #Ory Oathkeeper API
3
-
4
- #Documentation for all of Ory Oathkeeper's APIs.
5
-
6
- The version of the OpenAPI document: v0.8.0-alpha.1
7
- Contact: hi@ory.sh
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OryKetoClient
17
- # PatchRelationTuplesBadRequestBody PatchRelationTuplesBadRequestBody PatchRelationTuplesBadRequestBody PatchRelationTuplesBadRequestBody PatchRelationTuplesBadRequestBody PatchRelationTuplesBadRequestBody patch relation tuples bad request body
18
- class PatchRelationTuplesBadRequestBody
19
- # code
20
- attr_accessor :code
21
-
22
- # details
23
- attr_accessor :details
24
-
25
- # message
26
- attr_accessor :message
27
-
28
- # reason
29
- attr_accessor :reason
30
-
31
- # request
32
- attr_accessor :request
33
-
34
- # status
35
- attr_accessor :status
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'code' => :'code',
41
- :'details' => :'details',
42
- :'message' => :'message',
43
- :'reason' => :'reason',
44
- :'request' => :'request',
45
- :'status' => :'status'
46
- }
47
- end
48
-
49
- # Returns all the JSON keys this model knows about
50
- def self.acceptable_attributes
51
- attribute_map.values
52
- end
53
-
54
- # Attribute type mapping.
55
- def self.openapi_types
56
- {
57
- :'code' => :'Integer',
58
- :'details' => :'Array<Object>',
59
- :'message' => :'String',
60
- :'reason' => :'String',
61
- :'request' => :'String',
62
- :'status' => :'String'
63
- }
64
- end
65
-
66
- # List of attributes with nullable: true
67
- def self.openapi_nullable
68
- Set.new([
69
- ])
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- if (!attributes.is_a?(Hash))
76
- fail ArgumentError, "The input argument (attributes) must be a hash in `OryKetoClient::PatchRelationTuplesBadRequestBody` initialize method"
77
- end
78
-
79
- # check to see if the attribute exists and convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `OryKetoClient::PatchRelationTuplesBadRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
- end
84
- h[k.to_sym] = v
85
- }
86
-
87
- if attributes.key?(:'code')
88
- self.code = attributes[:'code']
89
- end
90
-
91
- if attributes.key?(:'details')
92
- if (value = attributes[:'details']).is_a?(Array)
93
- self.details = value
94
- end
95
- end
96
-
97
- if attributes.key?(:'message')
98
- self.message = attributes[:'message']
99
- end
100
-
101
- if attributes.key?(:'reason')
102
- self.reason = attributes[:'reason']
103
- end
104
-
105
- if attributes.key?(:'request')
106
- self.request = attributes[:'request']
107
- end
108
-
109
- if attributes.key?(:'status')
110
- self.status = attributes[:'status']
111
- end
112
- end
113
-
114
- # Show invalid properties with the reasons. Usually used together with valid?
115
- # @return Array for valid properties with the reasons
116
- def list_invalid_properties
117
- invalid_properties = Array.new
118
- invalid_properties
119
- end
120
-
121
- # Check to see if the all the properties in the model are valid
122
- # @return true if the model is valid
123
- def valid?
124
- true
125
- end
126
-
127
- # Checks equality by comparing each attribute.
128
- # @param [Object] Object to be compared
129
- def ==(o)
130
- return true if self.equal?(o)
131
- self.class == o.class &&
132
- code == o.code &&
133
- details == o.details &&
134
- message == o.message &&
135
- reason == o.reason &&
136
- request == o.request &&
137
- status == o.status
138
- end
139
-
140
- # @see the `==` method
141
- # @param [Object] Object to be compared
142
- def eql?(o)
143
- self == o
144
- end
145
-
146
- # Calculates hash code according to all attributes.
147
- # @return [Integer] Hash code
148
- def hash
149
- [code, details, message, reason, request, status].hash
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 self.build_from_hash(attributes)
156
- new.build_from_hash(attributes)
157
- end
158
-
159
- # Builds the object from hash
160
- # @param [Hash] attributes Model attributes in the form of hash
161
- # @return [Object] Returns the model itself
162
- def build_from_hash(attributes)
163
- return nil unless attributes.is_a?(Hash)
164
- self.class.openapi_types.each_pair do |key, type|
165
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
- self.send("#{key}=", nil)
167
- elsif type =~ /\AArray<(.*)>/i
168
- # check to ensure the input is an array given that the attribute
169
- # is documented as an array but the input is not
170
- if attributes[self.class.attribute_map[key]].is_a?(Array)
171
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
- end
173
- elsif !attributes[self.class.attribute_map[key]].nil?
174
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
- end
176
- end
177
-
178
- self
179
- end
180
-
181
- # Deserializes the data based on type
182
- # @param string type Data type
183
- # @param string value Value to be deserialized
184
- # @return [Object] Deserialized data
185
- def _deserialize(type, value)
186
- case type.to_sym
187
- when :Time
188
- Time.parse(value)
189
- when :Date
190
- Date.parse(value)
191
- when :String
192
- value.to_s
193
- when :Integer
194
- value.to_i
195
- when :Float
196
- value.to_f
197
- when :Boolean
198
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
- true
200
- else
201
- false
202
- end
203
- when :Object
204
- # generic object (usually a Hash), return directly
205
- value
206
- when /\AArray<(?<inner_type>.+)>\z/
207
- inner_type = Regexp.last_match[:inner_type]
208
- value.map { |v| _deserialize(inner_type, v) }
209
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
- k_type = Regexp.last_match[:k_type]
211
- v_type = Regexp.last_match[:v_type]
212
- {}.tap do |hash|
213
- value.each do |k, v|
214
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
- end
216
- end
217
- else # model
218
- # models (e.g. Pet) or oneOf
219
- klass = OryKetoClient.const_get(type)
220
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
- end
222
- end
223
-
224
- # Returns the string representation of the object
225
- # @return [String] String presentation of the object
226
- def to_s
227
- to_hash.to_s
228
- end
229
-
230
- # to_body is an alias to to_hash (backward compatibility)
231
- # @return [Hash] Returns the object in the form of hash
232
- def to_body
233
- to_hash
234
- end
235
-
236
- # Returns the object in the form of hash
237
- # @return [Hash] Returns the object in the form of hash
238
- def to_hash
239
- hash = {}
240
- self.class.attribute_map.each_pair do |attr, param|
241
- value = self.send(attr)
242
- if value.nil?
243
- is_nullable = self.class.openapi_nullable.include?(attr)
244
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
- end
246
-
247
- hash[param] = _to_hash(value)
248
- end
249
- hash
250
- end
251
-
252
- # Outputs non-array value in the form of hash
253
- # For object, use to_hash. Otherwise, just return the value
254
- # @param [Object] value Any valid value
255
- # @return [Hash] Returns the value in the form of hash
256
- def _to_hash(value)
257
- if value.is_a?(Array)
258
- value.compact.map { |v| _to_hash(v) }
259
- elsif value.is_a?(Hash)
260
- {}.tap do |hash|
261
- value.each { |k, v| hash[k] = _to_hash(v) }
262
- end
263
- elsif value.respond_to? :to_hash
264
- value.to_hash
265
- else
266
- value
267
- end
268
- end
269
-
270
- end
271
-
272
- end
@@ -1,272 +0,0 @@
1
- =begin
2
- #Ory Oathkeeper API
3
-
4
- #Documentation for all of Ory Oathkeeper's APIs.
5
-
6
- The version of the OpenAPI document: v0.8.0-alpha.1
7
- Contact: hi@ory.sh
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OryKetoClient
17
- # PatchRelationTuplesInternalServerErrorBody PatchRelationTuplesInternalServerErrorBody PatchRelationTuplesInternalServerErrorBody PatchRelationTuplesInternalServerErrorBody PatchRelationTuplesInternalServerErrorBody PatchRelationTuplesInternalServerErrorBody patch relation tuples internal server error body
18
- class PatchRelationTuplesInternalServerErrorBody
19
- # code
20
- attr_accessor :code
21
-
22
- # details
23
- attr_accessor :details
24
-
25
- # message
26
- attr_accessor :message
27
-
28
- # reason
29
- attr_accessor :reason
30
-
31
- # request
32
- attr_accessor :request
33
-
34
- # status
35
- attr_accessor :status
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'code' => :'code',
41
- :'details' => :'details',
42
- :'message' => :'message',
43
- :'reason' => :'reason',
44
- :'request' => :'request',
45
- :'status' => :'status'
46
- }
47
- end
48
-
49
- # Returns all the JSON keys this model knows about
50
- def self.acceptable_attributes
51
- attribute_map.values
52
- end
53
-
54
- # Attribute type mapping.
55
- def self.openapi_types
56
- {
57
- :'code' => :'Integer',
58
- :'details' => :'Array<Object>',
59
- :'message' => :'String',
60
- :'reason' => :'String',
61
- :'request' => :'String',
62
- :'status' => :'String'
63
- }
64
- end
65
-
66
- # List of attributes with nullable: true
67
- def self.openapi_nullable
68
- Set.new([
69
- ])
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- if (!attributes.is_a?(Hash))
76
- fail ArgumentError, "The input argument (attributes) must be a hash in `OryKetoClient::PatchRelationTuplesInternalServerErrorBody` initialize method"
77
- end
78
-
79
- # check to see if the attribute exists and convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `OryKetoClient::PatchRelationTuplesInternalServerErrorBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
- end
84
- h[k.to_sym] = v
85
- }
86
-
87
- if attributes.key?(:'code')
88
- self.code = attributes[:'code']
89
- end
90
-
91
- if attributes.key?(:'details')
92
- if (value = attributes[:'details']).is_a?(Array)
93
- self.details = value
94
- end
95
- end
96
-
97
- if attributes.key?(:'message')
98
- self.message = attributes[:'message']
99
- end
100
-
101
- if attributes.key?(:'reason')
102
- self.reason = attributes[:'reason']
103
- end
104
-
105
- if attributes.key?(:'request')
106
- self.request = attributes[:'request']
107
- end
108
-
109
- if attributes.key?(:'status')
110
- self.status = attributes[:'status']
111
- end
112
- end
113
-
114
- # Show invalid properties with the reasons. Usually used together with valid?
115
- # @return Array for valid properties with the reasons
116
- def list_invalid_properties
117
- invalid_properties = Array.new
118
- invalid_properties
119
- end
120
-
121
- # Check to see if the all the properties in the model are valid
122
- # @return true if the model is valid
123
- def valid?
124
- true
125
- end
126
-
127
- # Checks equality by comparing each attribute.
128
- # @param [Object] Object to be compared
129
- def ==(o)
130
- return true if self.equal?(o)
131
- self.class == o.class &&
132
- code == o.code &&
133
- details == o.details &&
134
- message == o.message &&
135
- reason == o.reason &&
136
- request == o.request &&
137
- status == o.status
138
- end
139
-
140
- # @see the `==` method
141
- # @param [Object] Object to be compared
142
- def eql?(o)
143
- self == o
144
- end
145
-
146
- # Calculates hash code according to all attributes.
147
- # @return [Integer] Hash code
148
- def hash
149
- [code, details, message, reason, request, status].hash
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 self.build_from_hash(attributes)
156
- new.build_from_hash(attributes)
157
- end
158
-
159
- # Builds the object from hash
160
- # @param [Hash] attributes Model attributes in the form of hash
161
- # @return [Object] Returns the model itself
162
- def build_from_hash(attributes)
163
- return nil unless attributes.is_a?(Hash)
164
- self.class.openapi_types.each_pair do |key, type|
165
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
- self.send("#{key}=", nil)
167
- elsif type =~ /\AArray<(.*)>/i
168
- # check to ensure the input is an array given that the attribute
169
- # is documented as an array but the input is not
170
- if attributes[self.class.attribute_map[key]].is_a?(Array)
171
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
- end
173
- elsif !attributes[self.class.attribute_map[key]].nil?
174
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
- end
176
- end
177
-
178
- self
179
- end
180
-
181
- # Deserializes the data based on type
182
- # @param string type Data type
183
- # @param string value Value to be deserialized
184
- # @return [Object] Deserialized data
185
- def _deserialize(type, value)
186
- case type.to_sym
187
- when :Time
188
- Time.parse(value)
189
- when :Date
190
- Date.parse(value)
191
- when :String
192
- value.to_s
193
- when :Integer
194
- value.to_i
195
- when :Float
196
- value.to_f
197
- when :Boolean
198
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
- true
200
- else
201
- false
202
- end
203
- when :Object
204
- # generic object (usually a Hash), return directly
205
- value
206
- when /\AArray<(?<inner_type>.+)>\z/
207
- inner_type = Regexp.last_match[:inner_type]
208
- value.map { |v| _deserialize(inner_type, v) }
209
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
- k_type = Regexp.last_match[:k_type]
211
- v_type = Regexp.last_match[:v_type]
212
- {}.tap do |hash|
213
- value.each do |k, v|
214
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
- end
216
- end
217
- else # model
218
- # models (e.g. Pet) or oneOf
219
- klass = OryKetoClient.const_get(type)
220
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
- end
222
- end
223
-
224
- # Returns the string representation of the object
225
- # @return [String] String presentation of the object
226
- def to_s
227
- to_hash.to_s
228
- end
229
-
230
- # to_body is an alias to to_hash (backward compatibility)
231
- # @return [Hash] Returns the object in the form of hash
232
- def to_body
233
- to_hash
234
- end
235
-
236
- # Returns the object in the form of hash
237
- # @return [Hash] Returns the object in the form of hash
238
- def to_hash
239
- hash = {}
240
- self.class.attribute_map.each_pair do |attr, param|
241
- value = self.send(attr)
242
- if value.nil?
243
- is_nullable = self.class.openapi_nullable.include?(attr)
244
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
- end
246
-
247
- hash[param] = _to_hash(value)
248
- end
249
- hash
250
- end
251
-
252
- # Outputs non-array value in the form of hash
253
- # For object, use to_hash. Otherwise, just return the value
254
- # @param [Object] value Any valid value
255
- # @return [Hash] Returns the value in the form of hash
256
- def _to_hash(value)
257
- if value.is_a?(Array)
258
- value.compact.map { |v| _to_hash(v) }
259
- elsif value.is_a?(Hash)
260
- {}.tap do |hash|
261
- value.each { |k, v| hash[k] = _to_hash(v) }
262
- end
263
- elsif value.respond_to? :to_hash
264
- value.to_hash
265
- else
266
- value
267
- end
268
- end
269
-
270
- end
271
-
272
- end