vonage 7.27.0 → 8.0.0.beta
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 +89 -388
- data/lib/vonage/applications.rb +4 -12
- data/lib/vonage/basic.rb +1 -1
- data/lib/vonage/bearer_token.rb +1 -1
- data/lib/vonage/client.rb +0 -65
- data/lib/vonage/client_error.rb +1 -1
- data/lib/vonage/config.rb +1 -9
- data/lib/vonage/conversations/events.rb +0 -12
- data/lib/vonage/conversations/legs.rb +0 -6
- data/lib/vonage/conversations/members.rb +0 -15
- data/lib/vonage/conversations/users.rb +0 -15
- data/lib/vonage/conversations.rb +0 -30
- data/lib/vonage/errors.rb +20 -37
- data/lib/vonage/gsm7.rb +1 -1
- data/lib/vonage/jwt.rb +0 -17
- data/lib/vonage/key_secret_params.rb +2 -3
- data/lib/vonage/keys.rb +1 -11
- data/lib/vonage/logger.rb +3 -5
- data/lib/vonage/messaging/channels/viber.rb +1 -8
- data/lib/vonage/messaging/channels/whats_app.rb +1 -3
- data/lib/vonage/messaging/message.rb +0 -1
- data/lib/vonage/messaging.rb +4 -34
- data/lib/vonage/namespace.rb +68 -137
- data/lib/vonage/numbers.rb +17 -40
- data/lib/vonage/server_error.rb +1 -1
- data/lib/vonage/signature.rb +5 -5
- data/lib/vonage/sms.rb +20 -20
- data/lib/vonage/version.rb +1 -1
- data/lib/vonage/video/archives.rb +53 -18
- data/lib/vonage/video/list_response.rb +11 -0
- data/lib/vonage/video/moderation.rb +22 -7
- data/lib/vonage/video/signals.rb +9 -4
- data/lib/vonage/video/streams.rb +12 -6
- data/lib/vonage/video.rb +13 -50
- data/lib/vonage/voice/actions/connect.rb +5 -34
- data/lib/vonage/voice/actions/conversation.rb +4 -10
- data/lib/vonage/voice/actions/input.rb +3 -19
- data/lib/vonage/voice/actions/notify.rb +3 -8
- data/lib/vonage/voice/actions/pay.rb +107 -0
- data/lib/vonage/voice/actions/record.rb +4 -52
- data/lib/vonage/voice/actions/stream.rb +4 -48
- data/lib/vonage/voice/actions/talk.rb +4 -54
- data/lib/vonage/voice/talk.rb +1 -11
- data/lib/vonage/voice.rb +0 -24
- data/lib/vonage.rb +0 -4
- data/vonage.gemspec +1 -3
- metadata +9 -104
- data/lib/vonage/api_error.rb +0 -33
- data/lib/vonage/conversation/event/list_response.rb +0 -11
- data/lib/vonage/conversation/event.rb +0 -108
- data/lib/vonage/conversation/list_response.rb +0 -11
- data/lib/vonage/conversation/member/list_response.rb +0 -11
- data/lib/vonage/conversation/member.rb +0 -134
- data/lib/vonage/conversation/user/conversations_list_response.rb +0 -11
- data/lib/vonage/conversation/user/sessions_list_response.rb +0 -11
- data/lib/vonage/conversation/user.rb +0 -67
- data/lib/vonage/conversation.rb +0 -164
- data/lib/vonage/meetings/applications.rb +0 -28
- data/lib/vonage/meetings/dial_in_numbers/list_response.rb +0 -11
- data/lib/vonage/meetings/dial_in_numbers.rb +0 -26
- data/lib/vonage/meetings/recordings.rb +0 -42
- data/lib/vonage/meetings/rooms/list_response.rb +0 -11
- data/lib/vonage/meetings/rooms.rb +0 -167
- data/lib/vonage/meetings/sessions/list_response.rb +0 -11
- data/lib/vonage/meetings/sessions.rb +0 -31
- data/lib/vonage/meetings/themes/list_response.rb +0 -11
- data/lib/vonage/meetings/themes.rb +0 -239
- data/lib/vonage/meetings.rb +0 -50
- data/lib/vonage/messaging/channels/rcs.rb +0 -42
- data/lib/vonage/network_authentication/client_authentication.rb +0 -39
- data/lib/vonage/network_authentication/server_authentication.rb +0 -47
- data/lib/vonage/network_authentication.rb +0 -22
- data/lib/vonage/network_number_verification.rb +0 -92
- data/lib/vonage/network_sim_swap.rb +0 -84
- data/lib/vonage/number_insight_2.rb +0 -36
- data/lib/vonage/proactive_connect/events/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/events.rb +0 -71
- data/lib/vonage/proactive_connect/item.rb +0 -116
- data/lib/vonage/proactive_connect/items/file_response.rb +0 -32
- data/lib/vonage/proactive_connect/items/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/items.rb +0 -116
- data/lib/vonage/proactive_connect/list.rb +0 -186
- data/lib/vonage/proactive_connect/lists/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/lists.rb +0 -38
- data/lib/vonage/proactive_connect.rb +0 -43
- data/lib/vonage/subaccounts/balance_transfers/list_response.rb +0 -11
- data/lib/vonage/subaccounts/credit_transfers/list_response.rb +0 -11
- data/lib/vonage/subaccounts/list_response.rb +0 -15
- data/lib/vonage/subaccounts.rb +0 -203
- data/lib/vonage/users/list_response.rb +0 -11
- data/lib/vonage/users.rb +0 -156
- data/lib/vonage/verify2/channels/email.rb +0 -36
- data/lib/vonage/verify2/channels/silent_auth.rb +0 -45
- data/lib/vonage/verify2/channels/sms.rb +0 -63
- data/lib/vonage/verify2/channels/voice.rb +0 -32
- data/lib/vonage/verify2/channels/whats_app.rb +0 -39
- data/lib/vonage/verify2/channels/whats_app_interactive.rb +0 -32
- data/lib/vonage/verify2/start_verification_options.rb +0 -63
- data/lib/vonage/verify2/workflow.rb +0 -39
- data/lib/vonage/verify2/workflow_builder.rb +0 -25
- data/lib/vonage/verify2.rb +0 -100
- data/lib/vonage/video/archives/list_response.rb +0 -11
- data/lib/vonage/video/broadcasts/list_response.rb +0 -11
- data/lib/vonage/video/broadcasts.rb +0 -75
- data/lib/vonage/video/captions.rb +0 -67
- data/lib/vonage/video/renders/list_response.rb +0 -11
- data/lib/vonage/video/renders.rb +0 -107
- data/lib/vonage/video/sip.rb +0 -48
- data/lib/vonage/video/streams/list_response.rb +0 -11
- data/lib/vonage/video/web_socket.rb +0 -61
@@ -1,39 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Verify2::Workflow
|
6
|
-
CHANNELS = {
|
7
|
-
sms: Verify2::Channels::SMS,
|
8
|
-
whatsapp: Verify2::Channels::WhatsApp,
|
9
|
-
whatsapp_interactive: Verify2::Channels::WhatsAppInteractive,
|
10
|
-
voice: Verify2::Channels::Voice,
|
11
|
-
email: Verify2::Channels::Email,
|
12
|
-
silent_auth: Verify2::Channels::SilentAuth
|
13
|
-
}
|
14
|
-
|
15
|
-
CHANNELS.keys.each do |method|
|
16
|
-
define_method method do |attributes|
|
17
|
-
CHANNELS[method].new(**attributes)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.method_missing(method)
|
22
|
-
raise ClientError.new("Workflow channel must be one of the valid options. Please refer to https://developer.vonage.com/en/api/verify.v2#newRequest for a complete list.")
|
23
|
-
end
|
24
|
-
|
25
|
-
attr_reader :list
|
26
|
-
|
27
|
-
def initialize
|
28
|
-
@list = []
|
29
|
-
end
|
30
|
-
|
31
|
-
def <<(workflow)
|
32
|
-
list << workflow
|
33
|
-
end
|
34
|
-
|
35
|
-
def hashified_list
|
36
|
-
list.map(&:to_h)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Verify2::WorkflowBuilder
|
6
|
-
|
7
|
-
def self.build
|
8
|
-
builder = self.new
|
9
|
-
yield builder if block_given?
|
10
|
-
builder.workflow
|
11
|
-
end
|
12
|
-
|
13
|
-
attr_reader :workflow
|
14
|
-
|
15
|
-
def initialize
|
16
|
-
@workflow = Vonage::Verify2::Workflow.new
|
17
|
-
end
|
18
|
-
|
19
|
-
Vonage::Verify2::Workflow::CHANNELS.keys.each do |channel|
|
20
|
-
define_method "add_#{channel.to_s}" do |args|
|
21
|
-
workflow << workflow.send(channel, **args)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/vonage/verify2.rb
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Verify2 < Namespace
|
6
|
-
self.authentication = BearerToken
|
7
|
-
|
8
|
-
self.request_body = JSON
|
9
|
-
|
10
|
-
# Request a verification be sent to a user.
|
11
|
-
#
|
12
|
-
# @example
|
13
|
-
# verification_request = client.verify2.start_verification(
|
14
|
-
# brand: 'Acme',
|
15
|
-
# workflow: [{channel: 'sms', to: '447000000000'}],
|
16
|
-
# code_length: 6
|
17
|
-
# )
|
18
|
-
#
|
19
|
-
# @param [required, String] :brand The brand that is sending the verification request
|
20
|
-
# - Must be between 1 and 16 characters in length
|
21
|
-
#
|
22
|
-
# @param [required, Array<Hash>] :workflow An array of hashes for channels in the workflow
|
23
|
-
#
|
24
|
-
# @param [optional, Hash] opts the options for the verification request.
|
25
|
-
# @option opts [Integer] :code_length The length of the one-time code provided to the end-user
|
26
|
-
# @option opts [String] :code An optional alphanumeric custom code to use instead of an auto-generated code
|
27
|
-
# @option opts [String] :locale The language to use for the verification message (where applicable)
|
28
|
-
# @option opts [Integer] :channel_timeout Wait time in seconds before trying the next channel in the workflow
|
29
|
-
# @option opts [String] :client_ref Reference to be included in callbacks
|
30
|
-
# @option opts [Boolean] If used, must be set to `false`. Will bypass a network block for a single Verify V2 request
|
31
|
-
#
|
32
|
-
# @return Vonage::Response
|
33
|
-
# @see https://developer.vonage.com/en/api/verify.v2#newRequest
|
34
|
-
#
|
35
|
-
def start_verification(brand:, workflow:, **opts)
|
36
|
-
raise ArgumentError, ':brand must be a String' unless brand.is_a?(String)
|
37
|
-
raise ArgumentError, "Invalid 'brand' value #{brand}. Length must be between 1 and 16 characters." unless brand.length.between?(1, 16)
|
38
|
-
raise ArgumentError, ':workflow must be an Array' unless workflow.is_a?(Array)
|
39
|
-
raise ArgumentError, ':workflow must not be empty' if workflow.empty?
|
40
|
-
|
41
|
-
request('/v2/verify/', params: opts.merge(brand: brand, workflow: workflow), type: Post)
|
42
|
-
end
|
43
|
-
|
44
|
-
# Check a supplied code against a request to see if it is valid.
|
45
|
-
#
|
46
|
-
# @example
|
47
|
-
# code_check = client.verify2.check_code(request_id: '7e8c5965-0a3f-44df-8a14-f1486209d8a2', code: '1234')
|
48
|
-
#
|
49
|
-
# @param [required, String] :request_id The request_id of the verification request being checked
|
50
|
-
#
|
51
|
-
# @param [required, String] :code The code supplied to the end-user by the verification request
|
52
|
-
#
|
53
|
-
# @see https://developer.vonage.com/en/api/verify.v2#checkCode
|
54
|
-
#
|
55
|
-
def check_code(request_id:, code:)
|
56
|
-
request('/v2/verify/' + request_id, params: {code: code}, type: Post)
|
57
|
-
end
|
58
|
-
|
59
|
-
# Cancel a verifiction. If a verification request is still active, calling this method aborts the workflow.
|
60
|
-
#
|
61
|
-
# @example
|
62
|
-
# client.verify2.cancel_verification_request(request_id: '7e8c5965-0a3f-44df-8a14-f1486209d8a2')
|
63
|
-
#
|
64
|
-
# @param [required, String] :request_id The request_id of the verification request to be cancelled
|
65
|
-
#
|
66
|
-
# @see https://developer.vonage.com/en/api/verify.v2#cancelRequest
|
67
|
-
#
|
68
|
-
def cancel_verification_request(request_id:)
|
69
|
-
request('/v2/verify/' + request_id, type: Delete)
|
70
|
-
end
|
71
|
-
|
72
|
-
def next_workflow(request_id:)
|
73
|
-
request('/v2/verify/' + request_id + '/next-workflow', type: Post)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Instantiate a new Vonage::Verify2::StartVerificationOptions object
|
77
|
-
#
|
78
|
-
# @param [optional, Hash] opts the options for the verification request.
|
79
|
-
# @option opts [Integer] :code_length The length of the one-time code provided to the end-user
|
80
|
-
# @option opts [String] :code An optional alphanumeric custom code to use instead of an auto-generated code
|
81
|
-
# @option opts [String] :locale The language to use for the verification message (where applicable)
|
82
|
-
# @option opts [Integer] :channel_timeout Wait time in seconds before trying the next channel in the workflow
|
83
|
-
# @option opts [String] :client_ref Reference to be included in callbacks
|
84
|
-
# @option opts [Boolean] If used, must be set to `false`. Will bypass a network block for a single Verify V2 request
|
85
|
-
#
|
86
|
-
def start_verification_options(**opts)
|
87
|
-
StartVerificationOptions.new(**opts)
|
88
|
-
end
|
89
|
-
|
90
|
-
# Instantiate a new Vonage::Verify2::Workflow object
|
91
|
-
def workflow
|
92
|
-
Workflow.new
|
93
|
-
end
|
94
|
-
|
95
|
-
# Return the Vonage::Verify2::WorkflowBuilder class
|
96
|
-
def workflow_builder
|
97
|
-
WorkflowBuilder.itself
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Video::Broadcasts < Namespace
|
6
|
-
include Keys
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.request_body = JSON
|
11
|
-
|
12
|
-
self.host = :video_host
|
13
|
-
|
14
|
-
# Get a list of live streaming broadcasts for a specified Vonage application.
|
15
|
-
#
|
16
|
-
def list(**params)
|
17
|
-
path = '/v2/project/' + @config.application_id + '/broadcast'
|
18
|
-
path += "?#{Params.encode(camelcase(params))}" unless params.empty?
|
19
|
-
|
20
|
-
request(path, response_class: ListResponse)
|
21
|
-
end
|
22
|
-
|
23
|
-
# Return information for specified broadcast.
|
24
|
-
#
|
25
|
-
def info(broadcast_id:)
|
26
|
-
request('/v2/project/' + @config.application_id + '/broadcast/' + broadcast_id)
|
27
|
-
end
|
28
|
-
|
29
|
-
# Start a new live streaming broadcast.
|
30
|
-
#
|
31
|
-
def start(session_id:, **params)
|
32
|
-
request(
|
33
|
-
'/v2/project/' + @config.application_id + '/broadcast',
|
34
|
-
params: camelcase(params.merge(session_id: session_id)),
|
35
|
-
type: Post
|
36
|
-
)
|
37
|
-
end
|
38
|
-
|
39
|
-
# Stop a specified broadcast.
|
40
|
-
#
|
41
|
-
def stop(broadcast_id:)
|
42
|
-
request('/v2/project/' + @config.application_id + '/broadcast/' + broadcast_id + '/stop', type: Post)
|
43
|
-
end
|
44
|
-
|
45
|
-
# Add a stream to a live streaming broadcast.
|
46
|
-
#
|
47
|
-
|
48
|
-
def add_stream(broadcast_id:, stream_id:, **params)
|
49
|
-
request(
|
50
|
-
'/v2/project/' + @config.application_id + '/broadcast/' + broadcast_id + '/streams',
|
51
|
-
params: camelcase(params.merge(addStream: stream_id)),
|
52
|
-
type: Patch
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
# Remove a stream from a live streaming broadcast.
|
57
|
-
#
|
58
|
-
def remove_stream(broadcast_id:, stream_id:)
|
59
|
-
request(
|
60
|
-
'/v2/project/' + @config.application_id + '/broadcast/' + broadcast_id + '/streams',
|
61
|
-
params: {removeStream: stream_id},
|
62
|
-
type: Patch
|
63
|
-
)
|
64
|
-
end
|
65
|
-
|
66
|
-
# Dynamically change layout of a broadcast.
|
67
|
-
#
|
68
|
-
def change_layout(broadcast_id:, **params)
|
69
|
-
request(
|
70
|
-
'/v2/project/' + @config.application_id + '/broadcast/' + broadcast_id + '/layout',
|
71
|
-
params: camelcase(params),
|
72
|
-
type: Put)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Video::Captions < Namespace
|
6
|
-
include Keys
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.request_body = JSON
|
11
|
-
|
12
|
-
self.host = :video_host
|
13
|
-
|
14
|
-
# Start Live Captions for a Vonage Video stream
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# response = client.video.captions.start(
|
18
|
-
# session_id: "12312312-3811-4726-b508-e41a0f96c68f",
|
19
|
-
# token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp...",
|
20
|
-
# language_code: 'en-US',
|
21
|
-
# max_duration: 300,
|
22
|
-
# partial_captions: false,
|
23
|
-
# status_callback_url: 'https://example.com/captions/status'
|
24
|
-
# )
|
25
|
-
#
|
26
|
-
# @params [required, String] :session_id The id of the session to start captions for
|
27
|
-
#
|
28
|
-
# @param [required, String] :token A valid Vonage Video token with role set to 'moderator'
|
29
|
-
#
|
30
|
-
# @params [optional, String] :language_code The BCP-47 code for a spoken language used on this call. The default value is "en-US"
|
31
|
-
# - Must be one of: 'en-US', 'en-AU', 'en-GB', 'zh-CN', 'fr-FR', 'fr-CA', 'de-DE', 'hi-IN', 'it-IT', 'ja-JP', 'ko-KR', 'pt-BR', 'th-TH'
|
32
|
-
#
|
33
|
-
# @param [optional, Integer] :max_duration The maximum duration for the audio captioning, in seconds.
|
34
|
-
# - The default value is 14,400 seconds (4 hours), the maximum duration allowed.
|
35
|
-
# - The minimum value for maxDuration is 300 (300 seconds, or 5 minutes).
|
36
|
-
#
|
37
|
-
# @param [optional, Boolean] :partial_captions Whether to enable this to faster captioning (true, the default) at the cost of some degree of inaccuracies.
|
38
|
-
#
|
39
|
-
# @param [optional, String] :status_callback_url The URL to send the status of the captions to.
|
40
|
-
#
|
41
|
-
# @return [Response]
|
42
|
-
#
|
43
|
-
# @see TODO: Add document link here
|
44
|
-
#
|
45
|
-
def start(session_id:, token:, **params)
|
46
|
-
request(
|
47
|
-
'/v2/project/' + @config.application_id + '/captions',
|
48
|
-
params: camelcase(params.merge({sessionId: session_id, token: token})),
|
49
|
-
type: Post)
|
50
|
-
end
|
51
|
-
|
52
|
-
# Stop live captions for a session
|
53
|
-
#
|
54
|
-
# @example
|
55
|
-
# response = client.video.captions.stop(captions_id: "7c0580fc-6274-4de5-a66f-d0648e8d3ac3")
|
56
|
-
#
|
57
|
-
# @params [required, String] :captions_id ID of the connection used for captions
|
58
|
-
#
|
59
|
-
# @return [Response]
|
60
|
-
#
|
61
|
-
# @see TODO: Add document link here
|
62
|
-
#
|
63
|
-
def stop(captions_id:)
|
64
|
-
request('/v2/project/' + @config.application_id + '/captions/' + captions_id + '/stop', type: Post)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
data/lib/vonage/video/renders.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Video::Renders < Namespace
|
6
|
-
include Keys
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.request_body = JSON
|
11
|
-
|
12
|
-
self.host = :video_host
|
13
|
-
|
14
|
-
# Start an Experience Composer Render
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# response = client.video.renders.start(
|
18
|
-
# session_id: "12312312-3811-4726-b508-e41a0f96c68f",
|
19
|
-
# token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp...",
|
20
|
-
# url: 'https://example.com/',
|
21
|
-
# max_duration: 1800,
|
22
|
-
# resolution: '1280x720',
|
23
|
-
# properties: {
|
24
|
-
# name: 'foo'
|
25
|
-
# }
|
26
|
-
# )
|
27
|
-
#
|
28
|
-
# @params [required, String] :session_id The session ID of the Vonage Video session you are working with.
|
29
|
-
#
|
30
|
-
# @param [required, String] :token A valid OpenTok JWT token with a Publisher role and (optionally) connection data to be associated with the output stream.
|
31
|
-
#
|
32
|
-
# @params [required, String] :url A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention.
|
33
|
-
#
|
34
|
-
# @params [optional, Integer] :max_duration The maximum duration of the rendered video in seconds.
|
35
|
-
# - After this time, it is stopped automatically, if it is still running.
|
36
|
-
# - Min: 60
|
37
|
-
# - Max: 3600
|
38
|
-
# - Default: 3600
|
39
|
-
#
|
40
|
-
# @params [optional, String] :resolution The resolution of the Experience Composer render.
|
41
|
-
# - Must be one of: '640x480', '480x640', '1280x720', '720x1280', '1080x1920', '1920x1080'
|
42
|
-
#
|
43
|
-
# @params [optional, Hash] :properties The initial configuration of Publisher properties for the composed output stream.
|
44
|
-
# @option properties [required, String] :name The name of the composed output stream which is published to the session.
|
45
|
-
#
|
46
|
-
# @return [Response]
|
47
|
-
#
|
48
|
-
# @see TODO: Add document link here
|
49
|
-
#
|
50
|
-
def start(session_id:, token:, url:, **params)
|
51
|
-
request(
|
52
|
-
'/v2/project/' + @config.application_id + '/render',
|
53
|
-
params: camelcase(params.merge({sessionId: session_id, token: token, url: url})),
|
54
|
-
type: Post)
|
55
|
-
end
|
56
|
-
|
57
|
-
# Stop an Experience Composer render
|
58
|
-
#
|
59
|
-
# @example
|
60
|
-
# response = client.video.renders.stop(experience_composer_id: "1248e7070b81464c9789f46ad10e7764")
|
61
|
-
#
|
62
|
-
# @params [required, String] :experience_composer_id ID of the Experience Composer instance that you want to stop.
|
63
|
-
#
|
64
|
-
# @return [Response]
|
65
|
-
#
|
66
|
-
# @see TODO: Add document link here
|
67
|
-
#
|
68
|
-
def stop(experience_composer_id:)
|
69
|
-
request('/v2/project/' + @config.application_id + '/render/' + experience_composer_id, type: Delete)
|
70
|
-
end
|
71
|
-
|
72
|
-
# Get information about an Experience Composer session
|
73
|
-
#
|
74
|
-
# @example
|
75
|
-
# response = client.video.renders.info(experience_composer_id: "1248e7070b81464c9789f46ad10e7764")
|
76
|
-
#
|
77
|
-
# @params [required, String] :experience_composer_id ID of the Experience Composer instance for which you are requesitng information.
|
78
|
-
#
|
79
|
-
# @return [Response]
|
80
|
-
#
|
81
|
-
# @see TODO: Add document link here
|
82
|
-
#
|
83
|
-
def info(experience_composer_id:)
|
84
|
-
request('/v2/project/' + @config.application_id + '/render/' + experience_composer_id)
|
85
|
-
end
|
86
|
-
|
87
|
-
# List all Experience Composer renders in an application
|
88
|
-
#
|
89
|
-
# @example
|
90
|
-
# response = client.video.renders.list
|
91
|
-
#
|
92
|
-
# @params [optional, Integer] :offset Specify the index offset of the first experience composer. 0 is offset of the most recently started render.
|
93
|
-
#
|
94
|
-
# @params [optional, Integer] :count Limit the number of experience composers to be returned.
|
95
|
-
#
|
96
|
-
# @return [Video::Renders::ListResponse]
|
97
|
-
#
|
98
|
-
# @see TODO: Add document link here
|
99
|
-
#
|
100
|
-
def list(**params)
|
101
|
-
path = '/v2/project/' + @config.application_id + '/render'
|
102
|
-
path += "?#{Params.encode(camelcase(params))}" unless params.empty?
|
103
|
-
|
104
|
-
request(path, response_class: ListResponse)
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
data/lib/vonage/video/sip.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Video::SIP < Namespace
|
6
|
-
include Keys
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.request_body = JSON
|
11
|
-
|
12
|
-
self.host = :video_host
|
13
|
-
|
14
|
-
# Initiate an outbound SIP call.
|
15
|
-
#
|
16
|
-
def dial(session_id:, token:, sip_uri:, **params)
|
17
|
-
request(
|
18
|
-
'/v2/project/' + @config.application_id + '/dial',
|
19
|
-
params: camelcase({
|
20
|
-
session_id: session_id,
|
21
|
-
token: token,
|
22
|
-
sip: params.merge({uri: sip_uri})
|
23
|
-
}),
|
24
|
-
type: Post
|
25
|
-
)
|
26
|
-
end
|
27
|
-
|
28
|
-
# Play DTMF tones into a SIP call.
|
29
|
-
#
|
30
|
-
def play_dtmf_to_session(session_id:, dtmf_digits:)
|
31
|
-
request(
|
32
|
-
'/v2/project/' + @config.application_id + '/session/' + session_id + '/play-dtmf',
|
33
|
-
params: {digits: dtmf_digits},
|
34
|
-
type: Post
|
35
|
-
)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Play DMTF tones into a specific connection.
|
39
|
-
#
|
40
|
-
def play_dtmf_to_connection(session_id:, connection_id:, dtmf_digits:)
|
41
|
-
request(
|
42
|
-
'/v2/project/' + @config.application_id + '/session/' + session_id + '/connection/' + connection_id + '/play-dtmf',
|
43
|
-
params: {digits: dtmf_digits},
|
44
|
-
type: Post
|
45
|
-
)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class Video::WebSocket < Namespace
|
6
|
-
include Keys
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.request_body = JSON
|
11
|
-
|
12
|
-
self.host = :video_host
|
13
|
-
|
14
|
-
# Start an audio connector websocket connection
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# response = client.video.web_socket.connect(
|
18
|
-
# session_id: "12312312-3811-4726-b508-e41a0f96c68f",
|
19
|
-
# token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp...",
|
20
|
-
# websocket: {
|
21
|
-
# uri: 'wss://example.com/ws-endpoint',
|
22
|
-
# streams: ["8b732909-0a06-46a2-8ea8-074e64d43422"],
|
23
|
-
# headers: { property1: 'foo', property2: 'bar' },
|
24
|
-
# audio_rate: 16000
|
25
|
-
# }
|
26
|
-
# )
|
27
|
-
#
|
28
|
-
# @params [required, String] :session_id The Vonage Video session ID that includes the Vonage Video streams you want to include in the WebSocket stream.
|
29
|
-
# - The Audio Connector feature is only supported in routed sessions
|
30
|
-
#
|
31
|
-
# @param [required, String] :token A valid Vonage Video token for the Audio Connector connection to the Vonage Video Session.
|
32
|
-
# - You can add additional data to the JWT to identify that the connection is the Audio Connector endpoint or for any other identifying data.
|
33
|
-
#
|
34
|
-
# @params [required, Hash] :websocket The WebSocket configuration for the Audio Connector connection.
|
35
|
-
# @option websocket [required, String] :uri A publicly reachable WebSocket URI to be used for the destination of the audio stream
|
36
|
-
# @option websocket [optional, String] :streams An array of stream IDs for the Vonage Video streams you want to include in the WebSocket audio.
|
37
|
-
# - If you omit this property, all streams in the session will be included.
|
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
|
-
# @option websocket [optional, Integer] :audio_rate A number representing the audio sampling rate in Hz
|
40
|
-
# - Must be one of: 8000, 16000
|
41
|
-
#
|
42
|
-
# @return [Response]
|
43
|
-
#
|
44
|
-
# @see TODO: Add document link here
|
45
|
-
#
|
46
|
-
def connect(session_id:, token:, websocket:)
|
47
|
-
raise ArgumentError, 'websocket must be a Hash' unless websocket.is_a?(Hash)
|
48
|
-
raise ArgumentError, 'websocket must contain a uri' unless websocket.key?(:uri)
|
49
|
-
|
50
|
-
request(
|
51
|
-
'/v2/project/' + @config.application_id + '/connect',
|
52
|
-
params: {
|
53
|
-
sessionId: session_id,
|
54
|
-
token: token,
|
55
|
-
websocket: camelcase(websocket)
|
56
|
-
},
|
57
|
-
type: Post
|
58
|
-
)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|