freeclimb 2.0.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +100 -0
  3. data/README.md +11 -4
  4. data/docs/GetDigits.md +3 -1
  5. data/docs/GetDigitsAllOf.md +3 -1
  6. data/docs/GetSpeech.md +2 -2
  7. data/docs/GetSpeechAllOf.md +2 -2
  8. data/docs/Hangup.md +17 -0
  9. data/docs/HangupAllOf.md +17 -0
  10. data/docs/MakeCallRequest.md +7 -3
  11. data/docs/MessageResult.md +1 -1
  12. data/docs/MessageResultAllOf.md +1 -1
  13. data/docs/OutDial.md +3 -1
  14. data/docs/OutDialAllOf.md +3 -1
  15. data/docs/Play.md +3 -1
  16. data/docs/PlayAllOf.md +3 -1
  17. data/docs/RecordUtterance.md +3 -1
  18. data/docs/RecordUtteranceAllOf.md +3 -1
  19. data/docs/Redirect.md +1 -1
  20. data/docs/RedirectAllOf.md +1 -1
  21. data/docs/Reject.md +17 -0
  22. data/docs/RejectAllOf.md +17 -0
  23. data/docs/Say.md +2 -2
  24. data/docs/SayAllOf.md +2 -2
  25. data/docs/SendDigits.md +3 -1
  26. data/docs/SendDigitsAllOf.md +3 -1
  27. data/freeclimb-2.0.3.gem +0 -0
  28. data/freeclimb-2.1.0.gem +0 -0
  29. data/freeclimb-2.1.1.gem +0 -0
  30. data/lib/freeclimb.rb +4 -0
  31. data/lib/freeclimb/api_client.rb +1 -1
  32. data/lib/freeclimb/models/get_digits.rb +14 -4
  33. data/lib/freeclimb/models/get_digits_all_of.rb +14 -4
  34. data/lib/freeclimb/models/get_speech.rb +8 -8
  35. data/lib/freeclimb/models/get_speech_all_of.rb +8 -8
  36. data/lib/freeclimb/models/hangup.rb +220 -0
  37. data/lib/freeclimb/models/hangup_all_of.rb +207 -0
  38. data/lib/freeclimb/models/make_call_request.rb +26 -11
  39. data/lib/freeclimb/models/message_result.rb +3 -3
  40. data/lib/freeclimb/models/message_result_all_of.rb +3 -3
  41. data/lib/freeclimb/models/out_dial.rb +14 -4
  42. data/lib/freeclimb/models/out_dial_all_of.rb +14 -4
  43. data/lib/freeclimb/models/play.rb +14 -4
  44. data/lib/freeclimb/models/play_all_of.rb +14 -4
  45. data/lib/freeclimb/models/record_utterance.rb +14 -4
  46. data/lib/freeclimb/models/record_utterance_all_of.rb +14 -4
  47. data/lib/freeclimb/models/redirect.rb +7 -2
  48. data/lib/freeclimb/models/redirect_all_of.rb +6 -1
  49. data/lib/freeclimb/models/reject.rb +220 -0
  50. data/lib/freeclimb/models/reject_all_of.rb +207 -0
  51. data/lib/freeclimb/models/say.rb +8 -8
  52. data/lib/freeclimb/models/say_all_of.rb +8 -8
  53. data/lib/freeclimb/models/send_digits.rb +14 -4
  54. data/lib/freeclimb/models/send_digits_all_of.rb +14 -4
  55. data/lib/freeclimb/version.rb +1 -1
  56. data/spec/models/hangup_spec.rb +41 -0
  57. data/spec/models/reject_spec.rb +41 -0
  58. metadata +18 -2
@@ -24,12 +24,16 @@ module Freeclimb
24
24
  # ID of the Conference the audio should be rendered to. If this is not specified, the audio is by default rendered to the caller associated with the call leg that corresponds to the current PerCL execution context. The call leg associated with this command must be in the specified Conference or the command will return an error.
25
25
  attr_accessor :conference_id
26
26
 
27
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
28
+ attr_accessor :privacy_mode
29
+
27
30
  # Attribute mapping from ruby-style variable name to JSON key.
