bandwidth-sdk 11.1.0 → 11.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **application_id** | **String** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | |
8
8
  | **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | |
9
- | **from** | **String** | One of your telephone numbers the message should come from in E164 format. | |
9
+ | **from** | **String** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | |
10
10
  | **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] |
11
11
  | **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] |
12
12
  | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] |
@@ -2,7 +2,7 @@ module Bandwidth
2
2
  module Bxml
3
3
  class Bxml < Bandwidth::Bxml::Root
4
4
  # Initializer
5
- # @param nested_verbs [Array<Verb>] XML element children. Defaults to an empty array.
5
+ # @param nested_verbs [Verb] or [Array<Verb>] XML element children. Defaults to an empty array.
6
6
  def initialize(nested_verbs = [])
7
7
  super(tag = 'Bxml', nested_verbs)
8
8
  end
@@ -6,12 +6,12 @@ module Bandwidth
6
6
  # Initializer
7
7
  # @param tag [String] Name of the XML element.
8
8
  # @param content [String] XML element content. Defaults to nil.
9
- # @param nested_verbs [Array] XML element children. Defaults to an empty array.
9
+ # @param nested_verbs [Verb] or [Array<Verb>] XML element children. Defaults to an empty array.
10
10
  # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
11
11
  def initialize(tag, content = nil, nested_verbs = [], attributes = {})
12
12
  @tag = tag
13
13
  @content = content
14
- @nested_verbs = nested_verbs
14
+ @nested_verbs = Array(nested_verbs)
15
15
  @attributes = attributes
16
16
  end
17
17
 
@@ -2,7 +2,7 @@ module Bandwidth
2
2
  module Bxml
3
3
  class Response < Bandwidth::Bxml::Root
4
4
  # Initializer
5
- # @param nested_verbs [Array<Verb>] XML element children. Defaults to an empty array.
5
+ # @param nested_verbs [Verb] or [Array<Verb>] XML element children. Defaults to an empty array.
6
6
  def initialize(nested_verbs = [])
7
7
  super(tag = 'Response', nested_verbs)
8
8
  end
@@ -8,10 +8,10 @@ module Bandwidth
8
8
  class Root
9
9
  # Initializer
10
10
  # @param tag [String] Name of the XML element.
11
- # @param nested_verbs [Array<Verb>] XML element children. Defaults to an empty array.
11
+ # @param nested_verbs [Verb] or [Array<Verb>] XML element children. Defaults to an empty array.
12
12
  def initialize(tag, nested_verbs = [])
13
13
  @tag = tag
14
- @nested_verbs = nested_verbs
14
+ @nested_verbs = Array(nested_verbs)
15
15
  end
16
16
 
17
17
  # Generate an XML element for the BXML response
@@ -30,12 +30,18 @@ module Bandwidth
30
30
  xml
31
31
  end
32
32
 
33
- # Add a verb to the nested verbs array
33
+ # Add a verb or verbs to the nested verbs array
34
34
  # @param *nested_verbs [Verb] or [Array<Verb>] Verb or verbs to add to the array.
35
- def add_verb(nested_verbs)
35
+ def add_verbs(nested_verbs)
36
36
  @nested_verbs.push(*nested_verbs)
37
37
  end
38
38
 
39
+ extend Gem::Deprecate
40
+ def add_verb(nested_verbs)
41
+ add_verbs(nested_verbs)
42
+ end
43
+ deprecate(:add_verb, 'add_verbs', 2024, 7)
44
+
39
45
  # Return BXML representaion of this response
40
46
  # @return [String] The XML response in string format.
41
47
  def to_bxml
@@ -2,7 +2,7 @@ module Bandwidth
2
2
  module Bxml
3
3
  class Gather < Bandwidth::Bxml::NestableVerb
4
4
  # Initializer
5
- # @param audio_verbs [Array] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio.
5
+ # @param audio_verbs [Verb] or [Array<Verb>] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio.
6
6
  # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
7
  def initialize(audio_verbs = [], attributes = {})
8
8
  super('Gather', nil, audio_verbs, attributes)
@@ -21,7 +21,7 @@ module Bandwidth
21
21
  max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
22
22
  inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60.
23
23
  first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested <SpeakSentence> or <PlayAudio> verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60.
