freeclimb 4.4.4 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,291 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ # The `TranscribeUtterance` command transcribes the caller’s voice and returns transcription of the audio and optionally returns the recording of the audio transcribed. `TranscribeUtterance` is blocking and is a terminal command. As such, the actionUrl property is required, and control of the Call picks up using the `PerCL` returned in response of the `actionUrl`. Recording and Transcription information is returned in the actionUrl request. If the reason this command ended was due to the call hanging up, any PerCL returned will not execute.
18
+ class TranscribeUtterance
19
+ attr_accessor :action_url
20
+
21
+ attr_accessor :play_beep
22
+
23
+ attr_accessor :record
24
+
25
+ attr_accessor :privacy_for_logging
26
+
27
+ attr_accessor :privacy_for_recording
28
+
29
+ attr_accessor :prompts
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'action_url' => :'actionUrl',
35
+ :'play_beep' => :'playBeep',
36
+ :'record' => :'record',
37
+ :'privacy_for_logging' => :'privacyForLogging',
38
+ :'privacy_for_recording' => :'privacyForRecording',
39
+ :'prompts' => :'prompts'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'action_url' => :'String',
52
+ :'play_beep' => :'Boolean',
53
+ :'record' => :'TranscribeUtteranceRecord',
54
+ :'privacy_for_logging' => :'Boolean',
55
+ :'privacy_for_recording' => :'Boolean',
56
+ :'prompts' => :'Array<Object>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::TranscribeUtterance` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::TranscribeUtterance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'action_url')
82
+ self.action_url = attributes[:'action_url']
83
+ end
84
+
85
+ if attributes.key?(:'play_beep')
86
+ self.play_beep = attributes[:'play_beep']
87
+ else
88
+ self.play_beep = false
89
+ end
90
+
91
+ if attributes.key?(:'record')
92
+ self.record = attributes[:'record']
93
+ end
94
+
95
+ if attributes.key?(:'privacy_for_logging')
96
+ self.privacy_for_logging = attributes[:'privacy_for_logging']
97
+ else
98
+ self.privacy_for_logging = false
99
+ end
100
+
101
+ if attributes.key?(:'privacy_for_recording')
102
+ self.privacy_for_recording = attributes[:'privacy_for_recording']
103
+ else
104
+ self.privacy_for_recording = false
105
+ end
106
+
107
+ if attributes.key?(:'prompts')
108
+ if (value = attributes[:'prompts']).is_a?(Array)
109
+ self.prompts = value
110
+ end
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ if @action_url.nil?
119
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
120
+ end
121
+
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+
129
+ if @action_url.nil?
130
+ false
131
+ elsif @play_beep.nil?
132
+ false
133
+ elsif @record.nil?
134
+ false
135
+ elsif @privacy_for_logging.nil?
136
+ false
137
+ elsif @privacy_for_recording.nil?
138
+ false
139
+ elsif @prompts.nil?
140
+ false
141
+ else
142
+ list_invalid_properties.length() == 0
143
+ end
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ action_url == o.action_url &&
152
+ play_beep == o.play_beep &&
153
+ record == o.record &&
154
+ privacy_for_logging == o.privacy_for_logging &&
155
+ privacy_for_recording == o.privacy_for_recording &&
156
+ prompts == o.prompts
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [action_url, play_beep, record, privacy_for_logging, privacy_for_recording, prompts].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.openapi_types.each_pair do |key, type|
184
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
185
+ self.send("#{key}=", nil)
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ end
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :Time
207
+ Time.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ # models (e.g. Pet) or oneOf
238
+ klass = Freeclimb.const_get(type)
239
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+
289
+ end
290
+
291
+ end
@@ -0,0 +1,293 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class TranscribeUtteranceRecord
18
+ attr_accessor :save_recording
19
+
20
+ attr_accessor :max_length_sec
21
+
22
+ attr_accessor :rcrd_termination_silence_time_ms
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'save_recording' => :'saveRecording',
28
+ :'max_length_sec' => :'maxLengthSec',
29
+ :'rcrd_termination_silence_time_ms' => :'rcrdTerminationSilenceTimeMs'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'save_recording' => :'Boolean',
42
+ :'max_length_sec' => :'Integer',
43
+ :'rcrd_termination_silence_time_ms' => :'Integer'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::TranscribeUtteranceRecord` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::TranscribeUtteranceRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'save_recording')
69
+ self.save_recording = attributes[:'save_recording']
70
+ else
71
+ self.save_recording = false
72
+ end
73
+
74
+ if attributes.key?(:'max_length_sec')
75
+ self.max_length_sec = attributes[:'max_length_sec']
76
+ else
77
+ self.max_length_sec = 60
78
+ end
79
+
80
+ if attributes.key?(:'rcrd_termination_silence_time_ms')
81
+ self.rcrd_termination_silence_time_ms = attributes[:'rcrd_termination_silence_time_ms']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if !@max_length_sec.nil? && @max_length_sec > 60
90
+ invalid_properties.push('invalid value for "max_length_sec", must be smaller than or equal to 60.')
91
+ end
92
+
93
+ if !@max_length_sec.nil? && @max_length_sec < 1
94
+ invalid_properties.push('invalid value for "max_length_sec", must be greater than or equal to 1.')
95
+ end
96
+
97
+ if !@rcrd_termination_silence_time_ms.nil? && @rcrd_termination_silence_time_ms > 3000
98
+ invalid_properties.push('invalid value for "rcrd_termination_silence_time_ms", must be smaller than or equal to 3000.')
99
+ end
100
+
101
+ if !@rcrd_termination_silence_time_ms.nil? && @rcrd_termination_silence_time_ms <= 0
102
+ invalid_properties.push('invalid value for "rcrd_termination_silence_time_ms", must be greater than 0.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+
112
+ if @save_recording.nil?
113
+ false
114
+ elsif @max_length_sec.nil?
115
+ false
116
+ elsif @rcrd_termination_silence_time_ms.nil?
117
+ false
118
+ else
119
+ list_invalid_properties.length() == 0
120
+ end
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] max_length_sec Value to be assigned
125
+ def max_length_sec=(max_length_sec)
126
+ if !max_length_sec.nil? && max_length_sec > 60
127
+ fail ArgumentError, 'invalid value for "max_length_sec", must be smaller than or equal to 60.'
128
+ end
129
+
130
+ if !max_length_sec.nil? && max_length_sec < 1
131
+ fail ArgumentError, 'invalid value for "max_length_sec", must be greater than or equal to 1.'
132
+ end
133
+
134
+ @max_length_sec = max_length_sec
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] rcrd_termination_silence_time_ms Value to be assigned
139
+ def rcrd_termination_silence_time_ms=(rcrd_termination_silence_time_ms)
140
+ if !rcrd_termination_silence_time_ms.nil? && rcrd_termination_silence_time_ms > 3000
141
+ fail ArgumentError, 'invalid value for "rcrd_termination_silence_time_ms", must be smaller than or equal to 3000.'
142
+ end
143
+
144
+ if !rcrd_termination_silence_time_ms.nil? && rcrd_termination_silence_time_ms <= 0
145
+ fail ArgumentError, 'invalid value for "rcrd_termination_silence_time_ms", must be greater than 0.'
146
+ end
147
+
148
+ @rcrd_termination_silence_time_ms = rcrd_termination_silence_time_ms
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ save_recording == o.save_recording &&
157
+ max_length_sec == o.max_length_sec &&
158
+ rcrd_termination_silence_time_ms == o.rcrd_termination_silence_time_ms
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [save_recording, max_length_sec, rcrd_termination_silence_time_ms].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ new.build_from_hash(attributes)
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ self.class.openapi_types.each_pair do |key, type|
186
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
187
+ self.send("#{key}=", nil)
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
+ end
194
+ elsif !attributes[self.class.attribute_map[key]].nil?
195
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
+ end
197
+ end
198
+
199
+ self
200
+ end
201
+
202
+ # Deserializes the data based on type
203
+ # @param string type Data type
204
+ # @param string value Value to be deserialized
205
+ # @return [Object] Deserialized data
206
+ def _deserialize(type, value)
207
+ case type.to_sym
208
+ when :Time
209
+ Time.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :Boolean
219
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ # models (e.g. Pet) or oneOf
240
+ klass = Freeclimb.const_get(type)
241
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
242
+ end
243
+ end
244
+
245
+ # Returns the string representation of the object
246
+ # @return [String] String presentation of the object
247
+ def to_s
248
+ to_hash.to_s
249
+ end
250
+
251
+ # to_body is an alias to to_hash (backward compatibility)
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_body
254
+ to_hash
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = self.send(attr)
263
+ if value.nil?
264
+ is_nullable = self.class.openapi_nullable.include?(attr)
265
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
266
+ end
267
+
268
+ hash[param] = _to_hash(value)
269
+ end
270
+ hash
271
+ end
272
+
273
+ # Outputs non-array value in the form of hash
274
+ # For object, use to_hash. Otherwise, just return the value
275
+ # @param [Object] value Any valid value
276
+ # @return [Hash] Returns the value in the form of hash
277
+ def _to_hash(value)
278
+ if value.is_a?(Array)
279
+ value.compact.map { |v| _to_hash(v) }
280
+ elsif value.is_a?(Hash)
281
+ {}.tap do |hash|
282
+ value.each { |k, v| hash[k] = _to_hash(v) }
283
+ end
284
+ elsif value.respond_to? :to_hash
285
+ value.to_hash
286
+ else
287
+ value
288
+ end
289
+ end
290
+
291
+ end
292
+
293
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.4.0
11
11
  =end
12
12
 
13
13
  module Freeclimb
14
- VERSION = '4.4.4'
14
+ VERSION = '4.5.0'
15
15
  end
data/lib/freeclimb.rb CHANGED
@@ -125,6 +125,8 @@ require 'freeclimb/models/set_listen_all_of'
125
125
  require 'freeclimb/models/set_talk_all_of'
126
126
  require 'freeclimb/models/sms_all_of'
127
127
  require 'freeclimb/models/terminate_conference_all_of'
128
+ require 'freeclimb/models/transcribe_utterance'
129
+ require 'freeclimb/models/transcribe_utterance_record'
128
130
  require 'freeclimb/models/update_call_request'
129
131
  require 'freeclimb/models/update_call_request_status'
130
132
  require 'freeclimb/models/update_conference_participant_request'