vonage 7.31.0 → 7.32.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/lib/vonage/keys.rb +3 -1
- data/lib/vonage/version.rb +1 -1
- data/lib/vonage/video/archives.rb +8 -0
- data/lib/vonage/video/connections/list_response.rb +11 -0
- data/lib/vonage/video/connections.rb +29 -0
- data/lib/vonage/video.rb +6 -0
- data/lib/vonage/voice/actions/connect.rb +1 -1
- data/lib/vonage/voice/actions/transfer.rb +83 -0
- data/lib/vonage/voice/actions/wait.rb +43 -0
- data/lib/vonage/voice/ncco.rb +3 -1
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 767237040504d75ff4f4e7966e2de52d44eb7b1be47470bb238cde32702892f7
|
|
4
|
+
data.tar.gz: 197f6d40f803f60acc37ea8a58dd96fae47666d86eb2b1c7eb1d17f9602b24bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07a15f1ae2b57f93ecd509a7d162594cd2e134ee79783ae21855d13c93f85886a3c78b797854c71640e10003275e669101e1cbc0c20e9cc39f031df7c01365b7
|
|
7
|
+
data.tar.gz: 8152d4eedc3109a26556fb8249fc192737624532b3b7906305b82587abd9be229dc23b797f05b4cf035cb2283a0f009f10db7227943fd58c62ac72c6d0ed71b9
|
data/lib/vonage/keys.rb
CHANGED
data/lib/vonage/version.rb
CHANGED
|
@@ -71,6 +71,14 @@ module Vonage
|
|
|
71
71
|
#
|
|
72
72
|
# @option layout [optional, String] :screenshareType
|
|
73
73
|
#
|
|
74
|
+
# @param [optional, Boolean] :has_transcription
|
|
75
|
+
#
|
|
76
|
+
# @param [optional, Hash] :transcription_properties
|
|
77
|
+
#
|
|
78
|
+
# @option transcription_properties [optional, String] :primaryLanguageCode
|
|
79
|
+
#
|
|
80
|
+
# @option transcription_properties [optional, Boolean] :hasSummary
|
|
81
|
+
#
|
|
74
82
|
# @return [Response]
|
|
75
83
|
#
|
|
76
84
|
# @see TODO: add docs link
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Vonage
|
|
5
|
+
class Video::Connections < Namespace
|
|
6
|
+
|
|
7
|
+
self.authentication = BearerToken
|
|
8
|
+
|
|
9
|
+
self.request_body = JSON
|
|
10
|
+
|
|
11
|
+
self.host = :video_host
|
|
12
|
+
|
|
13
|
+
# Get a list of connections for a specified session.
|
|
14
|
+
#
|
|
15
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
|
16
|
+
#
|
|
17
|
+
# @param [required, String] :session_id
|
|
18
|
+
#
|
|
19
|
+
# TODO: add auto_advance option
|
|
20
|
+
#
|
|
21
|
+
# @return [ListResponse]
|
|
22
|
+
#
|
|
23
|
+
# @see TODO: add docs link
|
|
24
|
+
#
|
|
25
|
+
def list(session_id:)
|
|
26
|
+
request('/v2/project/' + @config.application_id + '/session/' + session_id + '/connection', response_class: ListResponse)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/vonage/video.rb
CHANGED
|
@@ -65,7 +65,7 @@ module Vonage
|
|
|
65
65
|
raise ClientError.new("'user' must be defined") unless endpoint[:user]
|
|
66
66
|
when 'websocket'
|
|
67
67
|
raise ClientError.new("Expected 'uri' value to be a valid URI") unless URI.parse(endpoint[:uri]).kind_of?(URI::Generic)
|
|
68
|
-
raise ClientError.new("Expected 'content-type' parameter to be either 'audio/
|
|
68
|
+
raise ClientError.new("Expected 'content-type' parameter to be either 'audio/l16;rate=16000', 'audio/l16;rate=8000', or 'audio/l16;rate=24000'") unless ['audio/l16;rate=16000', 'audio/l16;rate=8000', 'audio/l16;rate=24000'].include?(endpoint[:'content-type'])
|
|
69
69
|
when 'sip'
|
|
70
70
|
raise ClientError.new("Expected 'uri' value to be a valid URI") unless URI.parse(endpoint[:uri]).kind_of?(URI::Generic) if endpoint[:uri]
|
|
71
71
|
raise ClientError.new("`uri` must not be combined with `user` and `domain`") if endpoint[:uri] && (endpoint[:user] || endpoint[:domain])
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# typed: true
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
|
|
5
|
+
module Vonage
|
|
6
|
+
class Voice::Actions::Transfer
|
|
7
|
+
attr_accessor :conversation_id, :can_hear, :can_speak, :mute
|
|
8
|
+
|
|
9
|
+
def initialize(attributes = {})
|
|
10
|
+
@conversation_id = attributes.fetch(:conversation_id)
|
|
11
|
+
@can_hear = attributes.fetch(:can_hear, nil)
|
|
12
|
+
@can_speak = attributes.fetch(:can_speak, nil)
|
|
13
|
+
@mute = attributes.fetch(:mute, nil)
|
|
14
|
+
|
|
15
|
+
after_initialize!
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def after_initialize!
|
|
19
|
+
validate_conversation_id
|
|
20
|
+
validate_can_hear if self.can_hear
|
|
21
|
+
validate_can_speak if self.can_speak
|
|
22
|
+
validate_mute if self.mute != nil
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def validate_conversation_id
|
|
26
|
+
conversation_id = self.conversation_id
|
|
27
|
+
|
|
28
|
+
raise ClientError.new("Expected 'conversation_id' parameter to be a string") unless conversation_id.is_a?(String)
|
|
29
|
+
|
|
30
|
+
self.conversation_id
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def validate_can_hear
|
|
34
|
+
can_hear = self.can_hear
|
|
35
|
+
unless can_hear.is_a?(Array) && can_hear.all? { |item| item.is_a?(String) }
|
|
36
|
+
raise ClientError.new("Expected 'can_hear' parameter to be an array of strings")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
self.can_hear
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def validate_can_speak
|
|
43
|
+
can_speak = self.can_speak
|
|
44
|
+
unless can_speak.is_a?(Array) && can_speak.all? { |item| item.is_a?(String) }
|
|
45
|
+
raise ClientError.new("Expected 'can_speak' parameter to be an array of strings")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
self.can_speak
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def validate_mute
|
|
52
|
+
mute = self.mute
|
|
53
|
+
unless [true, false].include?(mute)
|
|
54
|
+
raise ClientError.new("Expected 'mute' parameter to be a boolean")
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
if self.mute && self.can_speak
|
|
58
|
+
raise ClientError.new("The 'mute' parameter is not supported if 'can_speak' is also set")
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
self.mute
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def action
|
|
65
|
+
create_transfer!(self)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def create_transfer!(builder)
|
|
69
|
+
ncco = [
|
|
70
|
+
{
|
|
71
|
+
action: 'transfer',
|
|
72
|
+
conversation_id: builder.conversation_id,
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
ncco[0].merge!(canHear: builder.can_hear) if builder.can_hear
|
|
77
|
+
ncco[0].merge!(canSpeak: builder.can_speak) if builder.can_speak
|
|
78
|
+
ncco[0].merge!(mute: builder.mute) if builder.mute != nil
|
|
79
|
+
|
|
80
|
+
ncco
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# typed: true
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
|
|
5
|
+
module Vonage
|
|
6
|
+
class Voice::Actions::Wait
|
|
7
|
+
attr_accessor :timeout
|
|
8
|
+
|
|
9
|
+
def initialize(attributes = {})
|
|
10
|
+
@timeout = attributes.fetch(:timeout, nil)
|
|
11
|
+
|
|
12
|
+
after_initialize!
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def after_initialize!
|
|
16
|
+
validate_timeout if self.timeout
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def validate_timeout
|
|
20
|
+
timeout = self.timeout
|
|
21
|
+
|
|
22
|
+
raise ClientError.new("Expected 'timeout' parameter to be a number") unless timeout.is_a?(Numeric)
|
|
23
|
+
|
|
24
|
+
self.timeout
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def action
|
|
28
|
+
create_wait!(self)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def create_wait!(builder)
|
|
32
|
+
ncco = [
|
|
33
|
+
{
|
|
34
|
+
action: 'wait'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
ncco[0].merge!(timeout: builder.timeout) if builder.timeout
|
|
39
|
+
|
|
40
|
+
ncco
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
data/lib/vonage/voice/ncco.rb
CHANGED
|
@@ -10,7 +10,9 @@ module Vonage
|
|
|
10
10
|
notify: Vonage::Voice::Actions::Notify,
|
|
11
11
|
record: Vonage::Voice::Actions::Record,
|
|
12
12
|
stream: Vonage::Voice::Actions::Stream,
|
|
13
|
-
talk: Vonage::Voice::Actions::Talk
|
|
13
|
+
talk: Vonage::Voice::Actions::Talk,
|
|
14
|
+
wait: Vonage::Voice::Actions::Wait,
|
|
15
|
+
transfer: Vonage::Voice::Actions::Transfer
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
class << self
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vonage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.32.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vonage
|
|
@@ -250,6 +250,8 @@ files:
|
|
|
250
250
|
- lib/vonage/video/broadcasts.rb
|
|
251
251
|
- lib/vonage/video/broadcasts/list_response.rb
|
|
252
252
|
- lib/vonage/video/captions.rb
|
|
253
|
+
- lib/vonage/video/connections.rb
|
|
254
|
+
- lib/vonage/video/connections/list_response.rb
|
|
253
255
|
- lib/vonage/video/moderation.rb
|
|
254
256
|
- lib/vonage/video/renders.rb
|
|
255
257
|
- lib/vonage/video/renders/list_response.rb
|
|
@@ -266,6 +268,8 @@ files:
|
|
|
266
268
|
- lib/vonage/voice/actions/record.rb
|
|
267
269
|
- lib/vonage/voice/actions/stream.rb
|
|
268
270
|
- lib/vonage/voice/actions/talk.rb
|
|
271
|
+
- lib/vonage/voice/actions/transfer.rb
|
|
272
|
+
- lib/vonage/voice/actions/wait.rb
|
|
269
273
|
- lib/vonage/voice/dtmf.rb
|
|
270
274
|
- lib/vonage/voice/list_response.rb
|
|
271
275
|
- lib/vonage/voice/ncco.rb
|