xbim_identity 2.0.0 → 2.0.3

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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. metadata +6 -107
  3. data/Gemfile +0 -9
  4. data/README.md +0 -174
  5. data/Rakefile +0 -10
  6. data/lib/xbim_identity/api/authentication_api.rb +0 -118
  7. data/lib/xbim_identity/api/client_applications_api.rb +0 -315
  8. data/lib/xbim_identity/api/invitations_api.rb +0 -489
  9. data/lib/xbim_identity/api/me_api.rb +0 -148
  10. data/lib/xbim_identity/api/members_api.rb +0 -406
  11. data/lib/xbim_identity/api/registration_api.rb +0 -85
  12. data/lib/xbim_identity/api/tenants_api.rb +0 -709
  13. data/lib/xbim_identity/api/users_api.rb +0 -308
  14. data/lib/xbim_identity/api_client.rb +0 -390
  15. data/lib/xbim_identity/api_error.rb +0 -57
  16. data/lib/xbim_identity/configuration.rb +0 -278
  17. data/lib/xbim_identity/models/application_type.rb +0 -39
  18. data/lib/xbim_identity/models/client_app.rb +0 -351
  19. data/lib/xbim_identity/models/client_app_endpoint.rb +0 -239
  20. data/lib/xbim_identity/models/draft_invitation.rb +0 -379
  21. data/lib/xbim_identity/models/invitation.rb +0 -379
  22. data/lib/xbim_identity/models/invitation_create.rb +0 -253
  23. data/lib/xbim_identity/models/invitation_edit.rb +0 -239
  24. data/lib/xbim_identity/models/invite_status.rb +0 -41
  25. data/lib/xbim_identity/models/master.rb +0 -331
  26. data/lib/xbim_identity/models/master_base.rb +0 -243
  27. data/lib/xbim_identity/models/master_subscription.rb +0 -323
  28. data/lib/xbim_identity/models/o_data_boolean.rb +0 -230
  29. data/lib/xbim_identity/models/o_data_client_app_endpoint_list.rb +0 -252
  30. data/lib/xbim_identity/models/o_data_client_app_list.rb +0 -252
  31. data/lib/xbim_identity/models/o_data_invitation_list.rb +0 -252
  32. data/lib/xbim_identity/models/o_data_string.rb +0 -230
  33. data/lib/xbim_identity/models/o_data_tenant_list.rb +0 -252
  34. data/lib/xbim_identity/models/o_data_tenant_user_list.rb +0 -252
  35. data/lib/xbim_identity/models/o_data_user_list.rb +0 -252
  36. data/lib/xbim_identity/models/problem_details.rb +0 -259
  37. data/lib/xbim_identity/models/region.rb +0 -280
  38. data/lib/xbim_identity/models/region_info.rb +0 -256
  39. data/lib/xbim_identity/models/subscription.rb +0 -309
  40. data/lib/xbim_identity/models/team_member_create.rb +0 -229
  41. data/lib/xbim_identity/models/team_member_edit.rb +0 -219
  42. data/lib/xbim_identity/models/tenancy_type.rb +0 -38
  43. data/lib/xbim_identity/models/tenant.rb +0 -383
  44. data/lib/xbim_identity/models/tenant_create.rb +0 -267
  45. data/lib/xbim_identity/models/tenant_edit.rb +0 -229
  46. data/lib/xbim_identity/models/tenant_role.rb +0 -39
  47. data/lib/xbim_identity/models/tenant_user.rb +0 -299
  48. data/lib/xbim_identity/models/token_err_response.rb +0 -219
  49. data/lib/xbim_identity/models/token_response.rb +0 -259
  50. data/lib/xbim_identity/models/user.rb +0 -261
  51. data/lib/xbim_identity/models/user_create.rb +0 -247
  52. data/lib/xbim_identity/models/user_tenant.rb +0 -279
  53. data/lib/xbim_identity/version.rb +0 -15
  54. data/lib/xbim_identity.rb +0 -83
  55. data/spec/api/authentication_api_spec.rb +0 -52
  56. data/spec/api/client_applications_api_spec.rb +0 -101
  57. data/spec/api/invitations_api_spec.rb +0 -130
  58. data/spec/api/me_api_spec.rb +0 -61
  59. data/spec/api/members_api_spec.rb +0 -113
  60. data/spec/api/registration_api_spec.rb +0 -48
  61. data/spec/api/tenants_api_spec.rb +0 -176
  62. data/spec/api/users_api_spec.rb +0 -95
  63. data/spec/api_client_spec.rb +0 -226
  64. data/spec/configuration_spec.rb +0 -42
  65. data/spec/models/application_type_spec.rb +0 -28
  66. data/spec/models/client_app_endpoint_spec.rb +0 -46
  67. data/spec/models/client_app_spec.rb +0 -112
  68. data/spec/models/draft_invitation_spec.rb +0 -130
  69. data/spec/models/invitation_create_spec.rb +0 -52
  70. data/spec/models/invitation_edit_spec.rb +0 -46
  71. data/spec/models/invitation_spec.rb +0 -130
  72. data/spec/models/invite_status_spec.rb +0 -28
  73. data/spec/models/master_base_spec.rb +0 -46
  74. data/spec/models/master_spec.rb +0 -94
  75. data/spec/models/master_subscription_spec.rb +0 -94
  76. data/spec/models/o_data_boolean_spec.rb +0 -40
  77. data/spec/models/o_data_client_app_endpoint_list_spec.rb +0 -52
  78. data/spec/models/o_data_client_app_list_spec.rb +0 -52
  79. data/spec/models/o_data_invitation_list_spec.rb +0 -52
  80. data/spec/models/o_data_string_spec.rb +0 -40
  81. data/spec/models/o_data_tenant_list_spec.rb +0 -52
  82. data/spec/models/o_data_tenant_user_list_spec.rb +0 -52
  83. data/spec/models/o_data_user_list_spec.rb +0 -52
  84. data/spec/models/problem_details_spec.rb +0 -58
  85. data/spec/models/region_info_spec.rb +0 -46
  86. data/spec/models/region_spec.rb +0 -58
  87. data/spec/models/subscription_spec.rb +0 -88
  88. data/spec/models/team_member_create_spec.rb +0 -40
  89. data/spec/models/team_member_edit_spec.rb +0 -34
  90. data/spec/models/tenancy_type_spec.rb +0 -28
  91. data/spec/models/tenant_create_spec.rb +0 -58
  92. data/spec/models/tenant_edit_spec.rb +0 -40
  93. data/spec/models/tenant_role_spec.rb +0 -28
  94. data/spec/models/tenant_spec.rb +0 -130
  95. data/spec/models/tenant_user_spec.rb +0 -82
  96. data/spec/models/token_err_response_spec.rb +0 -34
  97. data/spec/models/token_response_spec.rb +0 -58
  98. data/spec/models/user_create_spec.rb +0 -46
  99. data/spec/models/user_spec.rb +0 -58
  100. data/spec/models/user_tenant_spec.rb +0 -70
  101. data/spec/spec_helper.rb +0 -111
  102. data/xbim_identity-1.0.0.gem +0 -0
  103. data/xbim_identity.gemspec +0 -38
