purecloudplatformclientv2 47.0.0 → 48.0.0

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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/docs/AnalyticsApi.md +66 -0
  4. data/docs/AnalyticsSession.md +1 -1
  5. data/docs/AuthorizationApi.md +9 -5
  6. data/docs/Condition.md +4 -4
  7. data/docs/ContactColumnToDataActionFieldMapping.md +12 -0
  8. data/docs/ConversationProperties.md +21 -0
  9. data/docs/DataActionConditionPredicate.md +12 -0
  10. data/docs/GroupsApi.md +1 -1
  11. data/docs/OrgUser.md +1 -0
  12. data/docs/OutboundApi.md +2 -2
  13. data/docs/QualityApi.md +376 -0
  14. data/docs/RoutingApi.md +85 -12
  15. data/docs/ScorableSurvey.md +18 -0
  16. data/docs/SearchApi.md +2 -42
  17. data/docs/SuggestApi.md +2 -2
  18. data/docs/Survey.md +22 -0
  19. data/docs/SurveyFormAndScoringSet.md +14 -0
  20. data/docs/SurveyQuestionGroupScore.md +17 -0
  21. data/docs/SurveyQuestionScore.md +19 -0
  22. data/docs/SurveyScoringSet.md +15 -0
  23. data/docs/Token.md +13 -0
  24. data/docs/TrustUser.md +1 -0
  25. data/docs/User.md +1 -0
  26. data/docs/UserMe.md +1 -0
  27. data/docs/UsersApi.md +8 -8
  28. data/docs/UtilitiesApi.md +59 -0
  29. data/docs/ViewFilter.md +13 -0
  30. data/lib/purecloudplatformclientv2.rb +10 -0
  31. data/lib/purecloudplatformclientv2/api/alerting_api.rb +11 -11
  32. data/lib/purecloudplatformclientv2/api/analytics_api.rb +91 -26
  33. data/lib/purecloudplatformclientv2/api/architect_api.rb +81 -81
  34. data/lib/purecloudplatformclientv2/api/attributes_api.rb +6 -6
  35. data/lib/purecloudplatformclientv2/api/authorization_api.rb +45 -36
  36. data/lib/purecloudplatformclientv2/api/billing_api.rb +2 -2
  37. data/lib/purecloudplatformclientv2/api/content_management_api.rb +38 -38
  38. data/lib/purecloudplatformclientv2/api/conversations_api.rb +100 -100
  39. data/lib/purecloudplatformclientv2/api/external_contacts_api.rb +30 -30
  40. data/lib/purecloudplatformclientv2/api/fax_api.rb +6 -6
  41. data/lib/purecloudplatformclientv2/api/flows_api.rb +1 -1
  42. data/lib/purecloudplatformclientv2/api/general_data_protection_regulation_api.rb +4 -4
  43. data/lib/purecloudplatformclientv2/api/geolocation_api.rb +4 -4
  44. data/lib/purecloudplatformclientv2/api/greetings_api.rb +16 -16
  45. data/lib/purecloudplatformclientv2/api/groups_api.rb +14 -14
  46. data/lib/purecloudplatformclientv2/api/identity_provider_api.rb +28 -28
  47. data/lib/purecloudplatformclientv2/api/integrations_api.rb +41 -41
  48. data/lib/purecloudplatformclientv2/api/languages_api.rb +10 -10
  49. data/lib/purecloudplatformclientv2/api/license_api.rb +8 -8
  50. data/lib/purecloudplatformclientv2/api/locations_api.rb +4 -4
  51. data/lib/purecloudplatformclientv2/api/messaging_api.rb +14 -14
  52. data/lib/purecloudplatformclientv2/api/mobile_devices_api.rb +5 -5
  53. data/lib/purecloudplatformclientv2/api/notifications_api.rb +7 -7
  54. data/lib/purecloudplatformclientv2/api/o_auth_api.rb +6 -6
  55. data/lib/purecloudplatformclientv2/api/objects_api.rb +8 -8
  56. data/lib/purecloudplatformclientv2/api/organization_api.rb +4 -4
  57. data/lib/purecloudplatformclientv2/api/organization_authorization_api.rb +23 -23
  58. data/lib/purecloudplatformclientv2/api/outbound_api.rb +98 -98
  59. data/lib/purecloudplatformclientv2/api/presence_api.rb +9 -9
  60. data/lib/purecloudplatformclientv2/api/quality_api.rb +450 -52
  61. data/lib/purecloudplatformclientv2/api/recording_api.rb +37 -37
  62. data/lib/purecloudplatformclientv2/api/response_management_api.rb +11 -11
  63. data/lib/purecloudplatformclientv2/api/routing_api.rb +173 -70
  64. data/lib/purecloudplatformclientv2/api/scripts_api.rb +11 -11
  65. data/lib/purecloudplatformclientv2/api/search_api.rb +16 -16
  66. data/lib/purecloudplatformclientv2/api/stations_api.rb +5 -5
  67. data/lib/purecloudplatformclientv2/api/suggest_api.rb +4 -4
  68. data/lib/purecloudplatformclientv2/api/telephony_providers_edge_api.rb +125 -125
  69. data/lib/purecloudplatformclientv2/api/tokens_api.rb +2 -2
  70. data/lib/purecloudplatformclientv2/api/user_recordings_api.rb +6 -6
  71. data/lib/purecloudplatformclientv2/api/users_api.rb +61 -61
  72. data/lib/purecloudplatformclientv2/api/utilities_api.rb +58 -3
  73. data/lib/purecloudplatformclientv2/api/voicemail_api.rb +24 -24
  74. data/lib/purecloudplatformclientv2/api/web_chat_api.rb +8 -8
  75. data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +64 -64
  76. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  77. data/lib/purecloudplatformclientv2/configuration.rb +9 -2
  78. data/lib/purecloudplatformclientv2/models/aggregate_metric_data.rb +2 -2
  79. data/lib/purecloudplatformclientv2/models/analytics_query_predicate.rb +2 -2
  80. data/lib/purecloudplatformclientv2/models/analytics_session.rb +1 -1
  81. data/lib/purecloudplatformclientv2/models/condition.rb +6 -6
  82. data/lib/purecloudplatformclientv2/models/contact_column_to_data_action_field_mapping.rb +176 -0
  83. data/lib/purecloudplatformclientv2/models/conversation_properties.rb +410 -0
  84. data/lib/purecloudplatformclientv2/models/data_action_condition_predicate.rb +176 -0
  85. data/lib/purecloudplatformclientv2/models/observation_metric_data.rb +2 -2
  86. data/lib/purecloudplatformclientv2/models/org_user.rb +27 -1
  87. data/lib/purecloudplatformclientv2/models/scorable_survey.rb +343 -0
  88. data/lib/purecloudplatformclientv2/models/survey.rb +444 -0
  89. data/lib/purecloudplatformclientv2/models/survey_form_and_scoring_set.rb +226 -0
  90. data/lib/purecloudplatformclientv2/models/survey_question_group_score.rb +303 -0
  91. data/lib/purecloudplatformclientv2/models/survey_question_score.rb +351 -0
  92. data/lib/purecloudplatformclientv2/models/survey_scoring_set.rb +253 -0
  93. data/lib/purecloudplatformclientv2/models/token.rb +207 -0
  94. data/lib/purecloudplatformclientv2/models/trust_user.rb +27 -1
  95. data/lib/purecloudplatformclientv2/models/user.rb +27 -1
  96. data/lib/purecloudplatformclientv2/models/user_me.rb +27 -1
  97. data/lib/purecloudplatformclientv2/models/view_filter.rb +354 -4
  98. data/lib/purecloudplatformclientv2/version.rb +1 -1
  99. metadata +22 -2
