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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eef9ba6a82f261b39300753a6a894de863fa511caeedbe4da526f19386310a5d
4
- data.tar.gz: ecdb4a66e5ce1d811c9acaf65c87c6a7acf7c25ec547ae2be6f1089600088f45
3
+ metadata.gz: 767237040504d75ff4f4e7966e2de52d44eb7b1be47470bb238cde32702892f7
4
+ data.tar.gz: 197f6d40f803f60acc37ea8a58dd96fae47666d86eb2b1c7eb1d17f9602b24bb
5
5
  SHA512:
6
- metadata.gz: 88e3b48ab6f91e84397bcf2ec1ec4d05303bdb54fb6a911a835b494bae537984779875975903a5ebd5ebfad10ac148da95c427785cd27fc6d701397df7ef9558
7
- data.tar.gz: 2fafc180379722a799ba71eaf5d3bcd08e992298e9ccc4f7503d5a07033498cad34e9fa3bbf23e955a7618f36b31b8f9a18ca16dad94aa0bc684beb1db0a2e20
6
+ metadata.gz: 07a15f1ae2b57f93ecd509a7d162594cd2e134ee79783ae21855d13c93f85886a3c78b797854c71640e10003275e669101e1cbc0c20e9cc39f031df7c01365b7
7
+ data.tar.gz: 8152d4eedc3109a26556fb8249fc192737624532b3b7906305b82587abd9be229dc23b797f05b4cf035cb2283a0f009f10db7227943fd58c62ac72c6d0ed71b9
data/lib/vonage/keys.rb CHANGED
@@ -41,7 +41,9 @@ module Vonage
41
41
  'hashed_phone_number',
42
42
  'max_age',
43
43
  'max_bitrate',
44
- 'quantization_parameter'
44
+ 'quantization_parameter',
45
+ 'has_transcription',
46
+ 'transcription_properties'
45
47
  ]
46
48
  hash.transform_keys do |k|
47
49
  if exceptions.include?(k.to_s)
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = '7.31.0'
4
+ VERSION = '7.32.0'
5
5
  end
@@ -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,11 @@
1
+ # typed: true
2
+
3
+ class Vonage::Video::Connections::ListResponse < Vonage::Response
4
+ include Enumerable
5
+
6
+ def each
7
+ return enum_for(:each) unless block_given?
8
+
9
+ @entity.items.each { |item| yield item }
10
+ end
11
+ end
@@ -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
@@ -107,6 +107,12 @@ module Vonage
107
107
  @streams ||= Streams.new(@config)
108
108
  end
109
109
 
110
+ # @return [Connections]
111
+ #
112
+ def connections
113
+ @connections ||= Connections.new(@config)
114
+ end
115
+
110
116
  # @return [Captions]
111
117
  #
112
118
  def captions
@@ -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/116;rate=16000' or 'audio/116;rate=8000") unless endpoint[:'content-type'] == 'audio/116;rate=16000' || endpoint[:'content-type'] == 'audio/116;rate=8000'
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
@@ -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.31.0
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