freeclimb 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +64 -41
  4. data/docs/AccountRequest.md +4 -4
  5. data/docs/AccountResult.md +12 -12
  6. data/docs/AccountResultAllOf.md +8 -8
  7. data/docs/AddToConference.md +35 -0
  8. data/docs/AddToConferenceAllOf.md +35 -0
  9. data/docs/ApplicationList.md +9 -9
  10. data/docs/ApplicationListAllOf.md +2 -2
  11. data/docs/ApplicationRequest.md +9 -9
  12. data/docs/ApplicationResult.md +14 -14
  13. data/docs/ApplicationResultAllOf.md +10 -10
  14. data/docs/AvailableNumber.md +7 -7
  15. data/docs/AvailableNumberList.md +9 -9
  16. data/docs/AvailableNumberListAllOf.md +2 -2
  17. data/docs/BuyIncomingNumberRequest.md +5 -5
  18. data/docs/CallList.md +9 -9
  19. data/docs/CallListAllOf.md +2 -2
  20. data/docs/CallResult.md +20 -20
  21. data/docs/CallResultAllOf.md +16 -16
  22. data/docs/ConferenceList.md +9 -9
  23. data/docs/ConferenceListAllOf.md +2 -2
  24. data/docs/ConferenceParticipantList.md +9 -9
  25. data/docs/ConferenceParticipantListAllOf.md +2 -2
  26. data/docs/ConferenceParticipantResult.md +11 -11
  27. data/docs/ConferenceParticipantResultAllOf.md +7 -7
  28. data/docs/ConferenceResult.md +15 -15
  29. data/docs/ConferenceResultAllOf.md +11 -11
  30. data/docs/CreateConference.md +27 -0
  31. data/docs/CreateConferenceAllOf.md +27 -0
  32. data/docs/CreateConferenceRequest.md +7 -7
  33. data/docs/Dequeue.md +16 -0
  34. data/docs/DequeueMemberRequest.md +2 -2
  35. data/docs/Enqueue.md +23 -0
  36. data/docs/EnqueueAllOf.md +23 -0
  37. data/docs/FilterLogsRequest.md +3 -3
  38. data/docs/GetDigits.md +31 -0
  39. data/docs/GetDigitsAllOf.md +31 -0
  40. data/docs/GetSpeech.md +41 -0
  41. data/docs/GetSpeechAllOf.md +41 -0
  42. data/docs/IncomingNumberList.md +9 -9
  43. data/docs/IncomingNumberListAllOf.md +2 -2
  44. data/docs/IncomingNumberRequest.md +4 -4
  45. data/docs/IncomingNumberResult.md +14 -14
  46. data/docs/IncomingNumberResultAllOf.md +10 -10
  47. data/docs/LogList.md +9 -9
  48. data/docs/LogListAllOf.md +2 -2
  49. data/docs/LogResult.md +8 -8
  50. data/docs/MakeCallRequest.md +10 -10
  51. data/docs/MessageRequest.md +11 -11
  52. data/docs/MessageRequestAllOf.md +7 -7
  53. data/docs/MessageResult.md +13 -13
  54. data/docs/MessageResultAllOf.md +9 -9
  55. data/docs/MessagesList.md +9 -9
  56. data/docs/MessagesListAllOf.md +2 -2
  57. data/docs/MutableResourceModel.md +5 -5
  58. data/docs/OutDial.md +33 -0
  59. data/docs/OutDialAllOf.md +33 -0
  60. data/docs/PaginationModel.md +8 -8
  61. data/docs/Pause.md +17 -0
  62. data/docs/PauseAllOf.md +17 -0
  63. data/docs/PerclCommand.md +17 -0
  64. data/docs/PerclScript.md +17 -0
  65. data/docs/Play.md +21 -0
  66. data/docs/PlayAllOf.md +21 -0
  67. data/docs/PlayEarlyMedia.md +17 -0
  68. data/docs/PlayEarlyMediaAllOf.md +17 -0
  69. data/docs/QueueList.md +9 -9
  70. data/docs/QueueListAllOf.md +2 -2
  71. data/docs/QueueMember.md +6 -6
  72. data/docs/QueueMemberList.md +9 -9
  73. data/docs/QueueMemberListAllOf.md +2 -2
  74. data/docs/QueueRequest.md +4 -4
  75. data/docs/QueueResult.md +12 -12
  76. data/docs/QueueResultAllOf.md +8 -8
  77. data/docs/RecordUtterance.md +27 -0
  78. data/docs/RecordUtteranceAllOf.md +27 -0
  79. data/docs/RecordingList.md +9 -9
  80. data/docs/RecordingListAllOf.md +2 -2
  81. data/docs/RecordingResult.md +10 -10
  82. data/docs/RecordingResultAllOf.md +6 -6
  83. data/docs/Redirect.md +17 -0
  84. data/docs/RedirectAllOf.md +17 -0
  85. data/docs/RemoveFromConference.md +17 -0
  86. data/docs/RemoveFromConferenceAllOf.md +17 -0
  87. data/docs/Say.md +25 -0
  88. data/docs/SayAllOf.md +25 -0
  89. data/docs/SendDigits.md +19 -0
  90. data/docs/SendDigitsAllOf.md +19 -0
  91. data/docs/SetListen.md +19 -0
  92. data/docs/SetListenAllOf.md +19 -0
  93. data/docs/SetTalk.md +19 -0
  94. data/docs/SetTalkAllOf.md +19 -0
  95. data/docs/Sms.md +23 -0
  96. data/docs/SmsAllOf.md +23 -0
  97. data/docs/StartRecordCall.md +16 -0
  98. data/docs/TerminateConference.md +17 -0
  99. data/docs/TerminateConferenceAllOf.md +17 -0
  100. data/docs/UpdateCallRequest.md +3 -3
  101. data/docs/UpdateConferenceParticipantRequest.md +4 -4
  102. data/docs/UpdateConferenceRequest.md +5 -5
  103. data/lib/freeclimb/api_client.rb +1 -1
  104. data/lib/freeclimb/models/add_to_conference.rb +320 -0
  105. data/lib/freeclimb/models/add_to_conference_all_of.rb +307 -0
  106. data/lib/freeclimb/models/create_conference.rb +275 -0
  107. data/lib/freeclimb/models/create_conference_all_of.rb +262 -0
  108. data/lib/freeclimb/models/dequeue.rb +209 -0
  109. data/lib/freeclimb/models/enqueue.rb +265 -0
  110. data/lib/freeclimb/models/enqueue_all_of.rb +252 -0
  111. data/lib/freeclimb/models/get_digits.rb +297 -0
  112. data/lib/freeclimb/models/get_digits_all_of.rb +284 -0
  113. data/lib/freeclimb/models/get_speech.rb +352 -0
  114. data/lib/freeclimb/models/get_speech_all_of.rb +339 -0
  115. data/lib/freeclimb/models/out_dial.rb +320 -0
  116. data/lib/freeclimb/models/out_dial_all_of.rb +307 -0
  117. data/lib/freeclimb/models/pause.rb +225 -0
  118. data/lib/freeclimb/models/pause_all_of.rb +212 -0
  119. data/lib/freeclimb/models/percl_command.rb +211 -0
  120. data/lib/freeclimb/models/percl_script.rb +210 -0
  121. data/lib/freeclimb/models/play.rb +245 -0
  122. data/lib/freeclimb/models/play_all_of.rb +232 -0
  123. data/lib/freeclimb/models/play_early_media.rb +225 -0
  124. data/lib/freeclimb/models/play_early_media_all_of.rb +212 -0
  125. data/lib/freeclimb/models/record_utterance.rb +275 -0
  126. data/lib/freeclimb/models/record_utterance_all_of.rb +262 -0
  127. data/lib/freeclimb/models/redirect.rb +220 -0
  128. data/lib/freeclimb/models/redirect_all_of.rb +207 -0
  129. data/lib/freeclimb/models/remove_from_conference.rb +225 -0
  130. data/lib/freeclimb/models/remove_from_conference_all_of.rb +212 -0
  131. data/lib/freeclimb/models/say.rb +265 -0
  132. data/lib/freeclimb/models/say_all_of.rb +252 -0
  133. data/lib/freeclimb/models/send_digits.rb +235 -0
  134. data/lib/freeclimb/models/send_digits_all_of.rb +222 -0
  135. data/lib/freeclimb/models/set_listen.rb +235 -0
  136. data/lib/freeclimb/models/set_listen_all_of.rb +222 -0
  137. data/lib/freeclimb/models/set_talk.rb +235 -0
  138. data/lib/freeclimb/models/set_talk_all_of.rb +222 -0
  139. data/lib/freeclimb/models/sms.rb +265 -0
  140. data/lib/freeclimb/models/sms_all_of.rb +252 -0
  141. data/lib/freeclimb/models/start_record_call.rb +209 -0
  142. data/lib/freeclimb/models/terminate_conference.rb +225 -0
  143. data/lib/freeclimb/models/terminate_conference_all_of.rb +212 -0
  144. data/lib/freeclimb/version.rb +1 -1
  145. data/lib/freeclimb.rb +69 -1
  146. data/spec/models/add_to_conference_spec.rb +95 -0
  147. data/spec/models/create_conference_spec.rb +71 -0
  148. data/spec/models/dequeue_spec.rb +35 -0
  149. data/spec/models/enqueue_spec.rb +59 -0
  150. data/spec/models/get_digits_spec.rb +83 -0
  151. data/spec/models/get_speech_spec.rb +113 -0
  152. data/spec/models/out_dial_spec.rb +89 -0
  153. data/spec/models/pause_spec.rb +41 -0
  154. data/spec/models/percl_command_spec.rb +41 -0
  155. data/spec/models/percl_script_spec.rb +41 -0
  156. data/spec/models/play_early_media_spec.rb +41 -0
  157. data/spec/models/play_spec.rb +53 -0
  158. data/spec/models/record_utterance_spec.rb +71 -0
  159. data/spec/models/redirect_spec.rb +41 -0
  160. data/spec/models/remove_from_conference_spec.rb +41 -0
  161. data/spec/models/say_spec.rb +65 -0
  162. data/spec/models/send_digits_spec.rb +47 -0
  163. data/spec/models/set_listen_spec.rb +47 -0
  164. data/spec/models/set_talk_spec.rb +47 -0
  165. data/spec/models/sms_spec.rb +59 -0
  166. data/spec/models/start_record_call_spec.rb +35 -0
  167. data/spec/models/terminate_conference_spec.rb +41 -0
  168. metadata +126 -30
  169. data/docs/Percl.md +0 -697
  170. data/lib/percl/calls.rb +0 -43
  171. data/lib/percl/conference_participants.rb +0 -40
  172. data/lib/percl/conferences.rb +0 -21
  173. data/lib/percl/ivr.rb +0 -63
  174. data/lib/percl/jsonable.rb +0 -23
  175. data/lib/percl/percl.rb +0 -29
  176. data/lib/percl/queue_members.rb +0 -15
  177. data/lib/percl/recordings.rb +0 -15
  178. data/lib/percl/sms.rb +0 -11
  179. data/spec/percl/calls_spec.rb +0 -111
  180. data/spec/percl/conference_participant_spec.rb +0 -96
  181. data/spec/percl/conference_spec.rb +0 -46
  182. data/spec/percl/ivr_spec.rb +0 -155
  183. data/spec/percl/jsonable_spec.rb +0 -28
  184. data/spec/percl/percl_spec.rb +0 -31
  185. data/spec/percl/queue_members_spec.rb +0 -35
  186. data/spec/percl/recordings_spec.rb +0 -32
  187. data/spec/percl/sms_spec.rb +0 -29
