purecloudplatformclientv2 39.1.0 → 40.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/AuthorizationApi.md +80 -0
  4. data/docs/CreateQueueRequest.md +1 -1
  5. data/docs/DomainOrganizationRole.md +1 -1
  6. data/docs/DomainOrganizationRoleCreate.md +1 -1
  7. data/docs/DomainOrganizationRoleUpdate.md +1 -1
  8. data/docs/ExternalContactsApi.md +3 -3
  9. data/docs/JsonNode.md +4 -4
  10. data/docs/QualityApi.md +1 -1
  11. data/docs/QueueRequest.md +37 -0
  12. data/docs/RoutingApi.md +5 -5
  13. data/docs/SubjectDivisionGrants.md +17 -0
  14. data/docs/SubjectDivisionGrantsEntityListing.md +22 -0
  15. data/docs/TimeZone.md +2 -2
  16. data/docs/UserQueue.md +0 -1
  17. data/docs/WritableDivision.md +15 -0
  18. data/lib/purecloudplatformclientv2.rb +4 -0
  19. data/lib/purecloudplatformclientv2/api/authorization_api.rb +119 -0
  20. data/lib/purecloudplatformclientv2/api/external_contacts_api.rb +2 -2
  21. data/lib/purecloudplatformclientv2/api/routing_api.rb +2 -2
  22. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  23. data/lib/purecloudplatformclientv2/models/create_queue_request.rb +1 -1
  24. data/lib/purecloudplatformclientv2/models/domain_organization_role.rb +12 -12
  25. data/lib/purecloudplatformclientv2/models/domain_organization_role_create.rb +12 -12
  26. data/lib/purecloudplatformclientv2/models/domain_organization_role_update.rb +12 -12
  27. data/lib/purecloudplatformclientv2/models/forecast_time_series_result.rb +2 -2
  28. data/lib/purecloudplatformclientv2/models/history_listing.rb +2 -2
  29. data/lib/purecloudplatformclientv2/models/json_node.rb +76 -76
  30. data/lib/purecloudplatformclientv2/models/operation.rb +2 -2
  31. data/lib/purecloudplatformclientv2/models/queue_request.rb +870 -0
  32. data/lib/purecloudplatformclientv2/models/subject_division_grants.rb +319 -0
  33. data/lib/purecloudplatformclientv2/models/subject_division_grants_entity_listing.rb +428 -0
  34. data/lib/purecloudplatformclientv2/models/time_zone.rb +24 -24
  35. data/lib/purecloudplatformclientv2/models/user_queue.rb +1 -27
  36. data/lib/purecloudplatformclientv2/models/writable_division.rb +253 -0
  37. data/lib/purecloudplatformclientv2/version.rb +1 -1
  38. metadata +10 -2
@@ -227,7 +227,7 @@ module PureCloud
227
227
 
228
228
 
229
229
 
230
- allowed_values = ["CHECKIN", "DEBUG", "DELETE", "HISTORY", "PUBLISH", "STATE_CHANGE", "VALIDATE"]
230
+ allowed_values = ["CREATE", "CHECKIN", "DEBUG", "DELETE", "HISTORY", "PUBLISH", "STATE_CHANGE", "UPDATE", "VALIDATE"]
231
231
  if @action_name && !allowed_values.include?(@action_name)
232
232
  return false
233
233
  end
@@ -285,7 +285,7 @@ module PureCloud
285
285
  # Custom attribute writer method checking allowed values (enum).
286
286
  # @param [Object] action_name Object to be assigned
287
287
  def action_name=(action_name)
288
- allowed_values = ["CHECKIN", "DEBUG", "DELETE", "HISTORY", "PUBLISH", "STATE_CHANGE", "VALIDATE"]
288
+ allowed_values = ["CREATE", "CHECKIN", "DEBUG", "DELETE", "HISTORY", "PUBLISH", "STATE_CHANGE", "UPDATE", "VALIDATE"]
289
289
  if action_name && !allowed_values.include?(action_name)
290
290
  fail ArgumentError, "invalid value for 'action_name', must be one of #{allowed_values}."
291
291
  end