28
31
  def self.attribute_map
29
32
  {
30
33
  :'file' => :'file',
31
34
  :'loop' => :'loop',
32
- :'conference_id' => :'conferenceId'
35
+ :'conference_id' => :'conferenceId',
36
+ :'privacy_mode' => :'privacyMode'
33
37
  }
34
38
  end
35
39
 
@@ -38,7 +42,8 @@ module Freeclimb
38
42
  {
39
43
  :'file' => :'String',
40
44
  :'loop' => :'Integer',
41
- :'conference_id' => :'String'
45
+ :'conference_id' => :'String',
46
+ :'privacy_mode' => :'Boolean'
42
47
  }
43
48
  end
44
49
 
@@ -85,6 +90,10 @@ module Freeclimb
85
90
  if attributes.key?(:'conference_id')
86
91
  self.conference_id = attributes[:'conference_id']
87
92
  end
93
+
94
+ if attributes.key?(:'privacy_mode')
95
+ self.privacy_mode = attributes[:'privacy_mode']
96
+ end
88
97
  end
89
98
 
90
99
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -112,7 +121,8 @@ module Freeclimb
112
121
  self.class == o.class &&
113
122
  file == o.file &&
114
123
  loop == o.loop &&
115
- conference_id == o.conference_id && super(o)
124
+ conference_id == o.conference_id &&
125
+ privacy_mode == o.privacy_mode && super(o)
116
126
  end
117
127
 
118
128
  # @see the `==` method
@@ -124,7 +134,7 @@ module Freeclimb
124
134
  # Calculates hash code according to all attributes.
125
135
  # @return [Integer] Hash code
126
136
  def hash
127
- [file, loop, conference_id].hash
137
+ [file, loop, conference_id, privacy_mode].hash
128
138
  end
129
139
 
130
140
  # Builds the object from hash
@@ -23,12 +23,16 @@ module Freeclimb
23
23
  # ID of the Conference the audio should be rendered to. If this is not specified, the audio is by default rendered to the caller associated with the call leg that corresponds to the current PerCL execution context. The call leg associated with this command must be in the specified Conference or the command will return an error.
24
24
  attr_accessor :conference_id
25
25
 
26
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
27
+ attr_accessor :privacy_mode
28
+
26
29
  # Attribute mapping from ruby-style variable name to JSON key.
27
30
  def self.attribute_map
28
31
  {
29
32
  :'file' => :'file',
30
33
  :'loop' => :'loop',
31
- :'conference_id' => :'conferenceId'
34
+ :'conference_id' => :'conferenceId',
35
+ :'privacy_mode' => :'privacyMode'
32
36
  }
33
37
  end
34
38
 
@@ -37,7 +41,8 @@ module Freeclimb
37
41
  {
38
42
  :'file' => :'String',
39
43
  :'loop' => :'Integer',
40
- :'conference_id' => :'String'
44
+ :'conference_id' => :'String',
45
+ :'privacy_mode' => :'Boolean'
41
46
  }
42
47
  end
43
48
 
@@ -73,6 +78,10 @@ module Freeclimb
73
78
  if attributes.key?(:'conference_id')
74
79
  self.conference_id = attributes[:'conference_id']
75
80
  end
81
+
82
+ if attributes.key?(:'privacy_mode')
83
+ self.privacy_mode = attributes[:'privacy_mode']
84
+ end
76
85
  end
77
86
 
78
87
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -100,7 +109,8 @@ module Freeclimb
100
109
  self.class == o.class &&
101
110
  file == o.file &&
102
111
  loop == o.loop &&
103
- conference_id == o.conference_id
112
+ conference_id == o.conference_id &&
113
+ privacy_mode == o.privacy_mode
104
114
  end
105
115
 
106
116
  # @see the `==` method
@@ -112,7 +122,7 @@ module Freeclimb
112
122
  # Calculates hash code according to all attributes.
113
123
  # @return [Integer] Hash code
114
124
  def hash
115
- [file, loop, conference_id].hash
125
+ [file, loop, conference_id, privacy_mode].hash
116
126
  end