24
- repeat_count: 'repeat_count', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeat_count * number of verbs must not be greater than 20.
24
+ repeat_count: 'repeatCount', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeatCount * number of verbs must not be greater than 20.
25
25
  }
26
26
  end
27
27
 
@@ -32,11 +32,17 @@ module Bandwidth
32
32
  bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') }
33
33
  end
34
34
 
35
- # Add audio verb/s to the nested verbs array
36
- # @param audio_verbs [SpeakSentence] || [PlayAudio] or [Array<SpeakSentence || PlayAudio>] Verb or verbs to add to the array.
37
- def add_audio_verb(audio_verbs)
35
+ # Add audio verb or verbs to the nested verbs array
36
+ # @param audio_verbs [SpeakSentence] or [PlayAudio] or [Array<SpeakSentence || PlayAudio>] Verb or verbs to add to the array.
37
+ def add_audio_verbs(audio_verbs)
38
38
  @nested_verbs.push(*audio_verbs)
39
39
  end
40
+
41
+ extend Gem::Deprecate
42
+ def add_audio_verb(audio_verbs)
43
+ add_audio_verbs(audio_verbs)
44
+ end
45
+ deprecate(:add_audio_verb, 'add_audio_verbs', 2024, 7)
40
46
  end
41
47
  end
42
48
  end
@@ -2,7 +2,7 @@ module Bandwidth
2
2
  module Bxml
3
3
  class StartStream < Bandwidth::Bxml::NestableVerb
4
4
  # Initializer
5
- # @param stream_params [Array] XML element children. Defaults to an empty array. Valid nested stream params are: StreamParam. You may specify up to 12 <StreamParam/> elements nested within a <StartStream> tag.
5
+ # @param stream_params [Verb] or [Array<Verb>] XML element children. Defaults to an empty array. Valid nested stream params are: StreamParam. You may specify up to 12 <StreamParam/> elements nested within a <StartStream> tag.
6
6
  # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
7
  def initialize(stream_params = [], attributes = {})
8
8
  super('StartStream', nil, stream_params, attributes)
@@ -18,11 +18,17 @@ module Bandwidth
18
18
  }
19
19
  end
20
20
 
21
- # Add stream param/s to the nested verbs array
21
+ # Add stream param or params to the nested verbs array
22
22
  # @param stream_params [StreamParam] or [Array<StreamParam>] Verb or verbs to add to the array.
23
- def add_stream_param(stream_params)
23
+ def add_stream_params(stream_params)
24
24
  @nested_verbs.push(*stream_params)
25
25
  end
26
+
27
+ extend Gem::Deprecate
28
+ def add_stream_param(stream_params)
29
+ add_stream_params(stream_params)
30
+ end
31
+ deprecate(:add_stream_param, 'add_stream_params', 2024, 7)
26
32
  end
27
33
  end
28
34
  end
@@ -2,7 +2,7 @@ module Bandwidth
2
2
  module Bxml
3
3
  class StartTranscription < Bandwidth::Bxml::NestableVerb
4
4
  # Initializer
5
- # @param custom_params [Array] XML element children. Defaults to an empty array. Valid nested custom params are: CustomParam. You may specify up to 12 <CustomParam/> elements nested within a <StartTranscription> tag.
5
+ # @param custom_params [Verb] or [Array<Verb>] XML element children. Defaults to an empty array. Valid nested custom params are: CustomParam. You may specify up to 12 <CustomParam/> elements nested within a <StartTranscription> tag.
6
6
  # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
7
  def initialize(custom_params = [], attributes = {})
8
8
  super('StartTranscription', nil, custom_params, attributes)
@@ -19,11 +19,17 @@ module Bandwidth
19
19
  }
20
20
  end
21
21
 
22
- # Add custom param/s to the nested verbs array
22
+ # Add custom param or params to the nested verbs array
23
23
  # @param custom_params [CustomParam] or [Array<CustomParam>] Verb or verbs to add to the array.
24
- def add_custom_param(custom_params)
24
+ def add_custom_params(custom_params)
25
25
  @nested_verbs.push(*custom_params)
26
26
  end
27
+
28
+ extend Gem::Deprecate
29
+ def add_custom_param(custom_params)
30
+ add_custom_params(custom_params)
31
+ end
32
+ deprecate(:add_custom_param, 'add_custom_params', 2024, 7)
27
33
  end
28
34
  end
29
35
  end
@@ -2,7 +2,7 @@ module Bandwidth
2
2
  module Bxml