@@ -0,0 +1,297 @@
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 `GetDigits` command collects DTMF inputs from the caller. It is only supported only when there is a single party on the Call. `GetDigits` is a Terminal Command — any actions following it are never executed. When the Caller is done entering the digits, FreeClimb submits that data to the provided `actionUrl` using an HTTP POST request. Your server will be required to respond to the FreeClimb Webhook with PerCL to continue handling the call.
17
+ class GetDigits < PerclCommand
18
+ # When the Caller has finished entering digits, FreeClimb will make an HTTP POST request to this URL. A PerCL response is expected to continue handling the Call. Make sure to keep “http://“ in the URL.
19
+ attr_accessor :action_url
20
+
21
+ # Maximum time in milliseconds that FreeClimb will wait for the Caller to press any digit after the last digit entered, before making a determination that a `timeout` has occurred and moving on to make the request to the actionUrl to submit the results of the `GetDigits` command. This timeout interval begins and resets after each digit entered.
22
+ attr_accessor :digit_timeout_ms
23
+
24
+ # Digit that causes the input sequence to be deemed complete. This attribute defers to the `timeout` attribute – so, if a `timeout` occurs, then the command terminates regardless of the value of `finishOnKey`.
25
+ attr_accessor :finish_on_key
26
+
27
+ # If set to true, the FreeClimb platform starts with an empty DTMF buffer to store the digits entered by the caller. If set to false, FreeClimb will append the user inputs to the end of the existing digits buffer and will return digits from the start of the digits buffer.
28
+ attr_accessor :flush_buffer
29
+
30
+ # Maximum time in milliseconds that FreeClimb will wait for the Caller to press the first digit before making a determination that a `timeout` has occurred and moving on to make the request to the `actionUrl` to submit the results of the `GetDigits` command. This timeout interval begins when all nested commands have been fully executed.
31
+ attr_accessor :initial_timeout_ms
32
+
33
+ # Maximum number of digits expected in the input. If the terminating digit is not entered and the caller has entered the maximum number of digits allowed, the `GetDigits` command terminates regardless of the value of `finishOnKey`.
34
+ attr_accessor :max_digits
35
+
36
+ # Minimum number of digits expected in the input. If specified, FreeClimb will return the collected digits only if the Caller has entered at least that many digits.
37
+ attr_accessor :min_digits
38
+
39
+ # JSON array of PerCL commands to nest within the `GetDigits` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the Caller.
40
+ attr_accessor :prompts
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'action_url' => :'actionUrl',
46
+ :'digit_timeout_ms' => :'digitTimeoutMs',
47
+ :'finish_on_key' => :'finishOnKey',
48
+ :'flush_buffer' => :'flushBuffer',
49
+ :'initial_timeout_ms' => :'initialTimeoutMs',
50
+ :'max_digits' => :'maxDigits',
51
+ :'min_digits' => :'minDigits',
52
+ :'prompts' => :'prompts'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'action_url' => :'String',
60
+ :'digit_timeout_ms' => :'Integer',
61
+ :'finish_on_key' => :'String',
62
+ :'flush_buffer' => :'Boolean',
63
+ :'initial_timeout_ms' => :'String',
64
+ :'max_digits' => :'Integer',
65
+ :'min_digits' => :'Integer',
66
+ :'prompts' => :'Array<PerclCommand>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # List of class defined in allOf (OpenAPI v3)
77
+ def self.openapi_all_of
78
+ [
79
+ :'GetDigitsAllOf',
80
+ :'PerclCommand'
81
+ ]
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetDigits` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!self.class.attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetDigits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ # call parent's initialize
100
+ super(attributes)
101
+
102
+ if attributes.key?(:'action_url')
103
+ self.action_url = attributes[:'action_url']
104
+ end
105
+
106
+ if attributes.key?(:'digit_timeout_ms')
107
+ self.digit_timeout_ms = attributes[:'digit_timeout_ms']
108
+ end
109
+
110
+ if attributes.key?(:'finish_on_key')
111
+ self.finish_on_key = attributes[:'finish_on_key']
112
+ end
113
+
114
+ if attributes.key?(:'flush_buffer')
115
+ self.flush_buffer = attributes[:'flush_buffer']
116
+ end
117
+
118
+ if attributes.key?(:'initial_timeout_ms')
119
+ self.initial_timeout_ms = attributes[:'initial_timeout_ms']
120
+ end
121
+
122
+ if attributes.key?(:'max_digits')
123
+ self.max_digits = attributes[:'max_digits']
124
+ end
125
+
126
+ if attributes.key?(:'min_digits')
127
+ self.min_digits = attributes[:'min_digits']
128
+ end
129
+
130
+ if attributes.key?(:'prompts')
131
+ if (value = attributes[:'prompts']).is_a?(Array)
132
+ self.prompts = value
133
+ end
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = super
141
+ if @action_url.nil?
142
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
143
+ end
144
+
145
+ invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ return false if @action_url.nil?
152
+ true && super
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ action_url == o.action_url &&
161
+ digit_timeout_ms == o.digit_timeout_ms &&
162
+ finish_on_key == o.finish_on_key &&
163
+ flush_buffer == o.flush_buffer &&
164
+ initial_timeout_ms == o.initial_timeout_ms &&
165
+ max_digits == o.max_digits &&
166
+ min_digits == o.min_digits &&
167
+ prompts == o.prompts && super(o)
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [action_url, digit_timeout_ms, finish_on_key, flush_buffer, initial_timeout_ms, max_digits, min_digits, prompts].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ new.build_from_hash(attributes)
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def build_from_hash(attributes)
193
+ return nil unless attributes.is_a?(Hash)
194
+ super(attributes)
195
+ self.class.openapi_types.each_pair do |key, type|
196
+ if type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !attributes[self.class.attribute_map[key]].nil?
203
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
205
+ end
206
+
207
+ self
208
+ end
209
+
210
+ # Deserializes the data based on type
211
+ # @param string type Data type
212
+ # @param string value Value to be deserialized
213
+ # @return [Object] Deserialized data
214
+ def _deserialize(type, value)
215
+ case type.to_sym
216
+ when :DateTime
217
+ DateTime.parse(value)
218
+ when :Date
219
+ Date.parse(value)
220
+ when :String
221
+ value.to_s
222
+ when :Integer
223
+ value.to_i
224
+ when :Float
225
+ value.to_f
226
+ when :Boolean
227
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
228
+ true
229
+ else
230
+ false
231
+ end
232
+ when :Object
233
+ # generic object (usually a Hash), return directly
234
+ value
235
+ when /\AArray<(?<inner_type>.+)>\z/
236
+ inner_type = Regexp.last_match[:inner_type]
237
+ value.map { |v| _deserialize(inner_type, v) }
238
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
239
+ k_type = Regexp.last_match[:k_type]
240
+ v_type = Regexp.last_match[:v_type]
241
+ {}.tap do |hash|
242
+ value.each do |k, v|
243
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
244
+ end
245
+ end
246
+ else # model
247
+ Freeclimb.const_get(type).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 = super
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
+ end
297
+ end
@@ -0,0 +1,284 @@
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
+ class GetDigitsAllOf
17
+ # When the Caller has finished entering digits, FreeClimb will make an HTTP POST request to this URL. A PerCL response is expected to continue handling the Call. Make sure to keep “http://“ in the URL.
18
+ attr_accessor :action_url
19
+
20
+ # Maximum time in milliseconds that FreeClimb will wait for the Caller to press any digit after the last digit entered, before making a determination that a `timeout` has occurred and moving on to make the request to the actionUrl to submit the results of the `GetDigits` command. This timeout interval begins and resets after each digit entered.
21
+ attr_accessor :digit_timeout_ms
22
+
23
+ # Digit that causes the input sequence to be deemed complete. This attribute defers to the `timeout` attribute – so, if a `timeout` occurs, then the command terminates regardless of the value of `finishOnKey`.
24
+ attr_accessor :finish_on_key
25
+
26
+ # If set to true, the FreeClimb platform starts with an empty DTMF buffer to store the digits entered by the caller. If set to false, FreeClimb will append the user inputs to the end of the existing digits buffer and will return digits from the start of the digits buffer.
27
+ attr_accessor :flush_buffer
28
+
29
+ # Maximum time in milliseconds that FreeClimb will wait for the Caller to press the first digit before making a determination that a `timeout` has occurred and moving on to make the request to the `actionUrl` to submit the results of the `GetDigits` command. This timeout interval begins when all nested commands have been fully executed.
30
+ attr_accessor :initial_timeout_ms
31
+
32
+ # Maximum number of digits expected in the input. If the terminating digit is not entered and the caller has entered the maximum number of digits allowed, the `GetDigits` command terminates regardless of the value of `finishOnKey`.
33
+ attr_accessor :max_digits
34
+
35
+ # Minimum number of digits expected in the input. If specified, FreeClimb will return the collected digits only if the Caller has entered at least that many digits.
36
+ attr_accessor :min_digits
37
+
38
+ # JSON array of PerCL commands to nest within the `GetDigits` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the Caller.
39
+ attr_accessor :prompts
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'action_url' => :'actionUrl',
45
+ :'digit_timeout_ms' => :'digitTimeoutMs',
46
+ :'finish_on_key' => :'finishOnKey',
47
+ :'flush_buffer' => :'flushBuffer',
48
+ :'initial_timeout_ms' => :'initialTimeoutMs',
49
+ :'max_digits' => :'maxDigits',
50
+ :'min_digits' => :'minDigits',
51
+ :'prompts' => :'prompts'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'action_url' => :'String',
59
+ :'digit_timeout_ms' => :'Integer',
60
+ :'finish_on_key' => :'String',
61
+ :'flush_buffer' => :'Boolean',
62
+ :'initial_timeout_ms' => :'String',
63
+ :'max_digits' => :'Integer',
64
+ :'min_digits' => :'Integer',
65
+ :'prompts' => :'Array<PerclCommand>'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetDigitsAllOf` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetDigitsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'action_url')
91
+ self.action_url = attributes[:'action_url']
92
+ end
93
+
94
+ if attributes.key?(:'digit_timeout_ms')
95
+ self.digit_timeout_ms = attributes[:'digit_timeout_ms']
96
+ end
97
+
98
+ if attributes.key?(:'finish_on_key')
99
+ self.finish_on_key = attributes[:'finish_on_key']
100
+ end
101
+
102
+ if attributes.key?(:'flush_buffer')
103
+ self.flush_buffer = attributes[:'flush_buffer']
104
+ end
105
+
106
+ if attributes.key?(:'initial_timeout_ms')
107
+ self.initial_timeout_ms = attributes[:'initial_timeout_ms']
108
+ end
109
+
110
+ if attributes.key?(:'max_digits')
111
+ self.max_digits = attributes[:'max_digits']
112
+ end
113
+
114
+ if attributes.key?(:'min_digits')
115
+ self.min_digits = attributes[:'min_digits']
116
+ end
117
+
118
+ if attributes.key?(:'prompts')
119
+ if (value = attributes[:'prompts']).is_a?(Array)
120
+ self.prompts = value
121
+ end
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+ if @action_url.nil?
130
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ return false if @action_url.nil?
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ action_url == o.action_url &&
149
+ digit_timeout_ms == o.digit_timeout_ms &&
150
+ finish_on_key == o.finish_on_key &&
151
+ flush_buffer == o.flush_buffer &&
152
+ initial_timeout_ms == o.initial_timeout_ms &&
153
+ max_digits == o.max_digits &&
154
+ min_digits == o.min_digits &&
155
+ prompts == o.prompts
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [action_url, digit_timeout_ms, finish_on_key, flush_buffer, initial_timeout_ms, max_digits, min_digits, prompts].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ new.build_from_hash(attributes)
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.openapi_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ Freeclimb.const_get(type).build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+ end
284
+ end