@@ -0,0 +1,870 @@
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 QueueRequest
21
+ # The globally unique identifier for the object.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :name
25
+
26
+ # The division to which this entity belongs.
27
+ attr_accessor :division
28
+
29
+ # The queue description.
30
+ attr_accessor :description
31
+
32
+ # The current version of the queue.
33
+ attr_accessor :version
34
+
35
+ # The date the queue was created. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
36
+ attr_accessor :date_created
37
+
38
+ # The date of the last modification to the queue. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
39
+ attr_accessor :date_modified
40
+
41
+ # The ID of the user that last modified the queue.
42
+ attr_accessor :modified_by
43
+
44
+ # The ID of the user that created the queue.
45
+ attr_accessor :created_by
46
+
47
+ # Indicates if the queue is active, inactive, or deleted.
48
+ attr_accessor :state
49
+
50
+ # The application that last modified the queue.
51
+ attr_accessor :modified_by_app
52
+
53
+ # The application that created the queue.
54
+ attr_accessor :created_by_app
55
+
56
+ # The media settings for the queue. Valid Key Values: CALL, CALLBACK, CHAT, EMAIL, SOCIAL_EXPRESSION
57
+ attr_accessor :media_settings
58
+
59
+ # The bulls-eye settings for the queue.
60
+ attr_accessor :bullseye
61
+
62
+ # The ACW settings for the queue.
63
+ attr_accessor :acw_settings
64
+
65
+ # The skill evaluation method to use when routing conversations.
66
+ attr_accessor :skill_evaluation_method
67
+
68
+ # The in-queue flow to use for conversations waiting in queue.
69
+ attr_accessor :queue_flow
70
+
71
+ # The prompt used for whisper on the queue, if configured.
72
+ attr_accessor :whisper_prompt
73
+
74
+ # Specifies whether the configured whisper should play for all ACD calls, or only for those which are auto-answered.
75
+ attr_accessor :auto_answer_only
76
+
77
+ # The name to use for caller identification for outbound calls from this queue.
78
+ attr_accessor :calling_party_name
79
+
80
+ # The phone number to use for caller identification for outbound calls from this queue.
81
+ attr_accessor :calling_party_number
82
+
83
+ # The default script Ids for the communication types.
84
+ attr_accessor :default_scripts
85
+
86
+ attr_accessor :outbound_email_address
87
+
88
+ attr_accessor :member_count
89
+
90
+ # The URI for this object
91
+ attr_accessor :self_uri
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+
97
+ :'id' => :'id',
98
+
99
+ :'name' => :'name',
100
+
101
+ :'division' => :'division',
102
+
103
+ :'description' => :'description',
104
+
105
+ :'version' => :'version',
106
+
107
+ :'date_created' => :'dateCreated',
108
+
109
+ :'date_modified' => :'dateModified',
110
+
111
+ :'modified_by' => :'modifiedBy',
112
+
113
+ :'created_by' => :'createdBy',
114
+
115
+ :'state' => :'state',
116
+
117
+ :'modified_by_app' => :'modifiedByApp',
118
+
119
+ :'created_by_app' => :'createdByApp',
120
+
121
+ :'media_settings' => :'mediaSettings',
122
+
123
+ :'bullseye' => :'bullseye',
124
+
125
+ :'acw_settings' => :'acwSettings',
126
+
127
+ :'skill_evaluation_method' => :'skillEvaluationMethod',
128
+
129
+ :'queue_flow' => :'queueFlow',
130
+
131
+ :'whisper_prompt' => :'whisperPrompt',
132
+
133
+ :'auto_answer_only' => :'autoAnswerOnly',
134
+
135
+ :'calling_party_name' => :'callingPartyName',
136
+
137
+ :'calling_party_number' => :'callingPartyNumber',
138
+
139
+ :'default_scripts' => :'defaultScripts',
140
+
141
+ :'outbound_email_address' => :'outboundEmailAddress',
142
+
143
+ :'member_count' => :'memberCount',
144
+
145
+ :'self_uri' => :'selfUri'
146
+
147
+ }
148
+ end
149
+
150
+ # Attribute type mapping.
151
+ def self.swagger_types
152
+ {
153
+
154
+ :'id' => :'String',
155
+
156
+ :'name' => :'String',
157
+
158
+ :'division' => :'WritableDivision',
159
+
160
+ :'description' => :'String',
161
+
162
+ :'version' => :'Integer',
163
+
164
+ :'date_created' => :'DateTime',
165
+
166
+ :'date_modified' => :'DateTime',
167
+
168
+ :'modified_by' => :'String',
169
+
170
+ :'created_by' => :'String',
171
+
172
+ :'state' => :'String',
173
+
174
+ :'modified_by_app' => :'String',
175
+
176
+ :'created_by_app' => :'String',
177
+
178
+ :'media_settings' => :'Hash<String, MediaSetting>',
179
+
180
+ :'bullseye' => :'Bullseye',
181
+
182
+ :'acw_settings' => :'AcwSettings',
183
+
184
+ :'skill_evaluation_method' => :'String',
185
+
186
+ :'queue_flow' => :'UriReference',
187
+
188
+ :'whisper_prompt' => :'UriReference',
189
+
190
+ :'auto_answer_only' => :'BOOLEAN',
191
+
192
+ :'calling_party_name' => :'String',
193
+
194
+ :'calling_party_number' => :'String',
195
+
196
+ :'default_scripts' => :'Hash<String, Script>',
197
+
198
+ :'outbound_email_address' => :'QueueEmailAddress',
199
+
200
+ :'member_count' => :'Integer',
201
+
202
+ :'self_uri' => :'String'
203
+
204
+ }
205
+ end
206
+
207
+ # Initializes the object
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ def initialize(attributes = {})
210
+ return unless attributes.is_a?(Hash)
211
+
212
+ # convert string to symbol for hash key
213
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
214
+
215
+
216
+ if attributes.has_key?(:'id')
217
+
218
+
219
+ self.id = attributes[:'id']
220
+
221
+
222
+ end
223
+
224
+
225
+ if attributes.has_key?(:'name')
226
+
227
+
228
+ self.name = attributes[:'name']
229
+
230
+
231
+ end
232
+
233
+
234
+ if attributes.has_key?(:'division')
235
+
236
+
237
+ self.division = attributes[:'division']
238
+
239
+
240
+ end
241
+
242
+
243
+ if attributes.has_key?(:'description')
244
+
245
+
246
+ self.description = attributes[:'description']
247
+
248
+
249
+ end
250
+
251
+
252
+ if attributes.has_key?(:'version')
253
+
254
+
255
+ self.version = attributes[:'version']
256
+
257
+
258
+ end
259
+
260
+
261
+ if attributes.has_key?(:'dateCreated')
262
+
263
+
264
+ self.date_created = attributes[:'dateCreated']
265
+
266
+
267
+ end
268
+
269
+
270
+ if attributes.has_key?(:'dateModified')
271
+
272
+
273
+ self.date_modified = attributes[:'dateModified']
274
+
275
+
276
+ end
277
+
278
+
279
+ if attributes.has_key?(:'modifiedBy')
280
+
281
+
282
+ self.modified_by = attributes[:'modifiedBy']
283
+
284
+
285
+ end
286
+
287
+
288
+ if attributes.has_key?(:'createdBy')
289
+
290
+
291
+ self.created_by = attributes[:'createdBy']
292
+
293
+
294
+ end
295
+
296
+
297
+ if attributes.has_key?(:'state')
298
+
299
+
300
+ self.state = attributes[:'state']
301
+
302
+
303
+ end
304
+
305
+
306
+ if attributes.has_key?(:'modifiedByApp')
307
+
308
+
309
+ self.modified_by_app = attributes[:'modifiedByApp']
310
+
311
+
312
+ end
313
+
314
+
315
+ if attributes.has_key?(:'createdByApp')
316
+
317
+
318
+ self.created_by_app = attributes[:'createdByApp']
319
+
320
+
321
+ end
322
+
323
+
324
+ if attributes.has_key?(:'mediaSettings')
325
+
326
+ if (value = attributes[:'mediaSettings']).is_a?(Array)
327
+ self.media_settings = value
328
+ end
329
+
330
+
331
+
332
+ end
333
+
334
+
335
+ if attributes.has_key?(:'bullseye')
336
+
337
+
338
+ self.bullseye = attributes[:'bullseye']
339
+
340
+
341
+ end
342
+
343
+
344
+ if attributes.has_key?(:'acwSettings')
345
+
346
+
347
+ self.acw_settings = attributes[:'acwSettings']
348
+
349
+
350
+ end
351
+
352
+
353
+ if attributes.has_key?(:'skillEvaluationMethod')
354
+
355
+
356
+ self.skill_evaluation_method = attributes[:'skillEvaluationMethod']
357
+
358
+
359
+ end
360
+
361
+
362
+ if attributes.has_key?(:'queueFlow')
363
+
364
+
365
+ self.queue_flow = attributes[:'queueFlow']
366
+
367
+
368
+ end
369
+
370
+
371
+ if attributes.has_key?(:'whisperPrompt')
372
+
373
+
374
+ self.whisper_prompt = attributes[:'whisperPrompt']
375
+
376
+
377
+ end
378
+
379
+
380
+ if attributes.has_key?(:'autoAnswerOnly')
381
+
382
+
383
+ self.auto_answer_only = attributes[:'autoAnswerOnly']
384
+
385
+
386
+ end
387
+
388
+
389
+ if attributes.has_key?(:'callingPartyName')
390
+
391
+
392
+ self.calling_party_name = attributes[:'callingPartyName']
393
+
394
+
395
+ end
396
+
397
+
398
+ if attributes.has_key?(:'callingPartyNumber')
399
+
400
+
401
+ self.calling_party_number = attributes[:'callingPartyNumber']
402
+
403
+
404
+ end
405
+
406
+
407
+ if attributes.has_key?(:'defaultScripts')
408
+
409
+ if (value = attributes[:'defaultScripts']).is_a?(Array)
410
+ self.default_scripts = value
411
+ end
412
+
413
+
414
+
415
+ end
416
+
417
+
418
+ if attributes.has_key?(:'outboundEmailAddress')
419
+
420
+
421
+ self.outbound_email_address = attributes[:'outboundEmailAddress']
422
+
423
+
424
+ end
425
+
426
+
427
+ if attributes.has_key?(:'memberCount')
428
+
429
+
430
+ self.member_count = attributes[:'memberCount']
431
+
432
+
433
+ end
434
+
435
+
436
+ if attributes.has_key?(:'selfUri')
437
+
438
+
439
+ self.self_uri = attributes[:'selfUri']
440
+
441
+
442
+ end
443
+
444
+
445
+ end
446
+
447
+ # Show invalid properties with the reasons. Usually used together with valid?
448
+ # @return Array for valid properies with the reasons
449
+ def list_invalid_properties
450
+ invalid_properties = Array.new
451
+
452
+
453
+ return invalid_properties
454
+ end
455
+
456
+ # Check to see if the all the properties in the model are valid
457
+ # @return true if the model is valid
458
+ def valid?
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+ allowed_values = ["active", "inactive", "deleted"]
499
+ if @state && !allowed_values.include?(@state)
500
+ return false
501
+ end
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+
514
+ if @media_settings.nil?
515
+ return false
516
+ end
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+ if @acw_settings.nil?
528
+ return false
529
+ end
530
+
531
+
532
+
533
+
534
+
535
+
536
+ if @skill_evaluation_method.nil?
537
+ return false
538
+ end
539
+
540
+
541
+
542
+ allowed_values = ["NONE", "BEST", "ALL"]
543
+ if @skill_evaluation_method && !allowed_values.include?(@skill_evaluation_method)
544
+ return false
545
+ end
546
+
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+ end
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+ # Custom attribute writer method checking allowed values (enum).
635
+ # @param [Object] state Object to be assigned
636
+ def state=(state)
637
+ allowed_values = ["active", "inactive", "deleted"]
638
+ if state && !allowed_values.include?(state)
639
+ fail ArgumentError, "invalid value for 'state', must be one of #{allowed_values}."
640
+ end
641
+ @state = state
642
+ end
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+ # Custom attribute writer method checking allowed values (enum).
674
+ # @param [Object] skill_evaluation_method Object to be assigned
675
+ def skill_evaluation_method=(skill_evaluation_method)
676
+ allowed_values = ["NONE", "BEST", "ALL"]
677
+ if skill_evaluation_method && !allowed_values.include?(skill_evaluation_method)
678
+ fail ArgumentError, "invalid value for 'skill_evaluation_method', must be one of #{allowed_values}."
679
+ end
680
+ @skill_evaluation_method = skill_evaluation_method
681
+ end
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+
727
+
728
+
729
+
730
+
731
+ # Checks equality by comparing each attribute.
732
+ # @param [Object] Object to be compared
733
+ def ==(o)
734
+ return true if self.equal?(o)
735
+ self.class == o.class &&
736
+ id == o.id &&
737
+ name == o.name &&
738
+ division == o.division &&
739
+ description == o.description &&
740
+ version == o.version &&
741
+ date_created == o.date_created &&
742
+ date_modified == o.date_modified &&
743
+ modified_by == o.modified_by &&
744
+ created_by == o.created_by &&
745
+ state == o.state &&
746
+ modified_by_app == o.modified_by_app &&
747
+ created_by_app == o.created_by_app &&
748
+ media_settings == o.media_settings &&
749
+ bullseye == o.bullseye &&
750
+ acw_settings == o.acw_settings &&
751
+ skill_evaluation_method == o.skill_evaluation_method &&
752
+ queue_flow == o.queue_flow &&
753
+ whisper_prompt == o.whisper_prompt &&
754
+ auto_answer_only == o.auto_answer_only &&
755
+ calling_party_name == o.calling_party_name &&
756
+ calling_party_number == o.calling_party_number &&
757
+ default_scripts == o.default_scripts &&
758
+ outbound_email_address == o.outbound_email_address &&
759
+ member_count == o.member_count &&
760
+ self_uri == o.self_uri
761
+ end
762
+
763
+ # @see the `==` method
764
+ # @param [Object] Object to be compared
765
+ def eql?(o)
766
+ self == o
767
+ end
768
+
769
+ # Calculates hash code according to all attributes.
770
+ # @return [Fixnum] Hash code
771
+ def hash
772
+ [id, name, division, description, version, date_created, date_modified, modified_by, created_by, state, modified_by_app, created_by_app, media_settings, bullseye, acw_settings, skill_evaluation_method, queue_flow, whisper_prompt, auto_answer_only, calling_party_name, calling_party_number, default_scripts, outbound_email_address, member_count, self_uri].hash
773
+ end
774
+
775
+ # build the object from hash
776
+ def build_from_hash(attributes)
777
+ return nil unless attributes.is_a?(Hash)
778
+ self.class.swagger_types.each_pair do |key, type|
779
+ if type =~ /^Array<(.*)>/i
780
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
781
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
782
+ else
783
+ #TODO show warning in debug mode
784
+ end
785
+ elsif !attributes[self.class.attribute_map[key]].nil?
786
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
787
+ else
788
+ # data not found in attributes(hash), not an issue as the data can be optional
789
+ end
790
+ end
791
+
792
+ self
793
+ end
794
+
795
+ def _deserialize(type, value)
796
+ case type.to_sym
797
+ when :DateTime
798
+ DateTime.parse(value)
799
+ when :Date
800
+ Date.parse(value)
801
+ when :String
802
+ value.to_s
803
+ when :Integer
804
+ value.to_i
805
+ when :Float
806
+ value.to_f
807
+ when :BOOLEAN
808
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
809
+ true
810
+ else
811
+ false
812
+ end
813
+ when :Object
814
+ # generic object (usually a Hash), return directly
815
+ value
816
+ when /\AArray<(?<inner_type>.+)>\z/
817
+ inner_type = Regexp.last_match[:inner_type]
818
+ value.map { |v| _deserialize(inner_type, v) }
819
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
820
+ k_type = Regexp.last_match[:k_type]
821
+ v_type = Regexp.last_match[:v_type]
822
+ {}.tap do |hash|
823
+ value.each do |k, v|
824
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
825
+ end
826
+ end
827
+ else # model
828
+ _model = Object.const_get("PureCloud").const_get(type).new
829
+ _model.build_from_hash(value)
830
+ end
831
+ end
832
+
833
+ def to_s
834
+ to_hash.to_s
835
+ end
836
+
837
+ # to_body is an alias to to_body (backward compatibility))
838
+ def to_body
839
+ to_hash
840
+ end
841
+
842
+ # return the object in the form of hash
843
+ def to_hash
844
+ hash = {}
845
+ self.class.attribute_map.each_pair do |attr, param|
846
+ value = self.send(attr)
847
+ next if value.nil?
848
+ hash[param] = _to_hash(value)
849
+ end
850
+ hash
851
+ end
852
+
853
+ # Method to output non-array value in the form of hash
854
+ # For object, use to_hash. Otherwise, just return the value
855
+ def _to_hash(value)
856
+ if value.is_a?(Array)
857
+ value.compact.map{ |v| _to_hash(v) }
858
+ elsif value.is_a?(Hash)
859
+ {}.tap do |hash|
860
+ value.each { |k, v| hash[k] = _to_hash(v) }
861
+ end
862
+ elsif value.respond_to? :to_hash
863
+ value.to_hash
864
+ else
865
+ value
866
+ end
867
+ end
868
+
869
+ end
870
+ end