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,352 @@
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 `GetSpeech` command enables the Caller to respond to the application using a supported language. Unlike DTMF entry, which implicitly restricts the user to using the available buttons on the phone key pad, speech input allows for flexible audio inputs based on grammar. FreeClimb supports grammars written using GRXML compatible with the Microsoft Speech Platform. `GetSpeech` is only supported on a single call leg. It is not supported when there are two or more call legs connected (as in within a Conference).
17
+ class GetSpeech < PerclCommand
18
+ # When the caller has finished speaking or the command has timed out, FreeClimb will make a POST request to this URL. A PerCL response is expected to continue handling the call.
19
+ attr_accessor :action_url
20
+
21
+ # The grammar file type to use for speech recognition. A value of 'URL' indicates the grammarFile attribute specifies a URL that points to the grammar file. A value of `BUILTIN` indicates the grammarFile attribute specifies the name of one of the platform built-in grammar files.
22
+ attr_accessor :grammar_type
23
+
24
+ # The grammar file to use for speech recognition. If grammarType is set to URL, this attribute is specified as a download URL.
25
+ attr_accessor :grammar_file
26
+
27
+ # The grammar rule within the specified grammar file to use for speech recognition. This attribute is optional if `grammarType` is `URL` and ignored if `grammarType` is `BUILTIN`.
28
+ attr_accessor :grammar_rule
29
+
30
+ # Indicates whether a beep should be played just before speech recognition is initiated so that the speaker can start to speak.
31
+ attr_accessor :play_beep
32
+
33
+ # The JSON array of PerCL commands to nest within the `GetSpeech` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the caller. This allows for playing menu options to the caller and to prompt for the expected input. These commands stop executing when the caller begins to input speech.
34
+ attr_accessor :prompts
35
+
36
+ # When recognition is started and there is no speech detected for `noInputTimeoutMs` milliseconds, the recognizer will terminate the recognition operation.
37
+ attr_accessor :no_input_timeout_ms
38
+
39
+ # When playback of prompts ends and there is no match for `recognitionTimeoutMs` milliseconds, the recognizer will terminate the recognition operation.
40
+ attr_accessor :recognition_timeout_ms
41
+
42
+ # When a recognition resource recognizes a spoken phrase, it associates a confidence level with that match. Parameter `confidenceThreshold` specifies what confidence level is considered a successful match. Values are between 0.0 and 1.0.
43
+ attr_accessor :confidence_threshold
44
+
45
+ # The speech recognizer supports a variable level of sound sensitivity. The sensitivityLevel attribute allows for filtering out background noise, so it is not mistaken for speech. Values are between 0.0 and 1.0
46
+ attr_accessor :sensitivity_level
47
+
48
+ # Parameter `speechCompleteTimeoutMs` specifies the length of silence required following user speech before the speech recognizer finalizes a result. This timeout applies when the recognizer currently has a complete match against an active grammar. Reasonable speech complete timeout values are typically in the range of 0.3 seconds to 1.0 seconds.
49
+ attr_accessor :speech_complete_timeout_ms
50
+
51
+ # Parameter `speechIncompleteTimeoutMs` specifies the length of silence following user speech after which a recognizer finalizes a result. This timeout applies when the speech prior to the silence is an incomplete match of all active grammars. Timeout `speechIncompleteTimeoutMs` is usually longer than `speechCompleteTimeoutMs` to allow users to pause mid-utterance.
52
+ attr_accessor :speech_incomplete_timeout_ms
53
+
54
+ # Parameter enforcePCI will not log the `text` as required by PCI compliance.
55
+ attr_accessor :enforce_pci
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'action_url' => :'actionUrl',
61
+ :'grammar_type' => :'grammarType',
62
+ :'grammar_file' => :'grammarFile',
63
+ :'grammar_rule' => :'grammarRule',
64
+ :'play_beep' => :'playBeep',
65
+ :'prompts' => :'prompts',
66
+ :'no_input_timeout_ms' => :'noInputTimeoutMs',
67
+ :'recognition_timeout_ms' => :'recognitionTimeoutMs',
68
+ :'confidence_threshold' => :'confidenceThreshold',
69
+ :'sensitivity_level' => :'sensitivityLevel',
70
+ :'speech_complete_timeout_ms' => :'speechCompleteTimeoutMs',
71
+ :'speech_incomplete_timeout_ms' => :'speechIncompleteTimeoutMs',
72
+ :'enforce_pci' => :'enforcePCI'
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.openapi_types
78
+ {
79
+ :'action_url' => :'String',
80
+ :'grammar_type' => :'Integer',
81
+ :'grammar_file' => :'String',
82
+ :'grammar_rule' => :'Boolean',
83
+ :'play_beep' => :'String',
84
+ :'prompts' => :'Array<PerclCommand>',
85
+ :'no_input_timeout_ms' => :'Integer',
86
+ :'recognition_timeout_ms' => :'Integer',
87
+ :'confidence_threshold' => :'Float',
88
+ :'sensitivity_level' => :'Float',
89
+ :'speech_complete_timeout_ms' => :'Integer',
90
+ :'speech_incomplete_timeout_ms' => :'Integer',
91
+ :'enforce_pci' => :'Boolean'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ ])
99
+ end
100
+
101
+ # List of class defined in allOf (OpenAPI v3)
102
+ def self.openapi_all_of
103
+ [
104
+ :'GetSpeechAllOf',
105
+ :'PerclCommand'
106
+ ]
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ if (!attributes.is_a?(Hash))
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetSpeech` initialize method"
114
+ end
115
+
116
+ # check to see if the attribute exists and convert string to symbol for hash key
117
+ attributes = attributes.each_with_object({}) { |(k, v), h|
118
+ if (!self.class.attribute_map.key?(k.to_sym))
119
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetSpeech`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
120
+ end
121
+ h[k.to_sym] = v
122
+ }
123
+
124
+ # call parent's initialize
125
+ super(attributes)
126
+
127
+ if attributes.key?(:'action_url')
128
+ self.action_url = attributes[:'action_url']
129
+ end
130
+
131
+ if attributes.key?(:'grammar_type')
132
+ self.grammar_type = attributes[:'grammar_type']
133
+ end
134
+
135
+ if attributes.key?(:'grammar_file')
136
+ self.grammar_file = attributes[:'grammar_file']
137
+ end
138
+
139
+ if attributes.key?(:'grammar_rule')
140
+ self.grammar_rule = attributes[:'grammar_rule']
141
+ end
142
+
143
+ if attributes.key?(:'play_beep')
144
+ self.play_beep = attributes[:'play_beep']
145
+ end
146
+
147
+ if attributes.key?(:'prompts')
148
+ if (value = attributes[:'prompts']).is_a?(Array)
149
+ self.prompts = value
150
+ end
151
+ end
152
+
153
+ if attributes.key?(:'no_input_timeout_ms')
154
+ self.no_input_timeout_ms = attributes[:'no_input_timeout_ms']
155
+ end
156
+
157
+ if attributes.key?(:'recognition_timeout_ms')
158
+ self.recognition_timeout_ms = attributes[:'recognition_timeout_ms']
159
+ end
160
+
161
+ if attributes.key?(:'confidence_threshold')
162
+ self.confidence_threshold = attributes[:'confidence_threshold']
163
+ end
164
+
165
+ if attributes.key?(:'sensitivity_level')
166
+ self.sensitivity_level = attributes[:'sensitivity_level']
167
+ end
168
+
169
+ if attributes.key?(:'speech_complete_timeout_ms')
170
+ self.speech_complete_timeout_ms = attributes[:'speech_complete_timeout_ms']
171
+ end
172
+
173
+ if attributes.key?(:'speech_incomplete_timeout_ms')
174
+ self.speech_incomplete_timeout_ms = attributes[:'speech_incomplete_timeout_ms']
175
+ end
176
+
177
+ if attributes.key?(:'enforce_pci')
178
+ self.enforce_pci = attributes[:'enforce_pci']
179
+ end
180
+ end
181
+
182
+ # Show invalid properties with the reasons. Usually used together with valid?
183
+ # @return Array for valid properties with the reasons
184
+ def list_invalid_properties
185
+ invalid_properties = super
186
+ if @action_url.nil?
187
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
188
+ end
189
+
190
+ if @grammar_file.nil?
191
+ invalid_properties.push('invalid value for "grammar_file", grammar_file cannot be nil.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ return false if @action_url.nil?
201
+ return false if @grammar_file.nil?
202
+ true && super
203
+ end
204
+
205
+ # Checks equality by comparing each attribute.
206
+ # @param [Object] Object to be compared
207
+ def ==(o)
208
+ return true if self.equal?(o)
209
+ self.class == o.class &&
210
+ action_url == o.action_url &&
211
+ grammar_type == o.grammar_type &&
212
+ grammar_file == o.grammar_file &&
213
+ grammar_rule == o.grammar_rule &&
214
+ play_beep == o.play_beep &&
215
+ prompts == o.prompts &&
216
+ no_input_timeout_ms == o.no_input_timeout_ms &&
217
+ recognition_timeout_ms == o.recognition_timeout_ms &&
218
+ confidence_threshold == o.confidence_threshold &&
219
+ sensitivity_level == o.sensitivity_level &&
220
+ speech_complete_timeout_ms == o.speech_complete_timeout_ms &&
221
+ speech_incomplete_timeout_ms == o.speech_incomplete_timeout_ms &&
222
+ enforce_pci == o.enforce_pci && super(o)
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [action_url, grammar_type, grammar_file, grammar_rule, play_beep, prompts, no_input_timeout_ms, recognition_timeout_ms, confidence_threshold, sensitivity_level, speech_complete_timeout_ms, speech_incomplete_timeout_ms, enforce_pci].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ new.build_from_hash(attributes)
242
+ end
243
+
244
+ # Builds the object from hash
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ # @return [Object] Returns the model itself
247
+ def build_from_hash(attributes)
248
+ return nil unless attributes.is_a?(Hash)
249
+ super(attributes)
250
+ self.class.openapi_types.each_pair do |key, type|
251
+ if type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
255
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
+ end
257
+ elsif !attributes[self.class.attribute_map[key]].nil?
258
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
259
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
260
+ end
261
+
262
+ self
263
+ end
264
+
265
+ # Deserializes the data based on type
266
+ # @param string type Data type
267
+ # @param string value Value to be deserialized
268
+ # @return [Object] Deserialized data
269
+ def _deserialize(type, value)
270
+ case type.to_sym
271
+ when :DateTime
272
+ DateTime.parse(value)
273
+ when :Date
274
+ Date.parse(value)
275
+ when :String
276
+ value.to_s
277
+ when :Integer
278
+ value.to_i
279
+ when :Float
280
+ value.to_f
281
+ when :Boolean
282
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
283
+ true
284
+ else
285
+ false
286
+ end
287
+ when :Object
288
+ # generic object (usually a Hash), return directly
289
+ value
290
+ when /\AArray<(?<inner_type>.+)>\z/
291
+ inner_type = Regexp.last_match[:inner_type]
292
+ value.map { |v| _deserialize(inner_type, v) }
293
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
294
+ k_type = Regexp.last_match[:k_type]
295
+ v_type = Regexp.last_match[:v_type]
296
+ {}.tap do |hash|
297
+ value.each do |k, v|
298
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
299
+ end
300
+ end
301
+ else # model
302
+ Freeclimb.const_get(type).build_from_hash(value)
303
+ end
304
+ end
305
+
306
+ # Returns the string representation of the object
307
+ # @return [String] String presentation of the object
308
+ def to_s
309
+ to_hash.to_s
310
+ end
311
+
312
+ # to_body is an alias to to_hash (backward compatibility)
313
+ # @return [Hash] Returns the object in the form of hash
314
+ def to_body
315
+ to_hash
316
+ end
317
+
318
+ # Returns the object in the form of hash
319
+ # @return [Hash] Returns the object in the form of hash
320
+ def to_hash
321
+ hash = super
322
+ self.class.attribute_map.each_pair do |attr, param|
323
+ value = self.send(attr)
324
+ if value.nil?
325
+ is_nullable = self.class.openapi_nullable.include?(attr)
326
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
327
+ end
328
+
329
+ hash[param] = _to_hash(value)
330
+ end
331
+ hash
332
+ end
333
+
334
+ # Outputs non-array value in the form of hash
335
+ # For object, use to_hash. Otherwise, just return the value
336
+ # @param [Object] value Any valid value
337
+ # @return [Hash] Returns the value in the form of hash
338
+ def _to_hash(value)
339
+ if value.is_a?(Array)
340
+ value.compact.map { |v| _to_hash(v) }
341
+ elsif value.is_a?(Hash)
342
+ {}.tap do |hash|
343
+ value.each { |k, v| hash[k] = _to_hash(v) }
344
+ end
345
+ elsif value.respond_to? :to_hash
346
+ value.to_hash
347
+ else
348
+ value
349
+ end
350
+ end
351
+ end
352
+ end
@@ -0,0 +1,339 @@
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 GetSpeechAllOf
17
+ # When the caller has finished speaking or the command has timed out, FreeClimb will make a POST request to this URL. A PerCL response is expected to continue handling the call.
18
+ attr_accessor :action_url
19
+
20
+ # The grammar file type to use for speech recognition. A value of 'URL' indicates the grammarFile attribute specifies a URL that points to the grammar file. A value of `BUILTIN` indicates the grammarFile attribute specifies the name of one of the platform built-in grammar files.
21
+ attr_accessor :grammar_type
22
+
23
+ # The grammar file to use for speech recognition. If grammarType is set to URL, this attribute is specified as a download URL.
24
+ attr_accessor :grammar_file
25
+
26
+ # The grammar rule within the specified grammar file to use for speech recognition. This attribute is optional if `grammarType` is `URL` and ignored if `grammarType` is `BUILTIN`.
27
+ attr_accessor :grammar_rule
28
+
29
+ # Indicates whether a beep should be played just before speech recognition is initiated so that the speaker can start to speak.
30
+ attr_accessor :play_beep
31
+
32
+ # The JSON array of PerCL commands to nest within the `GetSpeech` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the caller. This allows for playing menu options to the caller and to prompt for the expected input. These commands stop executing when the caller begins to input speech.
33
+ attr_accessor :prompts
34
+
35
+ # When recognition is started and there is no speech detected for `noInputTimeoutMs` milliseconds, the recognizer will terminate the recognition operation.
36
+ attr_accessor :no_input_timeout_ms
37
+
38
+ # When playback of prompts ends and there is no match for `recognitionTimeoutMs` milliseconds, the recognizer will terminate the recognition operation.
39
+ attr_accessor :recognition_timeout_ms
40
+
41
+ # When a recognition resource recognizes a spoken phrase, it associates a confidence level with that match. Parameter `confidenceThreshold` specifies what confidence level is considered a successful match. Values are between 0.0 and 1.0.
42
+ attr_accessor :confidence_threshold
43
+
44
+ # The speech recognizer supports a variable level of sound sensitivity. The sensitivityLevel attribute allows for filtering out background noise, so it is not mistaken for speech. Values are between 0.0 and 1.0
45
+ attr_accessor :sensitivity_level
46
+
47
+ # Parameter `speechCompleteTimeoutMs` specifies the length of silence required following user speech before the speech recognizer finalizes a result. This timeout applies when the recognizer currently has a complete match against an active grammar. Reasonable speech complete timeout values are typically in the range of 0.3 seconds to 1.0 seconds.
48
+ attr_accessor :speech_complete_timeout_ms
49
+
50
+ # Parameter `speechIncompleteTimeoutMs` specifies the length of silence following user speech after which a recognizer finalizes a result. This timeout applies when the speech prior to the silence is an incomplete match of all active grammars. Timeout `speechIncompleteTimeoutMs` is usually longer than `speechCompleteTimeoutMs` to allow users to pause mid-utterance.
51
+ attr_accessor :speech_incomplete_timeout_ms
52
+
53
+ # Parameter enforcePCI will not log the `text` as required by PCI compliance.
54
+ attr_accessor :enforce_pci
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'action_url' => :'actionUrl',
60
+ :'grammar_type' => :'grammarType',
61
+ :'grammar_file' => :'grammarFile',
62
+ :'grammar_rule' => :'grammarRule',
63
+ :'play_beep' => :'playBeep',
64
+ :'prompts' => :'prompts',
65
+ :'no_input_timeout_ms' => :'noInputTimeoutMs',
66
+ :'recognition_timeout_ms' => :'recognitionTimeoutMs',
67
+ :'confidence_threshold' => :'confidenceThreshold',
68
+ :'sensitivity_level' => :'sensitivityLevel',
69
+ :'speech_complete_timeout_ms' => :'speechCompleteTimeoutMs',
70
+ :'speech_incomplete_timeout_ms' => :'speechIncompleteTimeoutMs',
71
+ :'enforce_pci' => :'enforcePCI'
72
+ }
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'action_url' => :'String',
79
+ :'grammar_type' => :'Integer',
80
+ :'grammar_file' => :'String',
81
+ :'grammar_rule' => :'Boolean',
82
+ :'play_beep' => :'String',
83
+ :'prompts' => :'Array<PerclCommand>',
84
+ :'no_input_timeout_ms' => :'Integer',
85
+ :'recognition_timeout_ms' => :'Integer',
86
+ :'confidence_threshold' => :'Float',
87
+ :'sensitivity_level' => :'Float',
88
+ :'speech_complete_timeout_ms' => :'Integer',
89
+ :'speech_incomplete_timeout_ms' => :'Integer',
90
+ :'enforce_pci' => :'Boolean'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetSpeechAllOf` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!self.class.attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetSpeechAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'action_url')
116
+ self.action_url = attributes[:'action_url']
117
+ end
118
+
119
+ if attributes.key?(:'grammar_type')
120
+ self.grammar_type = attributes[:'grammar_type']
121
+ end
122
+
123
+ if attributes.key?(:'grammar_file')
124
+ self.grammar_file = attributes[:'grammar_file']
125
+ end
126
+
127
+ if attributes.key?(:'grammar_rule')
128
+ self.grammar_rule = attributes[:'grammar_rule']
129
+ end
130
+
131
+ if attributes.key?(:'play_beep')
132
+ self.play_beep = attributes[:'play_beep']
133
+ end
134
+
135
+ if attributes.key?(:'prompts')
136
+ if (value = attributes[:'prompts']).is_a?(Array)
137
+ self.prompts = value
138
+ end
139
+ end
140
+
141
+ if attributes.key?(:'no_input_timeout_ms')
142
+ self.no_input_timeout_ms = attributes[:'no_input_timeout_ms']
143
+ end
144
+
145
+ if attributes.key?(:'recognition_timeout_ms')
146
+ self.recognition_timeout_ms = attributes[:'recognition_timeout_ms']
147
+ end
148
+
149
+ if attributes.key?(:'confidence_threshold')
150
+ self.confidence_threshold = attributes[:'confidence_threshold']
151
+ end
152
+
153
+ if attributes.key?(:'sensitivity_level')
154
+ self.sensitivity_level = attributes[:'sensitivity_level']
155
+ end
156
+
157
+ if attributes.key?(:'speech_complete_timeout_ms')
158
+ self.speech_complete_timeout_ms = attributes[:'speech_complete_timeout_ms']
159
+ end
160
+
161
+ if attributes.key?(:'speech_incomplete_timeout_ms')
162
+ self.speech_incomplete_timeout_ms = attributes[:'speech_incomplete_timeout_ms']
163
+ end
164
+
165
+ if attributes.key?(:'enforce_pci')
166
+ self.enforce_pci = attributes[:'enforce_pci']
167
+ end
168
+ end
169
+
170
+ # Show invalid properties with the reasons. Usually used together with valid?
171
+ # @return Array for valid properties with the reasons
172
+ def list_invalid_properties
173
+ invalid_properties = Array.new
174
+ if @action_url.nil?
175
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
176
+ end
177
+
178
+ if @grammar_file.nil?
179
+ invalid_properties.push('invalid value for "grammar_file", grammar_file cannot be nil.')
180
+ end
181
+
182
+ invalid_properties
183
+ end
184
+
185
+ # Check to see if the all the properties in the model are valid
186
+ # @return true if the model is valid
187
+ def valid?
188
+ return false if @action_url.nil?
189
+ return false if @grammar_file.nil?
190
+ true
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ action_url == o.action_url &&
199
+ grammar_type == o.grammar_type &&
200
+ grammar_file == o.grammar_file &&
201
+ grammar_rule == o.grammar_rule &&
202
+ play_beep == o.play_beep &&
203
+ prompts == o.prompts &&
204
+ no_input_timeout_ms == o.no_input_timeout_ms &&
205
+ recognition_timeout_ms == o.recognition_timeout_ms &&
206
+ confidence_threshold == o.confidence_threshold &&
207
+ sensitivity_level == o.sensitivity_level &&
208
+ speech_complete_timeout_ms == o.speech_complete_timeout_ms &&
209
+ speech_incomplete_timeout_ms == o.speech_incomplete_timeout_ms &&
210
+ enforce_pci == o.enforce_pci
211
+ end
212
+
213
+ # @see the `==` method
214
+ # @param [Object] Object to be compared
215
+ def eql?(o)
216
+ self == o
217
+ end
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Integer] Hash code
221
+ def hash
222
+ [action_url, grammar_type, grammar_file, grammar_rule, play_beep, prompts, no_input_timeout_ms, recognition_timeout_ms, confidence_threshold, sensitivity_level, speech_complete_timeout_ms, speech_incomplete_timeout_ms, enforce_pci].hash
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def self.build_from_hash(attributes)
229
+ new.build_from_hash(attributes)
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ self.class.openapi_types.each_pair do |key, type|
238
+ if type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
242
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
243
+ end
244
+ elsif !attributes[self.class.attribute_map[key]].nil?
245
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
247
+ end
248
+
249
+ self
250
+ end
251
+
252
+ # Deserializes the data based on type
253
+ # @param string type Data type
254
+ # @param string value Value to be deserialized
255
+ # @return [Object] Deserialized data
256
+ def _deserialize(type, value)
257
+ case type.to_sym
258
+ when :DateTime
259
+ DateTime.parse(value)
260
+ when :Date
261
+ Date.parse(value)
262
+ when :String
263
+ value.to_s
264
+ when :Integer
265
+ value.to_i
266
+ when :Float
267
+ value.to_f
268
+ when :Boolean
269
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
270
+ true
271
+ else
272
+ false
273
+ end
274
+ when :Object
275
+ # generic object (usually a Hash), return directly
276
+ value
277
+ when /\AArray<(?<inner_type>.+)>\z/
278
+ inner_type = Regexp.last_match[:inner_type]
279
+ value.map { |v| _deserialize(inner_type, v) }
280
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
281
+ k_type = Regexp.last_match[:k_type]
282
+ v_type = Regexp.last_match[:v_type]
283
+ {}.tap do |hash|
284
+ value.each do |k, v|
285
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
286
+ end
287
+ end
288
+ else # model
289
+ Freeclimb.const_get(type).build_from_hash(value)
290
+ end
291
+ end
292
+
293
+ # Returns the string representation of the object
294
+ # @return [String] String presentation of the object
295
+ def to_s
296
+ to_hash.to_s
297
+ end
298
+
299
+ # to_body is an alias to to_hash (backward compatibility)
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_body
302
+ to_hash
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = self.send(attr)
311
+ if value.nil?
312
+ is_nullable = self.class.openapi_nullable.include?(attr)
313
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
+ end
315
+
316
+ hash[param] = _to_hash(value)
317
+ end
318
+ hash
319
+ end
320
+
321
+ # Outputs non-array value in the form of hash
322
+ # For object, use to_hash. Otherwise, just return the value
323
+ # @param [Object] value Any valid value
324
+ # @return [Hash] Returns the value in the form of hash
325
+ def _to_hash(value)
326
+ if value.is_a?(Array)
327
+ value.compact.map { |v| _to_hash(v) }
328
+ elsif value.is_a?(Hash)
329
+ {}.tap do |hash|
330
+ value.each { |k, v| hash[k] = _to_hash(v) }
331
+ end
332
+ elsif value.respond_to? :to_hash
333
+ value.to_hash
334
+ else
335
+ value
336
+ end
337
+ end
338
+ end
339
+ end