freeclimb 3.0.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +38 -19
- data/README.md +37 -35
- data/docs/AccountRequest.md +9 -8
- data/docs/AccountResult.md +27 -26
- data/docs/AccountResultAllOf.md +19 -18
- data/docs/AddToConference.md +25 -24
- data/docs/AddToConferenceAllOf.md +25 -24
- data/docs/ApplicationList.md +21 -20
- data/docs/ApplicationListAllOf.md +7 -6
- data/docs/ApplicationRequest.md +19 -18
- data/docs/ApplicationResult.md +31 -30
- data/docs/ApplicationResultAllOf.md +23 -22
- data/docs/AvailableNumber.md +17 -16
- data/docs/AvailableNumberList.md +21 -20
- data/docs/AvailableNumberListAllOf.md +7 -6
- data/docs/BuyIncomingNumberRequest.md +11 -10
- data/docs/CallList.md +21 -20
- data/docs/CallListAllOf.md +7 -6
- data/docs/CallResult.md +43 -44
- data/docs/CallResultAllOf.md +35 -36
- data/docs/Capabilities.md +26 -0
- data/docs/ConferenceList.md +21 -20
- data/docs/ConferenceListAllOf.md +7 -6
- data/docs/ConferenceParticipantList.md +21 -20
- data/docs/ConferenceParticipantListAllOf.md +7 -6
- data/docs/ConferenceParticipantResult.md +25 -24
- data/docs/ConferenceParticipantResultAllOf.md +17 -16
- data/docs/ConferenceResult.md +33 -32
- data/docs/ConferenceResultAllOf.md +25 -24
- data/docs/CreateConference.md +17 -16
- data/docs/CreateConferenceAllOf.md +17 -16
- data/docs/CreateConferenceRequest.md +15 -14
- data/docs/DefaultApi.md +1629 -629
- data/docs/Dequeue.md +3 -4
- data/docs/Enqueue.md +13 -12
- data/docs/EnqueueAllOf.md +13 -12
- data/docs/FilterLogsRequest.md +7 -6
- data/docs/GetDigits.md +23 -22
- data/docs/GetDigitsAllOf.md +23 -22
- data/docs/GetSpeech.md +31 -30
- data/docs/GetSpeechAllOf.md +31 -30
- data/docs/Hangup.md +7 -6
- data/docs/HangupAllOf.md +7 -6
- data/docs/IncomingNumberList.md +21 -20
- data/docs/IncomingNumberListAllOf.md +7 -6
- data/docs/IncomingNumberRequest.md +9 -8
- data/docs/IncomingNumberResult.md +33 -30
- data/docs/IncomingNumberResultAllOf.md +25 -22
- data/docs/LogList.md +21 -20
- data/docs/LogListAllOf.md +7 -6
- data/docs/LogResult.md +19 -18
- data/docs/MakeCallRequest.md +25 -24
- data/docs/MessageRequest.md +23 -22
- data/docs/MessageRequestAllOf.md +15 -14
- data/docs/MessageResult.md +29 -28
- data/docs/MessageResultAllOf.md +21 -20
- data/docs/MessagesList.md +21 -20
- data/docs/MessagesListAllOf.md +7 -6
- data/docs/MutableResourceModel.md +13 -12
- data/docs/OutDial.md +25 -24
- data/docs/OutDialAllOf.md +25 -24
- data/docs/PaginationModel.md +19 -18
- data/docs/Pause.md +7 -6
- data/docs/PauseAllOf.md +7 -6
- data/docs/PerclCommand.md +7 -6
- data/docs/PerclScript.md +7 -6
- data/docs/Play.md +13 -12
- data/docs/PlayAllOf.md +13 -12
- data/docs/PlayEarlyMedia.md +7 -6
- data/docs/PlayEarlyMediaAllOf.md +7 -6
- data/docs/QueueList.md +21 -20
- data/docs/QueueListAllOf.md +7 -6
- data/docs/QueueMember.md +15 -14
- data/docs/QueueMemberList.md +21 -20
- data/docs/QueueMemberListAllOf.md +7 -6
- data/docs/QueueRequest.md +9 -8
- data/docs/QueueResult.md +27 -26
- data/docs/QueueResultAllOf.md +19 -18
- data/docs/RecordUtterance.md +19 -18
- data/docs/RecordUtteranceAllOf.md +19 -18
- data/docs/RecordingList.md +21 -20
- data/docs/RecordingListAllOf.md +7 -6
- data/docs/RecordingResult.md +23 -22
- data/docs/RecordingResultAllOf.md +15 -14
- data/docs/Redirect.md +7 -6
- data/docs/RedirectAllOf.md +7 -6
- data/docs/Reject.md +7 -6
- data/docs/RejectAllOf.md +7 -6
- data/docs/RemoveFromConference.md +7 -6
- data/docs/RemoveFromConferenceAllOf.md +7 -6
- data/docs/Say.md +15 -14
- data/docs/SayAllOf.md +15 -14
- data/docs/SendDigits.md +11 -10
- data/docs/SendDigitsAllOf.md +11 -10
- data/docs/SetListen.md +9 -8
- data/docs/SetListenAllOf.md +9 -8
- data/docs/SetTalk.md +9 -8
- data/docs/SetTalkAllOf.md +9 -8
- data/docs/Sms.md +13 -12
- data/docs/SmsAllOf.md +13 -12
- data/docs/StartRecordCall.md +3 -4
- data/docs/TerminateConference.md +7 -6
- data/docs/TerminateConferenceAllOf.md +7 -6
- data/docs/UpdateCallRequest.md +7 -6
- data/docs/UpdateConferenceParticipantRequest.md +9 -8
- data/docs/UpdateConferenceRequest.md +11 -10
- data/freeclimb.gemspec +3 -4
- data/lib/freeclimb/api/default_api.rb +449 -263
- data/lib/freeclimb/api_client.rb +55 -51
- data/lib/freeclimb/api_error.rb +2 -2
- data/lib/freeclimb/configuration.rb +41 -11
- data/lib/freeclimb/models/account_request.rb +20 -8
- data/lib/freeclimb/models/account_result.rb +39 -8
- data/lib/freeclimb/models/account_result_all_of.rb +39 -8
- data/lib/freeclimb/models/add_to_conference.rb +21 -8
- data/lib/freeclimb/models/add_to_conference_all_of.rb +20 -8
- data/lib/freeclimb/models/application_list.rb +28 -8
- data/lib/freeclimb/models/application_list_all_of.rb +21 -8
- data/lib/freeclimb/models/application_request.rb +20 -8
- data/lib/freeclimb/models/application_result.rb +29 -8
- data/lib/freeclimb/models/application_result_all_of.rb +29 -8
- data/lib/freeclimb/models/available_number.rb +35 -19
- data/lib/freeclimb/models/available_number_list.rb +28 -8
- data/lib/freeclimb/models/available_number_list_all_of.rb +21 -8
- data/lib/freeclimb/models/buy_incoming_number_request.rb +20 -8
- data/lib/freeclimb/models/call_list.rb +28 -8
- data/lib/freeclimb/models/call_list_all_of.rb +21 -8
- data/lib/freeclimb/models/call_result.rb +36 -21
- data/lib/freeclimb/models/call_result_all_of.rb +36 -21
- data/lib/freeclimb/models/capabilities.rb +265 -0
- data/lib/freeclimb/models/conference_list.rb +28 -8
- data/lib/freeclimb/models/conference_list_all_of.rb +21 -8
- data/lib/freeclimb/models/conference_participant_list.rb +28 -8
- data/lib/freeclimb/models/conference_participant_list_all_of.rb +21 -8
- data/lib/freeclimb/models/conference_participant_result.rb +26 -8
- data/lib/freeclimb/models/conference_participant_result_all_of.rb +26 -8
- data/lib/freeclimb/models/conference_result.rb +30 -8
- data/lib/freeclimb/models/conference_result_all_of.rb +30 -8
- data/lib/freeclimb/models/create_conference.rb +21 -8
- data/lib/freeclimb/models/create_conference_all_of.rb +20 -8
- data/lib/freeclimb/models/create_conference_request.rb +20 -8
- data/lib/freeclimb/models/dequeue.rb +21 -8
- data/lib/freeclimb/models/enqueue.rb +21 -8
- data/lib/freeclimb/models/enqueue_all_of.rb +20 -8
- data/lib/freeclimb/models/filter_logs_request.rb +20 -8
- data/lib/freeclimb/models/get_digits.rb +21 -8
- data/lib/freeclimb/models/get_digits_all_of.rb +20 -8
- data/lib/freeclimb/models/get_speech.rb +21 -8
- data/lib/freeclimb/models/get_speech_all_of.rb +20 -8
- data/lib/freeclimb/models/hangup.rb +21 -8
- data/lib/freeclimb/models/hangup_all_of.rb +20 -8
- data/lib/freeclimb/models/incoming_number_list.rb +28 -8
- data/lib/freeclimb/models/incoming_number_list_all_of.rb +21 -8
- data/lib/freeclimb/models/incoming_number_request.rb +20 -8
- data/lib/freeclimb/models/incoming_number_result.rb +39 -9
- data/lib/freeclimb/models/incoming_number_result_all_of.rb +39 -9
- data/lib/freeclimb/models/log_list.rb +28 -8
- data/lib/freeclimb/models/log_list_all_of.rb +21 -8
- data/lib/freeclimb/models/log_result.rb +27 -8
- data/lib/freeclimb/models/make_call_request.rb +22 -8
- data/lib/freeclimb/models/message_request.rb +20 -8
- data/lib/freeclimb/models/message_request_all_of.rb +20 -8
- data/lib/freeclimb/models/message_result.rb +28 -8
- data/lib/freeclimb/models/message_result_all_of.rb +28 -8
- data/lib/freeclimb/models/messages_list.rb +28 -8
- data/lib/freeclimb/models/messages_list_all_of.rb +21 -8
- data/lib/freeclimb/models/mutable_resource_model.rb +20 -8
- data/lib/freeclimb/models/out_dial.rb +21 -8
- data/lib/freeclimb/models/out_dial_all_of.rb +20 -8
- data/lib/freeclimb/models/pagination_model.rb +27 -8
- data/lib/freeclimb/models/pause.rb +21 -8
- data/lib/freeclimb/models/pause_all_of.rb +20 -8
- data/lib/freeclimb/models/percl_command.rb +39 -8
- data/lib/freeclimb/models/percl_script.rb +24 -8
- data/lib/freeclimb/models/play.rb +21 -8
- data/lib/freeclimb/models/play_all_of.rb +20 -8
- data/lib/freeclimb/models/play_early_media.rb +21 -8
- data/lib/freeclimb/models/play_early_media_all_of.rb +20 -8
- data/lib/freeclimb/models/queue_list.rb +28 -8
- data/lib/freeclimb/models/queue_list_all_of.rb +21 -8
- data/lib/freeclimb/models/queue_member.rb +25 -8
- data/lib/freeclimb/models/queue_member_list.rb +28 -8
- data/lib/freeclimb/models/queue_member_list_all_of.rb +21 -8
- data/lib/freeclimb/models/queue_request.rb +22 -8
- data/lib/freeclimb/models/queue_result.rb +27 -8
- data/lib/freeclimb/models/queue_result_all_of.rb +27 -8
- data/lib/freeclimb/models/record_utterance.rb +21 -8
- data/lib/freeclimb/models/record_utterance_all_of.rb +20 -8
- data/lib/freeclimb/models/recording_list.rb +28 -8
- data/lib/freeclimb/models/recording_list_all_of.rb +21 -8
- data/lib/freeclimb/models/recording_result.rb +25 -8
- data/lib/freeclimb/models/recording_result_all_of.rb +25 -8
- data/lib/freeclimb/models/redirect.rb +21 -8
- data/lib/freeclimb/models/redirect_all_of.rb +20 -8
- data/lib/freeclimb/models/reject.rb +21 -8
- data/lib/freeclimb/models/reject_all_of.rb +20 -8
- data/lib/freeclimb/models/remove_from_conference.rb +21 -8
- data/lib/freeclimb/models/remove_from_conference_all_of.rb +20 -8
- data/lib/freeclimb/models/say.rb +21 -8
- data/lib/freeclimb/models/say_all_of.rb +20 -8
- data/lib/freeclimb/models/send_digits.rb +21 -8
- data/lib/freeclimb/models/send_digits_all_of.rb +20 -8
- data/lib/freeclimb/models/set_listen.rb +21 -8
- data/lib/freeclimb/models/set_listen_all_of.rb +20 -8
- data/lib/freeclimb/models/set_talk.rb +21 -8
- data/lib/freeclimb/models/set_talk_all_of.rb +20 -8
- data/lib/freeclimb/models/sms.rb +21 -8
- data/lib/freeclimb/models/sms_all_of.rb +20 -8
- data/lib/freeclimb/models/start_record_call.rb +21 -8
- data/lib/freeclimb/models/terminate_conference.rb +21 -8
- data/lib/freeclimb/models/terminate_conference_all_of.rb +20 -8
- data/lib/freeclimb/models/update_call_request.rb +20 -8
- data/lib/freeclimb/models/update_conference_participant_request.rb +20 -8
- data/lib/freeclimb/models/update_conference_request.rb +20 -8
- data/lib/freeclimb/version.rb +3 -3
- data/lib/freeclimb.rb +25 -53
- data/spec/api/default_api_spec.rb +1095 -668
- data/spec/api_client_spec.rb +7 -7
- data/spec/configuration_spec.rb +13 -5
- data/spec/factories.rb +80 -0
- data/spec/models/account_request_spec.rb +20 -13
- data/spec/models/account_result_spec.rb +81 -12
- data/spec/models/add_to_conference_spec.rb +7 -14
- data/spec/models/application_list_spec.rb +55 -12
- data/spec/models/application_request_spec.rb +49 -12
- data/spec/models/application_result_spec.rb +85 -12
- data/spec/models/available_number_list_spec.rb +55 -13
- data/spec/models/available_number_spec.rb +43 -12
- data/spec/models/buy_incoming_number_request_spec.rb +25 -12
- data/spec/models/call_list_spec.rb +55 -13
- data/spec/models/call_result_spec.rb +124 -12
- data/spec/models/capabilities_spec.rb +58 -0
- data/spec/models/conference_list_spec.rb +55 -12
- data/spec/models/conference_participant_list_spec.rb +55 -12
- data/spec/models/conference_participant_result_spec.rb +67 -12
- data/spec/models/conference_result_spec.rb +99 -13
- data/spec/models/create_conference_request_spec.rb +41 -13
- data/spec/models/create_conference_spec.rb +7 -14
- data/spec/models/dequeue_spec.rb +7 -14
- data/spec/models/enqueue_spec.rb +7 -14
- data/spec/models/filter_logs_request_spec.rb +15 -14
- data/spec/models/get_digits_spec.rb +13 -14
- data/spec/models/get_speech_spec.rb +8 -15
- data/spec/models/hangup_spec.rb +5 -12
- data/spec/models/incoming_number_list_spec.rb +55 -13
- data/spec/models/incoming_number_request_spec.rb +20 -13
- data/spec/models/incoming_number_result_spec.rb +91 -13
- data/spec/models/log_list_spec.rb +55 -12
- data/spec/models/log_result_spec.rb +53 -12
- data/spec/models/make_call_request_spec.rb +67 -12
- data/spec/models/message_request_spec.rb +61 -13
- data/spec/models/message_result_spec.rb +83 -12
- data/spec/models/messages_list_spec.rb +55 -12
- data/spec/models/mutable_resource_model_spec.rb +31 -13
- data/spec/models/out_dial_spec.rb +13 -14
- data/spec/models/pagination_model_spec.rb +49 -12
- data/spec/models/pause_spec.rb +7 -14
- data/spec/models/percl_command_spec.rb +7 -14
- data/spec/models/percl_script_spec.rb +7 -14
- data/spec/models/play_early_media_spec.rb +7 -14
- data/spec/models/play_spec.rb +13 -14
- data/spec/models/queue_list_spec.rb +54 -12
- data/spec/models/queue_member_list_spec.rb +55 -12
- data/spec/models/queue_member_spec.rb +37 -13
- data/spec/models/queue_request_spec.rb +20 -14
- data/spec/models/queue_result_spec.rb +73 -12
- data/spec/models/record_utterance_spec.rb +13 -14
- data/spec/models/recording_list_spec.rb +55 -12
- data/spec/models/recording_result_spec.rb +61 -12
- data/spec/models/redirect_spec.rb +7 -14
- data/spec/models/reject_spec.rb +5 -12
- data/spec/models/remove_from_conference_spec.rb +7 -14
- data/spec/models/say_spec.rb +8 -15
- data/spec/models/send_digits_spec.rb +13 -14
- data/spec/models/set_listen_spec.rb +7 -14
- data/spec/models/set_talk_spec.rb +7 -14
- data/spec/models/sms_spec.rb +7 -14
- data/spec/models/start_record_call_spec.rb +7 -14
- data/spec/models/terminate_conference_spec.rb +7 -14
- data/spec/models/update_call_request_spec.rb +19 -14
- data/spec/models/update_conference_participant_request_spec.rb +20 -13
- data/spec/models/update_conference_request_spec.rb +29 -12
- data/spec/quickstart_spec.rb +10 -0
- data/spec/spec_helper.rb +62 -7
- metadata +17 -38
- data/freeclimb-2.0.3.gem +0 -0
- data/freeclimb-2.1.0.gem +0 -0
- data/freeclimb-2.1.1.gem +0 -0
- data/freeclimb-2.1.2.gem +0 -0
- data/freeclimb-2.2.0.gem +0 -0
- data/freeclimb-3.0.0.gem +0 -0
- data/lib/freeclimb/utils.rb +0 -34
- data/spec/api/web_mocks.rb +0 -473
data/lib/freeclimb/api_client.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
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
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
7
|
+
Contact: support@freeclimb.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
14
14
|
require 'json'
|
15
15
|
require 'logger'
|
16
16
|
require 'tempfile'
|
17
|
+
require 'time'
|
17
18
|
require 'typhoeus'
|
18
19
|
|
19
20
|
module Freeclimb
|
@@ -30,7 +31,7 @@ module Freeclimb
|
|
30
31
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
31
32
|
def initialize(config = Configuration.default)
|
32
33
|
@config = config
|
33
|
-
@user_agent = "
|
34
|
+
@user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
|
34
35
|
@default_headers = {
|
35
36
|
'Content-Type' => 'application/json',
|
36
37
|
'User-Agent' => @user_agent
|
@@ -86,7 +87,7 @@ module Freeclimb
|
|
86
87
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
87
88
|
# @return [Typhoeus::Request] A Typhoeus Request
|
88
89
|
def build_request(http_method, path, opts = {})
|
89
|
-
url = build_request_url(path)
|
90
|
+
url = build_request_url(path, opts)
|
90
91
|
http_method = http_method.to_sym.downcase
|
91
92
|
|
92
93
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
@@ -155,6 +156,44 @@ module Freeclimb
|
|
155
156
|
data
|
156
157
|
end
|
157
158
|
|
159
|
+
# Save response body into a file in (the defined) temporary folder, using the filename
|
160
|
+
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
161
|
+
# The response body is written to the file in chunks in order to handle files which
|
162
|
+
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
163
|
+
# process can use.
|
164
|
+
#
|
165
|
+
# @see Configuration#temp_folder_path
|
166
|
+
def download_file(request)
|
167
|
+
tempfile = nil
|
168
|
+
encoding = nil
|
169
|
+
request.on_headers do |response|
|
170
|
+
content_disposition = response.headers['Content-Disposition']
|
171
|
+
if content_disposition && content_disposition =~ /filename=/i
|
172
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
173
|
+
prefix = sanitize_filename(filename)
|
174
|
+
else
|
175
|
+
prefix = 'download-'
|
176
|
+
end
|
177
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
178
|
+
encoding = response.body.encoding
|
179
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
180
|
+
@tempfile = tempfile
|
181
|
+
end
|
182
|
+
request.on_body do |chunk|
|
183
|
+
chunk.force_encoding(encoding)
|
184
|
+
tempfile.write(chunk)
|
185
|
+
end
|
186
|
+
request.on_complete do |response|
|
187
|
+
if tempfile
|
188
|
+
tempfile.close
|
189
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
190
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
191
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
192
|
+
"explicitly with `tempfile.delete`"
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
158
197
|
# Check if the given MIME is a JSON MIME.
|
159
198
|
# JSON MIME examples:
|
160
199
|
# application/json
|
@@ -191,7 +230,7 @@ module Freeclimb
|
|
191
230
|
begin
|
192
231
|
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
193
232
|
rescue JSON::ParserError => e
|
194
|
-
if %w(String Date
|
233
|
+
if %w(String Date Time).include?(return_type)
|
195
234
|
data = body
|
196
235
|
else
|
197
236
|
raise e
|
@@ -216,9 +255,9 @@ module Freeclimb
|
|
216
255
|
data.to_f
|
217
256
|
when 'Boolean'
|
218
257
|
data == true
|
219
|
-
when '
|
258
|
+
when 'Time'
|
220
259
|
# parse date time (expecting ISO 8601 format)
|
221
|
-
|
260
|
+
Time.parse data
|
222
261
|
when 'Date'
|
223
262
|
# parse date time (expecting ISO 8601 format)
|
224
263
|
Date.parse data
|
@@ -236,44 +275,9 @@ module Freeclimb
|
|
236
275
|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
237
276
|
end
|
238
277
|
else
|
239
|
-
# models
|
240
|
-
Freeclimb.const_get(return_type)
|
241
|
-
|
242
|
-
end
|
243
|
-
|
244
|
-
# Save response body into a file in (the defined) temporary folder, using the filename
|
245
|
-
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
246
|
-
# The response body is written to the file in chunks in order to handle files which
|
247
|
-
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
248
|
-
# process can use.
|
249
|
-
#
|
250
|
-
# @see Configuration#temp_folder_path
|
251
|
-
def download_file(request)
|
252
|
-
tempfile = nil
|
253
|
-
encoding = nil
|
254
|
-
request.on_headers do |response|
|
255
|
-
content_disposition = response.headers['Content-Disposition']
|
256
|
-
if content_disposition && content_disposition =~ /filename=/i
|
257
|
-
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
258
|
-
prefix = sanitize_filename(filename)
|
259
|
-
else
|
260
|
-
prefix = 'download-'
|
261
|
-
end
|
262
|
-
prefix = prefix + '-' unless prefix.end_with?('-')
|
263
|
-
encoding = response.body.encoding
|
264
|
-
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
265
|
-
@tempfile = tempfile
|
266
|
-
end
|
267
|
-
request.on_body do |chunk|
|
268
|
-
chunk.force_encoding(encoding)
|
269
|
-
tempfile.write(chunk)
|
270
|
-
end
|
271
|
-
request.on_complete do |response|
|
272
|
-
tempfile.close if tempfile
|
273
|
-
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
274
|
-
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
275
|
-
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
276
|
-
"explicitly with `tempfile.delete`"
|
278
|
+
# models (e.g. Pet) or oneOf
|
279
|
+
klass = Freeclimb.const_get(return_type)
|
280
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
277
281
|
end
|
278
282
|
end
|
279
283
|
|
@@ -286,13 +290,13 @@ module Freeclimb
|
|
286
290
|
filename.gsub(/.*[\/\\]/, '')
|
287
291
|
end
|
288
292
|
|
289
|
-
def build_request_url(path)
|
293
|
+
def build_request_url(path, opts = {})
|
290
294
|
# Add leading and trailing slashes to path
|
291
295
|
path = "/#{path}".gsub(/\/+/, '/')
|
292
|
-
@config.base_url + path
|
296
|
+
@config.base_url(opts[:operation]) + path
|
293
297
|
end
|
294
298
|
|
295
|
-
# Update
|
299
|
+
# Update header and query params based on authentication settings.
|
296
300
|
#
|
297
301
|
# @param [Hash] header_params Header parameters
|
298
302
|
# @param [Hash] query_params Query parameters
|
@@ -304,7 +308,7 @@ module Freeclimb
|
|
304
308
|
case auth_setting[:in]
|
305
309
|
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
306
310
|
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
307
|
-
else fail ArgumentError, 'Authentication token must be in `query`
|
311
|
+
else fail ArgumentError, 'Authentication token must be in `query` or `header`'
|
308
312
|
end
|
309
313
|
end
|
310
314
|
end
|
@@ -331,8 +335,8 @@ module Freeclimb
|
|
331
335
|
# @param [Array] content_types array for Content-Type
|
332
336
|
# @return [String] the Content-Type header (e.g. application/json)
|
333
337
|
def select_header_content_type(content_types)
|
334
|
-
#
|
335
|
-
return
|
338
|
+
# return nil by default
|
339
|
+
return if content_types.nil? || content_types.empty?
|
336
340
|
# use JSON when present, otherwise use the first one
|
337
341
|
json_content_type = content_types.find { |s| json_mime?(s) }
|
338
342
|
json_content_type || content_types.first
|
data/lib/freeclimb/api_error.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
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
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
7
|
+
Contact: support@freeclimb.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -4,9 +4,9 @@
|
|
4
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
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
7
|
+
Contact: support@freeclimb.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,6 +21,18 @@ module Freeclimb
|
|
21
21
|
# Defines url base path
|
22
22
|
attr_accessor :base_path
|
23
23
|
|
24
|
+
# Define server configuration index
|
25
|
+
attr_accessor :server_index
|
26
|
+
|
27
|
+
# Define server operation configuration index
|
28
|
+
attr_accessor :server_operation_index
|
29
|
+
|
30
|
+
# Default server variables
|
31
|
+
attr_accessor :server_variables
|
32
|
+
|
33
|
+
# Default server operation variables
|
34
|
+
attr_accessor :server_operation_variables
|
35
|
+
|
24
36
|
# Defines API keys used with API Key authentications.
|
25
37
|
#
|
26
38
|
# @return [Hash] key: parameter name, value: parameter value (API key)
|
@@ -129,15 +141,19 @@ module Freeclimb
|
|
129
141
|
@scheme = 'https'
|
130
142
|
@host = 'www.freeclimb.com'
|
131
143
|
@base_path = '/apiserver'
|
144
|
+
@server_index = 0
|
145
|
+
@server_operation_index = {}
|
146
|
+
@server_variables = {}
|
147
|
+
@server_operation_variables = {}
|
132
148
|
@api_key = {}
|
133
149
|
@api_key_prefix = {}
|
134
|
-
@timeout = 0
|
135
150
|
@client_side_validation = true
|
136
151
|
@verify_ssl = true
|
137
152
|
@verify_ssl_host = true
|
138
153
|
@params_encoding = nil
|
139
154
|
@cert_file = nil
|
140
155
|
@key_file = nil
|
156
|
+
@timeout = 0
|
141
157
|
@debugging = false
|
142
158
|
@inject_format = false
|
143
159
|
@force_ending_format = false
|
@@ -171,17 +187,23 @@ module Freeclimb
|
|
171
187
|
@base_path = '' if @base_path == '/'
|
172
188
|
end
|
173
189
|
|
174
|
-
|
175
|
-
|
190
|
+
# Returns base URL for specified operation based on server settings
|
191
|
+
def base_url(operation = nil)
|
192
|
+
index = server_operation_index.fetch(operation, server_index)
|
193
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
|
194
|
+
|
195
|
+
server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
176
196
|
end
|
177
197
|
|
178
198
|
# Gets API key (with prefix if set).
|
179
199
|
# @param [String] param_name the parameter name of API key auth
|
180
|
-
def api_key_with_prefix(param_name)
|
200
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
201
|
+
key = @api_key[param_name]
|
202
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
181
203
|
if @api_key_prefix[param_name]
|
182
|
-
"#{@api_key_prefix[param_name]} #{
|
204
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
183
205
|
else
|
184
|
-
|
206
|
+
key
|
185
207
|
end
|
186
208
|
end
|
187
209
|
|
@@ -213,12 +235,17 @@ module Freeclimb
|
|
213
235
|
]
|
214
236
|
end
|
215
237
|
|
238
|
+
def operation_server_settings
|
239
|
+
{
|
240
|
+
}
|
241
|
+
end
|
242
|
+
|
216
243
|
# Returns URL based on server settings
|
217
244
|
#
|
218
245
|
# @param index array index of the server settings
|
219
246
|
# @param variables hash of variable and the corresponding value
|
220
|
-
def server_url(index, variables = {})
|
221
|
-
servers = server_settings
|
247
|
+
def server_url(index, variables = {}, servers = nil)
|
248
|
+
servers = server_settings if servers == nil
|
222
249
|
|
223
250
|
# check array index out of bound
|
224
251
|
if (index < 0 || index >= servers.size)
|
@@ -228,10 +255,12 @@ module Freeclimb
|
|
228
255
|
server = servers[index]
|
229
256
|
url = server[:url]
|
230
257
|
|
258
|
+
return url unless server.key? :variables
|
259
|
+
|
231
260
|
# go through variable and assign a value
|
232
261
|
server[:variables].each do |name, variable|
|
233
262
|
if variables.key?(name)
|
234
|
-
if (server[:variables][name][:enum_values].include?
|
263
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
235
264
|
url.gsub! "{" + name.to_s + "}", variables[name]
|
236
265
|
else
|
237
266
|
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
@@ -244,5 +273,6 @@ module Freeclimb
|
|
244
273
|
|
245
274
|
url
|
246
275
|
end
|
276
|
+
|
247
277
|
end
|
248
278
|
end
|
@@ -4,13 +4,14 @@
|
|
4
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
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
7
|
+
Contact: support@freeclimb.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Freeclimb
|
16
17
|
class AccountRequest
|
@@ -28,6 +29,11 @@ module Freeclimb
|
|
28
29
|
}
|
29
30
|
end
|
30
31
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
31
37
|
# Attribute type mapping.
|
32
38
|
def self.openapi_types
|
33
39
|
{
|
@@ -113,7 +119,9 @@ module Freeclimb
|
|
113
119
|
def build_from_hash(attributes)
|
114
120
|
return nil unless attributes.is_a?(Hash)
|
115
121
|
self.class.openapi_types.each_pair do |key, type|
|
116
|
-
if
|
122
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
123
|
+
self.send("#{key}=", nil)
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
117
125
|
# check to ensure the input is an array given that the attribute
|
118
126
|
# is documented as an array but the input is not
|
119
127
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -121,7 +129,7 @@ module Freeclimb
|
|
121
129
|
end
|
122
130
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
131
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
-
end
|
132
|
+
end
|
125
133
|
end
|
126
134
|
|
127
135
|
self
|
@@ -133,8 +141,8 @@ module Freeclimb
|
|
133
141
|
# @return [Object] Deserialized data
|
134
142
|
def _deserialize(type, value)
|
135
143
|
case type.to_sym
|
136
|
-
when :
|
137
|
-
|
144
|
+
when :Time
|
145
|
+
Time.parse(value)
|
138
146
|
when :Date
|
139
147
|
Date.parse(value)
|
140
148
|
when :String
|
@@ -164,7 +172,9 @@ module Freeclimb
|
|
164
172
|
end
|
165
173
|
end
|
166
174
|
else # model
|
167
|
-
|
175
|
+
# models (e.g. Pet) or oneOf
|
176
|
+
klass = Freeclimb.const_get(type)
|
177
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
178
|
end
|
169
179
|
end
|
170
180
|
|
@@ -190,7 +200,7 @@ module Freeclimb
|
|
190
200
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
201
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
202
|
end
|
193
|
-
|
203
|
+
|
194
204
|
hash[param] = _to_hash(value)
|
195
205
|
end
|
196
206
|
hash
|
@@ -213,5 +223,7 @@ module Freeclimb
|
|
213
223
|
value
|
214
224
|
end
|
215
225
|
end
|
226
|
+
|
216
227
|
end
|
228
|
+
|
217
229
|
end
|
@@ -4,13 +4,14 @@
|
|
4
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
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
7
|
+
Contact: support@freeclimb.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Freeclimb
|
16
17
|
class AccountResult
|
@@ -86,6 +87,11 @@ module Freeclimb
|
|
86
87
|
}
|
87
88
|
end
|
88
89
|
|
90
|
+
# Returns all the JSON keys this model knows about
|
91
|
+
def self.acceptable_attributes
|
92
|
+
attribute_map.values
|
93
|
+
end
|
94
|
+
|
89
95
|
# Attribute type mapping.
|
90
96
|
def self.openapi_types
|
91
97
|
{
|
@@ -106,6 +112,13 @@ module Freeclimb
|
|
106
112
|
# List of attributes with nullable: true
|
107
113
|
def self.openapi_nullable
|
108
114
|
Set.new([
|
115
|
+
:'account_id',
|
116
|
+
:'api_key',
|
117
|
+
:'_alias',
|
118
|
+
:'label',
|
119
|
+
:'type',
|
120
|
+
:'status',
|
121
|
+
:'subresource_uris'
|
109
122
|
])
|
110
123
|
end
|
111
124
|
|
@@ -187,11 +200,23 @@ module Freeclimb
|
|
187
200
|
# Check to see if the all the properties in the model are valid
|
188
201
|
# @return true if the model is valid
|
189
202
|
def valid?
|
203
|
+
type_validator = EnumAttributeValidator.new('String', ["trial", "full"])
|
204
|
+
return false unless type_validator.valid?(@type)
|
190
205
|
status_validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
|
191
206
|
return false unless status_validator.valid?(@status)
|
192
207
|
true
|
193
208
|
end
|
194
209
|
|
210
|
+
# Custom attribute writer method checking allowed values (enum).
|
211
|
+
# @param [Object] type Object to be assigned
|
212
|
+
def type=(type)
|
213
|
+
validator = EnumAttributeValidator.new('String', ["trial", "full"])
|
214
|
+
unless validator.valid?(type)
|
215
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
216
|
+
end
|
217
|
+
@type = type
|
218
|
+
end
|
219
|
+
|
195
220
|
# Custom attribute writer method checking allowed values (enum).
|
196
221
|
# @param [Object] status Object to be assigned
|
197
222
|
def status=(status)
|
@@ -245,7 +270,9 @@ module Freeclimb
|
|
245
270
|
def build_from_hash(attributes)
|
246
271
|
return nil unless attributes.is_a?(Hash)
|
247
272
|
self.class.openapi_types.each_pair do |key, type|
|
248
|
-
if
|
273
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
274
|
+
self.send("#{key}=", nil)
|
275
|
+
elsif type =~ /\AArray<(.*)>/i
|
249
276
|
# check to ensure the input is an array given that the attribute
|
250
277
|
# is documented as an array but the input is not
|
251
278
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -253,7 +280,7 @@ module Freeclimb
|
|
253
280
|
end
|
254
281
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
255
282
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
256
|
-
end
|
283
|
+
end
|
257
284
|
end
|
258
285
|
|
259
286
|
self
|
@@ -265,8 +292,8 @@ module Freeclimb
|
|
265
292
|
# @return [Object] Deserialized data
|
266
293
|
def _deserialize(type, value)
|
267
294
|
case type.to_sym
|
268
|
-
when :
|
269
|
-
|
295
|
+
when :Time
|
296
|
+
Time.parse(value)
|
270
297
|
when :Date
|
271
298
|
Date.parse(value)
|
272
299
|
when :String
|
@@ -296,7 +323,9 @@ module Freeclimb
|
|
296
323
|
end
|
297
324
|
end
|
298
325
|
else # model
|
299
|
-
|
326
|
+
# models (e.g. Pet) or oneOf
|
327
|
+
klass = Freeclimb.const_get(type)
|
328
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
300
329
|
end
|
301
330
|
end
|
302
331
|
|
@@ -322,7 +351,7 @@ module Freeclimb
|
|
322
351
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
323
352
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
324
353
|
end
|
325
|
-
|
354
|
+
|
326
355
|
hash[param] = _to_hash(value)
|
327
356
|
end
|
328
357
|
hash
|
@@ -345,5 +374,7 @@ module Freeclimb
|
|
345
374
|
value
|
346
375
|
end
|
347
376
|
end
|
377
|
+
|
348
378
|
end
|
379
|
+
|
349
380
|
end
|
@@ -4,13 +4,14 @@
|
|
4
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
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
|
-
|
7
|
+
Contact: support@freeclimb.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Freeclimb
|
16
17
|
class AccountResultAllOf
|
@@ -70,6 +71,11 @@ module Freeclimb
|
|
70
71
|
}
|
71
72
|
end
|
72
73
|
|
74
|
+
# Returns all the JSON keys this model knows about
|
75
|
+
def self.acceptable_attributes
|
76
|
+
attribute_map.values
|
77
|
+
end
|
78
|
+
|
73
79
|
# Attribute type mapping.
|
74
80
|
def self.openapi_types
|
75
81
|
{
|
@@ -86,6 +92,13 @@ module Freeclimb
|
|
86
92
|
# List of attributes with nullable: true
|
87
93
|
def self.openapi_nullable
|
88
94
|
Set.new([
|
95
|
+
:'account_id',
|
96
|
+
:'api_key',
|
97
|
+
:'_alias',
|
98
|
+
:'label',
|
99
|
+
:'type',
|
100
|
+
:'status',
|
101
|
+
:'subresource_uris'
|
89
102
|
])
|
90
103
|
end
|
91
104
|
|
@@ -143,11 +156,23 @@ module Freeclimb
|
|
143
156
|
# Check to see if the all the properties in the model are valid
|
144
157
|
# @return true if the model is valid
|
145
158
|
def valid?
|
159
|
+
type_validator = EnumAttributeValidator.new('String', ["trial", "full"])
|
160
|
+
return false unless type_validator.valid?(@type)
|
146
161
|
status_validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
|
147
162
|
return false unless status_validator.valid?(@status)
|
148
163
|
true
|
149
164
|
end
|
150
165
|
|
166
|
+
# Custom attribute writer method checking allowed values (enum).
|
167
|
+
# @param [Object] type Object to be assigned
|
168
|
+
def type=(type)
|
169
|
+
validator = EnumAttributeValidator.new('String', ["trial", "full"])
|
170
|
+
unless validator.valid?(type)
|
171
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
172
|
+
end
|
173
|
+
@type = type
|
174
|
+
end
|
175
|
+
|
151
176
|
# Custom attribute writer method checking allowed values (enum).
|
152
177
|
# @param [Object] status Object to be assigned
|
153
178
|
def status=(status)
|
@@ -197,7 +222,9 @@ module Freeclimb
|
|
197
222
|
def build_from_hash(attributes)
|
198
223
|
return nil unless attributes.is_a?(Hash)
|
199
224
|
self.class.openapi_types.each_pair do |key, type|
|
200
|
-
if
|
225
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
226
|
+
self.send("#{key}=", nil)
|
227
|
+
elsif type =~ /\AArray<(.*)>/i
|
201
228
|
# check to ensure the input is an array given that the attribute
|
202
229
|
# is documented as an array but the input is not
|
203
230
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -205,7 +232,7 @@ module Freeclimb
|
|
205
232
|
end
|
206
233
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
207
234
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
208
|
-
end
|
235
|
+
end
|
209
236
|
end
|
210
237
|
|
211
238
|
self
|
@@ -217,8 +244,8 @@ module Freeclimb
|
|
217
244
|
# @return [Object] Deserialized data
|
218
245
|
def _deserialize(type, value)
|
219
246
|
case type.to_sym
|
220
|
-
when :
|
221
|
-
|
247
|
+
when :Time
|
248
|
+
Time.parse(value)
|
222
249
|
when :Date
|
223
250
|
Date.parse(value)
|
224
251
|
when :String
|
@@ -248,7 +275,9 @@ module Freeclimb
|
|
248
275
|
end
|
249
276
|
end
|
250
277
|
else # model
|
251
|
-
|
278
|
+
# models (e.g. Pet) or oneOf
|
279
|
+
klass = Freeclimb.const_get(type)
|
280
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
252
281
|
end
|
253
282
|
end
|
254
283
|
|
@@ -274,7 +303,7 @@ module Freeclimb
|
|
274
303
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
275
304
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
276
305
|
end
|
277
|
-
|
306
|
+
|
278
307
|
hash[param] = _to_hash(value)
|
279
308
|
end
|
280
309
|
hash
|
@@ -297,5 +326,7 @@ module Freeclimb
|
|
297
326
|
value
|
298
327
|
end
|
299
328
|
end
|
329
|
+
|
300
330
|
end
|
331
|
+
|
301
332
|
end
|