bandwidth-sdk 18.2.0 → 18.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +30 -24
- data/README.md +1 -1
- data/bandwidth.yml +58 -15
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +239 -38
- data/coverage/index.html +5421 -3237
- data/custom_templates/README.mustache +1 -1
- data/custom_templates/gem.mustache +3 -0
- data/docs/MediaApi.md +9 -9
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +1 -1
- data/docs/TfvSubmissionInfo.md +2 -2
- data/docs/TollFreeVerificationApi.md +3 -3
- data/docs/VerificationRequest.md +2 -2
- data/docs/VerificationUpdateRequest.md +3 -3
- data/generate.sh +9 -0
- data/lib/bandwidth-sdk/api/media_api.rb +10 -10
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +6 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/connect.rb +23 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/endpoint.rb +11 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +2 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +22 -14
- data/lib/bandwidth-sdk/models/bxml/verbs/record.rb +2 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +2 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +2 -2
- data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +2 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +1 -0
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +2 -2
- data/lib/bandwidth-sdk/models/verification_request.rb +2 -2
- data/lib/bandwidth-sdk/models/verification_update_request.rb +19 -2
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +2 -0
- data/spec/smoke/media_api_spec.rb +2 -2
- data/spec/smoke/messages_api_spec.rb +2 -2
- data/spec/unit/models/bxml/verbs/connect_spec.rb +62 -0
- data/spec/unit/models/bxml/verbs/endpoint_spec.rb +16 -0
- data/spec/unit/models/bxml/verbs/forward_spec.rb +6 -2
- data/spec/unit/models/bxml/verbs/gather_spec.rb +23 -7
- data/spec/unit/models/bxml/verbs/record_spec.rb +8 -4
- data/spec/unit/models/bxml/verbs/start_recording_spec.rb +8 -4
- data/spec/unit/models/bxml/verbs/start_stream_spec.rb +5 -5
- data/spec/unit/models/bxml/verbs/start_transcription_spec.rb +11 -7
- data/spec/unit/models/bxml/verbs/transfer_spec.rb +7 -5
- data/spec/unit/models/tfv_submission_wrapper_spec.rb +2 -1
- data/spec/unit/models/verification_update_request_spec.rb +4 -2
- metadata +9 -2
|
@@ -48,14 +48,14 @@ module Bandwidth
|
|
|
48
48
|
# The company 'Doing Business As'.
|
|
49
49
|
attr_accessor :business_dba
|
|
50
50
|
|
|
51
|
-
# Government-issued business identifying number. **
|
|
51
|
+
# Government-issued business identifying number. **As of October 19th, 2026 this field is required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
|
|
52
52
|
attr_accessor :business_registration_number
|
|
53
53
|
|
|
54
54
|
attr_accessor :business_registration_type
|
|
55
55
|
|
|
56
56
|
attr_accessor :business_entity_type
|
|
57
57
|
|
|
58
|
-
# The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **
|
|
58
|
+
# The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **As of October 19th, 2026 this field is required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
|
|
59
59
|
attr_accessor :business_registration_issuing_country
|
|
60
60
|
|
|
61
61
|
# A message that gets sent to users requesting help.
|
|
@@ -250,6 +250,8 @@ module Bandwidth
|
|
|
250
250
|
|
|
251
251
|
if attributes.key?(:'business_entity_type')
|
|
252
252
|
self.business_entity_type = attributes[:'business_entity_type']
|
|
253
|
+
else
|
|
254
|
+
self.business_entity_type = nil
|
|
253
255
|
end
|
|
254
256
|
|
|
255
257
|
if attributes.key?(:'business_registration_issuing_country')
|
|
@@ -366,6 +368,10 @@ module Bandwidth
|
|
|
366
368
|
invalid_properties.push('invalid value for "business_registration_number", the character length must be smaller than or equal to 500.')
|
|
367
369
|
end
|
|
368
370
|
|
|
371
|
+
if @business_entity_type.nil?
|
|
372
|
+
invalid_properties.push('invalid value for "business_entity_type", business_entity_type cannot be nil.')
|
|
373
|
+
end
|
|
374
|
+
|
|
369
375
|
if !@help_message_response.nil? && @help_message_response.to_s.length > 500
|
|
370
376
|
invalid_properties.push('invalid value for "help_message_response", the character length must be smaller than or equal to 500.')
|
|
371
377
|
end
|
|
@@ -408,6 +414,7 @@ module Bandwidth
|
|
|
408
414
|
return false if !@terms_and_conditions_url.nil? && @terms_and_conditions_url.to_s.length > 500
|
|
409
415
|
return false if !@business_dba.nil? && @business_dba.to_s.length > 500
|
|
410
416
|
return false if !@business_registration_number.nil? && @business_registration_number.to_s.length > 500
|
|
417
|
+
return false if @business_entity_type.nil?
|
|
411
418
|
return false if !@help_message_response.nil? && @help_message_response.to_s.length > 500
|
|
412
419
|
return false if !@cv_token.nil? && @cv_token.to_s.length > 500
|
|
413
420
|
return false if !@cv_token.nil? && @cv_token.to_s.length < 0
|
|
@@ -596,6 +603,16 @@ module Bandwidth
|
|
|
596
603
|
@business_registration_number = business_registration_number
|
|
597
604
|
end
|
|
598
605
|
|
|
606
|
+
# Custom attribute writer method with validation
|
|
607
|
+
# @param [Object] business_entity_type Value to be assigned
|
|
608
|
+
def business_entity_type=(business_entity_type)
|
|
609
|
+
if business_entity_type.nil?
|
|
610
|
+
fail ArgumentError, 'business_entity_type cannot be nil'
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
@business_entity_type = business_entity_type
|
|
614
|
+
end
|
|
615
|
+
|
|
599
616
|
# Custom attribute writer method with validation
|
|
600
617
|
# @param [Object] help_message_response Value to be assigned
|
|
601
618
|
def help_message_response=(help_message_response)
|
data/lib/bandwidth-sdk.rb
CHANGED
|
@@ -228,7 +228,9 @@ require 'bandwidth-sdk/models/bxml/verb'
|
|
|
228
228
|
require 'bandwidth-sdk/models/bxml/nestable_verb'
|
|
229
229
|
require 'bandwidth-sdk/models/bxml/verbs/bridge'
|
|
230
230
|
require 'bandwidth-sdk/models/bxml/verbs/conference'
|
|
231
|
+
require 'bandwidth-sdk/models/bxml/verbs/connect'
|
|
231
232
|
require 'bandwidth-sdk/models/bxml/verbs/custom_param'
|
|
233
|
+
require 'bandwidth-sdk/models/bxml/verbs/endpoint'
|
|
232
234
|
require 'bandwidth-sdk/models/bxml/verbs/forward'
|
|
233
235
|
require 'bandwidth-sdk/models/bxml/verbs/gather'
|
|
234
236
|
require 'bandwidth-sdk/models/bxml/verbs/hangup'
|
|
@@ -8,8 +8,8 @@ describe 'MediaApi Integration Tests' do
|
|
|
8
8
|
before(:all) do
|
|
9
9
|
config = Bandwidth::Configuration.new
|
|
10
10
|
config.configure do |config|
|
|
11
|
-
config.
|
|
12
|
-
config.
|
|
11
|
+
config.client_id = BW_CLIENT_ID
|
|
12
|
+
config.client_secret = BW_CLIENT_SECRET
|
|
13
13
|
config.return_binary_data = true
|
|
14
14
|
end
|
|
15
15
|
client = Bandwidth::ApiClient.new(config)
|
|
@@ -12,8 +12,8 @@ describe 'MessagesApi Integration Tests' do
|
|
|
12
12
|
before(:all) do
|
|
13
13
|
config = Bandwidth::Configuration.new
|
|
14
14
|
config.configure do |config|
|
|
15
|
-
config.
|
|
16
|
-
config.
|
|
15
|
+
config.client_id = BW_CLIENT_ID
|
|
16
|
+
config.client_secret = BW_CLIENT_SECRET
|
|
17
17
|
end
|
|
18
18
|
client = Bandwidth::ApiClient.new(config)
|
|
19
19
|
@messaging_api_instance = Bandwidth::MessagesApi.new(client)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Connect
|
|
2
|
+
describe 'Bandwidth::Bxml::Connect' do
|
|
3
|
+
let(:initial_attributes) {
|
|
4
|
+
{
|
|
5
|
+
event_callback_url: 'https://initial.com',
|
|
6
|
+
event_fallback_url: 'https://initial.com'
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let(:new_attributes) {
|
|
11
|
+
{
|
|
12
|
+
event_callback_url: 'https://new.com',
|
|
13
|
+
event_fallback_url: 'https://new.com'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let(:endpoint_1) { Bandwidth::Bxml::Endpoint.new('endpoint_id_1') }
|
|
18
|
+
let(:endpoint_2) { Bandwidth::Bxml::Endpoint.new('endpoint_id_2') }
|
|
19
|
+
|
|
20
|
+
let(:instance) { Bandwidth::Bxml::Connect.new([], initial_attributes) }
|
|
21
|
+
let(:instance_nested) { Bandwidth::Bxml::Connect.new(endpoint_1, initial_attributes) }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of Connect' do
|
|
24
|
+
it 'validates instance of Connect' do
|
|
25
|
+
expect(instance).to be_instance_of(Bandwidth::Bxml::Connect)
|
|
26
|
+
expect(instance).to be_a(Bandwidth::Bxml::Verb)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'tests the to_bxml method of the Connect instance' do
|
|
30
|
+
expected = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\"/>\n"
|
|
31
|
+
expect(instance.to_bxml).to eq(expected)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'tests the set_attributes method of the Connect instance' do
|
|
35
|
+
instance.set_attributes(new_attributes)
|
|
36
|
+
expected = "\n<Connect eventCallbackUrl=\"https://new.com\" eventFallbackUrl=\"https://new.com\"/>\n"
|
|
37
|
+
expect(instance.to_bxml).to eq(expected)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe 'test an instance of Connect with nested verbs' do
|
|
42
|
+
it 'validates instance of Connect' do
|
|
43
|
+
expect(instance_nested).to be_instance_of(Bandwidth::Bxml::Connect)
|
|
44
|
+
expect(instance_nested).to be_a(Bandwidth::Bxml::Verb)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it 'tests the to_bxml method of the nested Connect instance' do
|
|
48
|
+
expected = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\">\n <Endpoint>endpoint_id_1</Endpoint>\n</Connect>\n"
|
|
49
|
+
expect(instance_nested.to_bxml).to eq(expected)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'tests the add_endpoints method of the nested Connect instance' do
|
|
53
|
+
expected_single = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\">\n <Endpoint>endpoint_id_1</Endpoint>\n <Endpoint>endpoint_id_2</Endpoint>\n</Connect>\n"
|
|
54
|
+
instance_nested.add_endpoints(endpoint_2)
|
|
55
|
+
expect(instance_nested.to_bxml).to eq(expected_single)
|
|
56
|
+
|
|
57
|
+
expected_multiple = "\n<Connect eventCallbackUrl=\"https://initial.com\" eventFallbackUrl=\"https://initial.com\">\n <Endpoint>endpoint_id_1</Endpoint>\n <Endpoint>endpoint_id_2</Endpoint>\n <Endpoint>endpoint_id_2</Endpoint>\n <Endpoint>endpoint_id_1</Endpoint>\n</Connect>\n"
|
|
58
|
+
instance_nested.add_endpoints([endpoint_2, endpoint_1])
|
|
59
|
+
expect(instance_nested.to_bxml).to eq(expected_multiple)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Endpoint
|
|
2
|
+
describe 'Bandwidth::Bxml::Endpoint' do
|
|
3
|
+
let(:instance) { Bandwidth::Bxml::Endpoint.new('test_endpoint_id') }
|
|
4
|
+
|
|
5
|
+
describe 'test an instance of Endpoint' do
|
|
6
|
+
it 'validates instance of Endpoint' do
|
|
7
|
+
expect(instance).to be_instance_of(Bandwidth::Bxml::Endpoint)
|
|
8
|
+
expect(instance).to be_a(Bandwidth::Bxml::Verb)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'tests the to_bxml method of the Endpoint instance' do
|
|
12
|
+
expected = "\n<Endpoint>test_endpoint_id</Endpoint>\n"
|
|
13
|
+
expect(instance.to_bxml).to eq(expected)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -4,6 +4,8 @@ describe 'Bandwidth::Bxml::Forward' do
|
|
|
4
4
|
{
|
|
5
5
|
to: '+19195551234',
|
|
6
6
|
from: '+19195554321',
|
|
7
|
+
privacy: true,
|
|
8
|
+
caller_display_name: 'Restricted',
|
|
7
9
|
call_timeout: 5,
|
|
8
10
|
diversion_treatment: 'propagate',
|
|
9
11
|
diversion_reason: 'user-busy',
|
|
@@ -15,6 +17,8 @@ describe 'Bandwidth::Bxml::Forward' do
|
|
|
15
17
|
{
|
|
16
18
|
to: '+19195554321',
|
|
17
19
|
from: '+19195551234',
|
|
20
|
+
privacy: false,
|
|
21
|
+
caller_display_name: 'new_display_name',
|
|
18
22
|
call_timeout: 10,
|
|
19
23
|
diversion_treatment: 'stack',
|
|
20
24
|
diversion_reason: 'no-answer',
|
|
@@ -31,13 +35,13 @@ describe 'Bandwidth::Bxml::Forward' do
|
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
it 'tests the to_bxml method of the Forward instance' do
|
|
34
|
-
expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" callTimeout=\"5\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
|
|
38
|
+
expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" privacy=\"true\" callerDisplayName=\"Restricted\" callTimeout=\"5\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
|
|
35
39
|
expect(instance.to_bxml).to eq(expected)
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
it 'tests the set_attributes method of the Forward instance' do
|
|
39
43
|
instance.set_attributes(new_attributes)
|
|
40
|
-
expected = "\n<Forward to=\"+19195554321\" from=\"+19195551234\" callTimeout=\"10\" diversionTreatment=\"stack\" diversionReason=\"no-answer\" uui=\"4fa28015d8ede84bd1a493d6f3c0be5845960b74;encoding=base64,fdsa;encoding=jwt\"/>\n"
|
|
44
|
+
expected = "\n<Forward to=\"+19195554321\" from=\"+19195551234\" privacy=\"false\" callerDisplayName=\"new_display_name\" callTimeout=\"10\" diversionTreatment=\"stack\" diversionReason=\"no-answer\" uui=\"4fa28015d8ede84bd1a493d6f3c0be5845960b74;encoding=base64,fdsa;encoding=jwt\"/>\n"
|
|
41
45
|
expect(instance.to_bxml).to eq(expected)
|
|
42
46
|
end
|
|
43
47
|
end
|
|
@@ -15,7 +15,15 @@ describe 'Bandwidth::Bxml::Gather' do
|
|
|
15
15
|
max_digits: 5,
|
|
16
16
|
inter_digit_timeout: 5,
|
|
17
17
|
first_digit_timeout: 5,
|
|
18
|
-
repeat_count: 5
|
|
18
|
+
repeat_count: 5,
|
|
19
|
+
input: 'dtmf',
|
|
20
|
+
hints: 'initial_hints',
|
|
21
|
+
language: 'en-US',
|
|
22
|
+
partial_result_callback: 'https://initial.com',
|
|
23
|
+
partial_result_callback_method: 'POST',
|
|
24
|
+
profanity_filter: true,
|
|
25
|
+
speech_model: 'default',
|
|
26
|
+
speech_timeout: 5
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
|
|
@@ -34,7 +42,15 @@ describe 'Bandwidth::Bxml::Gather' do
|
|
|
34
42
|
max_digits: 10,
|
|
35
43
|
inter_digit_timeout: 10,
|
|
36
44
|
first_digit_timeout: 10,
|
|
37
|
-
repeat_count: 10
|
|
45
|
+
repeat_count: 10,
|
|
46
|
+
input: 'speech',
|
|
47
|
+
hints: 'new_hints',
|
|
48
|
+
language: 'es-US',
|
|
49
|
+
partial_result_callback: 'https://new.com',
|
|
50
|
+
partial_result_callback_method: 'GET',
|
|
51
|
+
profanity_filter: false,
|
|
52
|
+
speech_model: 'phone_call',
|
|
53
|
+
speech_timeout: 10
|
|
38
54
|
}
|
|
39
55
|
}
|
|
40
56
|
|
|
@@ -51,13 +67,13 @@ describe 'Bandwidth::Bxml::Gather' do
|
|
|
51
67
|
end
|
|
52
68
|
|
|
53
69
|
it 'tests the to_bxml method of the Gather instance' do
|
|
54
|
-
expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\"/>\n"
|
|
70
|
+
expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\" input=\"dtmf\" hints=\"initial_hints\" language=\"en-US\" partialResultCallback=\"https://initial.com\" partialResultCallbackMethod=\"POST\" profanityFilter=\"true\" speechModel=\"default\" speechTimeout=\"5\"/>\n"
|
|
55
71
|
expect(instance.to_bxml).to eq(expected)
|
|
56
72
|
end
|
|
57
73
|
|
|
58
74
|
it 'tests the set_attributes method of the Gather instance' do
|
|
59
75
|
instance.set_attributes(new_attributes)
|
|
60
|
-
expected = "\n<Gather gatherUrl=\"https://new.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://new.com\" gatherFallbackMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" terminatingDigits=\"10\" maxDigits=\"10\" interDigitTimeout=\"10\" firstDigitTimeout=\"10\" repeatCount=\"10\"/>\n"
|
|
76
|
+
expected = "\n<Gather gatherUrl=\"https://new.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://new.com\" gatherFallbackMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" terminatingDigits=\"10\" maxDigits=\"10\" interDigitTimeout=\"10\" firstDigitTimeout=\"10\" repeatCount=\"10\" input=\"speech\" hints=\"new_hints\" language=\"es-US\" partialResultCallback=\"https://new.com\" partialResultCallbackMethod=\"GET\" profanityFilter=\"false\" speechModel=\"phone_call\" speechTimeout=\"10\"/>\n"
|
|
61
77
|
expect(instance.to_bxml).to eq(expected)
|
|
62
78
|
end
|
|
63
79
|
end
|
|
@@ -69,16 +85,16 @@ describe 'Bandwidth::Bxml::Gather' do
|
|
|
69
85
|
end
|
|
70
86
|
|
|
71
87
|
it 'tests the to_bxml method of the nested Gather instance' do
|
|
72
|
-
expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
|
|
88
|
+
expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\" input=\"dtmf\" hints=\"initial_hints\" language=\"en-US\" partialResultCallback=\"https://initial.com\" partialResultCallbackMethod=\"POST\" profanityFilter=\"true\" speechModel=\"default\" speechTimeout=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
|
|
73
89
|
expect(instance_nested.to_bxml).to eq(expected)
|
|
74
90
|
end
|
|
75
91
|
|
|
76
92
|
it 'tests the add_verb method of the nested Gather instance' do
|
|
77
|
-
expected_single = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n</Gather>\n"
|
|
93
|
+
expected_single = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\" input=\"dtmf\" hints=\"initial_hints\" language=\"en-US\" partialResultCallback=\"https://initial.com\" partialResultCallbackMethod=\"POST\" profanityFilter=\"true\" speechModel=\"default\" speechTimeout=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n</Gather>\n"
|
|
78
94
|
instance_nested.add_audio_verbs(speak_sentence)
|
|
79
95
|
expect(instance_nested.to_bxml).to eq(expected_single)
|
|
80
96
|
|
|
81
|
-
expected_multiple = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
|
|
97
|
+
expected_multiple = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\" input=\"dtmf\" hints=\"initial_hints\" language=\"en-US\" partialResultCallback=\"https://initial.com\" partialResultCallbackMethod=\"POST\" profanityFilter=\"true\" speechModel=\"default\" speechTimeout=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
|
|
82
98
|
instance_nested.add_audio_verbs([speak_sentence, play_audio])
|
|
83
99
|
expect(instance_nested.to_bxml).to eq(expected_multiple)
|
|
84
100
|
end
|
|
@@ -9,6 +9,7 @@ describe 'Bandwidth::Bxml::Record' do
|
|
|
9
9
|
recording_available_url: 'https://initial.com',
|
|
10
10
|
recording_available_method: 'POST',
|
|
11
11
|
transcribe: true,
|
|
12
|
+
detect_language: true,
|
|
12
13
|
transcription_available_url: 'https://initial.com',
|
|
13
14
|
transcription_available_method: 'POST',
|
|
14
15
|
username: 'initial_username',
|
|
@@ -19,7 +20,8 @@ describe 'Bandwidth::Bxml::Record' do
|
|
|
19
20
|
terminating_digits: '5',
|
|
20
21
|
max_duration: 5,
|
|
21
22
|
silence_timeout: 5,
|
|
22
|
-
file_format: 'wav'
|
|
23
|
+
file_format: 'wav',
|
|
24
|
+
recording_name: 'initial_recording_name'
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -32,6 +34,7 @@ describe 'Bandwidth::Bxml::Record' do
|
|
|
32
34
|
recording_available_url: 'https://new.com',
|
|
33
35
|
recording_available_method: 'GET',
|
|
34
36
|
transcribe: true,
|
|
37
|
+
detect_language: false,
|
|
35
38
|
transcription_available_url: 'https://new.com',
|
|
36
39
|
transcription_available_method: 'GET',
|
|
37
40
|
username: 'new_username',
|
|
@@ -42,7 +45,8 @@ describe 'Bandwidth::Bxml::Record' do
|
|
|
42
45
|
terminating_digits: '0',
|
|
43
46
|
max_duration: 10,
|
|
44
47
|
silence_timeout: 10,
|
|
45
|
-
file_format: 'mp3'
|
|
48
|
+
file_format: 'mp3',
|
|
49
|
+
recording_name: 'new_recording_name'
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -55,13 +59,13 @@ describe 'Bandwidth::Bxml::Record' do
|
|
|
55
59
|
end
|
|
56
60
|
|
|
57
61
|
it 'tests the to_bxml method of the Record instance' do
|
|
58
|
-
expected = "\n<Record recordCompleteUrl=\"https://initial.com\" recordCompleteMethod=\"POST\" recordCompleteFallbackUrl=\"https://initial.com\" recordCompleteFallbackMethod=\"POST\" recordingAvailableUrl=\"https://initial.com\" recordingAvailableMethod=\"POST\" transcribe=\"true\" transcriptionAvailableUrl=\"https://initial.com\" transcriptionAvailableMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDuration=\"5\" silenceTimeout=\"5\" fileFormat=\"wav\"/>\n"
|
|
62
|
+
expected = "\n<Record recordCompleteUrl=\"https://initial.com\" recordCompleteMethod=\"POST\" recordCompleteFallbackUrl=\"https://initial.com\" recordCompleteFallbackMethod=\"POST\" recordingAvailableUrl=\"https://initial.com\" recordingAvailableMethod=\"POST\" transcribe=\"true\" detectLanguage=\"true\" transcriptionAvailableUrl=\"https://initial.com\" transcriptionAvailableMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDuration=\"5\" silenceTimeout=\"5\" fileFormat=\"wav\" recordingName=\"initial_recording_name\"/>\n"
|
|
59
63
|
expect(instance.to_bxml).to eq(expected)
|
|
60
64
|
end
|
|
61
65
|
|
|
62
66
|
it 'tests the set_attributes method of the Record instance' do
|
|
63
67
|
instance.set_attributes(new_attributes)
|
|
64
|
-
expected = "\n<Record recordCompleteUrl=\"https://new.com\" recordCompleteMethod=\"GET\" recordCompleteFallbackUrl=\"https://new.com\" recordCompleteFallbackMethod=\"GET\" recordingAvailableUrl=\"https://new.com\" recordingAvailableMethod=\"GET\" transcribe=\"true\" transcriptionAvailableUrl=\"https://new.com\" transcriptionAvailableMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" terminatingDigits=\"0\" maxDuration=\"10\" silenceTimeout=\"10\" fileFormat=\"mp3\"/>\n"
|
|
68
|
+
expected = "\n<Record recordCompleteUrl=\"https://new.com\" recordCompleteMethod=\"GET\" recordCompleteFallbackUrl=\"https://new.com\" recordCompleteFallbackMethod=\"GET\" recordingAvailableUrl=\"https://new.com\" recordingAvailableMethod=\"GET\" transcribe=\"true\" detectLanguage=\"false\" transcriptionAvailableUrl=\"https://new.com\" transcriptionAvailableMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" terminatingDigits=\"0\" maxDuration=\"10\" silenceTimeout=\"10\" fileFormat=\"mp3\" recordingName=\"new_recording_name\"/>\n"
|
|
65
69
|
expect(instance.to_bxml).to eq(expected)
|
|
66
70
|
end
|
|
67
71
|
end
|
|
@@ -5,13 +5,15 @@ describe 'Bandwidth::Bxml::StartRecording' do
|
|
|
5
5
|
recording_available_url: 'https://initial.com',
|
|
6
6
|
recording_available_method: 'POST',
|
|
7
7
|
transcribe: true,
|
|
8
|
+
detect_language: true,
|
|
8
9
|
transcription_available_url: 'https://initial.com',
|
|
9
10
|
transcription_available_method: 'POST',
|
|
10
11
|
username: 'initial_username',
|
|
11
12
|
password: 'initial_password',
|
|
12
13
|
tag: 'initial_tag',
|
|
13
14
|
file_format: 'wav',
|
|
14
|
-
multi_channel: true
|
|
15
|
+
multi_channel: true,
|
|
16
|
+
recording_name: 'initial_recording_name'
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -20,13 +22,15 @@ describe 'Bandwidth::Bxml::StartRecording' do
|
|
|
20
22
|
recording_available_url: 'https://new.com',
|
|
21
23
|
recording_available_method: 'GET',
|
|
22
24
|
transcribe: false,
|
|
25
|
+
detect_language: false,
|
|
23
26
|
transcription_available_url: 'https://new.com',
|
|
24
27
|
transcription_available_method: 'GET',
|
|
25
28
|
username: 'new_username',
|
|
26
29
|
password: 'new_password',
|
|
27
30
|
tag: 'new_tag',
|
|
28
31
|
file_format: 'mp3',
|
|
29
|
-
multi_channel: false
|
|
32
|
+
multi_channel: false,
|
|
33
|
+
recording_name: 'new_recording_name'
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
|
|
@@ -39,13 +43,13 @@ describe 'Bandwidth::Bxml::StartRecording' do
|
|
|
39
43
|
end
|
|
40
44
|
|
|
41
45
|
it 'tests the to_bxml method of the StartRecording instance' do
|
|
42
|
-
expected = "\n<StartRecording recordingAvailableUrl=\"https://initial.com\" recordingAvailableMethod=\"POST\" transcribe=\"true\" transcriptionAvailableUrl=\"https://initial.com\" transcriptionAvailableMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" tag=\"initial_tag\" fileFormat=\"wav\" multiChannel=\"true\"/>\n"
|
|
46
|
+
expected = "\n<StartRecording recordingAvailableUrl=\"https://initial.com\" recordingAvailableMethod=\"POST\" transcribe=\"true\" detectLanguage=\"true\" transcriptionAvailableUrl=\"https://initial.com\" transcriptionAvailableMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" tag=\"initial_tag\" fileFormat=\"wav\" multiChannel=\"true\" recordingName=\"initial_recording_name\"/>\n"
|
|
43
47
|
expect(instance.to_bxml).to eq(expected)
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
it 'tests the set_attributes method of the StartRecording instance' do
|
|
47
51
|
instance.set_attributes(new_attributes)
|
|
48
|
-
expected = "\n<StartRecording recordingAvailableUrl=\"https://new.com\" recordingAvailableMethod=\"GET\" transcribe=\"false\" transcriptionAvailableUrl=\"https://new.com\" transcriptionAvailableMethod=\"GET\" username=\"new_username\" password=\"new_password\" tag=\"new_tag\" fileFormat=\"mp3\" multiChannel=\"false\"/>\n"
|
|
52
|
+
expected = "\n<StartRecording recordingAvailableUrl=\"https://new.com\" recordingAvailableMethod=\"GET\" transcribe=\"false\" detectLanguage=\"false\" transcriptionAvailableUrl=\"https://new.com\" transcriptionAvailableMethod=\"GET\" username=\"new_username\" password=\"new_password\" tag=\"new_tag\" fileFormat=\"mp3\" multiChannel=\"false\" recordingName=\"new_recording_name\"/>\n"
|
|
49
53
|
expect(instance.to_bxml).to eq(expected)
|
|
50
54
|
end
|
|
51
55
|
end
|
|
@@ -43,13 +43,13 @@ describe 'Bandwidth::Bxml::StartStream' do
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it 'tests the to_bxml method of the StartStream instance' do
|
|
46
|
-
expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\"
|
|
46
|
+
expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destinationUsername=\"initial_destination_username\" destinationPassword=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\"/>\n"
|
|
47
47
|
expect(instance.to_bxml).to eq(expected)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
it 'tests the set_attributes method of the StartStream instance' do
|
|
51
51
|
instance.set_attributes(new_attributes)
|
|
52
|
-
expected = "\n<StartStream name=\"new_name\" mode=\"bidirectional\" tracks=\"outbound\" destination=\"https://new.com\"
|
|
52
|
+
expected = "\n<StartStream name=\"new_name\" mode=\"bidirectional\" tracks=\"outbound\" destination=\"https://new.com\" destinationUsername=\"new_destination_username\" destinationPassword=\"new_destination_password\" streamEventUrl=\"https://new.com\" streamEventMethod=\"GET\" username=\"new_username\" password=\"new_password\"/>\n"
|
|
53
53
|
expect(instance.to_bxml).to eq(expected)
|
|
54
54
|
end
|
|
55
55
|
end
|
|
@@ -61,16 +61,16 @@ describe 'Bandwidth::Bxml::StartStream' do
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
it 'tests the to_bxml method of the nested StartStream instance' do
|
|
64
|
-
expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\"
|
|
64
|
+
expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destinationUsername=\"initial_destination_username\" destinationPassword=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n</StartStream>\n"
|
|
65
65
|
expect(instance_nested.to_bxml).to eq(expected)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
it 'tests the add_stream_param method of the nested StartStream instance' do
|
|
69
|
-
expected_single = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\"
|
|
69
|
+
expected_single = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destinationUsername=\"initial_destination_username\" destinationPassword=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n</StartStream>\n"
|
|
70
70
|
instance_nested.add_stream_params(stream_param_2)
|
|
71
71
|
expect(instance_nested.to_bxml).to eq(expected_single)
|
|
72
72
|
|
|
73
|
-
expected_multiple = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\"
|
|
73
|
+
expected_multiple = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destinationUsername=\"initial_destination_username\" destinationPassword=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n</StartStream>\n"
|
|
74
74
|
instance_nested.add_stream_params([stream_param_2, stream_param_2])
|
|
75
75
|
expect(instance_nested.to_bxml).to eq(expected_multiple)
|
|
76
76
|
end
|
|
@@ -9,7 +9,9 @@ describe 'Bandwidth::Bxml::StartTranscription' do
|
|
|
9
9
|
username: 'initial_username',
|
|
10
10
|
password: 'initial_password',
|
|
11
11
|
destination: 'https://initial.com',
|
|
12
|
-
stabilized: true
|
|
12
|
+
stabilized: true,
|
|
13
|
+
detect_language: false,
|
|
14
|
+
preferred_languages: 'en-US'
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -22,7 +24,9 @@ describe 'Bandwidth::Bxml::StartTranscription' do
|
|
|
22
24
|
username: 'new_username',
|
|
23
25
|
password: 'new_password',
|
|
24
26
|
destination: 'https://new.com',
|
|
25
|
-
stabilized: false
|
|
27
|
+
stabilized: false,
|
|
28
|
+
detect_language: true,
|
|
29
|
+
preferred_languages: 'es-US'
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -39,13 +43,13 @@ describe 'Bandwidth::Bxml::StartTranscription' do
|
|
|
39
43
|
end
|
|
40
44
|
|
|
41
45
|
it 'tests the to_bxml method of the StartTranscription instance' do
|
|
42
|
-
expected = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\"/>\n"
|
|
46
|
+
expected = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\" detectLanguage=\"false\" preferredLanguages=\"en-US\"/>\n"
|
|
43
47
|
expect(instance.to_bxml).to eq(expected)
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
it 'tests the set_attributes method of the StartTranscription instance' do
|
|
47
51
|
instance.set_attributes(new_attributes)
|
|
48
|
-
expected = "\n<StartTranscription name=\"new_name\" tracks=\"outbound\" transcriptionEventUrl=\"https://new.com\" transcriptionEventMethod=\"GET\" username=\"new_username\" password=\"new_password\" destination=\"https://new.com\" stabilized=\"false\"/>\n"
|
|
52
|
+
expected = "\n<StartTranscription name=\"new_name\" tracks=\"outbound\" transcriptionEventUrl=\"https://new.com\" transcriptionEventMethod=\"GET\" username=\"new_username\" password=\"new_password\" destination=\"https://new.com\" stabilized=\"false\" detectLanguage=\"true\" preferredLanguages=\"es-US\"/>\n"
|
|
49
53
|
expect(instance.to_bxml).to eq(expected)
|
|
50
54
|
end
|
|
51
55
|
end
|
|
@@ -57,16 +61,16 @@ describe 'Bandwidth::Bxml::StartTranscription' do
|
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
it 'tests the to_bxml method of the nested StartTranscription instance' do
|
|
60
|
-
expected = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\">\n <CustomParam name=\"custom_param_name_1\" value=\"custom_param_value_1\"/>\n</StartTranscription>\n"
|
|
64
|
+
expected = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\" detectLanguage=\"false\" preferredLanguages=\"en-US\">\n <CustomParam name=\"custom_param_name_1\" value=\"custom_param_value_1\"/>\n</StartTranscription>\n"
|
|
61
65
|
expect(instance_nested.to_bxml).to eq(expected)
|
|
62
66
|
end
|
|
63
67
|
|
|
64
68
|
it 'tests the add_custom_param method of the nested StartTranscription instance' do
|
|
65
|
-
expected_single = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\">\n <CustomParam name=\"custom_param_name_1\" value=\"custom_param_value_1\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n</StartTranscription>\n"
|
|
69
|
+
expected_single = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\" detectLanguage=\"false\" preferredLanguages=\"en-US\">\n <CustomParam name=\"custom_param_name_1\" value=\"custom_param_value_1\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n</StartTranscription>\n"
|
|
66
70
|
instance_nested.add_custom_params(custom_param_2)
|
|
67
71
|
expect(instance_nested.to_bxml).to eq(expected_single)
|
|
68
72
|
|
|
69
|
-
expected_multiple = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\">\n <CustomParam name=\"custom_param_name_1\" value=\"custom_param_value_1\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n</StartTranscription>\n"
|
|
73
|
+
expected_multiple = "\n<StartTranscription name=\"initial_name\" tracks=\"inbound\" transcriptionEventUrl=\"https://initial.com\" transcriptionEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" destination=\"https://initial.com\" stabilized=\"true\" detectLanguage=\"false\" preferredLanguages=\"en-US\">\n <CustomParam name=\"custom_param_name_1\" value=\"custom_param_value_1\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n <CustomParam name=\"custom_param_name_2\" value=\"custom_param_value_2\"/>\n</StartTranscription>\n"
|
|
70
74
|
instance_nested.add_custom_params([custom_param_2, custom_param_2])
|
|
71
75
|
expect(instance_nested.to_bxml).to eq(expected_multiple)
|
|
72
76
|
end
|
|
@@ -3,6 +3,7 @@ describe 'Bandwidth::Bxml::Transfer' do
|
|
|
3
3
|
let(:initial_attributes) {
|
|
4
4
|
{
|
|
5
5
|
transfer_caller_id: '+19195551234',
|
|
6
|
+
privacy: true,
|
|
6
7
|
transfer_caller_display_name: 'initial_caller',
|
|
7
8
|
call_timeout: 5,
|
|
8
9
|
transfer_complete_url: 'https://initial.com',
|
|
@@ -22,6 +23,7 @@ describe 'Bandwidth::Bxml::Transfer' do
|
|
|
22
23
|
let(:new_attributes) {
|
|
23
24
|
{
|
|
24
25
|
transfer_caller_id: '+19195554321',
|
|
26
|
+
privacy: false,
|
|
25
27
|
transfer_caller_display_name: 'new_caller',
|
|
26
28
|
call_timeout: 10,
|
|
27
29
|
transfer_complete_url: 'https://new.com',
|
|
@@ -51,13 +53,13 @@ describe 'Bandwidth::Bxml::Transfer' do
|
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
it 'tests the to_bxml method of the Transfer instance' do
|
|
54
|
-
expected = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\"/>\n"
|
|
56
|
+
expected = "\n<Transfer transferCallerId=\"+19195551234\" privacy=\"true\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\"/>\n"
|
|
55
57
|
expect(instance.to_bxml).to eq(expected)
|
|
56
58
|
end
|
|
57
59
|
|
|
58
60
|
it 'tests the set_attributes method of the Transfer instance' do
|
|
59
61
|
instance.set_attributes(new_attributes)
|
|
60
|
-
expected = "\n<Transfer transferCallerId=\"+19195554321\" transferCallerDisplayName=\"new_caller\" callTimeout=\"10\" transferCompleteUrl=\"https://new.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://new.com\" transferCompleteFallbackMethod=\"POST\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" diversionTreatment=\"stack\" diversionReason=\"no-answer\"/>\n"
|
|
62
|
+
expected = "\n<Transfer transferCallerId=\"+19195554321\" privacy=\"false\" transferCallerDisplayName=\"new_caller\" callTimeout=\"10\" transferCompleteUrl=\"https://new.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://new.com\" transferCompleteFallbackMethod=\"POST\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" diversionTreatment=\"stack\" diversionReason=\"no-answer\"/>\n"
|
|
61
63
|
expect(instance.to_bxml).to eq(expected)
|
|
62
64
|
end
|
|
63
65
|
end
|
|
@@ -69,16 +71,16 @@ describe 'Bandwidth::Bxml::Transfer' do
|
|
|
69
71
|
end
|
|
70
72
|
|
|
71
73
|
it 'tests the to_bxml method of the nested Transfer instance' do
|
|
72
|
-
expected = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
|
|
74
|
+
expected = "\n<Transfer transferCallerId=\"+19195551234\" privacy=\"true\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
|
|
73
75
|
expect(instance_nested.to_bxml).to eq(expected)
|
|
74
76
|
end
|
|
75
77
|
|
|
76
78
|
it 'tests the add_verb method of the nested Transfer instance' do
|
|
77
|
-
expected_single = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n</Transfer>\n"
|
|
79
|
+
expected_single = "\n<Transfer transferCallerId=\"+19195551234\" privacy=\"true\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n</Transfer>\n"
|
|
78
80
|
instance_nested.add_transfer_recipients(sip_uri)
|
|
79
81
|
expect(instance_nested.to_bxml).to eq(expected_single)
|
|
80
82
|
|
|
81
|
-
expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
|
|
83
|
+
expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" privacy=\"true\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
|
|
82
84
|
instance_nested.add_transfer_recipients([sip_uri, phone_number])
|
|
83
85
|
expect(instance_nested.to_bxml).to eq(expected_multiple)
|
|
84
86
|
end
|
|
@@ -44,7 +44,8 @@ describe Bandwidth::TfvSubmissionWrapper do
|
|
|
44
44
|
optInWorkflow: { description: 'opt-in via website', imageUrls: ['https://example.com/optin.png'] },
|
|
45
45
|
privacyPolicyUrl: 'https://example.com/privacy',
|
|
46
46
|
termsAndConditionsUrl: 'https://example.com/terms',
|
|
47
|
-
businessDba: 'Bandwidth Inc'
|
|
47
|
+
businessDba: 'Bandwidth Inc',
|
|
48
|
+
businessEntityType: Bandwidth::BusinessEntityTypeEnum::PRIVATE_PROFIT
|
|
48
49
|
}
|
|
49
50
|
})
|
|
50
51
|
expect(tfv_submission_wrapper_from_hash).to be_instance_of(Bandwidth::TfvSubmissionWrapper)
|
|
@@ -7,7 +7,8 @@ describe Bandwidth::VerificationUpdateRequest do
|
|
|
7
7
|
use_case: 'baseline use case',
|
|
8
8
|
use_case_summary: 'baseline summary',
|
|
9
9
|
production_message_content: 'baseline message',
|
|
10
|
-
opt_in_workflow: { description: 'baseline opt-in', imageUrls: [] }
|
|
10
|
+
opt_in_workflow: { description: 'baseline opt-in', imageUrls: [] },
|
|
11
|
+
business_entity_type: Bandwidth::BusinessEntityTypeEnum::PRIVATE_PROFIT
|
|
11
12
|
}) }
|
|
12
13
|
let(:verification_update_request_values) { Bandwidth::VerificationUpdateRequest.new({
|
|
13
14
|
business_address: { name: 'Bandwidth' },
|
|
@@ -126,7 +127,8 @@ describe Bandwidth::VerificationUpdateRequest do
|
|
|
126
127
|
use_case: 'baseline use case',
|
|
127
128
|
use_case_summary: 'baseline summary',
|
|
128
129
|
production_message_content: 'baseline message',
|
|
129
|
-
opt_in_workflow: { description: 'baseline opt-in', imageUrls: [] }
|
|
130
|
+
opt_in_workflow: { description: 'baseline opt-in', imageUrls: [] },
|
|
131
|
+
business_entity_type: Bandwidth::BusinessEntityTypeEnum::PRIVATE_PROFIT
|
|
130
132
|
})
|
|
131
133
|
expect(verification_update_request_default.eql?(verification_update_request_equal)).to be true
|
|
132
134
|
expect(verification_update_request_default.eql?(verification_update_request_values)).to be false
|