authress-sdk 2.0.36.0 → 2.0.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/authress-sdk/api/access_records_api.rb +6 -6
  3. data/lib/authress-sdk/api/accounts_api.rb +9 -9
  4. data/lib/authress-sdk/api/metadata_api.rb +6 -6
  5. data/lib/authress-sdk/api/resource_permissions_api.rb +9 -9
  6. data/lib/authress-sdk/api/roles_api.rb +9 -9
  7. data/lib/authress-sdk/api/service_clients_api.rb +15 -15
  8. data/lib/authress-sdk/api/user_permissions_api.rb +9 -9
  9. data/lib/authress-sdk/api/users_api.rb +134 -0
  10. data/lib/authress-sdk/models/{permission_response.rb → permission_collection.rb} +3 -3
  11. data/lib/authress-sdk/models/{v1resourcesresource_uri_permissions.rb → user_identity.rb} +40 -38
  12. data/lib/authress-sdk/models/{inline_response_200_6.rb → user_identity_collection.rb} +5 -5
  13. metadata +6 -28
  14. data/lib/authress-sdk/models/inline_response_200.rb +0 -240
  15. data/lib/authress-sdk/models/inline_response_200_1.rb +0 -229
  16. data/lib/authress-sdk/models/inline_response_200_10.rb +0 -248
  17. data/lib/authress-sdk/models/inline_response_200_11.rb +0 -204
  18. data/lib/authress-sdk/models/inline_response_200_12.rb +0 -206
  19. data/lib/authress-sdk/models/inline_response_200_13.rb +0 -222
  20. data/lib/authress-sdk/models/inline_response_200_14.rb +0 -239
  21. data/lib/authress-sdk/models/inline_response_200_15.rb +0 -235
  22. data/lib/authress-sdk/models/inline_response_200_2.rb +0 -231
  23. data/lib/authress-sdk/models/inline_response_200_3.rb +0 -253
  24. data/lib/authress-sdk/models/inline_response_200_4.rb +0 -221
  25. data/lib/authress-sdk/models/inline_response_200_5.rb +0 -206
  26. data/lib/authress-sdk/models/inline_response_200_7.rb +0 -222
  27. data/lib/authress-sdk/models/inline_response_200_9.rb +0 -261
  28. data/lib/authress-sdk/models/v1clients_options.rb +0 -211
  29. data/lib/authress-sdk/models/v1records_account.rb +0 -204
  30. data/lib/authress-sdk/models/v1records_links.rb +0 -204
  31. data/lib/authress-sdk/models/v1records_links_self.rb +0 -216
  32. data/lib/authress-sdk/models/v1records_users.rb +0 -205
  33. data/lib/authress-sdk/models/v1roles_permissions.rb +0 -251
  34. data/lib/authress-sdk/models/v1usersuser_idresourcesresource_urimetadata_account.rb +0 -199
  35. data/lib/authress-sdk/models/v1usersuser_idtokens_resources.rb +0 -205
  36. data/lib/authress-sdk/models/v1usersuser_idtokens_statements.rb +0 -222