3
3
  class Transfer < Bandwidth::Bxml::NestableVerb
4
4
  # Initializer
5
- # @param transfer_to [Array] XML element children. Defaults to an empty array. Valid nested transfer verbs are: PhoneNumber, SipUri.
5
+ # @param transfer_to [Verb] or [Array<Verb>] XML element children. Defaults to an empty array. Valid nested transfer verbs are: PhoneNumber, SipUri.
6
6
  # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
7
  def initialize(transfer_to = [], attributes = {})
8
8
  super('Transfer', nil, transfer_to, attributes)
@@ -24,11 +24,17 @@ module Bandwidth
24
24
  }
25
25
  end
26
26
 
27
- # Add transfer recipient/s to the nested verbs array
28
- # @param recipients [PhoneNumber] || [SipUri] or [Array<PhoneNumber || SipUri>] Verb or verbs to add to the array.
29
- def add_transfer_recipient(recipients)
27
+ # Add transfer recipient or recipients to the nested verbs array
28
+ # @param recipients [PhoneNumber] or [SipUri] or [Array<PhoneNumber || SipUri>] Verb or verbs to add to the array.
29
+ def add_transfer_recipients(recipients)
30
30
  @nested_verbs.push(*recipients)
31
31
  end
32
+
33
+ extend Gem::Deprecate
34
+ def add_transfer_recipient(recipients)
35
+ add_transfer_recipients(recipients)
36
+ end
37
+ deprecate(:add_transfer_recipient, 'add_transfer_recipients', 2024, 7)
32
38
  end
33
39
  end
34
40
  end
@@ -21,7 +21,7 @@ module Bandwidth
21
21
  # The phone number(s) the message should be sent to in E164 format.
22
22
  attr_accessor :to
23
23
 
24
- # One of your telephone numbers the message should come from in E164 format.
24
+ # Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.
25
25
  attr_accessor :from
26
26
 
27
27
  # The contents of the text message. Must be 2048 characters or less.
@@ -11,5 +11,5 @@ OpenAPI Generator version: 7.0.0
11
11
  =end
12
12
 
13
13
  module Bandwidth
14
- VERSION = '11.1.0'
14
+ VERSION = '11.2.0'
15
15
  end
@@ -1,6 +1,7 @@
1
1
  # Unit tests for Bandwidth::Bxml::Bxml
2
2
  describe 'Bandwidth::Bxml::Bxml' do
3
3
  let(:instance) { Bandwidth::Bxml::Bxml.new }
4
+ let(:pause_recording) { Bandwidth::Bxml::PauseRecording.new }
4
5
 
5
6
  describe 'test an instance of Bxml' do
6
7
  it 'validates instance of Bxml' do
@@ -8,6 +9,30 @@ describe 'Bandwidth::Bxml::Bxml' do
8
9
  expect(instance).to be_a(Bandwidth::Bxml::Root)
9
10
  end
10
11
 
12
+ it 'test initializing with a single nested verb' do
13
+ instance = Bandwidth::Bxml::Bxml.new(pause_recording)
14
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n <PauseRecording/>\n</Bxml>\n"
15
+ expect(instance.to_bxml).to eq(expected)
16
+ end
17
+
18
+ it 'test initializing with multiple nested verbs' do
19
+ instance = Bandwidth::Bxml::Bxml.new([pause_recording, pause_recording])
20
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n <PauseRecording/>\n <PauseRecording/>\n</Bxml>\n"
21
+ expect(instance.to_bxml).to eq(expected)
22
+ end
23
+
24
+ it 'test adding a single verb to the Bxml instance' do
25
+ instance.add_verbs(pause_recording)
26
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n <PauseRecording/>\n</Bxml>\n"
27
+ expect(instance.to_bxml).to eq(expected)
28
+ end
29
+
30
+ it 'test adding multiple verbs to the Bxml instance' do
31
+ instance.add_verbs([pause_recording, pause_recording])
32
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n <PauseRecording/>\n <PauseRecording/>\n</Bxml>\n"
33
+ expect(instance.to_bxml).to eq(expected)
34
+ end
35
+
11
36
  it 'test the to_bxml method of the Bxml instance' do
12
37
  expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml/>\n"
13
38
  expect(instance.to_bxml).to eq(expected)
