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,320 @@
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 OutDial command is used to call a phone number
17
+ class OutDial < PerclCommand
18
+ # URL to which FreeClimb sends an HTTP POST request.
19
+ attr_accessor :action_url
20
+
21
+ # URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial.
22
+ attr_accessor :call_connect_url
23
+
24
+ # he caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb.
25
+ attr_accessor :calling_number
26
+
27
+ # E.164 representation of the phone number to Call.
28
+ attr_accessor :destination
29
+
30
+ # Specifies how FreeClimb should handle this OutDial if an answering machine answers the Call. Valid values: `redirect` invokes the ifMachineUrl for instructions. `hangup` hangs up the Call. The ifMachineUrl will not be invoked.
31
+ attr_accessor :if_machine
32
+
33
+ # When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included.
34
+ attr_accessor :if_machine_url
35
+
36
+ # DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension.
37
+ attr_accessor :send_digits
38
+
39
+ # When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored.
40
+ attr_accessor :status_callback_url
41
+
42
+ # Maximum time in seconds the `OutDial` command waits for the called party to answer the Call. When a timeout occurs, FreeClimb invokes the `callConnectUrl` Webhook to report that the out-dialed Call has ended with a status of `noAnswer`.
43
+ attr_accessor :timeout
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'action_url' => :'actionUrl',
49
+ :'call_connect_url' => :'callConnectUrl',
50
+ :'calling_number' => :'callingNumber',
51
+ :'destination' => :'destination',
52
+ :'if_machine' => :'ifMachine',
53
+ :'if_machine_url' => :'ifMachineUrl',
54
+ :'send_digits' => :'sendDigits',
55
+ :'status_callback_url' => :'statusCallbackUrl',
56
+ :'timeout' => :'timeout'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'action_url' => :'String',
64
+ :'call_connect_url' => :'String',
65
+ :'calling_number' => :'Float',
66
+ :'destination' => :'Float',
67
+ :'if_machine' => :'String',
68
+ :'if_machine_url' => :'String',
69
+ :'send_digits' => :'String',
70
+ :'status_callback_url' => :'String',
71
+ :'timeout' => :'Integer'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # List of class defined in allOf (OpenAPI v3)
82
+ def self.openapi_all_of
83
+ [
84
+ :'OutDialAllOf',
85
+ :'PerclCommand'
86
+ ]
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDial` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!self.class.attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDial`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ # call parent's initialize
105
+ super(attributes)
106
+
107
+ if attributes.key?(:'action_url')
108
+ self.action_url = attributes[:'action_url']
109
+ end
110
+
111
+ if attributes.key?(:'call_connect_url')
112
+ self.call_connect_url = attributes[:'call_connect_url']
113
+ end
114
+
115
+ if attributes.key?(:'calling_number')
116
+ self.calling_number = attributes[:'calling_number']
117
+ end
118
+
119
+ if attributes.key?(:'destination')
120
+ self.destination = attributes[:'destination']
121
+ end
122
+
123
+ if attributes.key?(:'if_machine')
124
+ self.if_machine = attributes[:'if_machine']
125
+ end
126
+
127
+ if attributes.key?(:'if_machine_url')
128
+ self.if_machine_url = attributes[:'if_machine_url']
129
+ end
130
+
131
+ if attributes.key?(:'send_digits')
132
+ self.send_digits = attributes[:'send_digits']
133
+ end
134
+
135
+ if attributes.key?(:'status_callback_url')
136
+ self.status_callback_url = attributes[:'status_callback_url']
137
+ end
138
+
139
+ if attributes.key?(:'timeout')
140
+ self.timeout = attributes[:'timeout']
141
+ end
142
+ end
143
+
144
+ # Show invalid properties with the reasons. Usually used together with valid?
145
+ # @return Array for valid properties with the reasons
146
+ def list_invalid_properties
147
+ invalid_properties = super
148
+ if @action_url.nil?
149
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
150
+ end
151
+
152
+ if @call_connect_url.nil?
153
+ invalid_properties.push('invalid value for "call_connect_url", call_connect_url cannot be nil.')
154
+ end
155
+
156
+ if @calling_number.nil?
157
+ invalid_properties.push('invalid value for "calling_number", calling_number cannot be nil.')
158
+ end
159
+
160
+ if @destination.nil?
161
+ invalid_properties.push('invalid value for "destination", destination cannot be nil.')
162
+ end
163
+
164
+ invalid_properties
165
+ end
166
+
167
+ # Check to see if the all the properties in the model are valid
168
+ # @return true if the model is valid
169
+ def valid?
170
+ return false if @action_url.nil?
171
+ return false if @call_connect_url.nil?
172
+ return false if @calling_number.nil?
173
+ return false if @destination.nil?
174
+ true && super
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ action_url == o.action_url &&
183
+ call_connect_url == o.call_connect_url &&
184
+ calling_number == o.calling_number &&
185
+ destination == o.destination &&
186
+ if_machine == o.if_machine &&
187
+ if_machine_url == o.if_machine_url &&
188
+ send_digits == o.send_digits &&
189
+ status_callback_url == o.status_callback_url &&
190
+ timeout == o.timeout && super(o)
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(o)
196
+ self == o
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ def hash
202
+ [action_url, call_connect_url, calling_number, destination, if_machine, if_machine_url, send_digits, status_callback_url, timeout].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def self.build_from_hash(attributes)
209
+ new.build_from_hash(attributes)
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ super(attributes)
218
+ self.class.openapi_types.each_pair do |key, type|
219
+ if type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ end
225
+ elsif !attributes[self.class.attribute_map[key]].nil?
226
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
228
+ end
229
+
230
+ self
231
+ end
232
+
233
+ # Deserializes the data based on type
234
+ # @param string type Data type
235
+ # @param string value Value to be deserialized
236
+ # @return [Object] Deserialized data
237
+ def _deserialize(type, value)
238
+ case type.to_sym
239
+ when :DateTime
240
+ DateTime.parse(value)
241
+ when :Date
242
+ Date.parse(value)
243
+ when :String
244
+ value.to_s
245
+ when :Integer
246
+ value.to_i
247
+ when :Float
248
+ value.to_f
249
+ when :Boolean
250
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
+ true
252
+ else
253
+ false
254
+ end
255
+ when :Object
256
+ # generic object (usually a Hash), return directly
257
+ value
258
+ when /\AArray<(?<inner_type>.+)>\z/
259
+ inner_type = Regexp.last_match[:inner_type]
260
+ value.map { |v| _deserialize(inner_type, v) }
261
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
+ k_type = Regexp.last_match[:k_type]
263
+ v_type = Regexp.last_match[:v_type]
264
+ {}.tap do |hash|
265
+ value.each do |k, v|
266
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
+ end
268
+ end
269
+ else # model
270
+ Freeclimb.const_get(type).build_from_hash(value)
271
+ end
272
+ end
273
+
274
+ # Returns the string representation of the object
275
+ # @return [String] String presentation of the object
276
+ def to_s
277
+ to_hash.to_s
278
+ end
279
+
280
+ # to_body is an alias to to_hash (backward compatibility)
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_body
283
+ to_hash
284
+ end
285
+
286
+ # Returns the object in the form of hash
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_hash
289
+ hash = super
290
+ self.class.attribute_map.each_pair do |attr, param|
291
+ value = self.send(attr)
292
+ if value.nil?
293
+ is_nullable = self.class.openapi_nullable.include?(attr)
294
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
295
+ end
296
+
297
+ hash[param] = _to_hash(value)
298
+ end
299
+ hash
300
+ end
301
+
302
+ # Outputs non-array value in the form of hash
303
+ # For object, use to_hash. Otherwise, just return the value
304
+ # @param [Object] value Any valid value
305
+ # @return [Hash] Returns the value in the form of hash
306
+ def _to_hash(value)
307
+ if value.is_a?(Array)
308
+ value.compact.map { |v| _to_hash(v) }
309
+ elsif value.is_a?(Hash)
310
+ {}.tap do |hash|
311
+ value.each { |k, v| hash[k] = _to_hash(v) }
312
+ end
313
+ elsif value.respond_to? :to_hash
314
+ value.to_hash
315
+ else
316
+ value
317
+ end
318
+ end
319
+ end
320
+ end
@@ -0,0 +1,307 @@
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 OutDialAllOf
17
+ # URL to which FreeClimb sends an HTTP POST request.
18
+ attr_accessor :action_url
19
+
20
+ # URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial.
21
+ attr_accessor :call_connect_url
22
+
23
+ # he caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb.
24
+ attr_accessor :calling_number
25
+
26
+ # E.164 representation of the phone number to Call.
27
+ attr_accessor :destination
28
+
29
+ # Specifies how FreeClimb should handle this OutDial if an answering machine answers the Call. Valid values: `redirect` invokes the ifMachineUrl for instructions. `hangup` hangs up the Call. The ifMachineUrl will not be invoked.
30
+ attr_accessor :if_machine
31
+
32
+ # When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included.
33
+ attr_accessor :if_machine_url
34
+
35
+ # DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension.
36
+ attr_accessor :send_digits
37
+
38
+ # When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored.
39
+ attr_accessor :status_callback_url
40
+
41
+ # Maximum time in seconds the `OutDial` command waits for the called party to answer the Call. When a timeout occurs, FreeClimb invokes the `callConnectUrl` Webhook to report that the out-dialed Call has ended with a status of `noAnswer`.
42
+ attr_accessor :timeout
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'action_url' => :'actionUrl',
48
+ :'call_connect_url' => :'callConnectUrl',
49
+ :'calling_number' => :'callingNumber',
50
+ :'destination' => :'destination',
51
+ :'if_machine' => :'ifMachine',
52
+ :'if_machine_url' => :'ifMachineUrl',
53
+ :'send_digits' => :'sendDigits',
54
+ :'status_callback_url' => :'statusCallbackUrl',
55
+ :'timeout' => :'timeout'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'action_url' => :'String',
63
+ :'call_connect_url' => :'String',
64
+ :'calling_number' => :'Float',
65
+ :'destination' => :'Float',
66
+ :'if_machine' => :'String',
67
+ :'if_machine_url' => :'String',
68
+ :'send_digits' => :'String',
69
+ :'status_callback_url' => :'String',
70
+ :'timeout' => :'Integer'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialAllOf` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'action_url')
96
+ self.action_url = attributes[:'action_url']
97
+ end
98
+
99
+ if attributes.key?(:'call_connect_url')
100
+ self.call_connect_url = attributes[:'call_connect_url']
101
+ end
102
+
103
+ if attributes.key?(:'calling_number')
104
+ self.calling_number = attributes[:'calling_number']
105
+ end
106
+
107
+ if attributes.key?(:'destination')
108
+ self.destination = attributes[:'destination']
109
+ end
110
+
111
+ if attributes.key?(:'if_machine')
112
+ self.if_machine = attributes[:'if_machine']
113
+ end
114
+
115
+ if attributes.key?(:'if_machine_url')
116
+ self.if_machine_url = attributes[:'if_machine_url']
117
+ end
118
+
119
+ if attributes.key?(:'send_digits')
120
+ self.send_digits = attributes[:'send_digits']
121
+ end
122
+
123
+ if attributes.key?(:'status_callback_url')
124
+ self.status_callback_url = attributes[:'status_callback_url']
125
+ end
126
+
127
+ if attributes.key?(:'timeout')
128
+ self.timeout = attributes[:'timeout']
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ if @action_url.nil?
137
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
138
+ end
139
+
140
+ if @call_connect_url.nil?
141
+ invalid_properties.push('invalid value for "call_connect_url", call_connect_url cannot be nil.')
142
+ end
143
+
144
+ if @calling_number.nil?
145
+ invalid_properties.push('invalid value for "calling_number", calling_number cannot be nil.')
146
+ end
147
+
148
+ if @destination.nil?
149
+ invalid_properties.push('invalid value for "destination", destination cannot be nil.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ return false if @action_url.nil?
159
+ return false if @call_connect_url.nil?
160
+ return false if @calling_number.nil?
161
+ return false if @destination.nil?
162
+ true
163
+ end
164
+
165
+ # Checks equality by comparing each attribute.
166
+ # @param [Object] Object to be compared
167
+ def ==(o)
168
+ return true if self.equal?(o)
169
+ self.class == o.class &&
170
+ action_url == o.action_url &&
171
+ call_connect_url == o.call_connect_url &&
172
+ calling_number == o.calling_number &&
173
+ destination == o.destination &&
174
+ if_machine == o.if_machine &&
175
+ if_machine_url == o.if_machine_url &&
176
+ send_digits == o.send_digits &&
177
+ status_callback_url == o.status_callback_url &&
178
+ timeout == o.timeout
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [action_url, call_connect_url, calling_number, destination, if_machine, if_machine_url, send_digits, status_callback_url, timeout].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ new.build_from_hash(attributes)
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ self.class.openapi_types.each_pair do |key, type|
206
+ if type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
210
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
+ end
212
+ elsif !attributes[self.class.attribute_map[key]].nil?
213
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
215
+ end
216
+
217
+ self
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def _deserialize(type, value)
225
+ case type.to_sym
226
+ when :DateTime
227
+ DateTime.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value.to_s
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :Boolean
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ Freeclimb.const_get(type).build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+ end
307
+ end