vonage 7.34.0 → 7.35.0
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/README.md +2 -1
- data/lib/vonage/verify2/channels/whats_app.rb +6 -0
- data/lib/vonage/version.rb +1 -1
- data/lib/vonage/video/web_socket.rb +1 -1
- data/lib/vonage/voice/actions/connect.rb +1 -0
- data/lib/vonage/voice/actions/input.rb +7 -0
- data/lib/vonage/voice/actions/talk.rb +17 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8bd108a273a45332c5313bec61c2d5237f00d7e1f3c430c6cd057d8e8f13ece
|
|
4
|
+
data.tar.gz: bb19a42705afd74c9fdd435fbb56da73ad978924dc170d86dbf285c22a7887b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d74a13f6912927c92abea793e544e54089cf7d0679d8e7653e3887e0af913de0c00c255aacdd17711ec6f79b01f7cb5d0a677028385835d6265aae4bfc01bfdb
|
|
7
|
+
data.tar.gz: 33beaadea6c871bc040741962cb6ee2bf05853d7d3b1bbdca5d2ea0281cd10fb2d3189e87f3ba45c64acc4e04338de2fa1905f03f6814b189180755218f3993d
|
data/README.md
CHANGED
|
@@ -36,8 +36,9 @@ need a Vonage account. Sign up [for free at vonage.com][signup].
|
|
|
36
36
|
|
|
37
37
|
## Requirements
|
|
38
38
|
|
|
39
|
-
Vonage Ruby supports MRI/CRuby (
|
|
39
|
+
Vonage Ruby supports MRI/CRuby (tests in CI are run against 3.3 and newer, but the library will likely still work with any 2.x or newer version).
|
|
40
40
|
|
|
41
|
+
JRuby and Truffleruby are supported in theory, but aren't tested against as part of the CI pipeline.
|
|
41
42
|
|
|
42
43
|
## Installation
|
|
43
44
|
|
|
@@ -24,6 +24,12 @@ module Vonage
|
|
|
24
24
|
@from = from
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def mode=(mode)
|
|
28
|
+
valid_modes = ['otp_code', 'zero_tap']
|
|
29
|
+
raise ArgumentError, "Invalid 'mode' value #{mode}. Expected to be one of #{valid_modes.join(', ')}" unless valid_modes.include?(mode)
|
|
30
|
+
@mode = mode
|
|
31
|
+
end
|
|
32
|
+
|
|
27
33
|
def to_h
|
|
28
34
|
hash = Hash.new
|
|
29
35
|
self.instance_variables.each do |ivar|
|
data/lib/vonage/version.rb
CHANGED
|
@@ -37,7 +37,7 @@ module Vonage
|
|
|
37
37
|
# - If you omit this property, all streams in the session will be included.
|
|
38
38
|
# @option websocket [optional, Hash] :headers An object of key-value pairs of headers to be sent to your WebSocket server with each message, with a maximum length of 512 bytes.
|
|
39
39
|
# @option websocket [optional, Integer] :audio_rate A number representing the audio sampling rate in Hz
|
|
40
|
-
# - Must be one of: 8000, 16000
|
|
40
|
+
# - Must be one of: 8000, 16000, 24000
|
|
41
41
|
# @option websocket [optional, Boolean] :bidirectional Whether to send audio data from the WebSocket connection to a stream published in the session.
|
|
42
42
|
#
|
|
43
43
|
# @return [Response]
|
|
@@ -85,6 +85,13 @@ module Vonage
|
|
|
85
85
|
if self.speech[:maxDuration]
|
|
86
86
|
raise ClientError.new("Expected 'maxDuration' to not be more than 60 seconds") unless self.speech[:maxDuration] <= 60 && self.speech[:maxDuration] >= 0
|
|
87
87
|
end
|
|
88
|
+
|
|
89
|
+
if self.speech[:provider]
|
|
90
|
+
valid_providers = ['google']
|
|
91
|
+
|
|
92
|
+
raise ClientError.new("Invalid 'provider' value, must be one of: #{valid_providers.join(', ')}") unless valid_providers.include?(self.speech[:provider])
|
|
93
|
+
raise ClientError.new("The `providerOptions` parameter is required when specifying a `provider`") unless self.speech[:providerOptions]
|
|
94
|
+
end
|
|
88
95
|
end
|
|
89
96
|
|
|
90
97
|
def validate_event_url
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
module Vonage
|
|
4
4
|
class Voice::Actions::Talk
|
|
5
|
-
attr_accessor :text, :bargeIn, :loop, :level, :language, :style, :premium
|
|
5
|
+
attr_accessor :text, :bargeIn, :loop, :level, :language, :style, :premium, :provider, :providerOptions
|
|
6
6
|
|
|
7
7
|
def initialize(attributes= {})
|
|
8
8
|
@text = attributes.fetch(:text)
|
|
@@ -12,6 +12,8 @@ module Vonage
|
|
|
12
12
|
@language = attributes.fetch(:language, nil)
|
|
13
13
|
@style = attributes.fetch(:style, nil)
|
|
14
14
|
@premium = attributes.fetch(:premium, nil)
|
|
15
|
+
@provider = attributes.fetch(:provider, nil)
|
|
16
|
+
@providerOptions = attributes.fetch(:providerOptions, nil)
|
|
15
17
|
|
|
16
18
|
after_initialize!
|
|
17
19
|
end
|
|
@@ -36,6 +38,10 @@ module Vonage
|
|
|
36
38
|
if self.premium || self.premium == false
|
|
37
39
|
verify_premium
|
|
38
40
|
end
|
|
41
|
+
|
|
42
|
+
if self.provider
|
|
43
|
+
verify_provider
|
|
44
|
+
end
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
def verify_barge_in
|
|
@@ -58,6 +64,13 @@ module Vonage
|
|
|
58
64
|
raise ClientError.new("Expected 'premium' value to be a Boolean") unless self.premium == true || self.premium == false
|
|
59
65
|
end
|
|
60
66
|
|
|
67
|
+
def verify_provider
|
|
68
|
+
valid_providers = ['google']
|
|
69
|
+
|
|
70
|
+
raise ClientError.new("Invalid 'provider' value, must be one of: #{valid_providers.join(', ')}") unless valid_providers.include?(self.provider)
|
|
71
|
+
raise ClientError.new("The `providerOptions` parameter is required when specifying a `provider`") unless self.providerOptions
|
|
72
|
+
end
|
|
73
|
+
|
|
61
74
|
def action
|
|
62
75
|
create_talk!(self)
|
|
63
76
|
end
|
|
@@ -75,7 +88,9 @@ module Vonage
|
|
|
75
88
|
ncco[0].merge!(level: builder.level) if builder.level
|
|
76
89
|
ncco[0].merge!(language: builder.language) if builder.language
|
|
77
90
|
ncco[0].merge!(style: builder.style) if builder.style
|
|
78
|
-
ncco[0].merge!(premium: builder.premium) if (builder.
|
|
91
|
+
ncco[0].merge!(premium: builder.premium) if (builder.premium || builder.premium == false)
|
|
92
|
+
ncco[0].merge!(provider: builder.provider) if builder.provider
|
|
93
|
+
ncco[0].merge!(providerOptions: builder.providerOptions) if builder.providerOptions
|
|
79
94
|
|
|
80
95
|
ncco
|
|
81
96
|
end
|