@@ -1,229 +0,0 @@
1
- =begin
2
-
3
- =end
4
-
5
- require 'date'
6
-
7
- module AuthressSdk
8
- # Metadata and additional properties relevant.
9
- class InlineResponse2001
10
- attr_accessor :account
11
-
12
- attr_accessor :user_id
13
-
14
- # A JSON object limited to 10KB. The owner identified by the sub will always have access to read and update this data. Service clients may have access if the related property on the client is set. Access is restricted to authorized users.
15
- attr_accessor :metadata
16
-
17
- # Attribute mapping from ruby-style variable name to JSON key.
18
- def self.attribute_map
19
- {
20
- :'account' => :'account',
21
- :'user_id' => :'userId',
22
- :'metadata' => :'metadata'
23
- }
24
- end
25
-
26
- # Attribute type mapping.
27
- def self.openapi_types
28
- {
29
- :'account' => :'Object',
30
- :'user_id' => :'Object',
31
- :'metadata' => :'Object'
32
- }
33
- end
34
-
35
- # List of attributes with nullable: true
36
- def self.openapi_nullable
37
- Set.new([
38
- ])
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- if (!attributes.is_a?(Hash))
45
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse2001` initialize method"
46
- end
47
-
48
- # check to see if the attribute exists and convert string to symbol for hash key
49
- attributes = attributes.each_with_object({}) { |(k, v), h|
50
- if (!self.class.attribute_map.key?(k.to_sym))
51
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse2001`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
- end
53
- h[k.to_sym] = v
54
- }
55
-
56
- if attributes.key?(:'account')
57
- self.account = attributes[:'account']
58
- end
59
-
60
- if attributes.key?(:'user_id')
61
- self.user_id = attributes[:'user_id']
62
- end
63
-
64
- if attributes.key?(:'metadata')
65
- self.metadata = attributes[:'metadata']
66
- end
67
- end
68
-
69
- # Show invalid properties with the reasons. Usually used together with valid?
70
- # @return Array for valid properties with the reasons
71
- def list_invalid_properties
72
- invalid_properties = Array.new
73
- if @user_id.nil?
74
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
75
- end
76
-
77
- if @metadata.nil?
78
- invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
79
- end
80
-
81
- invalid_properties
82
- end
83
-
84
- # Check to see if the all the properties in the model are valid
85
- # @return true if the model is valid
86
- def valid?
87
- return false if @user_id.nil?
88
- return false if @metadata.nil?
89
- true
90
- end
91
-
92
- # Checks equality by comparing each attribute.
93
- # @param [Object] Object to be compared
94
- def ==(o)
95
- return true if self.equal?(o)
96
- self.class == o.class &&
97
- account == o.account &&
98
- user_id == o.user_id &&
99
- metadata == o.metadata
100
- end
101
-
102
- # @see the `==` method
103
- # @param [Object] Object to be compared
104
- def eql?(o)
105
- self == o
106
- end
107
-
108
- # Calculates hash code according to all attributes.
109
- # @return [Integer] Hash code
110
- def hash
111
- [account, user_id, metadata].hash
112
- end
113
-
114
- # Builds the object from hash
115
- # @param [Hash] attributes Model attributes in the form of hash
116
- # @return [Object] Returns the model itself
117
- def self.build_from_hash(attributes)
118
- new.build_from_hash(attributes)
119
- end
120
-
121
- # Builds the object from hash
122
- # @param [Hash] attributes Model attributes in the form of hash
123
- # @return [Object] Returns the model itself
124
- def build_from_hash(attributes)
125
- return nil unless attributes.is_a?(Hash)
126
- self.class.openapi_types.each_pair do |key, type|
127
- if type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the attribute
129
- # is documented as an array but the input is not
130
- if attributes[self.class.attribute_map[key]].is_a?(Array)
131
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
- end
133
- elsif !attributes[self.class.attribute_map[key]].nil?
134
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
136
- self.send("#{key}=", nil)
137
- end
138
- end
139
-
140
- self
141
- end
142
-
143
- # Deserializes the data based on type
144
- # @param string type Data type
145
- # @param string value Value to be deserialized
146
- # @return [Object] Deserialized data
147
- def _deserialize(type, value)
148
- case type.to_sym
149
- when :DateTime
150
- DateTime.parse(value)
151
- when :Date
152
- Date.parse(value)
153
- when :String
154
- value.to_s
155
- when :Integer
156
- value.to_i
157
- when :Float
158
- value.to_f
159
- when :Boolean
160
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
- true
162
- else
163
- false
164
- end
165
- when :Object
166
- # generic object (usually a Hash), return directly
167
- value
168
- when /\AArray<(?<inner_type>.+)>\z/
169
- inner_type = Regexp.last_match[:inner_type]
170
- value.map { |v| _deserialize(inner_type, v) }
171
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
- k_type = Regexp.last_match[:k_type]
173
- v_type = Regexp.last_match[:v_type]
174
- {}.tap do |hash|
175
- value.each do |k, v|
176
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
- end
178
- end
179
- else # model
180
- AuthressSdk.const_get(type).build_from_hash(value)
181
- end
182
- end
183
-
184
- # Returns the string representation of the object
185
- # @return [String] String presentation of the object
186
- def to_s
187
- to_hash.to_s
188
- end
189
-
190
- # to_body is an alias to to_hash (backward compatibility)
191
- # @return [Hash] Returns the object in the form of hash
192
- def to_body
193
- to_hash
194
- end
195
-
196
- # Returns the object in the form of hash
197
- # @return [Hash] Returns the object in the form of hash
198
- def to_hash
199
- hash = {}
200
- self.class.attribute_map.each_pair do |attr, param|
201
- value = self.send(attr)
202
- if value.nil?
203
- is_nullable = self.class.openapi_nullable.include?(attr)
204
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
- end
206
-
207
- hash[param] = _to_hash(value)
208
- end
209
- hash
210
- end
211
-
212
- # Outputs non-array value in the form of hash
213
- # For object, use to_hash. Otherwise, just return the value
214
- # @param [Object] value Any valid value
215
- # @return [Hash] Returns the value in the form of hash
216
- def _to_hash(value)
217
- if value.is_a?(Array)
218
- value.compact.map { |v| _to_hash(v) }
219
- elsif value.is_a?(Hash)
220
- {}.tap do |hash|
221
- value.each { |k, v| hash[k] = _to_hash(v) }
222
- end
223
- elsif value.respond_to? :to_hash
224
- value.to_hash
225
- else
226
- value
227
- end
228
- end end
229
- end
@@ -1,248 +0,0 @@
1
- =begin
2
-
3
- =end
4
-
5
- require 'date'
6
-
7
- module AuthressSdk
8
- # The role which contains a list of permissions.
9
- class InlineResponse20010
10
- # Unique identifier for the role, can be specified on creation, and used by records to map to permissions.
11
- attr_accessor :role_id
12
-
13
- # A helpful name for this role
14
- attr_accessor :name
15
-
16
- # A description for when to the user as well as additional information.
17
- attr_accessor :description
18
-
19
- # A list of the permissions
20
- attr_accessor :permissions
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'role_id' => :'roleId',
26
- :'name' => :'name',
27
- :'description' => :'description',
28
- :'permissions' => :'permissions'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'role_id' => :'Object',
36
- :'name' => :'Object',
37
- :'description' => :'Object',
38
- :'permissions' => :'Object'
39
- }
40
- end
41
-
42
- # List of attributes with nullable: true
43
- def self.openapi_nullable
44
- Set.new([
45
- ])
46
- end
47
-
48
- # Initializes the object
49
- # @param [Hash] attributes Model attributes in the form of hash
50
- def initialize(attributes = {})
51
- if (!attributes.is_a?(Hash))
52
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse20010` initialize method"
53
- end
54
-
55
- # check to see if the attribute exists and convert string to symbol for hash key
56
- attributes = attributes.each_with_object({}) { |(k, v), h|
57
- if (!self.class.attribute_map.key?(k.to_sym))
58
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse20010`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
- end
60
- h[k.to_sym] = v
61
- }
62
-
63
- if attributes.key?(:'role_id')
64
- self.role_id = attributes[:'role_id']
65
- end
66
-
67
- if attributes.key?(:'name')
68
- self.name = attributes[:'name']
69
- end
70
-
71
- if attributes.key?(:'description')
72
- self.description = attributes[:'description']
73
- end
74
-
75
- if attributes.key?(:'permissions')
76
- if (value = attributes[:'permissions']).is_a?(Array)
77
- self.permissions = value
78
- end
79
- end
80
- end
81
-
82
- # Show invalid properties with the reasons. Usually used together with valid?
83
- # @return Array for valid properties with the reasons
84
- def list_invalid_properties
85
- invalid_properties = Array.new
86
- if @role_id.nil?
87
- invalid_properties.push('invalid value for "role_id", role_id cannot be nil.')
88
- end
89
-
90
- if @name.nil?
91
- invalid_properties.push('invalid value for "name", name cannot be nil.')
92
- end
93
-
94
- if @permissions.nil?
95
- invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
96
- end
97
-
98
- invalid_properties
99
- end
100
-
101
- # Check to see if the all the properties in the model are valid
102
- # @return true if the model is valid
103
- def valid?
104
- return false if @role_id.nil?
105
- return false if @name.nil?
106
- return false if @permissions.nil?
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- role_id == o.role_id &&
116
- name == o.name &&
117
- description == o.description &&
118
- permissions == o.permissions
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Integer] Hash code
129
- def hash
130
- [role_id, name, description, permissions].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
- return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
147
- # check to ensure the input is an array given that the attribute
148
- # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
- end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
155
- self.send("#{key}=", nil)
156
- end
157
- end
158
-
159
- self
160
- end
161
-
162
- # Deserializes the data based on type
163
- # @param string type Data type
164
- # @param string value Value to be deserialized
165
- # @return [Object] Deserialized data
166
- def _deserialize(type, value)
167
- case type.to_sym
168
- when :DateTime
169
- DateTime.parse(value)
170
- when :Date
171
- Date.parse(value)
172
- when :String
173
- value.to_s
174
- when :Integer
175
- value.to_i
176
- when :Float
177
- value.to_f
178
- when :Boolean
179
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
- true
181
- else
182
- false
183
- end
184
- when :Object
185
- # generic object (usually a Hash), return directly
186
- value
187
- when /\AArray<(?<inner_type>.+)>\z/
188
- inner_type = Regexp.last_match[:inner_type]
189
- value.map { |v| _deserialize(inner_type, v) }
190
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
- k_type = Regexp.last_match[:k_type]
192
- v_type = Regexp.last_match[:v_type]
193
- {}.tap do |hash|
194
- value.each do |k, v|
195
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
- end
197
- end
198
- else # model
199
- AuthressSdk.const_get(type).build_from_hash(value)
200
- end
201
- end
202
-
203
- # Returns the string representation of the object
204
- # @return [String] String presentation of the object
205
- def to_s
206
- to_hash.to_s
207
- end
208
-
209
- # to_body is an alias to to_hash (backward compatibility)
210
- # @return [Hash] Returns the object in the form of hash
211
- def to_body
212
- to_hash
213
- end
214
-
215
- # Returns the object in the form of hash
216
- # @return [Hash] Returns the object in the form of hash
217
- def to_hash
218
- hash = {}
219
- self.class.attribute_map.each_pair do |attr, param|
220
- value = self.send(attr)
221
- if value.nil?
222
- is_nullable = self.class.openapi_nullable.include?(attr)
223
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
- end
225
-
226
- hash[param] = _to_hash(value)
227
- end
228
- hash
229
- end
230
-
231
- # Outputs non-array value in the form of hash
232
- # For object, use to_hash. Otherwise, just return the value
233
- # @param [Object] value Any valid value
234
- # @return [Hash] Returns the value in the form of hash
235
- def _to_hash(value)
236
- if value.is_a?(Array)
237
- value.compact.map { |v| _to_hash(v) }
238
- elsif value.is_a?(Hash)
239
- {}.tap do |hash|
240
- value.each { |k, v| hash[k] = _to_hash(v) }
241
- end
242
- elsif value.respond_to? :to_hash
243
- value.to_hash
244
- else
245
- value
246
- end
247
- end end
248
- end
@@ -1,204 +0,0 @@
1
- =begin
2
-
3
- =end
4
-
5
- require 'date'
6
-
7
- module AuthressSdk
8
- class InlineResponse20011
9
- attr_accessor :accounts
10
-
11
- # Attribute mapping from ruby-style variable name to JSON key.
12
- def self.attribute_map
13
- {
14
- :'accounts' => :'accounts'
15
- }
16
- end
17
-
18
- # Attribute type mapping.
19
- def self.openapi_types
20
- {
21
- :'accounts' => :'Object'
22
- }
23
- end
24
-
25
- # List of attributes with nullable: true
26
- def self.openapi_nullable
27
- Set.new([
28
- ])
29
- end
30
-
31
- # Initializes the object
32
- # @param [Hash] attributes Model attributes in the form of hash
33
- def initialize(attributes = {})
34
- if (!attributes.is_a?(Hash))
35
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse20011` initialize method"
36
- end
37
-
38
- # check to see if the attribute exists and convert string to symbol for hash key
39
- attributes = attributes.each_with_object({}) { |(k, v), h|
40
- if (!self.class.attribute_map.key?(k.to_sym))
41
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse20011`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
42
- end
43
- h[k.to_sym] = v
44
- }
45
-
46
- if attributes.key?(:'accounts')
47
- self.accounts = attributes[:'accounts']
48
- end
49
- end
50
-
51
- # Show invalid properties with the reasons. Usually used together with valid?
52
- # @return Array for valid properties with the reasons
53
- def list_invalid_properties
54
- invalid_properties = Array.new
55
- if @accounts.nil?
56
- invalid_properties.push('invalid value for "accounts", accounts cannot be nil.')
57
- end
58
-
59
- invalid_properties
60
- end
61
-
62
- # Check to see if the all the properties in the model are valid
63
- # @return true if the model is valid
64
- def valid?
65
- return false if @accounts.nil?
66
- true
67
- end
68
-
69
- # Checks equality by comparing each attribute.
70
- # @param [Object] Object to be compared
71
- def ==(o)
72
- return true if self.equal?(o)
73
- self.class == o.class &&
74
- accounts == o.accounts
75
- end
76
-
77
- # @see the `==` method
78
- # @param [Object] Object to be compared
79
- def eql?(o)
80
- self == o
81
- end
82
-
83
- # Calculates hash code according to all attributes.
84
- # @return [Integer] Hash code
85
- def hash
86
- [accounts].hash
87
- end
88
-
89
- # Builds the object from hash
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- # @return [Object] Returns the model itself
92
- def self.build_from_hash(attributes)
93
- new.build_from_hash(attributes)
94
- end
95
-
96
- # Builds the object from hash
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- # @return [Object] Returns the model itself
99
- def build_from_hash(attributes)
100
- return nil unless attributes.is_a?(Hash)
101
- self.class.openapi_types.each_pair do |key, type|
102
- if type =~ /\AArray<(.*)>/i
103
- # check to ensure the input is an array given that the attribute
104
- # is documented as an array but the input is not
105
- if attributes[self.class.attribute_map[key]].is_a?(Array)
106
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
- end
108
- elsif !attributes[self.class.attribute_map[key]].nil?
109
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
111
- self.send("#{key}=", nil)
112
- end
113
- end
114
-
115
- self
116
- end
117
-
118
- # Deserializes the data based on type
119
- # @param string type Data type
120
- # @param string value Value to be deserialized
121
- # @return [Object] Deserialized data
122
- def _deserialize(type, value)
123
- case type.to_sym
124
- when :DateTime
125
- DateTime.parse(value)
126
- when :Date
127
- Date.parse(value)
128
- when :String
129
- value.to_s
130
- when :Integer
131
- value.to_i
132
- when :Float
133
- value.to_f
134
- when :Boolean
135
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
136
- true
137
- else
138
- false
139
- end
140
- when :Object
141
- # generic object (usually a Hash), return directly
142
- value
143
- when /\AArray<(?<inner_type>.+)>\z/
144
- inner_type = Regexp.last_match[:inner_type]
145
- value.map { |v| _deserialize(inner_type, v) }
146
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
147
- k_type = Regexp.last_match[:k_type]
148
- v_type = Regexp.last_match[:v_type]
149
- {}.tap do |hash|
150
- value.each do |k, v|
151
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
- end
153
- end
154
- else # model
155
- AuthressSdk.const_get(type).build_from_hash(value)
156
- end
157
- end
158
-
159
- # Returns the string representation of the object
160
- # @return [String] String presentation of the object
161
- def to_s
162
- to_hash.to_s
163
- end
164
-
165
- # to_body is an alias to to_hash (backward compatibility)
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_body
168
- to_hash
169
- end
170
-
171
- # Returns the object in the form of hash
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_hash
174
- hash = {}
175
- self.class.attribute_map.each_pair do |attr, param|
176
- value = self.send(attr)
177
- if value.nil?
178
- is_nullable = self.class.openapi_nullable.include?(attr)
179
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
180
- end
181
-
182
- hash[param] = _to_hash(value)
183
- end
184
- hash
185
- end
186
-
187
- # Outputs non-array value in the form of hash
188
- # For object, use to_hash. Otherwise, just return the value
189
- # @param [Object] value Any valid value
190
- # @return [Hash] Returns the value in the form of hash
191
- def _to_hash(value)
192
- if value.is_a?(Array)
193
- value.compact.map { |v| _to_hash(v) }
194
- elsif value.is_a?(Hash)
195
- {}.tap do |hash|
196
- value.each { |k, v| hash[k] = _to_hash(v) }
197
- end
198
- elsif value.respond_to? :to_hash
199
- value.to_hash
200
- else
201
- value
202
- end
203
- end end
204
- end