@@ -1,6 +1,7 @@
1
1
  # Unit tests for Bandwidth::Bxml::Response
2
2
  describe 'Bandwidth::Bxml::Response' do
3
3
  let(:instance) { Bandwidth::Bxml::Response.new }
4
+ let(:pause_recording) { Bandwidth::Bxml::PauseRecording.new }
4
5
 
5
6
  describe 'test an instance of Response' do
6
7
  it 'validates instance of Response' do
@@ -8,6 +9,30 @@ describe 'Bandwidth::Bxml::Response' do
8
9
  expect(instance).to be_a(Bandwidth::Bxml::Root)
9
10
  end
10
11
 
12
+ it 'test initializing with a single nested verb' do
13
+ instance = Bandwidth::Bxml::Response.new(pause_recording)
14
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <PauseRecording/>\n</Response>\n"
15
+ expect(instance.to_bxml).to eq(expected)
16
+ end
17
+
18
+ it 'test initializing with multiple nested verbs' do
19
+ instance = Bandwidth::Bxml::Response.new([pause_recording, pause_recording])
20
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <PauseRecording/>\n <PauseRecording/>\n</Response>\n"
21
+ expect(instance.to_bxml).to eq(expected)
22
+ end
23
+
24
+ it 'test adding a single verb to the Response instance' do
25
+ instance.add_verbs(pause_recording)
26
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <PauseRecording/>\n</Response>\n"
27
+ expect(instance.to_bxml).to eq(expected)
28
+ end
29
+
30
+ it 'test adding multiple verbs to the Response instance' do
31
+ instance.add_verbs([pause_recording, pause_recording])
32
+ expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <PauseRecording/>\n <PauseRecording/>\n</Response>\n"
33
+ expect(instance.to_bxml).to eq(expected)
34
+ end
35
+
11
36
  it 'test the to_bxml method of the Response instance' do
12
37
  expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response/>\n"
13
38
  expect(instance.to_bxml).to eq(expected)
@@ -5,7 +5,7 @@ describe 'Bandwidth::Bxml::Forward' do
5
5
  to: '+19195551234',
6
6
  from: '+19195554321',
7
7
  call_timeout: 5,
8
- diversion_treatment: 'propogate',
8
+ diversion_treatment: 'propagate',
9
9
  diversion_reason: 'user-busy',
10
10
  uui: '93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt'
11
11
  }
@@ -31,7 +31,7 @@ describe 'Bandwidth::Bxml::Forward' do
31
31
  end
32
32
 
33
33
  it 'tests the to_bxml method of the Forward instance' do
34
- expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" callTimeout=\"5\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
34
+ expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" callTimeout=\"5\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
35
35
  expect(instance.to_bxml).to eq(expected)
36
36
  end
37
37
 
@@ -42,7 +42,7 @@ describe 'Bandwidth::Bxml::Gather' do
42
42
  let (:speak_sentence) { Bandwidth::Bxml::SpeakSentence.new('<lang xml:lang="es-MX">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis>') }
43
43
 
44
44
  let(:instance) { Bandwidth::Bxml::Gather.new([], initial_attributes) }
45
- let(:instance_nested) { Bandwidth::Bxml::Gather.new([play_audio], initial_attributes) }
45
+ let(:instance_nested) { Bandwidth::Bxml::Gather.new(play_audio, initial_attributes) }
46
46
 
47
47
  describe 'test an instance of Gather' do
48
48
  it 'validates instance of Gather' do
@@ -51,13 +51,13 @@ describe 'Bandwidth::Bxml::Gather' do
51
51
  end
52
52
 
53
53
  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\" repeat_count=\"5\"/>\n"
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"
55
55
  expect(instance.to_bxml).to eq(expected)
56
56
  end
57
57
 
58
58
  it 'tests the set_attributes method of the Gather instance' do
59
59
  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\" repeat_count=\"10\"/>\n"
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"
61
61
  expect(instance.to_bxml).to eq(expected)
62
62
  end
63
63
  end
@@ -69,17 +69,17 @@ describe 'Bandwidth::Bxml::Gather' do
69
69
  end
70
70
 
71
71
  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\" repeat_count=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
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"
73
73
  expect(instance_nested.to_bxml).to eq(expected)
74
74
  end
75
75
 
76
76
  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\" repeat_count=\"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
