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,351 +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 ClientApp
18
- attr_accessor :client_id
19
-
20
- attr_accessor :application_name
21
-
22
- attr_accessor :application_description
23
-
24
- attr_accessor :application_base_url
25
-
26
- attr_accessor :application_icon_url
27
-
28
- attr_accessor :application_type
29
-
30
- attr_accessor :is_system_application
31
-
32
- attr_accessor :is_public
33
-
34
- attr_accessor :is_enabled
35
-
36
- attr_accessor :owner
37
-
38
- attr_accessor :endpoints
39
-
40
- attr_accessor :master
41
-
42
- attr_accessor :date_created
43
-
44
- attr_accessor :date_modified
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'client_id' => :'clientId',
50
- :'application_name' => :'applicationName',
51
- :'application_description' => :'applicationDescription',
52
- :'application_base_url' => :'applicationBaseUrl',
53
- :'application_icon_url' => :'applicationIconUrl',
54
- :'application_type' => :'applicationType',
55
- :'is_system_application' => :'isSystemApplication',
56
- :'is_public' => :'isPublic',
57
- :'is_enabled' => :'isEnabled',
58
- :'owner' => :'owner',
59
- :'endpoints' => :'endpoints',
60
- :'master' => :'master',
61
- :'date_created' => :'dateCreated',
62
- :'date_modified' => :'dateModified'
63
- }
64
- end
65
-
66
- # Returns all the JSON keys this model knows about
67
- def self.acceptable_attributes
68
- attribute_map.values
69
- end
70
-
71
- # Attribute type mapping.
72
- def self.openapi_types
73
- {
74
- :'client_id' => :'String',
75
- :'application_name' => :'String',
76
- :'application_description' => :'String',
77
- :'application_base_url' => :'String',
78
- :'application_icon_url' => :'String',
79
- :'application_type' => :'ApplicationType',
80
- :'is_system_application' => :'Boolean',
81
- :'is_public' => :'Boolean',
82
- :'is_enabled' => :'Boolean',
83
- :'owner' => :'User',
84
- :'endpoints' => :'Array<ClientAppEndpoint>',
85
- :'master' => :'Master',
86
- :'date_created' => :'Time',
87
- :'date_modified' => :'Time'
88
- }
89
- end
90
-
91
- # List of attributes with nullable: true
92
- def self.openapi_nullable
93
- Set.new([
94
- :'client_id',
95
- :'application_name',
96
- :'application_description',
97
- :'application_base_url',
98
- :'application_icon_url',
99
- :'application_type',
100
- :'is_system_application',
101
- :'is_public',
102
- :'is_enabled',
103
- :'owner',
104
- :'endpoints',
105
- :'master',
106
- :'date_created',
107
- :'date_modified'
108
- ])
109
- end
110
-
111
- # Initializes the object
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- def initialize(attributes = {})
114
- if (!attributes.is_a?(Hash))
115
- fail ArgumentError, "The input argument (attributes) must be a hash in `XbimIdentity::ClientApp` initialize method"
116
- end
117
-
118
- # check to see if the attribute exists and convert string to symbol for hash key
119
- attributes = attributes.each_with_object({}) { |(k, v), h|
120
- if (!self.class.attribute_map.key?(k.to_sym))
121
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::ClientApp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
122
- end
123
- h[k.to_sym] = v
124
- }
125
-
126
- if attributes.key?(:'client_id')
127
- self.client_id = attributes[:'client_id']
128
- end
129
-
130
- if attributes.key?(:'application_name')
131
- self.application_name = attributes[:'application_name']
132
- end
133
-
134
- if attributes.key?(:'application_description')
135
- self.application_description = attributes[:'application_description']
136
- end
137
-
138
- if attributes.key?(:'application_base_url')
139
- self.application_base_url = attributes[:'application_base_url']
140
- end
141
-
142
- if attributes.key?(:'application_icon_url')
143
- self.application_icon_url = attributes[:'application_icon_url']
144
- end
145
-
146
- if attributes.key?(:'application_type')
147
- self.application_type = attributes[:'application_type']
148
- end
149
-
150
- if attributes.key?(:'is_system_application')
151
- self.is_system_application = attributes[:'is_system_application']
152
- end
153
-
154
- if attributes.key?(:'is_public')
155
- self.is_public = attributes[:'is_public']
156
- end
157
-
158
- if attributes.key?(:'is_enabled')
159
- self.is_enabled = attributes[:'is_enabled']
160
- end
161
-
162
- if attributes.key?(:'owner')
163
- self.owner = attributes[:'owner']
164
- end
165
-
166
- if attributes.key?(:'endpoints')
167
- if (value = attributes[:'endpoints']).is_a?(Array)
168
- self.endpoints = value
169
- end
170
- end
171
-
172
- if attributes.key?(:'master')
173
- self.master = attributes[:'master']
174
- end
175
-
176
- if attributes.key?(:'date_created')
177
- self.date_created = attributes[:'date_created']
178
- end
179
-
180
- if attributes.key?(:'date_modified')
181
- self.date_modified = attributes[:'date_modified']
182
- end
183
- end
184
-
185
- # Show invalid properties with the reasons. Usually used together with valid?
186
- # @return Array for valid properties with the reasons
187
- def list_invalid_properties
188
- invalid_properties = Array.new
189
- invalid_properties
190
- end
191
-
192
- # Check to see if the all the properties in the model are valid
193
- # @return true if the model is valid
194
- def valid?
195
- true
196
- end
197
-
198
- # Checks equality by comparing each attribute.
199
- # @param [Object] Object to be compared
200
- def ==(o)
201
- return true if self.equal?(o)
202
- self.class == o.class &&
203
- client_id == o.client_id &&
204
- application_name == o.application_name &&
205
- application_description == o.application_description &&
206
- application_base_url == o.application_base_url &&
207
- application_icon_url == o.application_icon_url &&
208
- application_type == o.application_type &&
209
- is_system_application == o.is_system_application &&
210
- is_public == o.is_public &&
211
- is_enabled == o.is_enabled &&
212
- owner == o.owner &&
213
- endpoints == o.endpoints &&
214
- master == o.master &&
215
- date_created == o.date_created &&
216
- date_modified == o.date_modified
217
- end
218
-
219
- # @see the `==` method
220
- # @param [Object] Object to be compared
221
- def eql?(o)
222
- self == o
223
- end
224
-
225
- # Calculates hash code according to all attributes.
226
- # @return [Integer] Hash code
227
- def hash
228
- [client_id, application_name, application_description, application_base_url, application_icon_url, application_type, is_system_application, is_public, is_enabled, owner, endpoints, master, date_created, date_modified].hash
229
- end
230
-
231
- # Builds the object from hash
232
- # @param [Hash] attributes Model attributes in the form of hash
233
- # @return [Object] Returns the model itself
234
- def self.build_from_hash(attributes)
235
- new.build_from_hash(attributes)
236
- end
237
-
238
- # Builds the object from hash
239
- # @param [Hash] attributes Model attributes in the form of hash
240
- # @return [Object] Returns the model itself
241
- def build_from_hash(attributes)
242
- return nil unless attributes.is_a?(Hash)
243
- self.class.openapi_types.each_pair do |key, type|
244
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
245
- self.send("#{key}=", nil)
246
- elsif type =~ /\AArray<(.*)>/i
247
- # check to ensure the input is an array given that the attribute
248
- # is documented as an array but the input is not
249
- if attributes[self.class.attribute_map[key]].is_a?(Array)
250
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
251
- end
252
- elsif !attributes[self.class.attribute_map[key]].nil?
253
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
254
- end
255
- end
256
-
257
- self
258
- end
259
-
260
- # Deserializes the data based on type
261
- # @param string type Data type
262
- # @param string value Value to be deserialized
263
- # @return [Object] Deserialized data
264
- def _deserialize(type, value)
265
- case type.to_sym
266
- when :Time
267
- Time.parse(value)
268
- when :Date
269
- Date.parse(value)
270
- when :String
271
- value.to_s
272
- when :Integer
273
- value.to_i
274
- when :Float
275
- value.to_f
276
- when :Boolean
277
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
278
- true
279
- else
280
- false
281
- end
282
- when :Object
283
- # generic object (usually a Hash), return directly
284
- value
285
- when /\AArray<(?<inner_type>.+)>\z/
286
- inner_type = Regexp.last_match[:inner_type]
287
- value.map { |v| _deserialize(inner_type, v) }
288
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
289
- k_type = Regexp.last_match[:k_type]
290
- v_type = Regexp.last_match[:v_type]
291
- {}.tap do |hash|
292
- value.each do |k, v|
293
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
294
- end
295
- end
296
- else # model
297
- # models (e.g. Pet) or oneOf
298
- klass = XbimIdentity.const_get(type)
299
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
300
- end
301
- end
302
-
303
- # Returns the string representation of the object
304
- # @return [String] String presentation of the object
305
- def to_s
306
- to_hash.to_s
307
- end
308
-
309
- # to_body is an alias to to_hash (backward compatibility)
310
- # @return [Hash] Returns the object in the form of hash
311
- def to_body
312
- to_hash
313
- end
314
-
315
- # Returns the object in the form of hash
316
- # @return [Hash] Returns the object in the form of hash
317
- def to_hash
318
- hash = {}
319
- self.class.attribute_map.each_pair do |attr, param|
320
- value = self.send(attr)
321
- if value.nil?
322
- is_nullable = self.class.openapi_nullable.include?(attr)
323
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
324
- end
325
-
326
- hash[param] = _to_hash(value)
327
- end
328
- hash
329
- end
330
-
331
- # Outputs non-array value in the form of hash
332
- # For object, use to_hash. Otherwise, just return the value
333
- # @param [Object] value Any valid value
334
- # @return [Hash] Returns the value in the form of hash
335
- def _to_hash(value)
336
- if value.is_a?(Array)
337
- value.compact.map { |v| _to_hash(v) }
338
- elsif value.is_a?(Hash)
339
- {}.tap do |hash|
340
- value.each { |k, v| hash[k] = _to_hash(v) }
341
- end
342
- elsif value.respond_to? :to_hash
343
- value.to_hash
344
- else
345
- value
346
- end
347
- end
348
-
349
- end
350
-
351
- end
@@ -1,239 +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 ClientAppEndpoint
18
- attr_accessor :client_id
19
-
20
- attr_accessor :endpoint_name
21
-
22
- attr_accessor :tokenised_path
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'client_id' => :'clientId',
28
- :'endpoint_name' => :'endpointName',
29
- :'tokenised_path' => :'tokenisedPath'
30
- }
31
- end
32
-
33
- # Returns all the JSON keys this model knows about
34
- def self.acceptable_attributes
35
- attribute_map.values
36
- end
37
-
38
- # Attribute type mapping.
39
- def self.openapi_types
40
- {
41
- :'client_id' => :'String',
42
- :'endpoint_name' => :'String',
43
- :'tokenised_path' => :'String'
44
- }
45
- end
46
-
47
- # List of attributes with nullable: true
48
- def self.openapi_nullable
49
- Set.new([
50
- :'client_id',
51
- :'endpoint_name',
52
- :'tokenised_path'
53
- ])
54
- end
55
-
56
- # Initializes the object
57
- # @param [Hash] attributes Model attributes in the form of hash
58
- def initialize(attributes = {})
59
- if (!attributes.is_a?(Hash))
60
- fail ArgumentError, "The input argument (attributes) must be a hash in `XbimIdentity::ClientAppEndpoint` initialize method"
61
- end
62
-
63
- # check to see if the attribute exists and convert string to symbol for hash key
64
- attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `XbimIdentity::ClientAppEndpoint`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
- end
68
- h[k.to_sym] = v
69
- }
70
-
71
- if attributes.key?(:'client_id')
72
- self.client_id = attributes[:'client_id']
73
- end
74
-
75
- if attributes.key?(:'endpoint_name')
76
- self.endpoint_name = attributes[:'endpoint_name']
77
- end
78
-
79
- if attributes.key?(:'tokenised_path')
80
- self.tokenised_path = attributes[:'tokenised_path']
81
- end
82
- end
83
-
84
- # Show invalid properties with the reasons. Usually used together with valid?
85
- # @return Array for valid properties with the reasons
86
- def list_invalid_properties
87
- invalid_properties = Array.new
88
- invalid_properties
89
- end
90
-
91
- # Check to see if the all the properties in the model are valid
92
- # @return true if the model is valid
93
- def valid?
94
- true
95
- end
96
-
97
- # Checks equality by comparing each attribute.
98
- # @param [Object] Object to be compared
99
- def ==(o)
100
- return true if self.equal?(o)
101
- self.class == o.class &&
102
- client_id == o.client_id &&
103
- endpoint_name == o.endpoint_name &&
104
- tokenised_path == o.tokenised_path
105
- end
106
-
107
- # @see the `==` method
108
- # @param [Object] Object to be compared
109
- def eql?(o)
110
- self == o
111
- end
112
-
113
- # Calculates hash code according to all attributes.
114
- # @return [Integer] Hash code
115
- def hash
116
- [client_id, endpoint_name, tokenised_path].hash
117
- end
118
-
119
- # Builds the object from hash
120
- # @param [Hash] attributes Model attributes in the form of hash
121
- # @return [Object] Returns the model itself
122
- def self.build_from_hash(attributes)
123
- new.build_from_hash(attributes)
124
- end
125
-
126
- # Builds the object from hash
127
- # @param [Hash] attributes Model attributes in the form of hash
128
- # @return [Object] Returns the model itself
129
- def build_from_hash(attributes)
130
- return nil unless attributes.is_a?(Hash)
131
- self.class.openapi_types.each_pair do |key, type|
132
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
- self.send("#{key}=", nil)
134
- elsif type =~ /\AArray<(.*)>/i
135
- # check to ensure the input is an array given that the attribute
136
- # is documented as an array but the input is not
137
- if attributes[self.class.attribute_map[key]].is_a?(Array)
138
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
- end
140
- elsif !attributes[self.class.attribute_map[key]].nil?
141
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
- end
143
- end
144
-
145
- self
146
- end
147
-
148
- # Deserializes the data based on type
149
- # @param string type Data type
150
- # @param string value Value to be deserialized
151
- # @return [Object] Deserialized data
152
- def _deserialize(type, value)
153
- case type.to_sym
154
- when :Time
155
- Time.parse(value)
156
- when :Date
157
- Date.parse(value)
158
- when :String
159
- value.to_s
160
- when :Integer
161
- value.to_i
162
- when :Float
163
- value.to_f
164
- when :Boolean
165
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
- true
167
- else
168
- false
169
- end
170
- when :Object
171
- # generic object (usually a Hash), return directly
172
- value
173
- when /\AArray<(?<inner_type>.+)>\z/
174
- inner_type = Regexp.last_match[:inner_type]
175
- value.map { |v| _deserialize(inner_type, v) }
176
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
- k_type = Regexp.last_match[:k_type]
178
- v_type = Regexp.last_match[:v_type]
179
- {}.tap do |hash|
180
- value.each do |k, v|
181
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
- end
183
- end
184
- else # model
185
- # models (e.g. Pet) or oneOf
186
- klass = XbimIdentity.const_get(type)
187
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
- end
189
- end
190
-
191
- # Returns the string representation of the object
192
- # @return [String] String presentation of the object
193
- def to_s
194
- to_hash.to_s
195
- end
196
-
197
- # to_body is an alias to to_hash (backward compatibility)
198
- # @return [Hash] Returns the object in the form of hash
199
- def to_body
200
- to_hash
201
- end
202
-
203
- # Returns the object in the form of hash
204
- # @return [Hash] Returns the object in the form of hash
205
- def to_hash
206
- hash = {}
207
- self.class.attribute_map.each_pair do |attr, param|
208
- value = self.send(attr)
209
- if value.nil?
210
- is_nullable = self.class.openapi_nullable.include?(attr)
211
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
- end
213
-
214
- hash[param] = _to_hash(value)
215
- end
216
- hash
217
- end
218
-
219
- # Outputs non-array value in the form of hash
220
- # For object, use to_hash. Otherwise, just return the value
221
- # @param [Object] value Any valid value
222
- # @return [Hash] Returns the value in the form of hash
223
- def _to_hash(value)
224
- if value.is_a?(Array)
225
- value.compact.map { |v| _to_hash(v) }
226
- elsif value.is_a?(Hash)
227
- {}.tap do |hash|
228
- value.each { |k, v| hash[k] = _to_hash(v) }
229
- end
230
- elsif value.respond_to? :to_hash
231
- value.to_hash
232
- else
233
- value
234
- end
235
- end
236
-
237
- end
238
-
239
- end