@@ -0,0 +1,444 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@genesys.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class Survey
21
+ # The globally unique identifier for the object.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :name
25
+
26
+ attr_accessor :conversation
27
+
28
+ # Survey form used for this survey.
29
+ attr_accessor :survey_form
30
+
31
+ attr_accessor :agent
32
+
33
+ attr_accessor :status
34
+
35
+ attr_accessor :queue
36
+
37
+ attr_accessor :answers
38
+
39
+ # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
40
+ attr_accessor :completed_date
41
+
42
+ # The URI for this object
43
+ attr_accessor :self_uri
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+
49
+ :'id' => :'id',
50
+
51
+ :'name' => :'name',
52
+
53
+ :'conversation' => :'conversation',
54
+
55
+ :'survey_form' => :'surveyForm',
56
+
57
+ :'agent' => :'agent',
58
+
59
+ :'status' => :'status',
60
+
61
+ :'queue' => :'queue',
62
+
63
+ :'answers' => :'answers',
64
+
65
+ :'completed_date' => :'completedDate',
66
+
67
+ :'self_uri' => :'selfUri'
68
+
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+
76
+ :'id' => :'String',
77
+
78
+ :'name' => :'String',
79
+
80
+ :'conversation' => :'Conversation',
81
+
82
+ :'survey_form' => :'SurveyForm',
83
+
84
+ :'agent' => :'UriReference',
85
+
86
+ :'status' => :'String',
87
+
88
+ :'queue' => :'QueueReference',
89
+
90
+ :'answers' => :'SurveyScoringSet',
91
+
92
+ :'completed_date' => :'DateTime',
93
+
94
+ :'self_uri' => :'String'
95
+
96
+ }
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ return unless attributes.is_a?(Hash)
103
+
104
+ # convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
106
+
107
+
108
+ if attributes.has_key?(:'id')
109
+
110
+
111
+ self.id = attributes[:'id']
112
+
113
+
114
+ end
115
+
116
+
117
+ if attributes.has_key?(:'name')
118
+
119
+
120
+ self.name = attributes[:'name']
121
+
122
+
123
+ end
124
+
125
+
126
+ if attributes.has_key?(:'conversation')
127
+
128
+
129
+ self.conversation = attributes[:'conversation']
130
+
131
+
132
+ end
133
+
134
+
135
+ if attributes.has_key?(:'surveyForm')
136
+
137
+
138
+ self.survey_form = attributes[:'surveyForm']
139
+
140
+
141
+ end
142
+
143
+
144
+ if attributes.has_key?(:'agent')
145
+
146
+
147
+ self.agent = attributes[:'agent']
148
+
149
+
150
+ end
151
+
152
+
153
+ if attributes.has_key?(:'status')
154
+
155
+
156
+ self.status = attributes[:'status']
157
+
158
+
159
+ end
160
+
161
+
162
+ if attributes.has_key?(:'queue')
163
+
164
+
165
+ self.queue = attributes[:'queue']
166
+
167
+
168
+ end
169
+
170
+
171
+ if attributes.has_key?(:'answers')
172
+
173
+
174
+ self.answers = attributes[:'answers']
175
+
176
+
177
+ end
178
+
179
+
180
+ if attributes.has_key?(:'completedDate')
181
+
182
+
183
+ self.completed_date = attributes[:'completedDate']
184
+
185
+
186
+ end
187
+
188
+
189
+ if attributes.has_key?(:'selfUri')
190
+
191
+
192
+ self.self_uri = attributes[:'selfUri']
193
+
194
+
195
+ end
196
+
197
+
198
+ end
199
+
200
+ # Show invalid properties with the reasons. Usually used together with valid?
201
+ # @return Array for valid properies with the reasons
202
+ def list_invalid_properties
203
+ invalid_properties = Array.new
204
+
205
+
206
+ return invalid_properties
207
+ end
208
+
209
+ # Check to see if the all the properties in the model are valid
210
+ # @return true if the model is valid
211
+ def valid?
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ allowed_values = ["Pending", "Sent", "InProgress", "Finished", "OptOut", "Error", "Expired"]
236
+ if @status && !allowed_values.include?(@status)
237
+ return false
238
+ end
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ end
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+ # Custom attribute writer method checking allowed values (enum).
288
+ # @param [Object] status Object to be assigned
289
+ def status=(status)
290
+ allowed_values = ["Pending", "Sent", "InProgress", "Finished", "OptOut", "Error", "Expired"]
291
+ if status && !allowed_values.include?(status)
292
+ fail ArgumentError, "invalid value for 'status', must be one of #{allowed_values}."
293
+ end
294
+ @status = status
295
+ end
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+ # Checks equality by comparing each attribute.
321
+ # @param [Object] Object to be compared
322
+ def ==(o)
323
+ return true if self.equal?(o)
324
+ self.class == o.class &&
325
+ id == o.id &&
326
+ name == o.name &&
327
+ conversation == o.conversation &&
328
+ survey_form == o.survey_form &&
329
+ agent == o.agent &&
330
+ status == o.status &&
331
+ queue == o.queue &&
332
+ answers == o.answers &&
333
+ completed_date == o.completed_date &&
334
+ self_uri == o.self_uri
335
+ end
336
+
337
+ # @see the `==` method
338
+ # @param [Object] Object to be compared
339
+ def eql?(o)
340
+ self == o
341
+ end
342
+
343
+ # Calculates hash code according to all attributes.
344
+ # @return [Fixnum] Hash code
345
+ def hash
346
+ [id, name, conversation, survey_form, agent, status, queue, answers, completed_date, self_uri].hash
347
+ end
348
+
349
+ # build the object from hash
350
+ def build_from_hash(attributes)
351
+ return nil unless attributes.is_a?(Hash)
352
+ self.class.swagger_types.each_pair do |key, type|
353
+ if type =~ /^Array<(.*)>/i
354
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
355
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
356
+ else
357
+ #TODO show warning in debug mode
358
+ end
359
+ elsif !attributes[self.class.attribute_map[key]].nil?
360
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
361
+ else
362
+ # data not found in attributes(hash), not an issue as the data can be optional
363
+ end
364
+ end
365
+
366
+ self
367
+ end
368
+
369
+ def _deserialize(type, value)
370
+ case type.to_sym
371
+ when :DateTime
372
+ DateTime.parse(value)
373
+ when :Date
374
+ Date.parse(value)
375
+ when :String
376
+ value.to_s
377
+ when :Integer
378
+ value.to_i
379
+ when :Float
380
+ value.to_f
381
+ when :BOOLEAN
382
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
383
+ true
384
+ else
385
+ false
386
+ end
387
+ when :Object
388
+ # generic object (usually a Hash), return directly
389
+ value
390
+ when /\AArray<(?<inner_type>.+)>\z/
391
+ inner_type = Regexp.last_match[:inner_type]
392
+ value.map { |v| _deserialize(inner_type, v) }
393
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
394
+ k_type = Regexp.last_match[:k_type]
395
+ v_type = Regexp.last_match[:v_type]
396
+ {}.tap do |hash|
397
+ value.each do |k, v|
398
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
399
+ end
400
+ end
401
+ else # model
402
+ _model = Object.const_get("PureCloud").const_get(type).new
403
+ _model.build_from_hash(value)
404
+ end
405
+ end
406
+
407
+ def to_s
408
+ to_hash.to_s
409
+ end
410
+
411
+ # to_body is an alias to to_body (backward compatibility))
412
+ def to_body
413
+ to_hash
414
+ end
415
+
416
+ # return the object in the form of hash
417
+ def to_hash
418
+ hash = {}
419
+ self.class.attribute_map.each_pair do |attr, param|
420
+ value = self.send(attr)
421
+ next if value.nil?
422
+ hash[param] = _to_hash(value)
423
+ end
424
+ hash
425
+ end
426
+
427
+ # Method to output non-array value in the form of hash
428
+ # For object, use to_hash. Otherwise, just return the value
429
+ def _to_hash(value)
430
+ if value.is_a?(Array)
431
+ value.compact.map{ |v| _to_hash(v) }
432
+ elsif value.is_a?(Hash)
433
+ {}.tap do |hash|
434
+ value.each { |k, v| hash[k] = _to_hash(v) }
435
+ end
436
+ elsif value.respond_to? :to_hash
437
+ value.to_hash
438
+ else
439
+ value
440
+ end
441
+ end
442
+
443
+ end
444
+ end
@@ -0,0 +1,226 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@genesys.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class SurveyFormAndScoringSet
21
+ attr_accessor :survey_form
22
+
23
+ attr_accessor :answers
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'survey_form' => :'surveyForm',
30
+
31
+ :'answers' => :'answers'
32
+
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+
40
+ :'survey_form' => :'SurveyForm',
41
+
42
+ :'answers' => :'SurveyScoringSet'
43
+
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+
56
+ if attributes.has_key?(:'surveyForm')
57
+
58
+
59
+ self.survey_form = attributes[:'surveyForm']
60
+
61
+
62
+ end
63
+
64
+
65
+ if attributes.has_key?(:'answers')
66
+
67
+
68
+ self.answers = attributes[:'answers']
69
+
70
+
71
+ end
72
+
73
+
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properies with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+
81
+
82
+ return invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ end
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
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
+ survey_form == o.survey_form &&
116
+ answers == o.answers
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Fixnum] Hash code
127
+ def hash
128
+ [survey_form, answers].hash
129
+ end
130
+
131
+ # build the object from hash
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /^Array<(.*)>/i
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
138
+ else
139
+ #TODO show warning in debug mode
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ else
144
+ # data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ DateTime.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ _model = Object.const_get("PureCloud").const_get(type).new
185
+ _model.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_body (backward compatibility))
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # return the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ next if value.nil?
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Method to output non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map{ |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+ end