- instance_nested.add_audio_verb(speak_sentence)
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"
78
+ instance_nested.add_audio_verbs(speak_sentence)
79
79
  expect(instance_nested.to_bxml).to eq(expected_single)
80
80
 
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\" repeat_count=\"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
- instance_nested.add_audio_verb([speak_sentence, play_audio])
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"
82
+ instance_nested.add_audio_verbs([speak_sentence, play_audio])
83
83
  expect(instance_nested.to_bxml).to eq(expected_multiple)
84
84
  end
85
85
  end
@@ -28,7 +28,7 @@ describe 'Bandwidth::Bxml::StartStream' do
28
28
  let (:stream_param_2) { Bandwidth::Bxml::StreamParam.new({ name: 'stream_param_name_2', value: 'stream_param_value_2' }) }
29
29
 
30
30
  let(:instance) { Bandwidth::Bxml::StartStream.new([], initial_attributes) }
31
- let(:instance_nested) { Bandwidth::Bxml::StartStream.new([stream_param_1], initial_attributes) }
31
+ let(:instance_nested) { Bandwidth::Bxml::StartStream.new(stream_param_1, initial_attributes) }
32
32
 
33
33
  describe 'test an instance of StartStream' do
34
34
  it 'validates instance of StartStream' do
@@ -61,11 +61,11 @@ describe 'Bandwidth::Bxml::StartStream' do
61
61
 
62
62
  it 'tests the add_stream_param method of the nested StartStream instance' do
63
63
  expected_single = "\n<StartStream name=\"initial_name\" tracks=\"inbound\" destination=\"https://initial.com\" 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"
64
- instance_nested.add_stream_param(stream_param_2)
64
+ instance_nested.add_stream_params(stream_param_2)
65
65
  expect(instance_nested.to_bxml).to eq(expected_single)
66
66
 
67
67
  expected_multiple = "\n<StartStream name=\"initial_name\" tracks=\"inbound\" destination=\"https://initial.com\" 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"
68
- instance_nested.add_stream_param([stream_param_2, stream_param_2])
68
+ instance_nested.add_stream_params([stream_param_2, stream_param_2])
69
69
  expect(instance_nested.to_bxml).to eq(expected_multiple)
70
70
  end
71
71
  end
@@ -30,7 +30,7 @@ describe 'Bandwidth::Bxml::StartTranscription' do
30
30
  let (:custom_param_2) { Bandwidth::Bxml::CustomParam.new({ name: 'custom_param_name_2', value: 'custom_param_value_2' }) }
31
31
 
32
32
  let(:instance) { Bandwidth::Bxml::StartTranscription.new([], initial_attributes) }
33
- let(:instance_nested) { Bandwidth::Bxml::StartTranscription.new([custom_param_1], initial_attributes) }
33
+ let(:instance_nested) { Bandwidth::Bxml::StartTranscription.new(custom_param_1, initial_attributes) }
34
34
 
35
35
  describe 'test an instance of StartTranscription' do
36
36
  it 'validates instance of StartTranscription' do
@@ -63,11 +63,11 @@ describe 'Bandwidth::Bxml::StartTranscription' do
63
63
 
64
64
  it 'tests the add_custom_param method of the nested StartTranscription instance' do
65
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"
66
- instance_nested.add_custom_param(custom_param_2)
66
+ instance_nested.add_custom_params(custom_param_2)
67
67
  expect(instance_nested.to_bxml).to eq(expected_single)
68
68
 
69
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"
70
- instance_nested.add_custom_param([custom_param_2, custom_param_2])
70
+ instance_nested.add_custom_params([custom_param_2, custom_param_2])
71
71
  expect(instance_nested.to_bxml).to eq(expected_multiple)
72
72
  end
73
73
  end
@@ -13,7 +13,7 @@ describe 'Bandwidth::Bxml::Transfer' do
13
13
  fallback_username: 'initial_fallback_username',
14
14
  fallback_password: 'initial_fallback_password',
15
15
  tag: 'initial_tag',
16
- diversion_treatment: 'propogate',
16
+ diversion_treatment: 'propagate',
17
17
  diversion_reason: 'user-busy'
18
18
  }
19
19
  }
@@ -40,7 +40,7 @@ describe 'Bandwidth::Bxml::Transfer' do
40
40
  let(:sip_uri) { Bandwidth::Bxml::SipUri.new('sip:1-999-123-4567@voip-provider.example.net') }
