freeclimb 1.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +80 -0
- data/Gemfile.lock +1 -1
- data/README.md +67 -42
- data/docs/AccountRequest.md +3 -5
- data/docs/AccountResult.md +12 -12
- data/docs/AccountResultAllOf.md +8 -8
- data/docs/AddToConference.md +35 -0
- data/docs/AddToConferenceAllOf.md +35 -0
- data/docs/ApplicationList.md +9 -9
- data/docs/ApplicationListAllOf.md +2 -2
- data/docs/ApplicationRequest.md +8 -10
- data/docs/ApplicationResult.md +14 -14
- data/docs/ApplicationResultAllOf.md +10 -10
- data/docs/AvailableNumber.md +7 -7
- data/docs/AvailableNumberList.md +9 -9
- data/docs/AvailableNumberListAllOf.md +2 -2
- data/docs/BuyIncomingNumberRequest.md +4 -6
- data/docs/CallList.md +9 -9
- data/docs/CallListAllOf.md +2 -2
- data/docs/CallResult.md +20 -20
- data/docs/CallResultAllOf.md +16 -16
- data/docs/ConferenceList.md +9 -9
- data/docs/ConferenceListAllOf.md +2 -2
- data/docs/ConferenceParticipantList.md +9 -9
- data/docs/ConferenceParticipantListAllOf.md +2 -2
- data/docs/ConferenceParticipantResult.md +11 -11
- data/docs/ConferenceParticipantResultAllOf.md +7 -7
- data/docs/ConferenceResult.md +15 -15
- data/docs/ConferenceResultAllOf.md +11 -11
- data/docs/CreateConference.md +27 -0
- data/docs/CreateConferenceAllOf.md +27 -0
- data/docs/CreateConferenceRequest.md +6 -8
- data/docs/DefaultApi.md +22 -38
- data/docs/Dequeue.md +16 -0
- data/docs/Enqueue.md +23 -0
- data/docs/EnqueueAllOf.md +23 -0
- data/docs/FilterLogsRequest.md +2 -4
- data/docs/GetDigits.md +33 -0
- data/docs/GetDigitsAllOf.md +33 -0
- data/docs/GetSpeech.md +41 -0
- data/docs/GetSpeechAllOf.md +41 -0
- data/docs/IncomingNumberList.md +9 -9
- data/docs/IncomingNumberListAllOf.md +2 -2
- data/docs/IncomingNumberRequest.md +3 -5
- data/docs/IncomingNumberResult.md +14 -14
- data/docs/IncomingNumberResultAllOf.md +10 -10
- data/docs/LogList.md +9 -9
- data/docs/LogListAllOf.md +2 -2
- data/docs/LogResult.md +8 -8
- data/docs/MakeCallRequest.md +11 -11
- data/docs/MessageRequest.md +10 -12
- data/docs/MessageRequestAllOf.md +6 -8
- data/docs/MessageResult.md +14 -14
- data/docs/MessageResultAllOf.md +10 -10
- data/docs/MessagesList.md +9 -9
- data/docs/MessagesListAllOf.md +2 -2
- data/docs/MutableResourceModel.md +5 -5
- data/docs/OutDial.md +35 -0
- data/docs/OutDialAllOf.md +35 -0
- data/docs/PaginationModel.md +8 -8
- data/docs/Pause.md +17 -0
- data/docs/PauseAllOf.md +17 -0
- data/docs/PerclCommand.md +17 -0
- data/docs/PerclScript.md +17 -0
- data/docs/Play.md +23 -0
- data/docs/PlayAllOf.md +23 -0
- data/docs/PlayEarlyMedia.md +17 -0
- data/docs/PlayEarlyMediaAllOf.md +17 -0
- data/docs/QueueList.md +9 -9
- data/docs/QueueListAllOf.md +2 -2
- data/docs/QueueMember.md +6 -6
- data/docs/QueueMemberList.md +9 -9
- data/docs/QueueMemberListAllOf.md +2 -2
- data/docs/QueueRequest.md +3 -5
- data/docs/QueueResult.md +12 -12
- data/docs/QueueResultAllOf.md +8 -8
- data/docs/RecordUtterance.md +27 -0
- data/docs/RecordUtteranceAllOf.md +27 -0
- data/docs/RecordingList.md +9 -9
- data/docs/RecordingListAllOf.md +2 -2
- data/docs/RecordingResult.md +10 -10
- data/docs/RecordingResultAllOf.md +6 -6
- data/docs/Redirect.md +17 -0
- data/docs/RedirectAllOf.md +17 -0
- data/docs/RemoveFromConference.md +17 -0
- data/docs/RemoveFromConferenceAllOf.md +17 -0
- data/docs/Say.md +25 -0
- data/docs/SayAllOf.md +25 -0
- data/docs/SendDigits.md +21 -0
- data/docs/SendDigitsAllOf.md +21 -0
- data/docs/SetListen.md +19 -0
- data/docs/SetListenAllOf.md +19 -0
- data/docs/SetTalk.md +19 -0
- data/docs/SetTalkAllOf.md +19 -0
- data/docs/Sms.md +23 -0
- data/docs/SmsAllOf.md +23 -0
- data/docs/StartRecordCall.md +16 -0
- data/docs/TerminateConference.md +17 -0
- data/docs/TerminateConferenceAllOf.md +17 -0
- data/docs/UpdateCallRequest.md +2 -4
- data/docs/UpdateConferenceParticipantRequest.md +3 -5
- data/docs/UpdateConferenceRequest.md +4 -6
- data/freeclimb-2.1.0.gem +0 -0
- data/lib/freeclimb.rb +69 -2
- data/lib/freeclimb/api/default_api.rb +42 -34
- data/lib/freeclimb/api_client.rb +1 -1
- data/lib/freeclimb/models/account_request.rb +4 -14
- data/lib/freeclimb/models/add_to_conference.rb +320 -0
- data/lib/freeclimb/models/add_to_conference_all_of.rb +307 -0
- data/lib/freeclimb/models/application_request.rb +4 -14
- data/lib/freeclimb/models/buy_incoming_number_request.rb +4 -14
- data/lib/freeclimb/models/create_conference.rb +275 -0
- data/lib/freeclimb/models/create_conference_all_of.rb +262 -0
- data/lib/freeclimb/models/create_conference_request.rb +4 -14
- data/lib/freeclimb/models/dequeue.rb +209 -0
- data/lib/freeclimb/models/enqueue.rb +265 -0
- data/lib/freeclimb/models/enqueue_all_of.rb +252 -0
- data/lib/freeclimb/models/filter_logs_request.rb +4 -14
- data/lib/freeclimb/models/get_digits.rb +307 -0
- data/lib/freeclimb/models/get_digits_all_of.rb +294 -0
- data/lib/freeclimb/models/get_speech.rb +352 -0
- data/lib/freeclimb/models/get_speech_all_of.rb +339 -0
- data/lib/freeclimb/models/incoming_number_request.rb +4 -14
- data/lib/freeclimb/models/make_call_request.rb +14 -14
- data/lib/freeclimb/models/message_request.rb +1 -11
- data/lib/freeclimb/models/message_request_all_of.rb +1 -11
- data/lib/freeclimb/models/message_result.rb +3 -3
- data/lib/freeclimb/models/message_result_all_of.rb +3 -3
- data/lib/freeclimb/models/out_dial.rb +330 -0
- data/lib/freeclimb/models/out_dial_all_of.rb +317 -0
- data/lib/freeclimb/models/pause.rb +225 -0
- data/lib/freeclimb/models/{dequeue_member_request.rb → pause_all_of.rb} +16 -11
- data/lib/freeclimb/models/percl_command.rb +211 -0
- data/lib/freeclimb/models/percl_script.rb +210 -0
- data/lib/freeclimb/models/play.rb +255 -0
- data/lib/freeclimb/models/play_all_of.rb +242 -0
- data/lib/freeclimb/models/play_early_media.rb +225 -0
- data/lib/freeclimb/models/play_early_media_all_of.rb +212 -0
- data/lib/freeclimb/models/queue_request.rb +4 -14
- data/lib/freeclimb/models/record_utterance.rb +275 -0
- data/lib/freeclimb/models/record_utterance_all_of.rb +262 -0
- data/lib/freeclimb/models/redirect.rb +220 -0
- data/lib/freeclimb/models/redirect_all_of.rb +207 -0
- data/lib/freeclimb/models/remove_from_conference.rb +225 -0
- data/lib/freeclimb/models/remove_from_conference_all_of.rb +212 -0
- data/lib/freeclimb/models/say.rb +265 -0
- data/lib/freeclimb/models/say_all_of.rb +252 -0
- data/lib/freeclimb/models/send_digits.rb +245 -0
- data/lib/freeclimb/models/send_digits_all_of.rb +232 -0
- data/lib/freeclimb/models/set_listen.rb +235 -0
- data/lib/freeclimb/models/set_listen_all_of.rb +222 -0
- data/lib/freeclimb/models/set_talk.rb +235 -0
- data/lib/freeclimb/models/set_talk_all_of.rb +222 -0
- data/lib/freeclimb/models/sms.rb +265 -0
- data/lib/freeclimb/models/sms_all_of.rb +252 -0
- data/lib/freeclimb/models/start_record_call.rb +209 -0
- data/lib/freeclimb/models/terminate_conference.rb +225 -0
- data/lib/freeclimb/models/terminate_conference_all_of.rb +212 -0
- data/lib/freeclimb/models/update_call_request.rb +4 -14
- data/lib/freeclimb/models/update_conference_participant_request.rb +4 -14
- data/lib/freeclimb/models/update_conference_request.rb +4 -14
- data/lib/freeclimb/version.rb +1 -1
- data/spec/api/default_api_spec.rb +9 -24
- data/spec/models/add_to_conference_spec.rb +95 -0
- data/spec/models/create_conference_spec.rb +71 -0
- data/spec/models/{dequeue_member_request_spec.rb → dequeue_spec.rb} +8 -7
- data/spec/models/enqueue_spec.rb +59 -0
- data/spec/models/get_digits_spec.rb +83 -0
- data/spec/models/get_speech_spec.rb +113 -0
- data/spec/models/out_dial_spec.rb +89 -0
- data/spec/models/pause_spec.rb +41 -0
- data/spec/models/percl_command_spec.rb +41 -0
- data/spec/models/percl_script_spec.rb +41 -0
- data/spec/models/play_early_media_spec.rb +41 -0
- data/spec/models/play_spec.rb +53 -0
- data/spec/models/record_utterance_spec.rb +71 -0
- data/spec/models/redirect_spec.rb +41 -0
- data/spec/models/remove_from_conference_spec.rb +41 -0
- data/spec/models/say_spec.rb +65 -0
- data/spec/models/send_digits_spec.rb +47 -0
- data/spec/models/set_listen_spec.rb +47 -0
- data/spec/models/set_talk_spec.rb +47 -0
- data/spec/models/sms_spec.rb +59 -0
- data/spec/models/start_record_call_spec.rb +35 -0
- data/spec/models/terminate_conference_spec.rb +41 -0
- metadata +128 -34
- data/docs/DequeueMemberRequest.md +0 -17
- data/docs/Percl.md +0 -697
- data/lib/percl/calls.rb +0 -43
- data/lib/percl/conference_participants.rb +0 -40
- data/lib/percl/conferences.rb +0 -21
- data/lib/percl/ivr.rb +0 -63
- data/lib/percl/jsonable.rb +0 -23
- data/lib/percl/percl.rb +0 -29
- data/lib/percl/queue_members.rb +0 -15
- data/lib/percl/recordings.rb +0 -15
- data/lib/percl/sms.rb +0 -11
- data/spec/percl/calls_spec.rb +0 -111
- data/spec/percl/conference_participant_spec.rb +0 -96
- data/spec/percl/conference_spec.rb +0 -46
- data/spec/percl/ivr_spec.rb +0 -155
- data/spec/percl/jsonable_spec.rb +0 -28
- data/spec/percl/percl_spec.rb +0 -31
- data/spec/percl/queue_members_spec.rb +0 -35
- data/spec/percl/recordings_spec.rb +0 -32
- data/spec/percl/sms_spec.rb +0 -29
@@ -0,0 +1,317 @@
|
|
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
|
+
# Parameter `privacyMode` will not log the `text` as required by PCI compliance.
|
45
|
+
attr_accessor :privacy_mode
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'action_url' => :'actionUrl',
|
51
|
+
:'call_connect_url' => :'callConnectUrl',
|
52
|
+
:'calling_number' => :'callingNumber',
|
53
|
+
:'destination' => :'destination',
|
54
|
+
:'if_machine' => :'ifMachine',
|
55
|
+
:'if_machine_url' => :'ifMachineUrl',
|
56
|
+
:'send_digits' => :'sendDigits',
|
57
|
+
:'status_callback_url' => :'statusCallbackUrl',
|
58
|
+
:'timeout' => :'timeout',
|
59
|
+
:'privacy_mode' => :'privacyMode'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute type mapping.
|
64
|
+
def self.openapi_types
|
65
|
+
{
|
66
|
+
:'action_url' => :'String',
|
67
|
+
:'call_connect_url' => :'String',
|
68
|
+
:'calling_number' => :'Float',
|
69
|
+
:'destination' => :'Float',
|
70
|
+
:'if_machine' => :'String',
|
71
|
+
:'if_machine_url' => :'String',
|
72
|
+
:'send_digits' => :'String',
|
73
|
+
:'status_callback_url' => :'String',
|
74
|
+
:'timeout' => :'Integer',
|
75
|
+
:'privacy_mode' => :'Boolean'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# List of attributes with nullable: true
|
80
|
+
def self.openapi_nullable
|
81
|
+
Set.new([
|
82
|
+
])
|
83
|
+
end
|
84
|
+
|
85
|
+
# Initializes the object
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
def initialize(attributes = {})
|
88
|
+
if (!attributes.is_a?(Hash))
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialAllOf` initialize method"
|
90
|
+
end
|
91
|
+
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
94
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
95
|
+
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
|
96
|
+
end
|
97
|
+
h[k.to_sym] = v
|
98
|
+
}
|
99
|
+
|
100
|
+
if attributes.key?(:'action_url')
|
101
|
+
self.action_url = attributes[:'action_url']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'call_connect_url')
|
105
|
+
self.call_connect_url = attributes[:'call_connect_url']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'calling_number')
|
109
|
+
self.calling_number = attributes[:'calling_number']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'destination')
|
113
|
+
self.destination = attributes[:'destination']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'if_machine')
|
117
|
+
self.if_machine = attributes[:'if_machine']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'if_machine_url')
|
121
|
+
self.if_machine_url = attributes[:'if_machine_url']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'send_digits')
|
125
|
+
self.send_digits = attributes[:'send_digits']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'status_callback_url')
|
129
|
+
self.status_callback_url = attributes[:'status_callback_url']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'timeout')
|
133
|
+
self.timeout = attributes[:'timeout']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'privacy_mode')
|
137
|
+
self.privacy_mode = attributes[:'privacy_mode']
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
142
|
+
# @return Array for valid properties with the reasons
|
143
|
+
def list_invalid_properties
|
144
|
+
invalid_properties = Array.new
|
145
|
+
if @action_url.nil?
|
146
|
+
invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
|
147
|
+
end
|
148
|
+
|
149
|
+
if @call_connect_url.nil?
|
150
|
+
invalid_properties.push('invalid value for "call_connect_url", call_connect_url cannot be nil.')
|
151
|
+
end
|
152
|
+
|
153
|
+
if @calling_number.nil?
|
154
|
+
invalid_properties.push('invalid value for "calling_number", calling_number cannot be nil.')
|
155
|
+
end
|
156
|
+
|
157
|
+
if @destination.nil?
|
158
|
+
invalid_properties.push('invalid value for "destination", destination cannot be nil.')
|
159
|
+
end
|
160
|
+
|
161
|
+
invalid_properties
|
162
|
+
end
|
163
|
+
|
164
|
+
# Check to see if the all the properties in the model are valid
|
165
|
+
# @return true if the model is valid
|
166
|
+
def valid?
|
167
|
+
return false if @action_url.nil?
|
168
|
+
return false if @call_connect_url.nil?
|
169
|
+
return false if @calling_number.nil?
|
170
|
+
return false if @destination.nil?
|
171
|
+
true
|
172
|
+
end
|
173
|
+
|
174
|
+
# Checks equality by comparing each attribute.
|
175
|
+
# @param [Object] Object to be compared
|
176
|
+
def ==(o)
|
177
|
+
return true if self.equal?(o)
|
178
|
+
self.class == o.class &&
|
179
|
+
action_url == o.action_url &&
|
180
|
+
call_connect_url == o.call_connect_url &&
|
181
|
+
calling_number == o.calling_number &&
|
182
|
+
destination == o.destination &&
|
183
|
+
if_machine == o.if_machine &&
|
184
|
+
if_machine_url == o.if_machine_url &&
|
185
|
+
send_digits == o.send_digits &&
|
186
|
+
status_callback_url == o.status_callback_url &&
|
187
|
+
timeout == o.timeout &&
|
188
|
+
privacy_mode == o.privacy_mode
|
189
|
+
end
|
190
|
+
|
191
|
+
# @see the `==` method
|
192
|
+
# @param [Object] Object to be compared
|
193
|
+
def eql?(o)
|
194
|
+
self == o
|
195
|
+
end
|
196
|
+
|
197
|
+
# Calculates hash code according to all attributes.
|
198
|
+
# @return [Integer] Hash code
|
199
|
+
def hash
|
200
|
+
[action_url, call_connect_url, calling_number, destination, if_machine, if_machine_url, send_digits, status_callback_url, timeout, privacy_mode].hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Builds the object from hash
|
204
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
205
|
+
# @return [Object] Returns the model itself
|
206
|
+
def self.build_from_hash(attributes)
|
207
|
+
new.build_from_hash(attributes)
|
208
|
+
end
|
209
|
+
|
210
|
+
# Builds the object from hash
|
211
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
212
|
+
# @return [Object] Returns the model itself
|
213
|
+
def build_from_hash(attributes)
|
214
|
+
return nil unless attributes.is_a?(Hash)
|
215
|
+
self.class.openapi_types.each_pair do |key, type|
|
216
|
+
if type =~ /\AArray<(.*)>/i
|
217
|
+
# check to ensure the input is an array given that the attribute
|
218
|
+
# is documented as an array but the input is not
|
219
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
220
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
221
|
+
end
|
222
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
223
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
224
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
225
|
+
end
|
226
|
+
|
227
|
+
self
|
228
|
+
end
|
229
|
+
|
230
|
+
# Deserializes the data based on type
|
231
|
+
# @param string type Data type
|
232
|
+
# @param string value Value to be deserialized
|
233
|
+
# @return [Object] Deserialized data
|
234
|
+
def _deserialize(type, value)
|
235
|
+
case type.to_sym
|
236
|
+
when :DateTime
|
237
|
+
DateTime.parse(value)
|
238
|
+
when :Date
|
239
|
+
Date.parse(value)
|
240
|
+
when :String
|
241
|
+
value.to_s
|
242
|
+
when :Integer
|
243
|
+
value.to_i
|
244
|
+
when :Float
|
245
|
+
value.to_f
|
246
|
+
when :Boolean
|
247
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
248
|
+
true
|
249
|
+
else
|
250
|
+
false
|
251
|
+
end
|
252
|
+
when :Object
|
253
|
+
# generic object (usually a Hash), return directly
|
254
|
+
value
|
255
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
256
|
+
inner_type = Regexp.last_match[:inner_type]
|
257
|
+
value.map { |v| _deserialize(inner_type, v) }
|
258
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
259
|
+
k_type = Regexp.last_match[:k_type]
|
260
|
+
v_type = Regexp.last_match[:v_type]
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each do |k, v|
|
263
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
else # model
|
267
|
+
Freeclimb.const_get(type).build_from_hash(value)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
# Returns the string representation of the object
|
272
|
+
# @return [String] String presentation of the object
|
273
|
+
def to_s
|
274
|
+
to_hash.to_s
|
275
|
+
end
|
276
|
+
|
277
|
+
# to_body is an alias to to_hash (backward compatibility)
|
278
|
+
# @return [Hash] Returns the object in the form of hash
|
279
|
+
def to_body
|
280
|
+
to_hash
|
281
|
+
end
|
282
|
+
|
283
|
+
# Returns the object in the form of hash
|
284
|
+
# @return [Hash] Returns the object in the form of hash
|
285
|
+
def to_hash
|
286
|
+
hash = {}
|
287
|
+
self.class.attribute_map.each_pair do |attr, param|
|
288
|
+
value = self.send(attr)
|
289
|
+
if value.nil?
|
290
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
291
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
292
|
+
end
|
293
|
+
|
294
|
+
hash[param] = _to_hash(value)
|
295
|
+
end
|
296
|
+
hash
|
297
|
+
end
|
298
|
+
|
299
|
+
# Outputs non-array value in the form of hash
|
300
|
+
# For object, use to_hash. Otherwise, just return the value
|
301
|
+
# @param [Object] value Any valid value
|
302
|
+
# @return [Hash] Returns the value in the form of hash
|
303
|
+
def _to_hash(value)
|
304
|
+
if value.is_a?(Array)
|
305
|
+
value.compact.map { |v| _to_hash(v) }
|
306
|
+
elsif value.is_a?(Hash)
|
307
|
+
{}.tap do |hash|
|
308
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
309
|
+
end
|
310
|
+
elsif value.respond_to? :to_hash
|
311
|
+
value.to_hash
|
312
|
+
else
|
313
|
+
value
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
@@ -0,0 +1,225 @@
|
|
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 `Pause` command halts execution of the current PerCL script for a specified number of milliseconds. If `Pause` is the first command in a PerCL document, FreeClimb will wait for the specified time to elapse before picking up the call.
|
17
|
+
class Pause < PerclCommand
|
18
|
+
# Length in milliseconds. FreeClimb will wait silently before continuing on.
|
19
|
+
attr_accessor :length
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'length' => :'length'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'length' => :'Integer'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of class defined in allOf (OpenAPI v3)
|
42
|
+
def self.openapi_all_of
|
43
|
+
[
|
44
|
+
:'PauseAllOf',
|
45
|
+
:'PerclCommand'
|
46
|
+
]
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::Pause` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::Pause`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
# call parent's initialize
|
65
|
+
super(attributes)
|
66
|
+
|
67
|
+
if attributes.key?(:'length')
|
68
|
+
self.length = attributes[:'length']
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
73
|
+
# @return Array for valid properties with the reasons
|
74
|
+
def list_invalid_properties
|
75
|
+
invalid_properties = super
|
76
|
+
if @length.nil?
|
77
|
+
invalid_properties.push('invalid value for "length", length cannot be nil.')
|
78
|
+
end
|
79
|
+
|
80
|
+
invalid_properties
|
81
|
+
end
|
82
|
+
|
83
|
+
# Check to see if the all the properties in the model are valid
|
84
|
+
# @return true if the model is valid
|
85
|
+
def valid?
|
86
|
+
return false if @length.nil?
|
87
|
+
true && super
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
length == o.length && super(o)
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[length].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
new.build_from_hash(attributes)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
super(attributes)
|
123
|
+
self.class.openapi_types.each_pair do |key, type|
|
124
|
+
if type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :DateTime
|
145
|
+
DateTime.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
Freeclimb.const_get(type).build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = super
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
if value.nil?
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
200
|
+
end
|
201
|
+
|
202
|
+
hash[param] = _to_hash(value)
|
203
|
+
end
|
204
|
+
hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Outputs non-array value in the form of hash
|
208
|
+
# For object, use to_hash. Otherwise, just return the value
|
209
|
+
# @param [Object] value Any valid value
|
210
|
+
# @return [Hash] Returns the value in the form of hash
|
211
|
+
def _to_hash(value)
|
212
|
+
if value.is_a?(Array)
|
213
|
+
value.compact.map { |v| _to_hash(v) }
|
214
|
+
elsif value.is_a?(Hash)
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
217
|
+
end
|
218
|
+
elsif value.respond_to? :to_hash
|
219
|
+
value.to_hash
|
220
|
+
else
|
221
|
+
value
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|