117
127
 
118
128
  # Builds the object from hash
@@ -33,6 +33,9 @@ module Freeclimb
33
33
  # If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated.
34
34
  attr_accessor :auto_start
35
35
 
36
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
37
+ attr_accessor :privacy_mode
38
+
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
37
40
  def self.attribute_map
38
41
  {
@@ -41,7 +44,8 @@ module Freeclimb
41
44
  :'finish_on_key' => :'finishOnKey',
42
45
  :'max_length_sec' => :'maxLengthSec',
43
46
  :'play_beep' => :'playBeep',
44
- :'auto_start' => :'autoStart'
47
+ :'auto_start' => :'autoStart',
48
+ :'privacy_mode' => :'privacyMode'
45
49
  }
46
50
  end
47
51
 
@@ -53,7 +57,8 @@ module Freeclimb
53
57
  :'finish_on_key' => :'String',
54
58
  :'max_length_sec' => :'Integer',
55
59
  :'play_beep' => :'Boolean',
56
- :'auto_start' => :'Boolean'
60
+ :'auto_start' => :'Boolean',
61
+ :'privacy_mode' => :'Boolean'
57
62
  }
58
63
  end
59
64
 
@@ -112,6 +117,10 @@ module Freeclimb
112
117
  if attributes.key?(:'auto_start')
113
118
  self.auto_start = attributes[:'auto_start']
114
119
  end
120
+
121
+ if attributes.key?(:'privacy_mode')
122
+ self.privacy_mode = attributes[:'privacy_mode']
123
+ end
115
124
  end
116
125
 
117
126
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -142,7 +151,8 @@ module Freeclimb
142
151
  finish_on_key == o.finish_on_key &&
143
152
  max_length_sec == o.max_length_sec &&
144
153
  play_beep == o.play_beep &&
145
- auto_start == o.auto_start && super(o)
154
+ auto_start == o.auto_start &&
155
+ privacy_mode == o.privacy_mode && super(o)
146
156
  end
147
157
 
148
158
  # @see the `==` method
@@ -154,7 +164,7 @@ module Freeclimb
154
164
  # Calculates hash code according to all attributes.
155
165
  # @return [Integer] Hash code
156
166
  def hash
157
- [action_url, silence_timeout_ms, finish_on_key, max_length_sec, play_beep, auto_start].hash
167
+ [action_url, silence_timeout_ms, finish_on_key, max_length_sec, play_beep, auto_start, privacy_mode].hash
158
168
  end
159
169
 
160
170
  # Builds the object from hash
@@ -32,6 +32,9 @@ module Freeclimb
32
32
  # If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated.
33
33
  attr_accessor :auto_start
34
34
 
35
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
36
+ attr_accessor :privacy_mode
37
+
35
38
  # Attribute mapping from ruby-style variable name to JSON key.
36
39
  def self.attribute_map
37
40
  {
@@ -40,7 +43,8 @@ module Freeclimb
40
43
  :'finish_on_key' => :'finishOnKey',
41
44
  :'max_length_sec' => :'maxLengthSec',
42
45
  :'play_beep' => :'playBeep',
43
- :'auto_start' => :'autoStart'
46
+ :'auto_start' => :'autoStart',
47
+ :'privacy_mode' => :'privacyMode'
44
48
  }
45
49
  end
46
50
 
@@ -52,7 +56,8 @@ module Freeclimb
52
56
  :'finish_on_key' => :'String',
53
57
  :'max_length_sec' => :'Integer',
54
58
  :'play_beep' => :'Boolean',
55
- :'auto_start' => :'Boolean'
59
+ :'auto_start' => :'Boolean',
60
+ :'privacy_mode' => :'Boolean'
56
61
  }
57
62
  end
58
63
 
@@ -100,6 +105,10 @@ module Freeclimb
100
105
  if attributes.key?(:'auto_start')
101
106
  self.auto_start = attributes[:'auto_start']
102
107
  end
108
+
109
+ if attributes.key?(:'privacy_mode')
110
+ self.privacy_mode = attributes[:'privacy_mode']
111
+ end
103
112
  end