41
41
 
42
42
  let(:instance) { Bandwidth::Bxml::Transfer.new([], initial_attributes) }
43
- let(:instance_nested) { Bandwidth::Bxml::Transfer.new([phone_number], initial_attributes) }
43
+ let(:instance_nested) { Bandwidth::Bxml::Transfer.new(phone_number, initial_attributes) }
44
44
 
45
45
  describe 'test an instance of Transfer' do
46
46
  it 'validates instance of Transfer' do
@@ -49,7 +49,7 @@ describe 'Bandwidth::Bxml::Transfer' do
49
49
  end
50
50
 
51
51
  it 'tests the to_bxml method of the Transfer instance' do
52
- expected = "\n<Transfer transferCallerId=\"+19195551234\" 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=\"propogate\" diversionReason=\"user-busy\"/>\n"
52
+ expected = "\n<Transfer transferCallerId=\"+19195551234\" 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"
53
53
  expect(instance.to_bxml).to eq(expected)
54
54
  end
55
55
 
@@ -67,17 +67,17 @@ describe 'Bandwidth::Bxml::Transfer' do
67
67
  end
68
68
 
69
69
  it 'tests the to_bxml method of the nested Transfer instance' do
70
- expected = "\n<Transfer transferCallerId=\"+19195551234\" 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=\"propogate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
70
+ expected = "\n<Transfer transferCallerId=\"+19195551234\" 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"
71
71
  expect(instance_nested.to_bxml).to eq(expected)
72
72
  end
73
73
 
74
74
  it 'tests the add_verb method of the nested Transfer instance' do
75
- expected_single = "\n<Transfer transferCallerId=\"+19195551234\" 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=\"propogate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n</Transfer>\n"
76
- instance_nested.add_transfer_recipient(sip_uri)
75
+ expected_single = "\n<Transfer transferCallerId=\"+19195551234\" 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"
76
+ instance_nested.add_transfer_recipients(sip_uri)
77
77
  expect(instance_nested.to_bxml).to eq(expected_single)
78
78
 
79
- expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" 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=\"propogate\" 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"
80
- instance_nested.add_transfer_recipient([sip_uri, phone_number])
79
+ expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" 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"
80
+ instance_nested.add_transfer_recipients([sip_uri, phone_number])
81
81
  expect(instance_nested.to_bxml).to eq(expected_multiple)
82
82
  end
83
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.1.0
4
+ version: 11.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-17 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -460,62 +460,62 @@ signing_key:
460
460
  specification_version: 4
461
461
  summary: Bandwidth Ruby SDK
462
462
  test_files:
463
- - spec/api/calls_api_spec.rb
464
- - spec/api/messages_api_spec.rb
465
- - spec/api/recordings_api_spec.rb
466
463
  - spec/api/phone_number_lookup_api_spec.rb
464
+ - spec/api/recordings_api_spec.rb
467
465
  - spec/api/mfa_api_spec.rb
468
- - spec/api/conferences_api_spec.rb
469
- - spec/api/media_api_spec.rb
470
466
  - spec/api/statistics_api_spec.rb
467
+ - spec/api/media_api_spec.rb
468
+ - spec/api/messages_api_spec.rb
469
+ - spec/api/calls_api_spec.rb
470
+ - spec/api/conferences_api_spec.rb
471
471
  - spec/api_client_spec.rb
472
472
  - spec/api_error_spec.rb
473
473
  - spec/call_utils.rb
474
474
  - spec/configuration_spec.rb
475
475
  - spec/fixtures/ruby_cat.jpeg
476
476
  - spec/integration/mfa_api_integration_spec.rb
477
- - spec/integration/media_api_integration_spec.rb
478
477
  - spec/integration/messages_api_integration_spec.rb
478
+ - spec/integration/recordings_api_integration_spec.rb
479
+ - spec/integration/media_api_integration_spec.rb
479
480
  - spec/integration/calls_api_integration_spec.rb
480
- - spec/integration/phone_number_lookup_api_integration_spec.rb
481
481
  - spec/integration/statistics_api_integration_spec.rb
482
+ - spec/integration/phone_number_lookup_api_integration_spec.rb
482
483
  - spec/integration/conferences_api_integration_spec.rb
