freeclimb 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +82 -0
- data/README.md +238 -0
- data/Rakefile +10 -0
- data/docs/AccountRequest.md +21 -0
- data/docs/AccountResult.md +37 -0
- data/docs/AccountResultAllOf.md +29 -0
- data/docs/ApplicationList.md +31 -0
- data/docs/ApplicationListAllOf.md +17 -0
- data/docs/ApplicationRequest.md +31 -0
- data/docs/ApplicationResult.md +41 -0
- data/docs/ApplicationResultAllOf.md +33 -0
- data/docs/AvailableNumber.md +27 -0
- data/docs/AvailableNumberList.md +31 -0
- data/docs/AvailableNumberListAllOf.md +17 -0
- data/docs/BuyIncomingNumberRequest.md +23 -0
- data/docs/CallList.md +31 -0
- data/docs/CallListAllOf.md +17 -0
- data/docs/CallResult.md +53 -0
- data/docs/CallResultAllOf.md +45 -0
- data/docs/ConferenceList.md +31 -0
- data/docs/ConferenceListAllOf.md +17 -0
- data/docs/ConferenceParticipantList.md +31 -0
- data/docs/ConferenceParticipantListAllOf.md +17 -0
- data/docs/ConferenceParticipantResult.md +35 -0
- data/docs/ConferenceParticipantResultAllOf.md +27 -0
- data/docs/ConferenceResult.md +43 -0
- data/docs/ConferenceResultAllOf.md +35 -0
- data/docs/CreateConferenceRequest.md +27 -0
- data/docs/DefaultApi.md +2504 -0
- data/docs/DequeueMemberRequest.md +17 -0
- data/docs/FilterLogsRequest.md +19 -0
- data/docs/IncomingNumberList.md +31 -0
- data/docs/IncomingNumberListAllOf.md +17 -0
- data/docs/IncomingNumberRequest.md +21 -0
- data/docs/IncomingNumberResult.md +41 -0
- data/docs/IncomingNumberResultAllOf.md +33 -0
- data/docs/LogList.md +31 -0
- data/docs/LogListAllOf.md +17 -0
- data/docs/LogResult.md +29 -0
- data/docs/MakeCallRequest.md +33 -0
- data/docs/MessageRequest.md +35 -0
- data/docs/MessageRequestAllOf.md +27 -0
- data/docs/MessageResult.md +39 -0
- data/docs/MessageResultAllOf.md +31 -0
- data/docs/MessagesList.md +31 -0
- data/docs/MessagesListAllOf.md +17 -0
- data/docs/MutableResourceModel.md +23 -0
- data/docs/PaginationModel.md +29 -0
- data/docs/Percl.md +697 -0
- data/docs/QueueList.md +31 -0
- data/docs/QueueListAllOf.md +17 -0
- data/docs/QueueMember.md +25 -0
- data/docs/QueueMemberList.md +31 -0
- data/docs/QueueMemberListAllOf.md +17 -0
- data/docs/QueueRequest.md +21 -0
- data/docs/QueueResult.md +37 -0
- data/docs/QueueResultAllOf.md +29 -0
- data/docs/RecordingList.md +31 -0
- data/docs/RecordingListAllOf.md +17 -0
- data/docs/RecordingResult.md +33 -0
- data/docs/RecordingResultAllOf.md +25 -0
- data/docs/UpdateCallRequest.md +19 -0
- data/docs/UpdateConferenceParticipantRequest.md +21 -0
- data/docs/UpdateConferenceRequest.md +23 -0
- data/freeclimb.gemspec +39 -0
- data/git_push.sh +58 -0
- data/lib/freeclimb.rb +99 -0
- data/lib/freeclimb/api/default_api.rb +2845 -0
- data/lib/freeclimb/api_client.rb +386 -0
- data/lib/freeclimb/api_error.rb +57 -0
- data/lib/freeclimb/configuration.rb +248 -0
- data/lib/freeclimb/models/account_request.rb +227 -0
- data/lib/freeclimb/models/account_result.rb +349 -0
- data/lib/freeclimb/models/account_result_all_of.rb +301 -0
- data/lib/freeclimb/models/application_list.rb +286 -0
- data/lib/freeclimb/models/application_list_all_of.rb +208 -0
- data/lib/freeclimb/models/application_request.rb +277 -0
- data/lib/freeclimb/models/application_result.rb +335 -0
- data/lib/freeclimb/models/application_result_all_of.rb +287 -0
- data/lib/freeclimb/models/available_number.rb +257 -0
- data/lib/freeclimb/models/available_number_list.rb +286 -0
- data/lib/freeclimb/models/available_number_list_all_of.rb +208 -0
- data/lib/freeclimb/models/buy_incoming_number_request.rb +242 -0
- data/lib/freeclimb/models/call_list.rb +286 -0
- data/lib/freeclimb/models/call_list_all_of.rb +208 -0
- data/lib/freeclimb/models/call_result.rb +429 -0
- data/lib/freeclimb/models/call_result_all_of.rb +381 -0
- data/lib/freeclimb/models/conference_list.rb +286 -0
- data/lib/freeclimb/models/conference_list_all_of.rb +208 -0
- data/lib/freeclimb/models/conference_participant_list.rb +286 -0
- data/lib/freeclimb/models/conference_participant_list_all_of.rb +208 -0
- data/lib/freeclimb/models/conference_participant_result.rb +305 -0
- data/lib/freeclimb/models/conference_participant_result_all_of.rb +257 -0
- data/lib/freeclimb/models/conference_result.rb +391 -0
- data/lib/freeclimb/models/conference_result_all_of.rb +343 -0
- data/lib/freeclimb/models/create_conference_request.rb +293 -0
- data/lib/freeclimb/models/dequeue_member_request.rb +207 -0
- data/lib/freeclimb/models/filter_logs_request.rb +222 -0
- data/lib/freeclimb/models/incoming_number_list.rb +286 -0
- data/lib/freeclimb/models/incoming_number_list_all_of.rb +208 -0
- data/lib/freeclimb/models/incoming_number_request.rb +227 -0
- data/lib/freeclimb/models/incoming_number_result.rb +335 -0
- data/lib/freeclimb/models/incoming_number_result_all_of.rb +287 -0
- data/lib/freeclimb/models/log_list.rb +286 -0
- data/lib/freeclimb/models/log_list_all_of.rb +208 -0
- data/lib/freeclimb/models/log_result.rb +301 -0
- data/lib/freeclimb/models/make_call_request.rb +302 -0
- data/lib/freeclimb/models/message_request.rb +320 -0
- data/lib/freeclimb/models/message_request_all_of.rb +272 -0
- data/lib/freeclimb/models/message_result.rb +359 -0
- data/lib/freeclimb/models/message_result_all_of.rb +311 -0
- data/lib/freeclimb/models/messages_list.rb +287 -0
- data/lib/freeclimb/models/messages_list_all_of.rb +209 -0
- data/lib/freeclimb/models/mutable_resource_model.rb +237 -0
- data/lib/freeclimb/models/pagination_model.rb +267 -0
- data/lib/freeclimb/models/queue_list.rb +286 -0
- data/lib/freeclimb/models/queue_list_all_of.rb +208 -0
- data/lib/freeclimb/models/queue_member.rb +247 -0
- data/lib/freeclimb/models/queue_member_list.rb +286 -0
- data/lib/freeclimb/models/queue_member_list_all_of.rb +208 -0
- data/lib/freeclimb/models/queue_request.rb +227 -0
- data/lib/freeclimb/models/queue_result.rb +315 -0
- data/lib/freeclimb/models/queue_result_all_of.rb +267 -0
- data/lib/freeclimb/models/recording_list.rb +286 -0
- data/lib/freeclimb/models/recording_list_all_of.rb +208 -0
- data/lib/freeclimb/models/recording_result.rb +295 -0
- data/lib/freeclimb/models/recording_result_all_of.rb +247 -0
- data/lib/freeclimb/models/update_call_request.rb +256 -0
- data/lib/freeclimb/models/update_conference_participant_request.rb +227 -0
- data/lib/freeclimb/models/update_conference_request.rb +273 -0
- data/lib/freeclimb/version.rb +15 -0
- data/lib/percl/calls.rb +43 -0
- data/lib/percl/conference_participants.rb +40 -0
- data/lib/percl/conferences.rb +21 -0
- data/lib/percl/ivr.rb +63 -0
- data/lib/percl/jsonable.rb +23 -0
- data/lib/percl/percl.rb +29 -0
- data/lib/percl/queue_members.rb +15 -0
- data/lib/percl/recordings.rb +15 -0
- data/lib/percl/sms.rb +11 -0
- data/spec/api/default_api_spec.rb +1151 -0
- data/spec/api/web_mocks.rb +473 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +34 -0
- data/spec/models/account_request_spec.rb +33 -0
- data/spec/models/account_result_spec.rb +33 -0
- data/spec/models/application_list_spec.rb +33 -0
- data/spec/models/application_request_spec.rb +33 -0
- data/spec/models/application_result_spec.rb +33 -0
- data/spec/models/available_number_list_spec.rb +34 -0
- data/spec/models/available_number_spec.rb +33 -0
- data/spec/models/buy_incoming_number_request_spec.rb +33 -0
- data/spec/models/call_list_spec.rb +34 -0
- data/spec/models/call_result_spec.rb +34 -0
- data/spec/models/conference_list_spec.rb +33 -0
- data/spec/models/conference_participant_list_spec.rb +33 -0
- data/spec/models/conference_participant_result_spec.rb +33 -0
- data/spec/models/conference_result_spec.rb +34 -0
- data/spec/models/create_conference_request_spec.rb +34 -0
- data/spec/models/dequeue_member_request_spec.rb +34 -0
- data/spec/models/filter_logs_request_spec.rb +33 -0
- data/spec/models/incoming_number_list_spec.rb +34 -0
- data/spec/models/incoming_number_request_spec.rb +33 -0
- data/spec/models/incoming_number_result_spec.rb +34 -0
- data/spec/models/log_list_spec.rb +33 -0
- data/spec/models/log_result_spec.rb +33 -0
- data/spec/models/make_call_request_spec.rb +33 -0
- data/spec/models/message_request_spec.rb +34 -0
- data/spec/models/message_result_spec.rb +33 -0
- data/spec/models/messages_list_spec.rb +33 -0
- data/spec/models/mutable_resource_model_spec.rb +34 -0
- data/spec/models/pagination_model_spec.rb +33 -0
- data/spec/models/queue_list_spec.rb +34 -0
- data/spec/models/queue_member_list_spec.rb +33 -0
- data/spec/models/queue_member_spec.rb +34 -0
- data/spec/models/queue_request_spec.rb +34 -0
- data/spec/models/queue_result_spec.rb +33 -0
- data/spec/models/recording_list_spec.rb +33 -0
- data/spec/models/recording_result_spec.rb +33 -0
- data/spec/models/update_call_request_spec.rb +33 -0
- data/spec/models/update_conference_participant_request_spec.rb +33 -0
- data/spec/models/update_conference_request_spec.rb +33 -0
- data/spec/percl/calls_spec.rb +111 -0
- data/spec/percl/conference_participant_spec.rb +96 -0
- data/spec/percl/conference_spec.rb +46 -0
- data/spec/percl/ivr_spec.rb +155 -0
- data/spec/percl/jsonable_spec.rb +28 -0
- data/spec/percl/percl_spec.rb +31 -0
- data/spec/percl/queue_members_spec.rb +35 -0
- data/spec/percl/recordings_spec.rb +32 -0
- data/spec/percl/sms_spec.rb +29 -0
- data/spec/spec_helper.rb +114 -0
- metadata +355 -0
@@ -0,0 +1,15 @@
|
|
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
|
+
module Freeclimb
|
14
|
+
VERSION = '1.0.0'
|
15
|
+
end
|
data/lib/percl/calls.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
module Percl
|
2
|
+
class OutDial < JSONable
|
3
|
+
attr_accessor :ifMachine
|
4
|
+
attr_accessor :ifMachineUrl
|
5
|
+
attr_accessor :sendDigits
|
6
|
+
attr_accessor :statusCallbackUrl
|
7
|
+
attr_accessor :timeout
|
8
|
+
def initialize(actionUrl, callConnectUrl, callingNumber, destination)
|
9
|
+
@actionUrl = actionUrl
|
10
|
+
@callConnectUrl = callConnectUrl
|
11
|
+
@callingNumber = callingNumber
|
12
|
+
@destination = destination
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Hangup < JSONable
|
17
|
+
attr_accessor :callId
|
18
|
+
attr_accessor :reason
|
19
|
+
end
|
20
|
+
|
21
|
+
class Pause < JSONable
|
22
|
+
def initialize(length)
|
23
|
+
@length = length
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Redirect < JSONable
|
28
|
+
def initialize(actionUrl)
|
29
|
+
@actionUrl = actionUrl
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class SendDigits < JSONable
|
34
|
+
attr_accessor :pauseMs
|
35
|
+
def initialize(digits)
|
36
|
+
@digits = digits
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class Reject < JSONable
|
41
|
+
attr_accessor :reason
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Percl
|
2
|
+
class AddToConference < JSONable
|
3
|
+
attr_accessor :startConfOnEnter
|
4
|
+
attr_accessor :talk
|
5
|
+
attr_accessor :listen
|
6
|
+
attr_accessor :allowCallControl
|
7
|
+
attr_accessor :callControlSequence
|
8
|
+
attr_accessor :callControlUrl
|
9
|
+
attr_accessor :leaveConferenceUrl
|
10
|
+
attr_accessor :notificationUrl
|
11
|
+
|
12
|
+
def initialize(confId, callId)
|
13
|
+
@conferenceId = confId
|
14
|
+
@callId = callId
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
class RemoveFromConference < JSONable
|
20
|
+
def initialize(callId)
|
21
|
+
@callId = callId
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class SetListen < JSONable
|
26
|
+
attr_accessor :listen
|
27
|
+
|
28
|
+
def initialize(callId)
|
29
|
+
@callId = callId
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class SetTalk < JSONable
|
34
|
+
attr_accessor :talk
|
35
|
+
|
36
|
+
def initialize(callId)
|
37
|
+
@callId = callId
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Percl
|
2
|
+
class CreateConference < JSONable
|
3
|
+
|
4
|
+
attr_accessor :alias
|
5
|
+
attr_accessor :playBeep
|
6
|
+
attr_accessor :record
|
7
|
+
attr_accessor :waitUrl
|
8
|
+
attr_accessor :statusCallbackUrl
|
9
|
+
|
10
|
+
def initialize(actionUrl)
|
11
|
+
@actionUrl = actionUrl
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
class TerminateConference < JSONable
|
17
|
+
def initialize(confId)
|
18
|
+
@conferenceId = confId
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/percl/ivr.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
module Percl
|
2
|
+
class PlayEarlyMedia < JSONable
|
3
|
+
def initialize(file)
|
4
|
+
@file = file
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class Say < JSONable
|
9
|
+
attr_accessor :language
|
10
|
+
attr_accessor :loop
|
11
|
+
attr_accessor :conferenceId
|
12
|
+
attr_accessor :enforcePCI
|
13
|
+
|
14
|
+
def initialize(response)
|
15
|
+
@text = response
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
class Play < JSONable
|
21
|
+
attr_accessor :loop
|
22
|
+
attr_accessor :conferenceId
|
23
|
+
|
24
|
+
def initialize(file)
|
25
|
+
@file = file
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class GetDigits < JSONable
|
30
|
+
attr_accessor :initialTimeoutMs
|
31
|
+
attr_accessor :digitTimeoutMs
|
32
|
+
attr_accessor :finishOnKey
|
33
|
+
attr_accessor :minDigits
|
34
|
+
attr_accessor :maxDigits
|
35
|
+
attr_accessor :flushBuffer
|
36
|
+
attr_accessor :prompts
|
37
|
+
attr_accessor :enforcePCI
|
38
|
+
|
39
|
+
def initialize(actionUrl)
|
40
|
+
@actionUrl = actionUrl
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
class GetSpeech < JSONable
|
46
|
+
attr_accessor :grammarType
|
47
|
+
attr_accessor :grammarRule
|
48
|
+
attr_accessor :playBeep
|
49
|
+
attr_accessor :prompts
|
50
|
+
attr_accessor :noInputTimeoutMs
|
51
|
+
attr_accessor :recognitionTimeoutMs
|
52
|
+
attr_accessor :confidenceThreshold
|
53
|
+
attr_accessor :speechCompleteTimeoutMs
|
54
|
+
attr_accessor :speechIncompleteTimeoutMs
|
55
|
+
attr_accessor :sensitivityLevel
|
56
|
+
attr_accessor :enforcePCI
|
57
|
+
|
58
|
+
def initialize(actionUrl, grammarFile)
|
59
|
+
@actionUrl = actionUrl
|
60
|
+
@grammarFile = grammarFile
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class JSONable
|
2
|
+
def as_json
|
3
|
+
hash = {}
|
4
|
+
self.instance_variables.each do |var|
|
5
|
+
val = self.instance_variable_get var
|
6
|
+
if val.instance_of? Array
|
7
|
+
arr = []
|
8
|
+
val.each do |prompt|
|
9
|
+
arr.push prompt.as_json
|
10
|
+
end
|
11
|
+
hash[var.to_s.delete "@"] = arr
|
12
|
+
else
|
13
|
+
hash[var.to_s.delete "@"] = val
|
14
|
+
end
|
15
|
+
end
|
16
|
+
{self.class.name.split('::').last => hash}
|
17
|
+
end
|
18
|
+
def from_json! string
|
19
|
+
JSON.load(string).each do |var, val|
|
20
|
+
self.instance_variable_set var, val
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/percl/percl.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative 'jsonable'
|
2
|
+
require 'json'
|
3
|
+
require_relative 'calls'
|
4
|
+
require_relative 'conferences'
|
5
|
+
require_relative 'conference_participants'
|
6
|
+
require_relative 'ivr'
|
7
|
+
require_relative 'queue_members'
|
8
|
+
require_relative 'recordings'
|
9
|
+
require_relative 'sms'
|
10
|
+
|
11
|
+
module Percl
|
12
|
+
class Script
|
13
|
+
def initialize
|
14
|
+
@commands = []
|
15
|
+
end
|
16
|
+
|
17
|
+
def add(command)
|
18
|
+
@commands.push(command)
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_json
|
22
|
+
hash = []
|
23
|
+
@commands.each do |command|
|
24
|
+
hash.push(command.as_json)
|
25
|
+
end
|
26
|
+
hash.to_json
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Percl
|
2
|
+
class RecordUtterance < JSONable
|
3
|
+
attr_accessor :silenceTimeoutMs
|
4
|
+
attr_accessor :finishOnKey
|
5
|
+
attr_accessor :maxLengthSec
|
6
|
+
attr_accessor :autoStart
|
7
|
+
|
8
|
+
def initialize(actionUrl)
|
9
|
+
@actionUrl = actionUrl
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class StartRecordCall < JSONable
|
14
|
+
end
|
15
|
+
end
|
data/lib/percl/sms.rb
ADDED
@@ -0,0 +1,1151 @@
|
|
1
|
+
=begin
|
2
|
+
#FreeClimb API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require_relative 'web_mocks'
|
16
|
+
# Unit tests for Freeclimb::DefaultApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
API_SERVER = 'https://www.freeclimb.com/apiserver'
|
20
|
+
|
21
|
+
describe 'DefaultApi' do
|
22
|
+
|
23
|
+
before do
|
24
|
+
Freeclimb.configure do |config|
|
25
|
+
# Configure HTTP basic authorization: fc
|
26
|
+
config.username = 'MOCK_ACCOUNT_ID'
|
27
|
+
config.password = 'MOCK_PASSWORD'
|
28
|
+
end
|
29
|
+
|
30
|
+
# run before each test
|
31
|
+
@api_instance = Freeclimb::DefaultApi.new
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
after do
|
36
|
+
# run after each test
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test an instance of DefaultApi' do
|
40
|
+
it 'should create an instance of DefaultApi' do
|
41
|
+
expect(@api_instance).to be_instance_of(Freeclimb::DefaultApi)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# unit tests for buy_a_phone_number
|
46
|
+
# Buy a Phone Number
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @option opts [BuyIncomingNumberRequest] :buy_incoming_number_request Incoming Number transaction details
|
49
|
+
# @return [IncomingNumberResult]
|
50
|
+
describe 'buy_a_phone_number test' do
|
51
|
+
|
52
|
+
before do
|
53
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/IncomingPhoneNumbers"
|
54
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::INCOMING_PHONE_NUMBER, :status => 200, :headers => {})
|
55
|
+
opts = {
|
56
|
+
buy_incoming_number_request: Freeclimb::BuyIncomingNumberRequest.new # BuyIncomingNumberRequest | Incoming Number transaction details
|
57
|
+
}
|
58
|
+
#Buy a Phone Number
|
59
|
+
@result = @api_instance.buy_a_phone_number(opts)
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
it 'should respond with the phone number that was bought' do
|
64
|
+
expect(@result).to be_instance_of Freeclimb::IncomingNumberResult
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'should make a POST request to /Accounts/{accountId}/IncomingPhoneNumbers' do
|
68
|
+
expect(@stub).to have_been_requested
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# unit tests for create_a_conference
|
73
|
+
# Create a Conference
|
74
|
+
# @param [Hash] opts the optional parameters
|
75
|
+
# @option opts [CreateConferenceRequest] :create_conference_request Conference to create
|
76
|
+
# @return [ConferenceResult]
|
77
|
+
describe 'create_a_conference test' do
|
78
|
+
before do
|
79
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences"
|
80
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::CONFERENCE_RESULT, :status => 200, :headers => {})
|
81
|
+
opts = {
|
82
|
+
create_conference_request: Freeclimb::CreateConferenceRequest.new # CreateConferenceRequest | Conference to create
|
83
|
+
}
|
84
|
+
#Create a Conference
|
85
|
+
@result = @api_instance.create_a_conference(opts)
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'should respond with the conference it created' do
|
90
|
+
expect(@result).to be_instance_of Freeclimb::ConferenceResult
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'should make a POST request to /Accounts/{accountId}/Conferences' do
|
94
|
+
expect(@stub).to have_been_requested
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# unit tests for create_a_queue
|
99
|
+
# Create a Queue
|
100
|
+
# @param account_id ID of the account that created this Queue.
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @option opts [QueueRequest] :queue_request Queue details used to create a queue
|
103
|
+
# @return [QueueResult]
|
104
|
+
describe 'create_a_queue test' do
|
105
|
+
before do
|
106
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues"
|
107
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::QUEUE_RESULT, :status => 200, :headers => {})
|
108
|
+
opts = {
|
109
|
+
queue_request: Freeclimb::QueueRequest.new # QueueRequest | Queue details used to create a queue
|
110
|
+
}
|
111
|
+
#Create a Queue
|
112
|
+
@result = @api_instance.create_a_queue(opts)
|
113
|
+
end
|
114
|
+
|
115
|
+
it 'should respond with the queue it created' do
|
116
|
+
expect(@result).to be_instance_of Freeclimb::QueueResult
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'should make a POST request to /Accounts/{accountId}/Queues' do
|
120
|
+
expect(@stub).to have_been_requested
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# unit tests for create_an_application
|
125
|
+
# Create an application
|
126
|
+
# @param [Hash] opts the optional parameters
|
127
|
+
# @option opts [ApplicationRequest] :application_request Application Details
|
128
|
+
# @return [ApplicationResult]
|
129
|
+
describe 'create_an_application test' do
|
130
|
+
before do
|
131
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Applications"
|
132
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::APPLICATION_RESULT, :status => 200, :headers => {})
|
133
|
+
opts = {
|
134
|
+
queue_request: Freeclimb::QueueRequest.new # QueueRequest | Queue details used to create a queue
|
135
|
+
}
|
136
|
+
#Create a Queue
|
137
|
+
@result = @api_instance.create_an_application(opts)
|
138
|
+
end
|
139
|
+
|
140
|
+
it 'should respond with the application it created' do
|
141
|
+
expect(@result).to be_instance_of Freeclimb::ApplicationResult
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'should make a POST request to /Accounts/{accountId}/Applications' do
|
145
|
+
expect(@stub).to have_been_requested
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# unit tests for delete_a_recording
|
150
|
+
# Delete a Recording
|
151
|
+
# @param recording_id String that uniquely identifies this recording resource.
|
152
|
+
# @param [Hash] opts the optional parameters
|
153
|
+
# @return [nil]
|
154
|
+
describe 'delete_a_recording test' do
|
155
|
+
before do
|
156
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Recordings/{recordingId}"
|
157
|
+
@stub = stub_request(:delete, uri_template).to_return(:status => 204, :headers => {})
|
158
|
+
recording_id = 'MOCK_RECORDING_ID' # String | String that uniquely identifies this recording resource.
|
159
|
+
|
160
|
+
@result = @api_instance.delete_a_recording(recording_id)
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'should respond with nothing' do
|
164
|
+
expect(@result).to be_nil
|
165
|
+
end
|
166
|
+
|
167
|
+
it 'should make a DELETE request to /Accounts/{accountId}/Recordings/{recordingId}' do
|
168
|
+
expect(@stub).to have_been_requested
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# unit tests for delete_an_application
|
173
|
+
# Delete an application
|
174
|
+
# @param application_id String that uniquely identifies this application resource.
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [nil]
|
177
|
+
describe 'delete_an_application test' do
|
178
|
+
before do
|
179
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Applications/{applicationId}"
|
180
|
+
@stub = stub_request(:delete, uri_template).to_return(:status => 204, :headers => {})
|
181
|
+
application_id = 'MOCK_APPLICATION_ID' # String | String that uniquely identifies this application resource.
|
182
|
+
|
183
|
+
@result = @api_instance.delete_an_application(application_id)
|
184
|
+
end
|
185
|
+
|
186
|
+
it 'should respond with nothing' do
|
187
|
+
expect(@result).to be_nil
|
188
|
+
end
|
189
|
+
|
190
|
+
it 'should make a DELETE request to /Accounts/{accountId}/Applications/{applicationId}' do
|
191
|
+
expect(@stub).to have_been_requested
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# unit tests for delete_an_incoming_number
|
196
|
+
# Delete an Incoming Number
|
197
|
+
# @param phone_number_id String that uniquely identifies this phone number resource.
|
198
|
+
# @param [Hash] opts the optional parameters
|
199
|
+
# @return [nil]
|
200
|
+
describe 'delete_an_incoming_number test' do
|
201
|
+
before do
|
202
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId}"
|
203
|
+
@stub = stub_request(:delete, uri_template).to_return(:status => 204, :headers => {})
|
204
|
+
phone_number_id = 'phone_number_id_example' # String | String that uniquely identifies this phone number resource.
|
205
|
+
|
206
|
+
#Delete an Incoming Number
|
207
|
+
@result = @api_instance.delete_an_incoming_number(phone_number_id)
|
208
|
+
end
|
209
|
+
|
210
|
+
it 'should respond with nothing' do
|
211
|
+
expect(@result).to be_nil
|
212
|
+
end
|
213
|
+
|
214
|
+
it 'should make a DELETE request to /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId}' do
|
215
|
+
expect(@stub).to have_been_requested
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# unit tests for dequeue_a_member
|
220
|
+
# Dequeue a Member
|
221
|
+
# @param queue_id String that uniquely identifies the Queue that the Member belongs to.
|
222
|
+
# @param call_id ID if the Call that the Member belongs to
|
223
|
+
# @param [Hash] opts the optional parameters
|
224
|
+
# @option opts [DequeueMemberRequest] :dequeue_member_request Dequeue member request details
|
225
|
+
# @return [QueueMember]
|
226
|
+
describe 'dequeue_a_member test' do
|
227
|
+
before do
|
228
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}/Members/{callId}"
|
229
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::QUEUE_MEMBER_RESULT, :status => 200, :headers => {})
|
230
|
+
queue_id = 'MOCK_QUEUE_ID' # String | String that uniquely identifies the Queue that the Member belongs to.
|
231
|
+
call_id = 'MOCK_CALL_ID' # String | ID if the Call that the Member belongs to
|
232
|
+
opts = {
|
233
|
+
dequeue_member_request: Freeclimb::DequeueMemberRequest.new # DequeueMemberRequest | Dequeue member request details
|
234
|
+
}
|
235
|
+
|
236
|
+
@result = @api_instance.dequeue_a_member(queue_id, call_id, opts)
|
237
|
+
end
|
238
|
+
|
239
|
+
it 'should respond with a queue member' do
|
240
|
+
expect(@result).to be_instance_of(Freeclimb::QueueMember)
|
241
|
+
end
|
242
|
+
|
243
|
+
it 'should make a POST request to /Accounts/{accountId}/Queues/{queueId}/Members/{callId}' do
|
244
|
+
expect(@stub).to have_been_requested
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# unit tests for dequeue_head_member
|
249
|
+
# Dequeue Head Member
|
250
|
+
# @param queue_id String that uniquely identifies this queue resource.
|
251
|
+
# @param [Hash] opts the optional parameters
|
252
|
+
# @option opts [DequeueMemberRequest] :dequeue_member_request Dequeue head member request details
|
253
|
+
# @return [QueueMember]
|
254
|
+
describe 'dequeue_head_member test' do
|
255
|
+
before do
|
256
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}/Members/Front"
|
257
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::QUEUE_MEMBER_RESULT, :status => 200, :headers => {})
|
258
|
+
queue_id = 'MOCK_QUEUE_ID' # String | String that uniquely identifies the Queue that the Member belongs to.
|
259
|
+
opts = {
|
260
|
+
dequeue_member_request: Freeclimb::DequeueMemberRequest.new # DequeueMemberRequest | Dequeue member request details
|
261
|
+
}
|
262
|
+
|
263
|
+
@result = @api_instance.dequeue_head_member(queue_id, opts)
|
264
|
+
end
|
265
|
+
|
266
|
+
it 'should respond with a queue member' do
|
267
|
+
expect(@result).to be_instance_of(Freeclimb::QueueMember)
|
268
|
+
end
|
269
|
+
|
270
|
+
it 'should make a POST request to /Accounts/{accountId}/Queues/{queueId}/Members/{callId}' do
|
271
|
+
expect(@stub).to have_been_requested
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
# unit tests for download_a_recording_file
|
276
|
+
# Download a Recording File
|
277
|
+
# @param recording_id String that uniquely identifies this recording resource.
|
278
|
+
# @param [Hash] opts the optional parameters
|
279
|
+
# @return [File]
|
280
|
+
describe 'download_a_recording_file test' do
|
281
|
+
before do
|
282
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Recordings/{recordingId}/Download"
|
283
|
+
@stub = stub_request(:get, uri_template).with(:headers => {'Accept' => 'audio/x-wav'}).to_return(:status => 200, :headers => {})
|
284
|
+
recording_id = 'MOCK_RECORDING_ID' # String | String that uniquely identifies this recording resource.
|
285
|
+
|
286
|
+
@result = @api_instance.download_a_recording_file(recording_id)
|
287
|
+
end
|
288
|
+
|
289
|
+
it 'should make a POST request to /Accounts/{accountId}/Recordings/{recordingId}/Download' do
|
290
|
+
expect(@stub).to have_been_requested
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
# unit tests for filter_logs
|
295
|
+
# Filter Logs
|
296
|
+
# @param [Hash] opts the optional parameters
|
297
|
+
# @option opts [FilterLogsRequest] :filter_logs_request Filter logs request paramters
|
298
|
+
# @return [LogList]
|
299
|
+
describe 'filter_logs test' do
|
300
|
+
before do
|
301
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Logs"
|
302
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::LOG_LIST_RESULT, :status => 200, :headers => {})
|
303
|
+
opts = {
|
304
|
+
filter_logs_request: Freeclimb::FilterLogsRequest.new # FilterLogsRequest | Filter logs request paramters
|
305
|
+
}
|
306
|
+
|
307
|
+
@result = @api_instance.filter_logs(opts)
|
308
|
+
end
|
309
|
+
|
310
|
+
it 'should respond with a list of logs' do
|
311
|
+
expect(@result).to be_instance_of(Freeclimb::LogList)
|
312
|
+
end
|
313
|
+
|
314
|
+
it 'should make a POST request to /Accounts/{accountId}/Logs' do
|
315
|
+
expect(@stub).to have_been_requested
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
|
320
|
+
# unit tests for get_a_call
|
321
|
+
# Get a Call
|
322
|
+
# @param call_id String that uniquely identifies this call resource.
|
323
|
+
# @param [Hash] opts the optional parameters
|
324
|
+
# @return [CallResult]
|
325
|
+
describe 'get_a_call test' do
|
326
|
+
before do
|
327
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Calls/{callId}"
|
328
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::CALL_RESULT, :status => 200, :headers => {})
|
329
|
+
call_id = 'MOCK_CALL_ID' # String | String that uniquely identifies this call resource.
|
330
|
+
|
331
|
+
@result = @api_instance.get_a_call(call_id)
|
332
|
+
end
|
333
|
+
|
334
|
+
it 'should respond with a call result' do
|
335
|
+
expect(@result).to be_instance_of(Freeclimb::CallResult)
|
336
|
+
end
|
337
|
+
|
338
|
+
it 'should make a GET request to /Accounts/{accountId}/Calls/{callId}' do
|
339
|
+
expect(@stub).to have_been_requested
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
# unit tests for get_a_conference
|
344
|
+
# Get a Conference
|
345
|
+
# @param conference_id A string that uniquely identifies this conference resource.
|
346
|
+
# @param [Hash] opts the optional parameters
|
347
|
+
# @return [ConferenceResult]
|
348
|
+
describe 'get_a_conference test' do
|
349
|
+
before do
|
350
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences/{conferenceId}"
|
351
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::CONFERENCE_RESULT, :status => 200, :headers => {})
|
352
|
+
conference_id = 'MOCK_CONFERENCE_ID' # String | A string that uniquely identifies this conference resource.
|
353
|
+
|
354
|
+
@result = @api_instance.get_a_conference(conference_id)
|
355
|
+
end
|
356
|
+
|
357
|
+
it 'should respond with a conference result' do
|
358
|
+
expect(@result).to be_instance_of(Freeclimb::ConferenceResult)
|
359
|
+
end
|
360
|
+
|
361
|
+
it 'should make a GET request to /Accounts/{accountId}/Conferences/{conferenceId}' do
|
362
|
+
expect(@stub).to have_been_requested
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
# unit tests for get_a_member
|
367
|
+
# Get a Member
|
368
|
+
# @param queue_id String that uniquely identifies the Queue that the Member belongs to.
|
369
|
+
# @param call_id ID of the Call that the Member belongs to
|
370
|
+
# @param [Hash] opts the optional parameters
|
371
|
+
# @return [QueueMember]
|
372
|
+
describe 'get_a_member test' do
|
373
|
+
before do
|
374
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}/Members/{callId}"
|
375
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::QUEUE_MEMBER_RESULT, :status => 200, :headers => {})
|
376
|
+
queue_id = 'MOCK_QUEUE_ID' # String | String that uniquely identifies the Queue that the Member belongs to.
|
377
|
+
call_id = 'MOCK_CALL_ID' # String | ID of the Call that the Member belongs to
|
378
|
+
@result = @api_instance.get_a_member(queue_id, call_id)
|
379
|
+
end
|
380
|
+
|
381
|
+
it 'should respond with a queue member result' do
|
382
|
+
expect(@result).to be_instance_of(Freeclimb::QueueMember)
|
383
|
+
end
|
384
|
+
|
385
|
+
it 'should make a GET request to /Accounts/{accountId}/Queues/{queueId}/Members/{callId}' do
|
386
|
+
expect(@stub).to have_been_requested
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
# unit tests for get_a_participant
|
391
|
+
# Get a Participant
|
392
|
+
# @param conference_id ID of the conference this participant is in.
|
393
|
+
# @param call_id ID of the Call associated with this participant.
|
394
|
+
# @param [Hash] opts the optional parameters
|
395
|
+
# @return [ConferenceParticipantResult]
|
396
|
+
describe 'get_a_participant test' do
|
397
|
+
before do
|
398
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences/{ConferenceId}/Participants/{callId}"
|
399
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::CONFERENCE_PARTICIPANT_RESULT, :status => 200, :headers => {})
|
400
|
+
conference_id = 'MOCK_CONFERENCE_ID' # String | ID of the conference this participant is in.
|
401
|
+
call_id = 'MOCK_CALL_ID' # String | ID of the Call associated with this participant.
|
402
|
+
|
403
|
+
@result = @api_instance.get_a_participant(conference_id, call_id)
|
404
|
+
end
|
405
|
+
|
406
|
+
it 'should respond with a Conference participant result' do
|
407
|
+
expect(@result).to be_instance_of(Freeclimb::ConferenceParticipantResult)
|
408
|
+
end
|
409
|
+
|
410
|
+
it 'should make a GET request to /Accounts/{accountId}/Conferences/{ConferenceId}/Participants/{callId}' do
|
411
|
+
expect(@stub).to have_been_requested
|
412
|
+
end
|
413
|
+
end
|
414
|
+
|
415
|
+
# unit tests for get_a_queue
|
416
|
+
# Get a Queue
|
417
|
+
# @param queue_id A string that uniquely identifies this queue resource.
|
418
|
+
# @param [Hash] opts the optional parameters
|
419
|
+
# @return [QueueResult]
|
420
|
+
describe 'get_a_queue test' do
|
421
|
+
before do
|
422
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}"
|
423
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::QUEUE_RESULT, :status => 200, :headers => {})
|
424
|
+
queue_id = 'MOCK_QUEUE_ID' # String | A string that uniquely identifies this queue resource.
|
425
|
+
|
426
|
+
@result = @api_instance.get_a_queue(queue_id)
|
427
|
+
end
|
428
|
+
|
429
|
+
it 'should respond with a queue result' do
|
430
|
+
expect(@result).to be_instance_of(Freeclimb::QueueResult)
|
431
|
+
end
|
432
|
+
|
433
|
+
it 'should make a GET request to /Accounts/{accountId}/Queues/{queueId}' do
|
434
|
+
expect(@stub).to have_been_requested
|
435
|
+
end
|
436
|
+
end
|
437
|
+
|
438
|
+
# unit tests for get_a_recording
|
439
|
+
# Get a Recording
|
440
|
+
# @param recording_id String that uniquely identifies this recording resource.
|
441
|
+
# @param [Hash] opts the optional parameters
|
442
|
+
# @return [RecordingResult]
|
443
|
+
describe 'get_a_recording test' do
|
444
|
+
before do
|
445
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Recordings/{recordingId}"
|
446
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::QUEUE_RESULT, :status => 200, :headers => {})
|
447
|
+
recording_id = 'MOCK_RECORDING_ID' # String | String that uniquely identifies this recording resource.
|
448
|
+
|
449
|
+
@result = @api_instance.get_a_recording(recording_id)
|
450
|
+
end
|
451
|
+
|
452
|
+
it 'should respond with a Recording result' do
|
453
|
+
expect(@result).to be_instance_of(Freeclimb::RecordingResult)
|
454
|
+
end
|
455
|
+
|
456
|
+
it 'should make a GET request to /Accounts/{accountId}/Recordings/{recordingId}' do
|
457
|
+
expect(@stub).to have_been_requested
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
# unit tests for get_an_account
|
462
|
+
# Get an Account
|
463
|
+
# @param [Hash] opts the optional parameters
|
464
|
+
# @return [AccountResult]
|
465
|
+
describe 'get_an_account test' do
|
466
|
+
before do
|
467
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}"
|
468
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::ACCOUNT_RESULT, :status => 200, :headers => {})
|
469
|
+
|
470
|
+
@result = @api_instance.get_an_account
|
471
|
+
end
|
472
|
+
|
473
|
+
it 'should respond with an Account result' do
|
474
|
+
expect(@result).to be_instance_of(Freeclimb::AccountResult)
|
475
|
+
end
|
476
|
+
|
477
|
+
it 'should make a GET request to /Accounts/{accountId}' do
|
478
|
+
expect(@stub).to have_been_requested
|
479
|
+
end
|
480
|
+
end
|
481
|
+
|
482
|
+
# unit tests for get_an_application
|
483
|
+
# Get an Application
|
484
|
+
# @param application_id A string that uniquely identifies this application resource.
|
485
|
+
# @param [Hash] opts the optional parameters
|
486
|
+
# @return [ApplicationResult]
|
487
|
+
describe 'get_an_application test' do
|
488
|
+
before do
|
489
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Applications/{applicationId}"
|
490
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::APPLICATION_RESULT, :status => 200, :headers => {})
|
491
|
+
|
492
|
+
application_id = 'MOCK_APPLICATION_ID' # String | A string that uniquely identifies this application resource.
|
493
|
+
@result = @api_instance.get_an_application(application_id)
|
494
|
+
end
|
495
|
+
|
496
|
+
it 'should respond with an Application result' do
|
497
|
+
expect(@result).to be_instance_of(Freeclimb::ApplicationResult)
|
498
|
+
end
|
499
|
+
|
500
|
+
it 'should make a GET request to /Accounts/{accountId}/Applications/{applicationId}' do
|
501
|
+
expect(@stub).to have_been_requested
|
502
|
+
end
|
503
|
+
end
|
504
|
+
|
505
|
+
# unit tests for get_an_incoming_number
|
506
|
+
# Get an Incoming Number
|
507
|
+
# @param phone_number_id String that uniquely identifies this phone number resource.
|
508
|
+
# @param [Hash] opts the optional parameters
|
509
|
+
# @return [IncomingNumberResult]
|
510
|
+
describe 'get_an_incoming_number test' do
|
511
|
+
before do
|
512
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId}"
|
513
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::INCOMING_PHONE_NUMBER, :status => 200, :headers => {})
|
514
|
+
|
515
|
+
phone_number_id = 'MOCK_PHONE_NUMBER_ID' # String | String that uniquely identifies this phone number resource.
|
516
|
+
@result = @api_instance.get_an_incoming_number(phone_number_id)
|
517
|
+
end
|
518
|
+
|
519
|
+
it 'should respond with an Application result' do
|
520
|
+
expect(@result).to be_instance_of(Freeclimb::IncomingNumberResult)
|
521
|
+
end
|
522
|
+
|
523
|
+
it 'should make a GET request to /Accounts/{accountId}/Applications/{applicationId}' do
|
524
|
+
expect(@stub).to have_been_requested
|
525
|
+
end
|
526
|
+
end
|
527
|
+
|
528
|
+
# unit tests for get_an_sms_message
|
529
|
+
# Get an SMS Message
|
530
|
+
# @param message_id String that uniquely identifies this Message resource.
|
531
|
+
# @param [Hash] opts the optional parameters
|
532
|
+
# @return [MessageResult]
|
533
|
+
describe 'get_an_sms_message test' do
|
534
|
+
before do
|
535
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Messages/{messageId}"
|
536
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::MESSAGE_RESULT, :status => 200, :headers => {})
|
537
|
+
|
538
|
+
message_id = 'MOCK_MESSAGE_ID' # String | String that uniquely identifies this Message resource.
|
539
|
+
|
540
|
+
@result = @api_instance.get_an_sms_message(message_id)
|
541
|
+
end
|
542
|
+
|
543
|
+
it 'should respond with a Message result' do
|
544
|
+
expect(@result).to be_instance_of(Freeclimb::MessageResult)
|
545
|
+
end
|
546
|
+
|
547
|
+
it 'should make a GET request to /Accounts/{accountId}/Messages/{messageId}' do
|
548
|
+
expect(@stub).to have_been_requested
|
549
|
+
end
|
550
|
+
end
|
551
|
+
|
552
|
+
# unit tests for get_head_member
|
553
|
+
# Get Head Member
|
554
|
+
# @param queue_id String that uniquely identifies the Queue that the Member belongs to.
|
555
|
+
# @param [Hash] opts the optional parameters
|
556
|
+
# @return [QueueMember]
|
557
|
+
describe 'get_head_member test' do
|
558
|
+
before do
|
559
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}/Members/Front"
|
560
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::QUEUE_MEMBER_RESULT, :status => 200, :headers => {})
|
561
|
+
|
562
|
+
queue_id = 'MOCK_QUEUE_ID' # String | String that uniquely identifies this Message resource.
|
563
|
+
|
564
|
+
@result = @api_instance.get_head_member(queue_id)
|
565
|
+
end
|
566
|
+
|
567
|
+
it 'should respond with a Queue Member result' do
|
568
|
+
expect(@result).to be_instance_of(Freeclimb::QueueMember)
|
569
|
+
end
|
570
|
+
|
571
|
+
it 'should make a GET request to /Accounts/{accountId}/Queues/{queueId}/Members/Front' do
|
572
|
+
expect(@stub).to have_been_requested
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
# unit tests for list_active_queues
|
577
|
+
# List Active Queues
|
578
|
+
# @param [Hash] opts the optional parameters
|
579
|
+
# @option opts [String] :_alias Return only the Queue resources with aliases that exactly match this name.
|
580
|
+
# @return [QueueList]
|
581
|
+
describe 'list_active_queues test' do
|
582
|
+
before do
|
583
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues"
|
584
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::QUEUE_LIST_RESULT, :status => 200, :headers => {})
|
585
|
+
|
586
|
+
@result = @api_instance.list_active_queues
|
587
|
+
end
|
588
|
+
|
589
|
+
it 'should respond with a Queue List result' do
|
590
|
+
expect(@result).to be_instance_of(Freeclimb::QueueList)
|
591
|
+
end
|
592
|
+
|
593
|
+
it 'should make a GET request to /Accounts/{accountId}/Queues' do
|
594
|
+
expect(@stub).to have_been_requested
|
595
|
+
end
|
596
|
+
end
|
597
|
+
|
598
|
+
# unit tests for list_all_account_logs
|
599
|
+
# List All Account Logs
|
600
|
+
# @param [Hash] opts the optional parameters
|
601
|
+
# @return [LogList]
|
602
|
+
describe 'list_all_account_logs test' do
|
603
|
+
before do
|
604
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Logs"
|
605
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::LOG_LIST_RESULT, :status => 200, :headers => {})
|
606
|
+
|
607
|
+
@result = @api_instance.list_all_account_logs
|
608
|
+
end
|
609
|
+
|
610
|
+
it 'should respond with a Queue Member result' do
|
611
|
+
expect(@result).to be_instance_of(Freeclimb::LogList)
|
612
|
+
end
|
613
|
+
|
614
|
+
it 'should make a GET request to /Accounts/{accountId}/Logs' do
|
615
|
+
expect(@stub).to have_been_requested
|
616
|
+
end
|
617
|
+
end
|
618
|
+
|
619
|
+
# unit tests for list_an_application
|
620
|
+
# List applications
|
621
|
+
# @param [Hash] opts the optional parameters
|
622
|
+
# @option opts [String] :_alias Return only applications with aliases that exactly match this value.
|
623
|
+
# @return [ApplicationList]
|
624
|
+
describe 'list_an_application test' do
|
625
|
+
before do
|
626
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Applications"
|
627
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::APPLICATION_LIST_RESULT, :status => 200, :headers => {})
|
628
|
+
|
629
|
+
@result = @api_instance.list_an_application
|
630
|
+
end
|
631
|
+
|
632
|
+
it 'should respond with a Application List result' do
|
633
|
+
expect(@result).to be_instance_of(Freeclimb::ApplicationList)
|
634
|
+
end
|
635
|
+
|
636
|
+
it 'should make a GET request to /Accounts/{accountId}/Applications' do
|
637
|
+
expect(@stub).to have_been_requested
|
638
|
+
end
|
639
|
+
end
|
640
|
+
|
641
|
+
# unit tests for list_available_numbers
|
642
|
+
# List available numbers
|
643
|
+
# @param [Hash] opts the optional parameters
|
644
|
+
# @option opts [String] :_alias Filter on numbers based on the formatted string of the phone number.
|
645
|
+
# @option opts [String] :phone_number PCRE-compatible regular expression to filter against `phoneNumber` field, which is in E.164 format.
|
646
|
+
# @return [AvailableNumberList]
|
647
|
+
describe 'list_available_numbers test' do
|
648
|
+
before do
|
649
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/AvailablePhoneNumbers?alias=MOCK_ALIAS&phoneNumber=MOCK_PHONE_NUMBER"
|
650
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::AVAILABLE_NUMBER_LIST, :status => 200, :headers => {})
|
651
|
+
|
652
|
+
opts = {
|
653
|
+
_alias: 'MOCK_ALIAS', # String | Filter on numbers based on the formatted string of the phone number.
|
654
|
+
phone_number: 'MOCK_PHONE_NUMBER' # String | PCRE-compatible regular expression to filter against `phoneNumber` field, which is in E.164 format.
|
655
|
+
}
|
656
|
+
|
657
|
+
@result = @api_instance.list_available_numbers(opts)
|
658
|
+
end
|
659
|
+
|
660
|
+
it 'should respond with a Available Number List result' do
|
661
|
+
expect(@result).to be_instance_of(Freeclimb::AvailableNumberList)
|
662
|
+
end
|
663
|
+
|
664
|
+
it 'should make a GET request to /AvailablePhoneNumbers' do
|
665
|
+
expect(@stub).to have_been_requested
|
666
|
+
end
|
667
|
+
end
|
668
|
+
|
669
|
+
# unit tests for list_call_logs
|
670
|
+
# List Call Logs
|
671
|
+
# @param call_id String that uniquely identifies this call resource.
|
672
|
+
# @param [Hash] opts the optional parameters
|
673
|
+
# @return [LogList]
|
674
|
+
describe 'list_call_logs test' do
|
675
|
+
before do
|
676
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Calls/{callId}/Logs"
|
677
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::LOG_LIST_RESULT, :status => 200, :headers => {})
|
678
|
+
|
679
|
+
call_id = 'MOCK_CALL_ID' # String | String that uniquely identifies this call resource.
|
680
|
+
@result = @api_instance.list_call_logs(call_id)
|
681
|
+
end
|
682
|
+
|
683
|
+
it 'should respond with a Logs List result' do
|
684
|
+
expect(@result).to be_instance_of(Freeclimb::LogList)
|
685
|
+
end
|
686
|
+
|
687
|
+
it 'should make a GET request to /Accounts/{accountId}/Calls/{callId}/Logs' do
|
688
|
+
expect(@stub).to have_been_requested
|
689
|
+
end
|
690
|
+
end
|
691
|
+
|
692
|
+
# unit tests for list_call_recordings
|
693
|
+
# List Call Recordings
|
694
|
+
# @param call_id String that uniquely identifies this call resource.
|
695
|
+
# @param [Hash] opts the optional parameters
|
696
|
+
# @option opts [String] :date_created Only show recordings created on the specified date, in the form *YYYY-MM-DD*.
|
697
|
+
# @return [RecordingList]
|
698
|
+
describe 'list_call_recordings test' do
|
699
|
+
before do
|
700
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Calls/{callId}/Recordings"
|
701
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::RECORDING_LIST_RESULT, :status => 200, :headers => {})
|
702
|
+
|
703
|
+
call_id = 'MOCK_CALL_ID' # String | String that uniquely identifies this call resource.
|
704
|
+
@result = @api_instance.list_call_recordings(call_id)
|
705
|
+
end
|
706
|
+
|
707
|
+
it 'should respond with a Recording List result' do
|
708
|
+
expect(@result).to be_instance_of(Freeclimb::RecordingList)
|
709
|
+
end
|
710
|
+
|
711
|
+
it 'should make a GET request to /Accounts/{accountId}/Calls/{callId}/Recordings' do
|
712
|
+
expect(@stub).to have_been_requested
|
713
|
+
end
|
714
|
+
end
|
715
|
+
|
716
|
+
# unit tests for list_calls
|
717
|
+
# List Calls
|
718
|
+
# @param [Hash] opts the optional parameters
|
719
|
+
# @option opts [String] :to Only show Calls to this phone number.
|
720
|
+
# @option opts [String] :from Only show Calls from this phone number.
|
721
|
+
# @option opts [String] :status Only show Calls currently in this status. May be `queued`, `ringing`, `inProgress`, `canceled`, `completed`, `failed`, `busy`, or `noAnswer`.
|
722
|
+
# @option opts [String] :start_time Only show Calls that started at or after this time, given as YYYY-MM-DD hh:mm:ss.
|
723
|
+
# @option opts [String] :end_time Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss.
|
724
|
+
# @option opts [String] :parent_call_id Only show Calls spawned by the call with this ID.
|
725
|
+
# @return [CallList]
|
726
|
+
describe 'list_calls test' do
|
727
|
+
before do
|
728
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Calls"
|
729
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::CALL_LIST_RESULT, :status => 200, :headers => {})
|
730
|
+
|
731
|
+
@result = @api_instance.list_calls
|
732
|
+
end
|
733
|
+
|
734
|
+
it 'should respond with a Call List result' do
|
735
|
+
expect(@result).to be_instance_of(Freeclimb::CallList)
|
736
|
+
end
|
737
|
+
|
738
|
+
it 'should make a GET request to /Accounts/{accountId}/Calls' do
|
739
|
+
expect(@stub).to have_been_requested
|
740
|
+
end
|
741
|
+
end
|
742
|
+
|
743
|
+
# unit tests for list_conferences
|
744
|
+
# List Conferences
|
745
|
+
# @param [Hash] opts the optional parameters
|
746
|
+
# @option opts [String] :status Only show conferences that currently have the specified status. Valid values: `empty`, `populated`, `inProgress`, or `terminated`.
|
747
|
+
# @option opts [String] :_alias List Conferences whose alias exactly matches this string.
|
748
|
+
# @option opts [String] :date_created Only show Conferences that were created on the specified date, in the form *YYYY-MM-DD*.
|
749
|
+
# @option opts [String] :date_updated Only show Conferences that were last updated on the specified date, in the form *YYYY-MM-DD*.
|
750
|
+
# @return [ConferenceList]
|
751
|
+
describe 'list_conferences test' do
|
752
|
+
before do
|
753
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences"
|
754
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::CONFERNECE_LIST_RESULT, :status => 200, :headers => {})
|
755
|
+
|
756
|
+
@result = @api_instance.list_conferences
|
757
|
+
end
|
758
|
+
|
759
|
+
it 'should respond with a Conferences List result' do
|
760
|
+
expect(@result).to be_instance_of(Freeclimb::ConferenceList)
|
761
|
+
end
|
762
|
+
|
763
|
+
it 'should make a GET request to /Accounts/{accountId}/Conferences' do
|
764
|
+
expect(@stub).to have_been_requested
|
765
|
+
end
|
766
|
+
end
|
767
|
+
|
768
|
+
# unit tests for list_incoming_numbers
|
769
|
+
# List Incoming Numbers
|
770
|
+
# @param [Hash] opts the optional parameters
|
771
|
+
# @option opts [String] :phone_number Only show incoming phone number resources that match this PCRE-compatible regular expression.
|
772
|
+
# @option opts [String] :_alias Only show incoming phone numbers with aliases that exactly match this value.
|
773
|
+
# @return [IncomingNumberList]
|
774
|
+
describe 'list_incoming_numbers test' do
|
775
|
+
before do
|
776
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/IncomingPhoneNumbers"
|
777
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::INCOMING_PHONE_NUMBER_LIST_RESULT, :status => 200, :headers => {})
|
778
|
+
|
779
|
+
@result = @api_instance.list_incoming_numbers
|
780
|
+
end
|
781
|
+
|
782
|
+
it 'should respond with a Incoming Phone Number List result' do
|
783
|
+
expect(@result).to be_instance_of(Freeclimb::IncomingNumberList)
|
784
|
+
end
|
785
|
+
|
786
|
+
it 'should make a GET request to /Accounts/{accountId}/IncomingPhoneNumbers' do
|
787
|
+
expect(@stub).to have_been_requested
|
788
|
+
end
|
789
|
+
end
|
790
|
+
|
791
|
+
# unit tests for list_members
|
792
|
+
# List Members
|
793
|
+
# @param queue_id String that uniquely identifies the Queue that the Member belongs to.
|
794
|
+
# @param [Hash] opts the optional parameters
|
795
|
+
# @return [QueueMemberList]
|
796
|
+
describe 'list_members test' do
|
797
|
+
before do
|
798
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}/Members"
|
799
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::QUEUE_MEMBER_RESULT, :status => 200, :headers => {})
|
800
|
+
|
801
|
+
queue_id = 'MOCK_QUEUE_ID'
|
802
|
+
@result = @api_instance.list_members(queue_id)
|
803
|
+
end
|
804
|
+
|
805
|
+
it 'should respond with a Queue Member List result' do
|
806
|
+
expect(@result).to be_instance_of(Freeclimb::QueueMemberList)
|
807
|
+
end
|
808
|
+
|
809
|
+
it 'should make a GET request to /Accounts/{accountId}/Queues/{queueId}/Members' do
|
810
|
+
expect(@stub).to have_been_requested
|
811
|
+
end
|
812
|
+
end
|
813
|
+
|
814
|
+
# unit tests for list_participants
|
815
|
+
# List Participants
|
816
|
+
# @param conference_id ID of the conference this participant is in.
|
817
|
+
# @param [Hash] opts the optional parameters
|
818
|
+
# @option opts [Boolean] :talk Only show Participants with the talk privilege.
|
819
|
+
# @option opts [Boolean] :listen Only show Participants with the listen privilege.
|
820
|
+
# @return [ConferenceParticipantList]
|
821
|
+
describe 'list_participants test' do
|
822
|
+
before do
|
823
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences/{conferenceId}/Participants"
|
824
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::PARTICIPANT_LIST_RESULT, :status => 200, :headers => {})
|
825
|
+
|
826
|
+
conference_id = 'MOCK_CONFERENCE_ID'
|
827
|
+
@result = @api_instance.list_participants(conference_id)
|
828
|
+
end
|
829
|
+
|
830
|
+
it 'should respond with a Conference Participant List result' do
|
831
|
+
expect(@result).to be_instance_of(Freeclimb::ConferenceParticipantList)
|
832
|
+
end
|
833
|
+
|
834
|
+
it 'should make a GET request to /Accounts/{accountId}/Conferences/{conferenceId}/Participants' do
|
835
|
+
expect(@stub).to have_been_requested
|
836
|
+
end
|
837
|
+
end
|
838
|
+
|
839
|
+
# unit tests for list_recordings
|
840
|
+
# List Recordings
|
841
|
+
# @param [Hash] opts the optional parameters
|
842
|
+
# @option opts [String] :call_id Show only Recordings made during the Call with this ID.
|
843
|
+
# @option opts [String] :conference_id Show only Recordings made during the conference with this ID.
|
844
|
+
# @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*.
|
845
|
+
# @return [RecordingList]
|
846
|
+
describe 'list_recordings test' do
|
847
|
+
before do
|
848
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Recordings"
|
849
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::RECORDING_LIST_RESULT, :status => 200, :headers => {})
|
850
|
+
|
851
|
+
@result = @api_instance.list_recordings
|
852
|
+
end
|
853
|
+
|
854
|
+
it 'should respond with a Recordings List result' do
|
855
|
+
expect(@result).to be_instance_of(Freeclimb::RecordingList)
|
856
|
+
end
|
857
|
+
|
858
|
+
it 'should make a GET request to /Accounts/{accountId}/Recordings' do
|
859
|
+
expect(@stub).to have_been_requested
|
860
|
+
end
|
861
|
+
end
|
862
|
+
|
863
|
+
# unit tests for list_sms_messages
|
864
|
+
# List SMS Messages
|
865
|
+
# @param [Hash] opts the optional parameters
|
866
|
+
# @option opts [String] :to Only show Messages to this phone number.
|
867
|
+
# @option opts [String] :from Only show Messages from this phone number.
|
868
|
+
# @option opts [String] :begin_time Only show Messages sent at or after this time (GMT), given as *YYYY-MM-DD hh:mm:ss*.
|
869
|
+
# @option opts [String] :end_time Only show messages sent at or before this time (GMT), given as *YYYY-MM-DD hh:mm*..
|
870
|
+
# @option opts [String] :direction Either `inbound` or `outbound`. Only show Messages that were either *sent from* or *received by* FreeClimb.
|
871
|
+
# @option opts [String] :account_id String that uniquely identifies this account resource.
|
872
|
+
# @return [MessagesList]
|
873
|
+
describe 'list_sms_messages test' do
|
874
|
+
before do
|
875
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Messages"
|
876
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::MESSAGE_RESULT, :status => 200, :headers => {})
|
877
|
+
|
878
|
+
@result = @api_instance.list_sms_messages
|
879
|
+
end
|
880
|
+
|
881
|
+
it 'should respond with a Messages List result' do
|
882
|
+
expect(@result).to be_instance_of(Freeclimb::MessagesList)
|
883
|
+
end
|
884
|
+
|
885
|
+
it 'should make a GET request to /Accounts/{accountId}/Messages' do
|
886
|
+
expect(@stub).to have_been_requested
|
887
|
+
end
|
888
|
+
end
|
889
|
+
|
890
|
+
# unit tests for make_a_call
|
891
|
+
# Make a Call
|
892
|
+
# @param [Hash] opts the optional parameters
|
893
|
+
# @option opts [MakeCallRequest] :make_call_request Call details for making a call
|
894
|
+
# @return [CallResult]
|
895
|
+
describe 'make_a_call test' do
|
896
|
+
before do
|
897
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Calls"
|
898
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::CALL_RESULT, :status => 200, :headers => {})
|
899
|
+
|
900
|
+
@result = @api_instance.make_a_call
|
901
|
+
end
|
902
|
+
|
903
|
+
it 'should respond with a Call Result result' do
|
904
|
+
expect(@result).to be_instance_of(Freeclimb::CallResult)
|
905
|
+
end
|
906
|
+
|
907
|
+
it 'should make a POST request to /Accounts/{accountId}/Calls' do
|
908
|
+
expect(@stub).to have_been_requested
|
909
|
+
end
|
910
|
+
end
|
911
|
+
|
912
|
+
# unit tests for remove_a_participant
|
913
|
+
# Remove a Participant
|
914
|
+
# @param conference_id ID of the conference this participant is in.
|
915
|
+
# @param call_id ID of the Call associated with this participant.
|
916
|
+
# @param [Hash] opts the optional parameters
|
917
|
+
# @return [nil]
|
918
|
+
describe 'remove_a_participant test' do
|
919
|
+
before do
|
920
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences/{conferenceId}/Participants/{callId}"
|
921
|
+
@stub = stub_request(:delete, uri_template).to_return(:status => 204, :headers => {})
|
922
|
+
|
923
|
+
conference_id = 'MOCK_CONFERENCE_ID'
|
924
|
+
call_id = 'CALL_ID'
|
925
|
+
@result = @api_instance.remove_a_participant(conference_id, call_id)
|
926
|
+
end
|
927
|
+
|
928
|
+
it 'should respond with nil' do
|
929
|
+
expect(@result).to be_nil
|
930
|
+
end
|
931
|
+
|
932
|
+
it 'should make a POST request to /Accounts/{accountId}/Calls' do
|
933
|
+
expect(@stub).to have_been_requested
|
934
|
+
end
|
935
|
+
end
|
936
|
+
|
937
|
+
# unit tests for send_an_sms_message
|
938
|
+
# Send an SMS Message
|
939
|
+
# @param [Hash] opts the optional parameters
|
940
|
+
# @option opts [MessageRequest] :message_request Details to create a message
|
941
|
+
# @return [MessageResult]
|
942
|
+
describe 'send_an_sms_message test' do
|
943
|
+
before do
|
944
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Messages"
|
945
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::CALL_RESULT, :status => 200, :headers => {})
|
946
|
+
|
947
|
+
request_body = Freeclimb::MessageRequest.new
|
948
|
+
request_body.to = 'MOCK_TO_NUMBER'
|
949
|
+
request_body.from ='MOCK_FROM_NUMBER'
|
950
|
+
request_body.text = 'MOCK_TEXT'
|
951
|
+
|
952
|
+
opts = {
|
953
|
+
message_request: request_body # MessageRequest | Details to create a message
|
954
|
+
}
|
955
|
+
|
956
|
+
@result = @api_instance.send_an_sms_message(opts)
|
957
|
+
end
|
958
|
+
|
959
|
+
it 'should respond with Message result' do
|
960
|
+
expect(@result).to be_instance_of(Freeclimb::MessageResult)
|
961
|
+
end
|
962
|
+
|
963
|
+
it 'should make a POST request to /Accounts/{accountId}/Messages' do
|
964
|
+
expect(@stub).to have_been_requested
|
965
|
+
end
|
966
|
+
end
|
967
|
+
|
968
|
+
# unit tests for stream_a_recording_file
|
969
|
+
# Stream a Recording File
|
970
|
+
# @param recording_id String that uniquely identifies this recording resource.
|
971
|
+
# @param [Hash] opts the optional parameters
|
972
|
+
# @return [File]
|
973
|
+
describe 'stream_a_recording_file test' do
|
974
|
+
before do
|
975
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Recordings/{recordingId}/Stream"
|
976
|
+
@stub = stub_request(:get, uri_template).to_return(:body => ResponseMocks::CALL_RESULT, :status => 200, :headers => {})
|
977
|
+
|
978
|
+
recording_id = 'MOCK_RECORDING_ID'
|
979
|
+
@result = @api_instance.stream_a_recording_file(recording_id)
|
980
|
+
end
|
981
|
+
|
982
|
+
it 'should make a GET request to /Accounts/{accountId}/Recordings/{recordingId}/Stream' do
|
983
|
+
expect(@stub).to have_been_requested
|
984
|
+
end
|
985
|
+
end
|
986
|
+
|
987
|
+
# unit tests for update_a_conference
|
988
|
+
# Update a Conference
|
989
|
+
# @param conference_id String that uniquely identifies this conference resource.
|
990
|
+
# @param [Hash] opts the optional parameters
|
991
|
+
# @option opts [UpdateConferenceRequest] :update_conference_request Conference Details to update
|
992
|
+
# @return [ConferenceResult]
|
993
|
+
describe 'update_a_conference test' do
|
994
|
+
before do
|
995
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences/{conferenceId}"
|
996
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::CONFERENCE_RESULT, :status => 200, :headers => {})
|
997
|
+
|
998
|
+
conference_id = 'MOCK_CONFERENCE_ID'
|
999
|
+
@result = @api_instance.update_a_conference(conference_id)
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
it 'should respond with a Conference result' do
|
1003
|
+
expect(@result).to be_instance_of(Freeclimb::ConferenceResult)
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
it 'should make a POST request to /Accounts/{accountId}/Conferences/{conferenceId}' do
|
1007
|
+
expect(@stub).to have_been_requested
|
1008
|
+
end
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
# unit tests for update_a_live_call
|
1012
|
+
# Update a Live Call
|
1013
|
+
# @param call_id String that uniquely identifies this call resource.
|
1014
|
+
# @param [Hash] opts the optional parameters
|
1015
|
+
# @option opts [UpdateCallRequest] :update_call_request Call details to update
|
1016
|
+
# @return [nil]
|
1017
|
+
describe 'update_a_live_call test' do
|
1018
|
+
before do
|
1019
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Calls/{callId}"
|
1020
|
+
@stub = stub_request(:post, uri_template).to_return(:body => '{}', :status => 202, :headers => {})
|
1021
|
+
|
1022
|
+
call_id = 'MOCK_CALL_ID'
|
1023
|
+
@result = @api_instance.update_a_live_call(call_id)
|
1024
|
+
end
|
1025
|
+
|
1026
|
+
it 'should make a POST request to /Accounts/{accountId}/Calls/{callId}' do
|
1027
|
+
expect(@stub).to have_been_requested
|
1028
|
+
end
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
# unit tests for update_a_participant
|
1032
|
+
# Update a Participant
|
1033
|
+
# @param conference_id ID of the conference this participant is in.
|
1034
|
+
# @param call_id ID of the Call associated with this participant.
|
1035
|
+
# @param [Hash] opts the optional parameters
|
1036
|
+
# @option opts [UpdateConferenceParticipantRequest] :update_conference_participant_request Conference participant details to update
|
1037
|
+
# @return [ConferenceParticipantResult]
|
1038
|
+
describe 'update_a_participant test' do
|
1039
|
+
before do
|
1040
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Conferences/{conferenceId}/Participants/{callId}"
|
1041
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::CONFERENCE_PARTICIPANT_RESULT, :status => 200, :headers => {})
|
1042
|
+
|
1043
|
+
conference_id = 'MOCK_CONFERENCE_ID'
|
1044
|
+
call_id = 'MOCK_CALL_ID'
|
1045
|
+
@result = @api_instance.update_a_participant(conference_id, call_id)
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
it 'should respond with a Conference Participant result' do
|
1049
|
+
expect(@result).to be_instance_of(Freeclimb::ConferenceParticipantResult)
|
1050
|
+
end
|
1051
|
+
|
1052
|
+
it 'should make a POST request to /Accounts/{accountId}/Conferences/{conferenceId}/Participants/{callId}' do
|
1053
|
+
expect(@stub).to have_been_requested
|
1054
|
+
end
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
# unit tests for update_a_queue
|
1058
|
+
# Update a Queue
|
1059
|
+
# @param queue_id A string that uniquely identifies this Queue resource.
|
1060
|
+
# @param [Hash] opts the optional parameters
|
1061
|
+
# @option opts [QueueRequest] :queue_request Queue Details to update
|
1062
|
+
# @return [QueueResult]
|
1063
|
+
describe 'update_a_queue test' do
|
1064
|
+
before do
|
1065
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Queues/{queueId}"
|
1066
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::QUEUE_RESULT, :status => 200, :headers => {})
|
1067
|
+
|
1068
|
+
queue_id = 'MOCK_QUEUE_ID'
|
1069
|
+
@result = @api_instance.update_a_queue(queue_id)
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
it 'should respond with a Queue result' do
|
1073
|
+
expect(@result).to be_instance_of(Freeclimb::QueueResult)
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
it 'should make a POST request to /Accounts/{accountId}/Queues/{queueId}' do
|
1077
|
+
expect(@stub).to have_been_requested
|
1078
|
+
end
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
# unit tests for update_an_account
|
1082
|
+
# Manage an account
|
1083
|
+
# @param [Hash] opts the optional parameters
|
1084
|
+
# @option opts [AccountRequest] :account_request Account details to update
|
1085
|
+
# @return [nil]
|
1086
|
+
describe 'update_an_account test' do
|
1087
|
+
before do
|
1088
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}"
|
1089
|
+
@stub = stub_request(:post, uri_template).to_return(:status => 204, :headers => {})
|
1090
|
+
|
1091
|
+
@result = @api_instance.update_an_account
|
1092
|
+
end
|
1093
|
+
|
1094
|
+
it 'should respond an empty body' do
|
1095
|
+
expect(@result).to be_nil
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
it 'should make a POST request to /Accounts/{accountId}' do
|
1099
|
+
expect(@stub).to have_been_requested
|
1100
|
+
end
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
# unit tests for update_an_application
|
1104
|
+
# Update an application
|
1105
|
+
# @param application_id A string that uniquely identifies this application resource.
|
1106
|
+
# @param [Hash] opts the optional parameters
|
1107
|
+
# @option opts [ApplicationRequest] :application_request Application details to update.
|
1108
|
+
# @return [ApplicationResult]
|
1109
|
+
describe 'update_an_application test' do
|
1110
|
+
before do
|
1111
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/Applications/{applicationId}"
|
1112
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::APPLICATION_RESULT, :status => 200, :headers => {})
|
1113
|
+
|
1114
|
+
application_id = 'MOCK_APPLICAION_ID'
|
1115
|
+
@result = @api_instance.update_an_application(application_id)
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
it 'should respond with an Application result' do
|
1119
|
+
expect(@result).to be_instance_of(Freeclimb::ApplicationResult)
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
it 'should make a POST request to /Accounts/{accountId}/Applications/{application_id}' do
|
1123
|
+
expect(@stub).to have_been_requested
|
1124
|
+
end
|
1125
|
+
end
|
1126
|
+
|
1127
|
+
# unit tests for update_an_incoming_number
|
1128
|
+
# Update an Incoming Number
|
1129
|
+
# @param phone_number_id String that uniquely identifies this phone number resource.
|
1130
|
+
# @param [Hash] opts the optional parameters
|
1131
|
+
# @option opts [IncomingNumberRequest] :incoming_number_request Incoming Number details to update
|
1132
|
+
# @return [IncomingNumberResult]
|
1133
|
+
describe 'update_an_incoming_number test' do
|
1134
|
+
before do
|
1135
|
+
uri_template = Addressable::Template.new "#{API_SERVER}/Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId}"
|
1136
|
+
@stub = stub_request(:post, uri_template).to_return(:body => ResponseMocks::APPLICATION_RESULT, :status => 200, :headers => {})
|
1137
|
+
|
1138
|
+
phoneNumberId = 'MOCK_PHONE_NUMBER'
|
1139
|
+
@result = @api_instance.update_an_incoming_number(phoneNumberId)
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
it 'should respond with an Incoming Number result' do
|
1143
|
+
expect(@result).to be_instance_of(Freeclimb::IncomingNumberResult)
|
1144
|
+
end
|
1145
|
+
|
1146
|
+
it 'should make a POST request to /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId}' do
|
1147
|
+
expect(@stub).to have_been_requested
|
1148
|
+
end
|
1149
|
+
end
|
1150
|
+
|
1151
|
+
end
|