104
113
 
105
114
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -130,7 +139,8 @@ module Freeclimb
130
139
  finish_on_key == o.finish_on_key &&
131
140
  max_length_sec == o.max_length_sec &&
132
141
  play_beep == o.play_beep &&
133
- auto_start == o.auto_start
142
+ auto_start == o.auto_start &&
143
+ privacy_mode == o.privacy_mode
134
144
  end
135
145
 
136
146
  # @see the `==` method
@@ -142,7 +152,7 @@ module Freeclimb
142
152
  # Calculates hash code according to all attributes.
143
153
  # @return [Integer] Hash code
144
154
  def hash
145
- [action_url, silence_timeout_ms, finish_on_key, max_length_sec, play_beep, auto_start].hash
155
+ [action_url, silence_timeout_ms, finish_on_key, max_length_sec, play_beep, auto_start, privacy_mode].hash
146
156
  end
147
157
 
148
158
  # Builds the object from hash
@@ -13,9 +13,9 @@ OpenAPI Generator version: 4.3.0-SNAPSHOT
13
13
  require 'date'
14
14
 
15
15
  module Freeclimb
16
- # The `Reject` command blocks an incoming Call. Using `Reject` is the only way to prevent FreeClimb from answering a Call. Any other response will result in an answered Call and your account will be billed.
16
+ # The `Redirect` command transfers control of a Call to the PerCL at a different URL. `Redirect` is a terminal command, so any actions following it are never executed. The maximum number of redirections allowed during the life time of a Call is 256. This is intended to prevent a Call from possibly looping infinitely due to errors in PerCL being generated.
17
17
  class Redirect < PerclCommand
18
- # Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application.
18
+ # URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call.
19
19
  attr_accessor :action_url
20
20
 
21
21
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -73,12 +73,17 @@ module Freeclimb
73
73
  # @return Array for valid properties with the reasons
74
74
  def list_invalid_properties
75
75
  invalid_properties = super
76
+ if @action_url.nil?
77
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
78
+ end
79
+
76
80
  invalid_properties
77
81
  end
78
82
 
79
83
  # Check to see if the all the properties in the model are valid
80
84
  # @return true if the model is valid
81
85
  def valid?
86
+ return false if @action_url.nil?
82
87
  true && super
83
88
  end
84
89
 
@@ -14,7 +14,7 @@ require 'date'
14
14
 
15
15
  module Freeclimb
16
16
  class RedirectAllOf
17
- # Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application.
17
+ # URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call.
18
18
  attr_accessor :action_url
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -61,12 +61,17 @@ module Freeclimb
61
61
  # @return Array for valid properties with the reasons
62
62
  def list_invalid_properties
63
63
  invalid_properties = Array.new
64
+ if @action_url.nil?
65
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
66
+ end
67
+
64
68
  invalid_properties
65
69
  end
66
70
 
67
71
  # Check to see if the all the properties in the model are valid
68
72
  # @return true if the model is valid
69
73
  def valid?
74
+ return false if @action_url.nil?
70
75
  true
71
76
  end
72
77
 
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #FreeClimb API
3
+
4
+ #FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Freeclimb
16
+ # The `Reject` command blocks an incoming Call. Using `Reject` is the only way to prevent FreeClimb from answering a Call. Any other response will result in an answered Call and your account will be billed.
17
+ class Reject < PerclCommand
18
+ # Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application.
19
+ attr_accessor :reason
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'reason' => :'reason'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'reason' => :'String'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # List of class defined in allOf (OpenAPI v3)
42
+ def self.openapi_all_of
43
+ [
44
+ :'PerclCommand',
45
+ :'RejectAllOf'
46
+ ]
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::Reject` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::Reject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ # call parent's initialize
65
+ super(attributes)
66
+
67
+ if attributes.key?(:'reason')
68
+ self.reason = attributes[:'reason']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = super
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true && super
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ reason == o.reason && super(o)
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [reason].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ new.build_from_hash(attributes)
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ super(attributes)
118
+ self.class.openapi_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ Freeclimb.const_get(type).build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = super
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end