483
- - spec/integration/recordings_api_integration_spec.rb
484
- - spec/models/bxml/nestable_verb_spec.rb
485
- - spec/models/bxml/response_spec.rb
484
+ - spec/models/verify_code_request_spec.rb
485
+ - spec/models/deferred_result_spec.rb
486
+ - spec/models/call_state_spec.rb
487
+ - spec/models/message_spec.rb
488
+ - spec/models/call_state_enum_spec.rb
486
489
  - spec/models/bxml/bxml_spec.rb
487
- - spec/models/bxml/verb_spec.rb
490
+ - spec/models/bxml/response_spec.rb
491
+ - spec/models/bxml/nestable_verb_spec.rb
492
+ - spec/models/bxml/verbs/gather_spec.rb
493
+ - spec/models/bxml/verbs/phone_number_spec.rb
494
+ - spec/models/bxml/verbs/start_transcription_spec.rb
488
495
  - spec/models/bxml/verbs/speak_sentence_spec.rb
489
- - spec/models/bxml/verbs/ring_spec.rb
496
+ - spec/models/bxml/verbs/hangup_spec.rb
497
+ - spec/models/bxml/verbs/custom_param_spec.rb
498
+ - spec/models/bxml/verbs/start_recording_spec.rb
499
+ - spec/models/bxml/verbs/pause_spec.rb
500
+ - spec/models/bxml/verbs/bridge_spec.rb
501
+ - spec/models/bxml/verbs/stop_gather_spec.rb
502
+ - spec/models/bxml/verbs/stream_param_spec.rb
490
503
  - spec/models/bxml/verbs/tag_spec.rb
491
- - spec/models/bxml/verbs/pause_recording_spec.rb
492
- - spec/models/bxml/verbs/start_transcription_spec.rb
493
- - spec/models/bxml/verbs/stop_stream_spec.rb
504
+ - spec/models/bxml/verbs/start_gather_spec.rb
494
505
  - spec/models/bxml/verbs/transfer_spec.rb
495
- - spec/models/bxml/verbs/pause_spec.rb
496
506
  - spec/models/bxml/verbs/start_stream_spec.rb
497
- - spec/models/bxml/verbs/play_audio_spec.rb
498
- - spec/models/bxml/verbs/record_spec.rb
499
- - spec/models/bxml/verbs/stop_gather_spec.rb
500
507
  - spec/models/bxml/verbs/stop_transcription_spec.rb
501
- - spec/models/bxml/verbs/forward_spec.rb
508
+ - spec/models/bxml/verbs/play_audio_spec.rb
509
+ - spec/models/bxml/verbs/sip_uri_spec.rb
502
510
  - spec/models/bxml/verbs/resume_recording_spec.rb
503
- - spec/models/bxml/verbs/bridge_spec.rb
511
+ - spec/models/bxml/verbs/stop_recording_spec.rb
512
+ - spec/models/bxml/verbs/pause_recording_spec.rb
513
+ - spec/models/bxml/verbs/record_spec.rb
514
+ - spec/models/bxml/verbs/redirect_spec.rb
515
+ - spec/models/bxml/verbs/ring_spec.rb
504
516
  - spec/models/bxml/verbs/send_dtmf_spec.rb
505
- - spec/models/bxml/verbs/start_recording_spec.rb
506
- - spec/models/bxml/verbs/custom_param_spec.rb
507
- - spec/models/bxml/verbs/sip_uri_spec.rb
508
- - spec/models/bxml/verbs/hangup_spec.rb
517
+ - spec/models/bxml/verbs/stop_stream_spec.rb
509
518
  - spec/models/bxml/verbs/conference_spec.rb
510
- - spec/models/bxml/verbs/phone_number_spec.rb
511
- - spec/models/bxml/verbs/stream_param_spec.rb
512
- - spec/models/bxml/verbs/redirect_spec.rb
513
- - spec/models/bxml/verbs/stop_recording_spec.rb
514
- - spec/models/bxml/verbs/start_gather_spec.rb
515
- - spec/models/bxml/verbs/gather_spec.rb
516
- - spec/models/verify_code_request_spec.rb
517
- - spec/models/message_spec.rb
518
- - spec/models/deferred_result_spec.rb
519
- - spec/models/call_state_spec.rb
520
- - spec/models/call_state_enum_spec.rb
519
+ - spec/models/bxml/verbs/forward_spec.rb
520
+ - spec/models/bxml/verb_spec.rb
521
521
  - spec/spec_helper.rb