bandwidth-sdk 3.8.0 → 3.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bandwidth.rb +24 -1
- data/lib/bandwidth/client.rb +2 -0
- data/lib/bandwidth/configuration.rb +23 -4
- data/lib/bandwidth/messaging_lib/messaging/client.rb +2 -0
- data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb +2 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +1 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +7 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +5 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +5 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +5 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +5 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +5 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +15 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb +20 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb +14 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +5 -1
- data/lib/bandwidth/voice_lib/voice.rb +5 -2
- data/lib/bandwidth/voice_lib/voice/client.rb +2 -0
- data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +416 -16
- data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
- data/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +17 -0
- data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +45 -0
- data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +45 -0
- data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +36 -0
- data/lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb +11 -2
- data/lib/bandwidth/voice_lib/voice/models/call_engine_modify_conference_request.rb +74 -2
- data/lib/bandwidth/voice_lib/voice/models/conference_detail.rb +7 -4
- data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata_response.rb +126 -0
- data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +32 -4
- data/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +17 -0
- data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +3 -3
- data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +4 -1
- data/lib/bandwidth/voice_lib/voice/models/{status2_enum.rb → status3_enum.rb} +3 -3
- data/lib/bandwidth/voice_lib/voice/models/transcription.rb +1 -1
- data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +13 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +2 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +1 -1
- metadata +30 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 957c708a64fbff873ec8eabc221cd4832deaf4d68ac4d29c1200104ddf1a9320
|
4
|
+
data.tar.gz: dff8ddef5916e696798d712f257be3f9ef471ec2fadc42567ffa248b119e9e3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef6d3e69a46cf27463b1bc72cea88a0a2e4dd78558758ca6c72eceedd99c48c5c304e08914cecd8e3f5919bb617d501930dc81d8fc28aeba47148ecf0a214f7f
|
7
|
+
data.tar.gz: 487a7c3d36817d419e482ac89d98927803789b03b3be3148eeeb246f7fbfdae1da74bf500918b4eac1f8a7c7cce890290be1da843ca632c9ee26719d232e6b12
|
data/lib/bandwidth.rb
CHANGED
@@ -42,4 +42,27 @@ require_relative 'bandwidth/http/auth/voice_basic_auth.rb'
|
|
42
42
|
require_relative 'bandwidth/web_rtc_lib/web_rtc'
|
43
43
|
require_relative 'bandwidth/http/auth/web_rtc_basic_auth.rb'
|
44
44
|
|
45
|
-
#
|
45
|
+
# External Files
|
46
|
+
require_relative 'bandwidth/voice_lib/bxml/bxml.rb'
|
47
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/bridge.rb'
|
48
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/conference.rb'
|
49
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/forward.rb'
|
50
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/gather.rb'
|
51
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/hangup.rb'
|
52
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/pause.rb'
|
53
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/pause_recording.rb'
|
54
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/phone_number.rb'
|
55
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/play_audio.rb'
|
56
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/record.rb'
|
57
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/redirect.rb'
|
58
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/resume_recording.rb'
|
59
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/ring.rb'
|
60
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/send_dtmf.rb'
|
61
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/speak_sentence.rb'
|
62
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/start_gather.rb'
|
63
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/start_recording.rb'
|
64
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/stop_gather.rb'
|
65
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/stop_recording.rb'
|
66
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/transfer.rb'
|
67
|
+
require_relative 'bandwidth/voice_lib/bxml/verbs/xml_verb.rb'
|
68
|
+
require_relative 'bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb'
|
data/lib/bandwidth/client.rb
CHANGED
@@ -30,6 +30,7 @@ module Bandwidth
|
|
30
30
|
|
31
31
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
32
32
|
backoff_factor: 1, environment: Environment::PRODUCTION,
|
33
|
+
base_url: 'https://www.example.com',
|
33
34
|
messaging_basic_auth_user_name: 'TODO: Replace',
|
34
35
|
messaging_basic_auth_password: 'TODO: Replace',
|
35
36
|
two_factor_auth_basic_auth_user_name: 'TODO: Replace',
|
@@ -43,6 +44,7 @@ module Bandwidth
|
|
43
44
|
retry_interval: retry_interval,
|
44
45
|
backoff_factor: backoff_factor,
|
45
46
|
environment: environment,
|
47
|
+
base_url: base_url,
|
46
48
|
messaging_basic_auth_user_name: messaging_basic_auth_user_name,
|
47
49
|
messaging_basic_auth_password: messaging_basic_auth_password,
|
48
50
|
two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
|
@@ -7,7 +7,8 @@ module Bandwidth
|
|
7
7
|
# An enum for SDK environments.
|
8
8
|
class Environment
|
9
9
|
ENVIRONMENT = [
|
10
|
-
PRODUCTION = 'production'.freeze
|
10
|
+
PRODUCTION = 'production'.freeze,
|
11
|
+
CUSTOM = 'custom'.freeze
|
11
12
|
].freeze
|
12
13
|
end
|
13
14
|
|
@@ -32,6 +33,7 @@ module Bandwidth
|
|
32
33
|
attr_reader :retry_interval
|
33
34
|
attr_reader :backoff_factor
|
34
35
|
attr_reader :environment
|
36
|
+
attr_reader :base_url
|
35
37
|
attr_reader :messaging_basic_auth_user_name
|
36
38
|
attr_reader :messaging_basic_auth_password
|
37
39
|
attr_reader :two_factor_auth_basic_auth_user_name
|
@@ -47,6 +49,7 @@ module Bandwidth
|
|
47
49
|
|
48
50
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
49
51
|
backoff_factor: 1, environment: Environment::PRODUCTION,
|
52
|
+
base_url: 'https://www.example.com',
|
50
53
|
messaging_basic_auth_user_name: 'TODO: Replace',
|
51
54
|
messaging_basic_auth_password: 'TODO: Replace',
|
52
55
|
two_factor_auth_basic_auth_user_name: 'TODO: Replace',
|
@@ -71,6 +74,9 @@ module Bandwidth
|
|
71
74
|
# Current API environment
|
72
75
|
@environment = String(environment)
|
73
76
|
|
77
|
+
# baseUrl value
|
78
|
+
@base_url = base_url
|
79
|
+
|
74
80
|
# The username to use with basic authentication
|
75
81
|
@messaging_basic_auth_user_name = messaging_basic_auth_user_name
|
76
82
|
|
@@ -100,7 +106,7 @@ module Bandwidth
|
|
100
106
|
end
|
101
107
|
|
102
108
|
def clone_with(timeout: nil, max_retries: nil, retry_interval: nil,
|
103
|
-
backoff_factor: nil, environment: nil,
|
109
|
+
backoff_factor: nil, environment: nil, base_url: nil,
|
104
110
|
messaging_basic_auth_user_name: nil,
|
105
111
|
messaging_basic_auth_password: nil,
|
106
112
|
two_factor_auth_basic_auth_user_name: nil,
|
@@ -114,6 +120,7 @@ module Bandwidth
|
|
114
120
|
retry_interval ||= self.retry_interval
|
115
121
|
backoff_factor ||= self.backoff_factor
|
116
122
|
environment ||= self.environment
|
123
|
+
base_url ||= self.base_url
|
117
124
|
messaging_basic_auth_user_name ||= self.messaging_basic_auth_user_name
|
118
125
|
messaging_basic_auth_password ||= self.messaging_basic_auth_password
|
119
126
|
two_factor_auth_basic_auth_user_name ||= self.two_factor_auth_basic_auth_user_name
|
@@ -126,7 +133,7 @@ module Bandwidth
|
|
126
133
|
Configuration.new(
|
127
134
|
timeout: timeout, max_retries: max_retries,
|
128
135
|
retry_interval: retry_interval, backoff_factor: backoff_factor,
|
129
|
-
environment: environment,
|
136
|
+
environment: environment, base_url: base_url,
|
130
137
|
messaging_basic_auth_user_name: messaging_basic_auth_user_name,
|
131
138
|
messaging_basic_auth_password: messaging_basic_auth_password,
|
132
139
|
two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
|
@@ -152,6 +159,13 @@ module Bandwidth
|
|
152
159
|
Server::TWOFACTORAUTHDEFAULT => 'https://mfa.bandwidth.com/api/v1/',
|
153
160
|
Server::VOICEDEFAULT => 'https://voice.bandwidth.com',
|
154
161
|
Server::WEBRTCDEFAULT => 'https://api.webrtc.bandwidth.com/v1'
|
162
|
+
},
|
163
|
+
Environment::CUSTOM => {
|
164
|
+
Server::DEFAULT => '{base_url}',
|
165
|
+
Server::MESSAGINGDEFAULT => '{base_url}',
|
166
|
+
Server::TWOFACTORAUTHDEFAULT => '{base_url}',
|
167
|
+
Server::VOICEDEFAULT => '{base_url}',
|
168
|
+
Server::WEBRTCDEFAULT => '{base_url}'
|
155
169
|
}
|
156
170
|
}.freeze
|
157
171
|
|
@@ -160,7 +174,12 @@ module Bandwidth
|
|
160
174
|
# required.
|
161
175
|
# @return [String] The base URI.
|
162
176
|
def get_base_uri(server = Server::DEFAULT)
|
163
|
-
|
177
|
+
parameters = {
|
178
|
+
'base_url' => { 'value' => base_url, 'encode' => false }
|
179
|
+
}
|
180
|
+
APIHelper.append_url_with_template_parameters(
|
181
|
+
ENVIRONMENTS[environment][server], parameters
|
182
|
+
)
|
164
183
|
end
|
165
184
|
end
|
166
185
|
end
|
@@ -17,6 +17,7 @@ module Bandwidth
|
|
17
17
|
|
18
18
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
19
19
|
backoff_factor: 1, environment: Environment::PRODUCTION,
|
20
|
+
base_url: 'https://www.example.com',
|
20
21
|
messaging_basic_auth_user_name: 'TODO: Replace',
|
21
22
|
messaging_basic_auth_password: 'TODO: Replace',
|
22
23
|
two_factor_auth_basic_auth_user_name: 'TODO: Replace',
|
@@ -32,6 +33,7 @@ module Bandwidth
|
|
32
33
|
retry_interval: retry_interval,
|
33
34
|
backoff_factor: backoff_factor,
|
34
35
|
environment: environment,
|
36
|
+
base_url: base_url,
|
35
37
|
messaging_basic_auth_user_name: messaging_basic_auth_user_name,
|
36
38
|
messaging_basic_auth_password: messaging_basic_auth_password,
|
37
39
|
two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
|
@@ -17,6 +17,7 @@ module Bandwidth
|
|
17
17
|
|
18
18
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
19
19
|
backoff_factor: 1, environment: Environment::PRODUCTION,
|
20
|
+
base_url: 'https://www.example.com',
|
20
21
|
messaging_basic_auth_user_name: 'TODO: Replace',
|
21
22
|
messaging_basic_auth_password: 'TODO: Replace',
|
22
23
|
two_factor_auth_basic_auth_user_name: 'TODO: Replace',
|
@@ -32,6 +33,7 @@ module Bandwidth
|
|
32
33
|
retry_interval: retry_interval,
|
33
34
|
backoff_factor: backoff_factor,
|
34
35
|
environment: environment,
|
36
|
+
base_url: base_url,
|
35
37
|
messaging_basic_auth_user_name: messaging_basic_auth_user_name,
|
36
38
|
messaging_basic_auth_password: messaging_basic_auth_password,
|
37
39
|
two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
|
@@ -14,7 +14,13 @@ module Bandwidth
|
|
14
14
|
'bridgeTargetCompleteMethod' => bridge_target_complete_method,
|
15
15
|
'username' => username,
|
16
16
|
'password' => password,
|
17
|
-
'tag' => tag
|
17
|
+
'tag' => tag,
|
18
|
+
'bridgeCompleteFallbackUrl' => bridge_complete_fallback_url,
|
19
|
+
'bridgeCompleteFallbackMethod' => bridge_complete_fallback_method,
|
20
|
+
'bridgeTargetCompleteFallbackUrl' => bridge_target_complete_fallback_url,
|
21
|
+
'bridgeTargetCompleteFallbackMethod' => bridge_target_complete_fallback_method,
|
22
|
+
'fallbackUsername' => fallback_username,
|
23
|
+
'fallbackPassword' => fallback_password
|
18
24
|
}))
|
19
25
|
end
|
20
26
|
end
|
@@ -20,7 +20,11 @@ module Bandwidth
|
|
20
20
|
'conferenceEventMethod' => conference_event_method,
|
21
21
|
'username' => username,
|
22
22
|
'password' => password,
|
23
|
-
'tag' => tag
|
23
|
+
'tag' => tag,
|
24
|
+
'conferenceEventFallbackUrl' => conference_event_fallback_url,
|
25
|
+
'conferenceEventFallbackMethod' => conference_event_fallback_method,
|
26
|
+
'fallbackUsername' => fallback_username,
|
27
|
+
'fallbackPassword' => fallback_password
|
24
28
|
}))
|
25
29
|
end
|
26
30
|
end
|
@@ -17,7 +17,11 @@ module Bandwidth
|
|
17
17
|
'username' => username,
|
18
18
|
'password' => password,
|
19
19
|
'firstDigitTimeout' => first_digit_timeout,
|
20
|
-
'repeatCount' => repeat_count
|
20
|
+
'repeatCount' => repeat_count,
|
21
|
+
'gatherFallbackUrl' => gather_fallback_url,
|
22
|
+
'gatherFallbackMethod' => gather_fallback_method,
|
23
|
+
'fallbackUsername' => fallback_username,
|
24
|
+
'fallbackPassword' => fallback_password
|
21
25
|
})) do
|
22
26
|
def embedded_xml(xml, property, type)
|
23
27
|
if property
|
@@ -12,7 +12,11 @@ module Bandwidth
|
|
12
12
|
'transferDisconnectMethod' => transfer_disconnect_method,
|
13
13
|
'username' => username,
|
14
14
|
'password' => password,
|
15
|
-
'tag' => tag
|
15
|
+
'tag' => tag,
|
16
|
+
'transferAnswerFallbackUrl' => transfer_answer_fallback_url,
|
17
|
+
'transferAnswerFallbackMethod' => transfer_answer_fallback_method,
|
18
|
+
'fallbackUsername' => fallback_username,
|
19
|
+
'fallbackPassword' => fallback_password
|
16
20
|
}))
|
17
21
|
end
|
18
22
|
end
|
@@ -21,7 +21,11 @@ module Bandwidth
|
|
21
21
|
'transcribe' => transcribe,
|
22
22
|
'transcriptionAvailableUrl' => transcription_available_url,
|
23
23
|
'transcriptionAvailableMethod' => transcription_available_method,
|
24
|
-
'silenceTimeout' => silence_timeout
|
24
|
+
'silenceTimeout' => silence_timeout,
|
25
|
+
'recordCompleteFallbackUrl' => record_complete_fallback_url,
|
26
|
+
'recordCompleteFallbackMethod' => record_complete_fallback_method,
|
27
|
+
'fallbackUsername' => fallback_username,
|
28
|
+
'fallbackPassword' => fallback_password
|
25
29
|
}))
|
26
30
|
end
|
27
31
|
end
|
@@ -12,7 +12,11 @@ module Bandwidth
|
|
12
12
|
'redirectMethod' => redirect_method,
|
13
13
|
'tag' => tag,
|
14
14
|
'username' => username,
|
15
|
-
'password' => password
|
15
|
+
'password' => password,
|
16
|
+
'redirectFallbackUrl' => redirect_fallback_url,
|
17
|
+
'redirectFallbackMethod' => redirect_fallback_method,
|
18
|
+
'fallbackUsername' => fallback_username,
|
19
|
+
'fallbackPassword' => fallback_password
|
16
20
|
}))
|
17
21
|
end
|
18
22
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'xml_verb'
|
2
|
+
|
3
|
+
module Bandwidth
|
4
|
+
module Voice
|
5
|
+
# The StartGather verb is used to start a gather
|
6
|
+
class StartGather
|
7
|
+
include XmlVerb
|
8
|
+
|
9
|
+
def to_bxml(xml)
|
10
|
+
xml.StartGather(compact_hash({
|
11
|
+
'username' => username,
|
12
|
+
'password' => password,
|
13
|
+
'tag' => tag,
|
14
|
+
'dtmfUrl' => dtmf_url,
|
15
|
+
'dtmfMethod' => dtmf_method,
|
16
|
+
}))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -16,7 +16,11 @@ module Bandwidth
|
|
16
16
|
'username' => username,
|
17
17
|
'password' => password,
|
18
18
|
'diversionTreatment' => diversion_treatment,
|
19
|
-
'diversionReason' => diversion_reason
|
19
|
+
'diversionReason' => diversion_reason,
|
20
|
+
'transferCompleteFallbackUrl' => transfer_complete_fallback_url,
|
21
|
+
'transferCompleteFallbackMethod' => transfer_complete_fallback_method,
|
22
|
+
'fallbackUsername' => fallback_username,
|
23
|
+
'fallbackPassword' => fallback_password
|
20
24
|
})) do
|
21
25
|
def embedded_xml(xml, property, type)
|
22
26
|
if property
|
@@ -11,15 +11,17 @@ require_relative 'voice/models/api_call_response.rb'
|
|
11
11
|
require_relative 'voice/models/api_call_state_response.rb'
|
12
12
|
require_relative 'voice/models/api_create_call_request.rb'
|
13
13
|
require_relative 'voice/models/api_modify_call_request.rb'
|
14
|
-
require_relative 'voice/models/api_transcribe_recording_request.rb'
|
15
14
|
require_relative 'voice/models/call_engine_modify_conference_request.rb'
|
15
|
+
require_relative 'voice/models/api_transcribe_recording_request.rb'
|
16
16
|
require_relative 'voice/models/conference_detail.rb'
|
17
17
|
require_relative 'voice/models/conference_member_detail.rb'
|
18
|
+
require_relative 'voice/models/conference_recording_metadata_response.rb'
|
18
19
|
require_relative 'voice/models/modify_call_recording_state.rb'
|
19
20
|
require_relative 'voice/models/recording_metadata_response.rb'
|
20
21
|
require_relative 'voice/models/transcript.rb'
|
21
22
|
require_relative 'voice/models/transcription.rb'
|
22
23
|
require_relative 'voice/models/transcription_response.rb'
|
24
|
+
require_relative 'voice/models/answer_fallback_method_enum.rb'
|
23
25
|
require_relative 'voice/models/answer_method_enum.rb'
|
24
26
|
require_relative 'voice/models/callback_method_enum.rb'
|
25
27
|
require_relative 'voice/models/conference_event_method_enum.rb'
|
@@ -27,13 +29,14 @@ require_relative 'voice/models/direction_enum.rb'
|
|
27
29
|
require_relative 'voice/models/disconnect_cause_enum.rb'
|
28
30
|
require_relative 'voice/models/disconnect_method_enum.rb'
|
29
31
|
require_relative 'voice/models/file_format_enum.rb'
|
32
|
+
require_relative 'voice/models/redirect_fallback_method_enum.rb'
|
30
33
|
require_relative 'voice/models/redirect_method_enum.rb'
|
31
34
|
require_relative 'voice/models/state_enum.rb'
|
32
35
|
require_relative 'voice/models/state1_enum.rb'
|
33
36
|
require_relative 'voice/models/state2_enum.rb'
|
34
37
|
require_relative 'voice/models/status_enum.rb'
|
35
38
|
require_relative 'voice/models/status1_enum.rb'
|
36
|
-
require_relative 'voice/models/
|
39
|
+
require_relative 'voice/models/status3_enum.rb'
|
37
40
|
|
38
41
|
# Exceptions
|
39
42
|
require_relative 'voice/exceptions/api_error_response_exception.rb'
|
@@ -17,6 +17,7 @@ module Bandwidth
|
|
17
17
|
|
18
18
|
def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
|
19
19
|
backoff_factor: 1, environment: Environment::PRODUCTION,
|
20
|
+
base_url: 'https://www.example.com',
|
20
21
|
messaging_basic_auth_user_name: 'TODO: Replace',
|
21
22
|
messaging_basic_auth_password: 'TODO: Replace',
|
22
23
|
two_factor_auth_basic_auth_user_name: 'TODO: Replace',
|
@@ -32,6 +33,7 @@ module Bandwidth
|
|
32
33
|
retry_interval: retry_interval,
|
33
34
|
backoff_factor: backoff_factor,
|
34
35
|
environment: environment,
|
36
|
+
base_url: base_url,
|
35
37
|
messaging_basic_auth_user_name: messaging_basic_auth_user_name,
|
36
38
|
messaging_basic_auth_password: messaging_basic_auth_password,
|
37
39
|
two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
|
@@ -332,17 +332,9 @@ module Voice
|
|
332
332
|
# took place during the specified call
|
333
333
|
# @param [String] account_id Required parameter: Example:
|
334
334
|
# @param [String] call_id Required parameter: Example:
|
335
|
-
# @param [String] from Optional parameter: Example:
|
336
|
-
# @param [String] to Optional parameter: Example:
|
337
|
-
# @param [String] min_start_time Optional parameter: Example:
|
338
|
-
# @param [String] max_start_time Optional parameter: Example:
|
339
335
|
# @return [List of RecordingMetadataResponse] response from the API call
|
340
336
|
def get_query_metadata_for_account_and_call(account_id,
|
341
|
-
call_id
|
342
|
-
from: nil,
|
343
|
-
to: nil,
|
344
|
-
min_start_time: nil,
|
345
|
-
max_start_time: nil)
|
337
|
+
call_id)
|
346
338
|
# Prepare query url.
|
347
339
|
_query_builder = config.get_base_uri(Server::VOICEDEFAULT)
|
348
340
|
_query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings'
|
@@ -351,13 +343,6 @@ module Voice
|
|
351
343
|
'accountId' => { 'value' => account_id, 'encode' => true },
|
352
344
|
'callId' => { 'value' => call_id, 'encode' => true }
|
353
345
|
)
|
354
|
-
_query_builder = APIHelper.append_url_with_query_parameters(
|
355
|
-
_query_builder,
|
356
|
-
'from' => from,
|
357
|
-
'to' => to,
|
358
|
-
'minStartTime' => min_start_time,
|
359
|
-
'maxStartTime' => max_start_time
|
360
|
-
)
|
361
346
|
_query_url = APIHelper.clean_url _query_builder
|
362
347
|
|
363
348
|
# Prepare headers.
|
@@ -970,6 +955,101 @@ module Voice
|
|
970
955
|
ApiResponse.new(_response)
|
971
956
|
end
|
972
957
|
|
958
|
+
# Returns information about the conferences in the account
|
959
|
+
# @param [String] account_id Required parameter: Example:
|
960
|
+
# @param [Integer] page_size Optional parameter: Example:1000
|
961
|
+
# @param [String] page_token Optional parameter: Example:
|
962
|
+
# @param [String] name Optional parameter: Example:
|
963
|
+
# @param [String] min_created_time Optional parameter: Example:
|
964
|
+
# @param [String] max_created_time Optional parameter: Example:
|
965
|
+
# @return [List of ConferenceDetail] response from the API call
|
966
|
+
def get_conferences_by_account(account_id,
|
967
|
+
page_size: 1000,
|
968
|
+
page_token: nil,
|
969
|
+
name: nil,
|
970
|
+
min_created_time: nil,
|
971
|
+
max_created_time: nil)
|
972
|
+
# Prepare query url.
|
973
|
+
_query_builder = config.get_base_uri(Server::VOICEDEFAULT)
|
974
|
+
_query_builder << '/api/v2/accounts/{accountId}/conferences'
|
975
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
976
|
+
_query_builder,
|
977
|
+
'accountId' => { 'value' => account_id, 'encode' => true }
|
978
|
+
)
|
979
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
980
|
+
_query_builder,
|
981
|
+
'pageSize' => page_size,
|
982
|
+
'pageToken' => page_token,
|
983
|
+
'name' => name,
|
984
|
+
'minCreatedTime' => min_created_time,
|
985
|
+
'maxCreatedTime' => max_created_time
|
986
|
+
)
|
987
|
+
_query_url = APIHelper.clean_url _query_builder
|
988
|
+
|
989
|
+
# Prepare headers.
|
990
|
+
_headers = {
|
991
|
+
'accept' => 'application/json'
|
992
|
+
}
|
993
|
+
|
994
|
+
# Prepare and execute HttpRequest.
|
995
|
+
_request = config.http_client.get(
|
996
|
+
_query_url,
|
997
|
+
headers: _headers
|
998
|
+
)
|
999
|
+
VoiceBasicAuth.apply(config, _request)
|
1000
|
+
_response = execute_request(_request)
|
1001
|
+
|
1002
|
+
# Validate response against endpoint and global error codes.
|
1003
|
+
if _response.status_code == 400
|
1004
|
+
raise ApiErrorResponseException.new(
|
1005
|
+
'Something\'s not quite right... Your request is invalid. Please' \
|
1006
|
+
' fix it before trying again.',
|
1007
|
+
_response
|
1008
|
+
)
|
1009
|
+
elsif _response.status_code == 401
|
1010
|
+
raise APIException.new(
|
1011
|
+
'Your credentials are invalid. Please use your Bandwidth dashboard' \
|
1012
|
+
' credentials to authenticate to the API.',
|
1013
|
+
_response
|
1014
|
+
)
|
1015
|
+
elsif _response.status_code == 403
|
1016
|
+
raise ApiErrorResponseException.new(
|
1017
|
+
'User unauthorized to perform this action.',
|
1018
|
+
_response
|
1019
|
+
)
|
1020
|
+
elsif _response.status_code == 404
|
1021
|
+
raise ApiErrorResponseException.new(
|
1022
|
+
'The resource specified cannot be found or does not belong to you.',
|
1023
|
+
_response
|
1024
|
+
)
|
1025
|
+
elsif _response.status_code == 415
|
1026
|
+
raise ApiErrorResponseException.new(
|
1027
|
+
'We don\'t support that media type. If a request body is required,' \
|
1028
|
+
' please send it to us as `application/json`.',
|
1029
|
+
_response
|
1030
|
+
)
|
1031
|
+
elsif _response.status_code == 429
|
1032
|
+
raise ApiErrorResponseException.new(
|
1033
|
+
'You\'re sending requests to this endpoint too frequently. Please' \
|
1034
|
+
' slow your request rate down and try again.',
|
1035
|
+
_response
|
1036
|
+
)
|
1037
|
+
elsif _response.status_code == 500
|
1038
|
+
raise ApiErrorResponseException.new(
|
1039
|
+
'Something unexpected happened. Please try again.',
|
1040
|
+
_response
|
1041
|
+
)
|
1042
|
+
end
|
1043
|
+
validate_response(_response)
|
1044
|
+
|
1045
|
+
# Return appropriate response type.
|
1046
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
1047
|
+
ApiResponse.new(
|
1048
|
+
_response,
|
1049
|
+
data: decoded.map { |element| ConferenceDetail.from_hash(element) }
|
1050
|
+
)
|
1051
|
+
end
|
1052
|
+
|
973
1053
|
# Returns information about the specified conference
|
974
1054
|
# @param [String] account_id Required parameter: Example:
|
975
1055
|
# @param [String] conference_id Required parameter: Example:
|
@@ -1129,6 +1209,88 @@ module Voice
|
|
1129
1209
|
ApiResponse.new(_response)
|
1130
1210
|
end
|
1131
1211
|
|
1212
|
+
# Updates settings for a particular conference member
|
1213
|
+
# @param [String] account_id Required parameter: Example:
|
1214
|
+
# @param [String] conference_id Required parameter: Example:
|
1215
|
+
# @param [String] call_id Required parameter: Example:
|
1216
|
+
# @param [ConferenceMemberDetail] body Optional parameter: Example:
|
1217
|
+
# @return [void] response from the API call
|
1218
|
+
def modify_conference_member(account_id,
|
1219
|
+
conference_id,
|
1220
|
+
call_id,
|
1221
|
+
body: nil)
|
1222
|
+
# Prepare query url.
|
1223
|
+
_query_builder = config.get_base_uri(Server::VOICEDEFAULT)
|
1224
|
+
_query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{callId}'
|
1225
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
1226
|
+
_query_builder,
|
1227
|
+
'accountId' => { 'value' => account_id, 'encode' => true },
|
1228
|
+
'conferenceId' => { 'value' => conference_id, 'encode' => true },
|
1229
|
+
'callId' => { 'value' => call_id, 'encode' => true }
|
1230
|
+
)
|
1231
|
+
_query_url = APIHelper.clean_url _query_builder
|
1232
|
+
|
1233
|
+
# Prepare headers.
|
1234
|
+
_headers = {
|
1235
|
+
'content-type' => 'application/json; charset=utf-8'
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
# Prepare and execute HttpRequest.
|
1239
|
+
_request = config.http_client.put(
|
1240
|
+
_query_url,
|
1241
|
+
headers: _headers,
|
1242
|
+
parameters: body.to_json
|
1243
|
+
)
|
1244
|
+
VoiceBasicAuth.apply(config, _request)
|
1245
|
+
_response = execute_request(_request)
|
1246
|
+
|
1247
|
+
# Validate response against endpoint and global error codes.
|
1248
|
+
if _response.status_code == 400
|
1249
|
+
raise ApiErrorResponseException.new(
|
1250
|
+
'Something\'s not quite right... Your request is invalid. Please' \
|
1251
|
+
' fix it before trying again.',
|
1252
|
+
_response
|
1253
|
+
)
|
1254
|
+
elsif _response.status_code == 401
|
1255
|
+
raise APIException.new(
|
1256
|
+
'Your credentials are invalid. Please use your Bandwidth dashboard' \
|
1257
|
+
' credentials to authenticate to the API.',
|
1258
|
+
_response
|
1259
|
+
)
|
1260
|
+
elsif _response.status_code == 403
|
1261
|
+
raise ApiErrorResponseException.new(
|
1262
|
+
'User unauthorized to perform this action.',
|
1263
|
+
_response
|
1264
|
+
)
|
1265
|
+
elsif _response.status_code == 404
|
1266
|
+
raise ApiErrorResponseException.new(
|
1267
|
+
'The resource specified cannot be found or does not belong to you.',
|
1268
|
+
_response
|
1269
|
+
)
|
1270
|
+
elsif _response.status_code == 415
|
1271
|
+
raise ApiErrorResponseException.new(
|
1272
|
+
'We don\'t support that media type. If a request body is required,' \
|
1273
|
+
' please send it to us as `application/json`.',
|
1274
|
+
_response
|
1275
|
+
)
|
1276
|
+
elsif _response.status_code == 429
|
1277
|
+
raise ApiErrorResponseException.new(
|
1278
|
+
'You\'re sending requests to this endpoint too frequently. Please' \
|
1279
|
+
' slow your request rate down and try again.',
|
1280
|
+
_response
|
1281
|
+
)
|
1282
|
+
elsif _response.status_code == 500
|
1283
|
+
raise ApiErrorResponseException.new(
|
1284
|
+
'Something unexpected happened. Please try again.',
|
1285
|
+
_response
|
1286
|
+
)
|
1287
|
+
end
|
1288
|
+
validate_response(_response)
|
1289
|
+
|
1290
|
+
# Return appropriate response type.
|
1291
|
+
ApiResponse.new(_response)
|
1292
|
+
end
|
1293
|
+
|
1132
1294
|
# Returns information about the specified conference member
|
1133
1295
|
# @param [String] account_id Required parameter: Example:
|
1134
1296
|
# @param [String] conference_id Required parameter: Example:
|
@@ -1211,6 +1373,244 @@ module Voice
|
|
1211
1373
|
)
|
1212
1374
|
end
|
1213
1375
|
|
1376
|
+
# Returns a (potentially empty) list of metadata for the recordings that
|
1377
|
+
# took place during the specified conference
|
1378
|
+
# @param [String] account_id Required parameter: Example:
|
1379
|
+
# @param [String] conference_id Required parameter: Example:
|
1380
|
+
# @return [List of ConferenceRecordingMetadataResponse] response from the API call
|
1381
|
+
def get_query_metadata_for_account_and_conference(account_id,
|
1382
|
+
conference_id)
|
1383
|
+
# Prepare query url.
|
1384
|
+
_query_builder = config.get_base_uri(Server::VOICEDEFAULT)
|
1385
|
+
_query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings'
|
1386
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
1387
|
+
_query_builder,
|
1388
|
+
'accountId' => { 'value' => account_id, 'encode' => true },
|
1389
|
+
'conferenceId' => { 'value' => conference_id, 'encode' => true }
|
1390
|
+
)
|
1391
|
+
_query_url = APIHelper.clean_url _query_builder
|
1392
|
+
|
1393
|
+
# Prepare headers.
|
1394
|
+
_headers = {
|
1395
|
+
'accept' => 'application/json'
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
# Prepare and execute HttpRequest.
|
1399
|
+
_request = config.http_client.get(
|
1400
|
+
_query_url,
|
1401
|
+
headers: _headers
|
1402
|
+
)
|
1403
|
+
VoiceBasicAuth.apply(config, _request)
|
1404
|
+
_response = execute_request(_request)
|
1405
|
+
|
1406
|
+
# Validate response against endpoint and global error codes.
|
1407
|
+
if _response.status_code == 400
|
1408
|
+
raise ApiErrorResponseException.new(
|
1409
|
+
'Something\'s not quite right... Your request is invalid. Please' \
|
1410
|
+
' fix it before trying again.',
|
1411
|
+
_response
|
1412
|
+
)
|
1413
|
+
elsif _response.status_code == 401
|
1414
|
+
raise APIException.new(
|
1415
|
+
'Your credentials are invalid. Please use your Bandwidth dashboard' \
|
1416
|
+
' credentials to authenticate to the API.',
|
1417
|
+
_response
|
1418
|
+
)
|
1419
|
+
elsif _response.status_code == 403
|
1420
|
+
raise ApiErrorResponseException.new(
|
1421
|
+
'User unauthorized to perform this action.',
|
1422
|
+
_response
|
1423
|
+
)
|
1424
|
+
elsif _response.status_code == 404
|
1425
|
+
raise ApiErrorResponseException.new(
|
1426
|
+
'The resource specified cannot be found or does not belong to you.',
|
1427
|
+
_response
|
1428
|
+
)
|
1429
|
+
elsif _response.status_code == 415
|
1430
|
+
raise ApiErrorResponseException.new(
|
1431
|
+
'We don\'t support that media type. If a request body is required,' \
|
1432
|
+
' please send it to us as `application/json`.',
|
1433
|
+
_response
|
1434
|
+
)
|
1435
|
+
elsif _response.status_code == 429
|
1436
|
+
raise ApiErrorResponseException.new(
|
1437
|
+
'You\'re sending requests to this endpoint too frequently. Please' \
|
1438
|
+
' slow your request rate down and try again.',
|
1439
|
+
_response
|
1440
|
+
)
|
1441
|
+
elsif _response.status_code == 500
|
1442
|
+
raise ApiErrorResponseException.new(
|
1443
|
+
'Something unexpected happened. Please try again.',
|
1444
|
+
_response
|
1445
|
+
)
|
1446
|
+
end
|
1447
|
+
validate_response(_response)
|
1448
|
+
|
1449
|
+
# Return appropriate response type.
|
1450
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
1451
|
+
ApiResponse.new(
|
1452
|
+
_response,
|
1453
|
+
data: decoded.map { |element| ConferenceRecordingMetadataResponse.from_hash(element) }
|
1454
|
+
)
|
1455
|
+
end
|
1456
|
+
|
1457
|
+
# Returns metadata for the specified recording
|
1458
|
+
# @param [String] account_id Required parameter: Example:
|
1459
|
+
# @param [String] conference_id Required parameter: Example:
|
1460
|
+
# @param [String] recording_id Required parameter: Example:
|
1461
|
+
# @return [RecordingMetadataResponse] response from the API call
|
1462
|
+
def get_metadata_for_conference_recording(account_id,
|
1463
|
+
conference_id,
|
1464
|
+
recording_id)
|
1465
|
+
# Prepare query url.
|
1466
|
+
_query_builder = config.get_base_uri(Server::VOICEDEFAULT)
|
1467
|
+
_query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}'
|
1468
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
1469
|
+
_query_builder,
|
1470
|
+
'accountId' => { 'value' => account_id, 'encode' => true },
|
1471
|
+
'conferenceId' => { 'value' => conference_id, 'encode' => true },
|
1472
|
+
'recordingId' => { 'value' => recording_id, 'encode' => true }
|
1473
|
+
)
|
1474
|
+
_query_url = APIHelper.clean_url _query_builder
|
1475
|
+
|
1476
|
+
# Prepare headers.
|
1477
|
+
_headers = {
|
1478
|
+
'accept' => 'application/json'
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
# Prepare and execute HttpRequest.
|
1482
|
+
_request = config.http_client.get(
|
1483
|
+
_query_url,
|
1484
|
+
headers: _headers
|
1485
|
+
)
|
1486
|
+
VoiceBasicAuth.apply(config, _request)
|
1487
|
+
_response = execute_request(_request)
|
1488
|
+
|
1489
|
+
# Validate response against endpoint and global error codes.
|
1490
|
+
if _response.status_code == 400
|
1491
|
+
raise ApiErrorResponseException.new(
|
1492
|
+
'Something\'s not quite right... Your request is invalid. Please' \
|
1493
|
+
' fix it before trying again.',
|
1494
|
+
_response
|
1495
|
+
)
|
1496
|
+
elsif _response.status_code == 401
|
1497
|
+
raise APIException.new(
|
1498
|
+
'Your credentials are invalid. Please use your Bandwidth dashboard' \
|
1499
|
+
' credentials to authenticate to the API.',
|
1500
|
+
_response
|
1501
|
+
)
|
1502
|
+
elsif _response.status_code == 403
|
1503
|
+
raise ApiErrorResponseException.new(
|
1504
|
+
'User unauthorized to perform this action.',
|
1505
|
+
_response
|
1506
|
+
)
|
1507
|
+
elsif _response.status_code == 404
|
1508
|
+
raise ApiErrorResponseException.new(
|
1509
|
+
'The resource specified cannot be found or does not belong to you.',
|
1510
|
+
_response
|
1511
|
+
)
|
1512
|
+
elsif _response.status_code == 415
|
1513
|
+
raise ApiErrorResponseException.new(
|
1514
|
+
'We don\'t support that media type. If a request body is required,' \
|
1515
|
+
' please send it to us as `application/json`.',
|
1516
|
+
_response
|
1517
|
+
)
|
1518
|
+
elsif _response.status_code == 429
|
1519
|
+
raise ApiErrorResponseException.new(
|
1520
|
+
'You\'re sending requests to this endpoint too frequently. Please' \
|
1521
|
+
' slow your request rate down and try again.',
|
1522
|
+
_response
|
1523
|
+
)
|
1524
|
+
elsif _response.status_code == 500
|
1525
|
+
raise ApiErrorResponseException.new(
|
1526
|
+
'Something unexpected happened. Please try again.',
|
1527
|
+
_response
|
1528
|
+
)
|
1529
|
+
end
|
1530
|
+
validate_response(_response)
|
1531
|
+
|
1532
|
+
# Return appropriate response type.
|
1533
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
1534
|
+
ApiResponse.new(
|
1535
|
+
_response, data: RecordingMetadataResponse.from_hash(decoded)
|
1536
|
+
)
|
1537
|
+
end
|
1538
|
+
|
1539
|
+
# Downloads the specified recording
|
1540
|
+
# @param [String] account_id Required parameter: Example:
|
1541
|
+
# @param [String] conference_id Required parameter: Example:
|
1542
|
+
# @param [String] recording_id Required parameter: Example:
|
1543
|
+
# @return [Binary] response from the API call
|
1544
|
+
def get_stream_conference_recording_media(account_id,
|
1545
|
+
conference_id,
|
1546
|
+
recording_id)
|
1547
|
+
# Prepare query url.
|
1548
|
+
_query_builder = config.get_base_uri(Server::VOICEDEFAULT)
|
1549
|
+
_query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media'
|
1550
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
1551
|
+
_query_builder,
|
1552
|
+
'accountId' => { 'value' => account_id, 'encode' => true },
|
1553
|
+
'conferenceId' => { 'value' => conference_id, 'encode' => true },
|
1554
|
+
'recordingId' => { 'value' => recording_id, 'encode' => true }
|
1555
|
+
)
|
1556
|
+
_query_url = APIHelper.clean_url _query_builder
|
1557
|
+
|
1558
|
+
# Prepare and execute HttpRequest.
|
1559
|
+
_request = config.http_client.get(
|
1560
|
+
_query_url
|
1561
|
+
)
|
1562
|
+
VoiceBasicAuth.apply(config, _request)
|
1563
|
+
_response = execute_request(_request, binary: true)
|
1564
|
+
|
1565
|
+
# Validate response against endpoint and global error codes.
|
1566
|
+
if _response.status_code == 400
|
1567
|
+
raise ApiErrorResponseException.new(
|
1568
|
+
'Something\'s not quite right... Your request is invalid. Please' \
|
1569
|
+
' fix it before trying again.',
|
1570
|
+
_response
|
1571
|
+
)
|
1572
|
+
elsif _response.status_code == 401
|
1573
|
+
raise APIException.new(
|
1574
|
+
'Your credentials are invalid. Please use your Bandwidth dashboard' \
|
1575
|
+
' credentials to authenticate to the API.',
|
1576
|
+
_response
|
1577
|
+
)
|
1578
|
+
elsif _response.status_code == 403
|
1579
|
+
raise ApiErrorResponseException.new(
|
1580
|
+
'User unauthorized to perform this action.',
|
1581
|
+
_response
|
1582
|
+
)
|
1583
|
+
elsif _response.status_code == 404
|
1584
|
+
raise ApiErrorResponseException.new(
|
1585
|
+
'The resource specified cannot be found or does not belong to you.',
|
1586
|
+
_response
|
1587
|
+
)
|
1588
|
+
elsif _response.status_code == 415
|
1589
|
+
raise ApiErrorResponseException.new(
|
1590
|
+
'We don\'t support that media type. If a request body is required,' \
|
1591
|
+
' please send it to us as `application/json`.',
|
1592
|
+
_response
|
1593
|
+
)
|
1594
|
+
elsif _response.status_code == 429
|
1595
|
+
raise ApiErrorResponseException.new(
|
1596
|
+
'You\'re sending requests to this endpoint too frequently. Please' \
|
1597
|
+
' slow your request rate down and try again.',
|
1598
|
+
_response
|
1599
|
+
)
|
1600
|
+
elsif _response.status_code == 500
|
1601
|
+
raise ApiErrorResponseException.new(
|
1602
|
+
'Something unexpected happened. Please try again.',
|
1603
|
+
_response
|
1604
|
+
)
|
1605
|
+
end
|
1606
|
+
validate_response(_response)
|
1607
|
+
|
1608
|
+
# Return appropriate response type.
|
1609
|
+
ApiResponse.new(
|
1610
|
+
_response, data: _response.raw_body
|
1611
|
+
)
|
1612
|
+
end
|
1613
|
+
|
1214
1614
|
# Returns a list of metadata for the recordings associated with the
|
1215
1615
|
# specified account. The list can be filtered by the optional from, to,
|
1216
1616
|
# minStartTime, and maxStartTime arguments. The list is capped at 1000
|