@@ -1,229 +0,0 @@
1
- =begin
2
- #Xbim Flex Identity API 2.0
3
-
4
- #Communication centralised around construction data
5
-
6
- The version of the OpenAPI document: 2.0
7
- Contact: info@xbim.net
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 XbimIdentity
17
- class TenantEdit
18
- attr_accessor :name
19
-
20
- attr_accessor :identifier
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'name' => :'name',
26
- :'identifier' => :'identifier'
27
- }
28
- end
29
-
30
- # Returns all the JSON keys this model knows about
31
- def self.acceptable_attributes
32
- attribute_map.values
33
- end
34
-
35
- # Attribute type mapping.
36
- def self.openapi_types
37
- {
38
- :'name' => :'String',
39
- :'identifier' => :'String'
40
- }
41
- end
42
-
43
- # List of attributes with nullable: true
44
- def self.openapi_nullable
45
- Set.new([
46
- :'name',
47
- :'identifier'
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 `XbimIdentity::TenantEdit` initialize method"
56
- end
57
-
58
- # check to see if the attribute exists and convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::TenantEdit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
- end
63
- h[k.to_sym] = v
64
- }
65
-
66
- if attributes.key?(:'name')
67
- self.name = attributes[:'name']
68
- end
69
-
70
- if attributes.key?(:'identifier')
71
- self.identifier = attributes[:'identifier']
72
- end
73
- end
74
-
75
- # Show invalid properties with the reasons. Usually used together with valid?
76
- # @return Array for valid properties with the reasons
77
- def list_invalid_properties
78
- invalid_properties = Array.new
79
- invalid_properties
80
- end
81
-
82
- # Check to see if the all the properties in the model are valid
83
- # @return true if the model is valid
84
- def valid?
85
- true
86
- end
87
-
88
- # Checks equality by comparing each attribute.
89
- # @param [Object] Object to be compared
90
- def ==(o)
91
- return true if self.equal?(o)
92
- self.class == o.class &&
93
- name == o.name &&
94
- identifier == o.identifier
95
- end
96
-
97
- # @see the `==` method
98
- # @param [Object] Object to be compared
99
- def eql?(o)
100
- self == o
101
- end
102
-
103
- # Calculates hash code according to all attributes.
104
- # @return [Integer] Hash code
105
- def hash
106
- [name, identifier].hash
107
- end
108
-
109
- # Builds the object from hash
110
- # @param [Hash] attributes Model attributes in the form of hash
111
- # @return [Object] Returns the model itself
112
- def self.build_from_hash(attributes)
113
- new.build_from_hash(attributes)
114
- end
115
-
116
- # Builds the object from hash
117
- # @param [Hash] attributes Model attributes in the form of hash
118
- # @return [Object] Returns the model itself
119
- def build_from_hash(attributes)
120
- return nil unless attributes.is_a?(Hash)
121
- self.class.openapi_types.each_pair do |key, type|
122
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
- self.send("#{key}=", nil)
124
- elsif type =~ /\AArray<(.*)>/i
125
- # check to ensure the input is an array given that the attribute
126
- # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
- end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
- end
133
- end
134
-
135
- self
136
- end
137
-
138
- # Deserializes the data based on type
139
- # @param string type Data type
140
- # @param string value Value to be deserialized
141
- # @return [Object] Deserialized data
142
- def _deserialize(type, value)
143
- case type.to_sym
144
- when :Time
145
- Time.parse(value)
146
- when :Date
147
- Date.parse(value)
148
- when :String
149
- value.to_s
150
- when :Integer
151
- value.to_i
152
- when :Float
153
- value.to_f
154
- when :Boolean
155
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
- true
157
- else
158
- false
159
- end
160
- when :Object
161
- # generic object (usually a Hash), return directly
162
- value
163
- when /\AArray<(?<inner_type>.+)>\z/
164
- inner_type = Regexp.last_match[:inner_type]
165
- value.map { |v| _deserialize(inner_type, v) }
166
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
- k_type = Regexp.last_match[:k_type]
168
- v_type = Regexp.last_match[:v_type]
169
- {}.tap do |hash|
170
- value.each do |k, v|
171
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
- end
173
- end
174
- else # model
175
- # models (e.g. Pet) or oneOf
176
- klass = XbimIdentity.const_get(type)
177
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
- end
179
- end
180
-
181
- # Returns the string representation of the object
182
- # @return [String] String presentation of the object
183
- def to_s
184
- to_hash.to_s
185
- end
186
-
187
- # to_body is an alias to to_hash (backward compatibility)
188
- # @return [Hash] Returns the object in the form of hash
189
- def to_body
190
- to_hash
191
- end
192
-
193
- # Returns the object in the form of hash
194
- # @return [Hash] Returns the object in the form of hash
195
- def to_hash
196
- hash = {}
197
- self.class.attribute_map.each_pair do |attr, param|
198
- value = self.send(attr)
199
- if value.nil?
200
- is_nullable = self.class.openapi_nullable.include?(attr)
201
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
- end
203
-
204
- hash[param] = _to_hash(value)
205
- end
206
- hash
207
- end
208
-
209
- # Outputs non-array value in the form of hash
210
- # For object, use to_hash. Otherwise, just return the value
211
- # @param [Object] value Any valid value
212
- # @return [Hash] Returns the value in the form of hash
213
- def _to_hash(value)
214
- if value.is_a?(Array)
215
- value.compact.map { |v| _to_hash(v) }
216
- elsif value.is_a?(Hash)
217
- {}.tap do |hash|
218
- value.each { |k, v| hash[k] = _to_hash(v) }
219
- end
220
- elsif value.respond_to? :to_hash
221
- value.to_hash
222
- else
223
- value
224
- end
225
- end
226
-
227
- end
228
-
229
- end
@@ -1,39 +0,0 @@
1
- =begin
2
- #Xbim Flex Identity API 2.0
3
-
4
- #Communication centralised around construction data
5
-
6
- The version of the OpenAPI document: 2.0
7
- Contact: info@xbim.net
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 XbimIdentity
17
- class TenantRole
18
- VIEWER = "Viewer".freeze
19
- ADMINISTRATOR = "Administrator".freeze
20
- PUBLISHER = "Publisher".freeze
21
- CONTRIBUTOR = "Contributor".freeze
22
-
23
- # Builds the enum from string
24
- # @param [String] The enum value in the form of the string
25
- # @return [String] The enum value
26
- def self.build_from_hash(value)
27
- new.build_from_hash(value)
28
- end
29
-
30
- # Builds the enum from string
31
- # @param [String] The enum value in the form of the string
32
- # @return [String] The enum value
33
- def build_from_hash(value)
34
- constantValues = TenantRole.constants.select { |c| TenantRole::const_get(c) == value }
35
- raise "Invalid ENUM value #{value} for class #TenantRole" if constantValues.empty?
36
- value
37
- end
38
- end
39
- end
@@ -1,299 +0,0 @@
1
- =begin
2
- #Xbim Flex Identity API 2.0
3
-
4
- #Communication centralised around construction data
5
-
6
- The version of the OpenAPI document: 2.0
7
- Contact: info@xbim.net
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 XbimIdentity
17
- class TenantUser
18
- attr_accessor :user_id
19
-
20
- attr_accessor :user
21
-
22
- attr_accessor :user_email
23
-
24
- attr_accessor :user_name
25
-
26
- attr_accessor :role
27
-
28
- attr_accessor :last_modified_by
29
-
30
- attr_accessor :created_by
31
-
32
- attr_accessor :date_created
33
-
34
- attr_accessor :date_modified
35
-
36
- # Attribute mapping from ruby-style variable name to JSON key.
37
- def self.attribute_map
38
- {
39
- :'user_id' => :'userId',
40
- :'user' => :'user',
41
- :'user_email' => :'userEmail',
42
- :'user_name' => :'userName',
43
- :'role' => :'role',
44
- :'last_modified_by' => :'lastModifiedBy',
45
- :'created_by' => :'createdBy',
46
- :'date_created' => :'dateCreated',
47
- :'date_modified' => :'dateModified'
48
- }
49
- end
50
-
51
- # Returns all the JSON keys this model knows about
52
- def self.acceptable_attributes
53
- attribute_map.values
54
- end
55
-
56
- # Attribute type mapping.
57
- def self.openapi_types
58
- {
59
- :'user_id' => :'String',
60
- :'user' => :'User',
61
- :'user_email' => :'String',
62
- :'user_name' => :'String',
63
- :'role' => :'TenantRole',
64
- :'last_modified_by' => :'User',
65
- :'created_by' => :'User',
66
- :'date_created' => :'Time',
67
- :'date_modified' => :'Time'
68
- }
69
- end
70
-
71
- # List of attributes with nullable: true
72
- def self.openapi_nullable
73
- Set.new([
74
- :'user_id',
75
- :'user',
76
- :'user_email',
77
- :'user_name',
78
- :'role',
79
- :'last_modified_by',
80
- :'created_by',
81
- :'date_created',
82
- :'date_modified'
83
- ])
84
- end
85
-
86
- # Initializes the object
87
- # @param [Hash] attributes Model attributes in the form of hash
88
- def initialize(attributes = {})
89
- if (!attributes.is_a?(Hash))
90
- fail ArgumentError, "The input argument (attributes) must be a hash in `XbimIdentity::TenantUser` initialize method"
91
- end
92
-
93
- # check to see if the attribute exists and convert string to symbol for hash key
94
- attributes = attributes.each_with_object({}) { |(k, v), h|
95
- if (!self.class.attribute_map.key?(k.to_sym))
96
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::TenantUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
- end
98
- h[k.to_sym] = v
99
- }
100
-
101
- if attributes.key?(:'user_id')
102
- self.user_id = attributes[:'user_id']
103
- end
104
-
105
- if attributes.key?(:'user')
106
- self.user = attributes[:'user']
107
- end
108
-
109
- if attributes.key?(:'user_email')
110
- self.user_email = attributes[:'user_email']
111
- end
112
-
113
- if attributes.key?(:'user_name')
114
- self.user_name = attributes[:'user_name']
115
- end
116
-
117
- if attributes.key?(:'role')
118
- self.role = attributes[:'role']
119
- end
120
-
121
- if attributes.key?(:'last_modified_by')
122
- self.last_modified_by = attributes[:'last_modified_by']
123
- end
124
-
125
- if attributes.key?(:'created_by')
126
- self.created_by = attributes[:'created_by']
127
- end
128
-
129
- if attributes.key?(:'date_created')
130
- self.date_created = attributes[:'date_created']
131
- end
132
-
133
- if attributes.key?(:'date_modified')
134
- self.date_modified = attributes[:'date_modified']
135
- end
136
- end
137
-
138
- # Show invalid properties with the reasons. Usually used together with valid?
139
- # @return Array for valid properties with the reasons
140
- def list_invalid_properties
141
- invalid_properties = Array.new
142
- invalid_properties
143
- end
144
-
145
- # Check to see if the all the properties in the model are valid
146
- # @return true if the model is valid
147
- def valid?
148
- true
149
- end
150
-
151
- # Checks equality by comparing each attribute.
152
- # @param [Object] Object to be compared
153
- def ==(o)
154
- return true if self.equal?(o)
155
- self.class == o.class &&
156
- user_id == o.user_id &&
157
- user == o.user &&
158
- user_email == o.user_email &&
159
- user_name == o.user_name &&
160
- role == o.role &&
161
- last_modified_by == o.last_modified_by &&
162
- created_by == o.created_by &&
163
- date_created == o.date_created &&
164
- date_modified == o.date_modified
165
- end
166
-
167
- # @see the `==` method
168
- # @param [Object] Object to be compared
169
- def eql?(o)
170
- self == o
171
- end
172
-
173
- # Calculates hash code according to all attributes.
174
- # @return [Integer] Hash code
175
- def hash
176
- [user_id, user, user_email, user_name, role, last_modified_by, created_by, date_created, date_modified].hash
177
- end
178
-
179
- # Builds the object from hash
180
- # @param [Hash] attributes Model attributes in the form of hash
181
- # @return [Object] Returns the model itself
182
- def self.build_from_hash(attributes)
183
- new.build_from_hash(attributes)
184
- end
185
-
186
- # Builds the object from hash
187
- # @param [Hash] attributes Model attributes in the form of hash
188
- # @return [Object] Returns the model itself
189
- def build_from_hash(attributes)
190
- return nil unless attributes.is_a?(Hash)
191
- self.class.openapi_types.each_pair do |key, type|
192
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
193
- self.send("#{key}=", nil)
194
- elsif type =~ /\AArray<(.*)>/i
195
- # check to ensure the input is an array given that the attribute
196
- # is documented as an array but the input is not
197
- if attributes[self.class.attribute_map[key]].is_a?(Array)
198
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
- end
200
- elsif !attributes[self.class.attribute_map[key]].nil?
201
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
- end
203
- end
204
-
205
- self
206
- end
207
-
208
- # Deserializes the data based on type
209
- # @param string type Data type
210
- # @param string value Value to be deserialized
211
- # @return [Object] Deserialized data
212
- def _deserialize(type, value)
213
- case type.to_sym
214
- when :Time
215
- Time.parse(value)
216
- when :Date
217
- Date.parse(value)
218
- when :String
219
- value.to_s
220
- when :Integer
221
- value.to_i
222
- when :Float
223
- value.to_f
224
- when :Boolean
225
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
- true
227
- else
228
- false
229
- end
230
- when :Object
231
- # generic object (usually a Hash), return directly
232
- value
233
- when /\AArray<(?<inner_type>.+)>\z/
234
- inner_type = Regexp.last_match[:inner_type]
235
- value.map { |v| _deserialize(inner_type, v) }
236
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
- k_type = Regexp.last_match[:k_type]
238
- v_type = Regexp.last_match[:v_type]
239
- {}.tap do |hash|
240
- value.each do |k, v|
241
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
- end
243
- end
244
- else # model
245
- # models (e.g. Pet) or oneOf
246
- klass = XbimIdentity.const_get(type)
247
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
- end
249
- end
250
-
251
- # Returns the string representation of the object
252
- # @return [String] String presentation of the object
253
- def to_s
254
- to_hash.to_s
255
- end
256
-
257
- # to_body is an alias to to_hash (backward compatibility)
258
- # @return [Hash] Returns the object in the form of hash
259
- def to_body
260
- to_hash
261
- end
262
-
263
- # Returns the object in the form of hash
264
- # @return [Hash] Returns the object in the form of hash
265
- def to_hash
266
- hash = {}
267
- self.class.attribute_map.each_pair do |attr, param|
268
- value = self.send(attr)
269
- if value.nil?
270
- is_nullable = self.class.openapi_nullable.include?(attr)
271
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
- end
273
-
274
- hash[param] = _to_hash(value)
275
- end
276
- hash
277
- end
278
-
279
- # Outputs non-array value in the form of hash
280
- # For object, use to_hash. Otherwise, just return the value
281
- # @param [Object] value Any valid value
282
- # @return [Hash] Returns the value in the form of hash
283
- def _to_hash(value)
284
- if value.is_a?(Array)
285
- value.compact.map { |v| _to_hash(v) }
286
- elsif value.is_a?(Hash)
287
- {}.tap do |hash|
288
- value.each { |k, v| hash[k] = _to_hash(v) }
289
- end
290
- elsif value.respond_to? :to_hash
291
- value.to_hash
292
- else
293
- value
294
- end
295
- end
296
-
297
- end
298
-
299
- end