vonage 7.16.1 → 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 +1 -170
- data/lib/vonage/client.rb +4 -32
- data/lib/vonage/client_error.rb +1 -1
- data/lib/vonage/config.rb +3 -7
- data/lib/vonage/errors.rb +20 -37
- data/lib/vonage/gsm7.rb +1 -1
- data/lib/vonage/keys.rb +7 -1
- 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/namespace.rb +58 -128
- data/lib/vonage/numbers.rb +6 -29
- data/lib/vonage/server_error.rb +1 -1
- data/lib/vonage/signature.rb +1 -1
- data/lib/vonage/sms.rb +20 -0
- data/lib/vonage/version.rb +1 -1
- data/lib/vonage/video/archives.rb +187 -0
- data/lib/vonage/video/list_response.rb +11 -0
- data/lib/vonage/video/moderation.rb +73 -0
- data/lib/vonage/video/signals.rb +55 -0
- data/lib/vonage/video/streams.rb +76 -0
- data/lib/vonage/video.rb +91 -0
- data/lib/vonage/voice/actions/connect.rb +3 -27
- data/lib/vonage/voice/actions/pay.rb +107 -0
- data/lib/vonage/voice/actions/talk.rb +2 -11
- data/lib/vonage/voice/talk.rb +1 -11
- data/lib/vonage/voice.rb +0 -11
- data/lib/vonage.rb +0 -1
- data/vonage.gemspec +1 -2
- metadata +14 -59
- data/lib/vonage/api_error.rb +0 -33
- data/lib/vonage/meetings/applications.rb +0 -25
- data/lib/vonage/meetings/dial_in_numbers/list_response.rb +0 -11
- data/lib/vonage/meetings/dial_in_numbers.rb +0 -23
- data/lib/vonage/meetings/recordings.rb +0 -36
- data/lib/vonage/meetings/rooms/list_response.rb +0 -11
- data/lib/vonage/meetings/rooms.rb +0 -155
- data/lib/vonage/meetings/sessions/list_response.rb +0 -11
- data/lib/vonage/meetings/sessions.rb +0 -28
- data/lib/vonage/meetings/themes/list_response.rb +0 -11
- data/lib/vonage/meetings/themes.rb +0 -218
- data/lib/vonage/meetings.rb +0 -38
- data/lib/vonage/proactive_connect/events/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/events.rb +0 -68
- data/lib/vonage/proactive_connect/item.rb +0 -104
- 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 -107
- data/lib/vonage/proactive_connect/list.rb +0 -168
- data/lib/vonage/proactive_connect/lists/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/lists.rb +0 -35
- data/lib/vonage/proactive_connect.rb +0 -33
- 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 -38
- data/lib/vonage/verify2/channels/silent_auth.rb +0 -32
- data/lib/vonage/verify2/channels/sms.rb +0 -39
- data/lib/vonage/verify2/channels/voice.rb +0 -32
- data/lib/vonage/verify2/channels/whats_app.rb +0 -38
- data/lib/vonage/verify2/channels/whats_app_interactive.rb +0 -32
- data/lib/vonage/verify2/start_verification_options.rb +0 -71
- data/lib/vonage/verify2/workflow.rb +0 -39
- data/lib/vonage/verify2/workflow_builder.rb +0 -25
- data/lib/vonage/verify2.rb +0 -93
data/lib/vonage/namespace.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# typed: true
|
2
2
|
# frozen_string_literal: true
|
3
|
-
|
4
3
|
require 'net/http'
|
5
|
-
require 'net/http/post/multipart'
|
6
4
|
require 'json'
|
7
5
|
|
8
6
|
module Vonage
|
@@ -23,7 +21,7 @@ module Vonage
|
|
23
21
|
end
|
24
22
|
|
25
23
|
def self.host=(host)
|
26
|
-
raise ArgumentError unless
|
24
|
+
raise ArgumentError unless host == :rest_host || host == :video_host
|
27
25
|
|
28
26
|
@host = host
|
29
27
|
end
|
@@ -49,7 +47,6 @@ module Vonage
|
|
49
47
|
end
|
50
48
|
|
51
49
|
protected
|
52
|
-
|
53
50
|
# :nocov:
|
54
51
|
|
55
52
|
Get = Net::HTTP::Get
|
@@ -62,7 +59,7 @@ module Vonage
|
|
62
59
|
authentication = self.class.authentication.new(@config)
|
63
60
|
authentication.update(params)
|
64
61
|
|
65
|
-
uri = URI(
|
62
|
+
uri = URI('https://' + @host + path)
|
66
63
|
unless type.const_get(:REQUEST_HAS_BODY) || params.empty?
|
67
64
|
uri.query = Params.encode(params)
|
68
65
|
end
|
@@ -74,20 +71,17 @@ module Vonage
|
|
74
71
|
request = type.new(uri)
|
75
72
|
|
76
73
|
# set headers
|
77
|
-
request[
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
self.class.request_headers.each { |key, value| request[key] = value }
|
74
|
+
request['User-Agent'] = UserAgent.string(@config.app_name, @config.app_version)
|
75
|
+
request['Accept'] = 'application/json'
|
76
|
+
self.class.request_headers.each do |key, value|
|
77
|
+
request[key] = value
|
78
|
+
end
|
83
79
|
|
84
80
|
# Set BearerToken if needed
|
85
81
|
authentication.update(request)
|
86
82
|
|
87
83
|
# set body
|
88
|
-
if type.const_get(:REQUEST_HAS_BODY)
|
89
|
-
self.class.request_body.update(request, params)
|
90
|
-
end
|
84
|
+
self.class.request_body.update(request, params) if type.const_get(:REQUEST_HAS_BODY)
|
91
85
|
|
92
86
|
request
|
93
87
|
end
|
@@ -107,31 +101,16 @@ module Vonage
|
|
107
101
|
end
|
108
102
|
|
109
103
|
def request(path, params: nil, type: Get, response_class: Response, &block)
|
110
|
-
auto_advance =
|
111
|
-
|
112
|
-
|
113
|
-
params[:auto_advance]
|
114
|
-
else
|
115
|
-
false
|
116
|
-
end
|
117
|
-
)
|
118
|
-
|
119
|
-
params =
|
120
|
-
params.tap { |params| params.delete(:auto_advance) } if !params.nil? &&
|
121
|
-
params.key?(:auto_advance)
|
104
|
+
auto_advance = !params.nil? && params.key?(:auto_advance) ? params[:auto_advance] : false
|
105
|
+
|
106
|
+
params = params.tap { |params| params.delete(:auto_advance) } if !params.nil? && params.key?(:auto_advance)
|
122
107
|
|
123
108
|
request = build_request(path: path, params: params || {}, type: type)
|
124
109
|
|
125
110
|
response = make_request!(request, &block)
|
126
111
|
|
127
112
|
if auto_advance
|
128
|
-
iterable_request(
|
129
|
-
path,
|
130
|
-
response: response,
|
131
|
-
response_class: response_class,
|
132
|
-
params: params,
|
133
|
-
&block
|
134
|
-
)
|
113
|
+
iterable_request(path, response: response, response_class: response_class, params: params, &block)
|
135
114
|
else
|
136
115
|
return if block
|
137
116
|
|
@@ -139,59 +118,22 @@ module Vonage
|
|
139
118
|
end
|
140
119
|
end
|
141
120
|
|
142
|
-
def multipart_post_request(path, filepath:, file_name:, mime_type:, params: {}, override_uri: nil, no_auth: false, response_class: Response, &block)
|
143
|
-
authentication = self.class.authentication.new(@config) unless no_auth
|
144
|
-
|
145
|
-
uri = override_uri ? URI(override_uri) : URI('https://' + @host + path)
|
146
|
-
|
147
|
-
http = override_uri ? Net::HTTP.new(uri.host, Net::HTTP.https_default_port, p_addr = nil) : @http
|
148
|
-
http.use_ssl = true
|
149
|
-
http.set_debug_output($stdout)
|
150
|
-
|
151
|
-
response = File.open(filepath) do |file|
|
152
|
-
request = Net::HTTP::Post::Multipart.new(
|
153
|
-
uri,
|
154
|
-
params.merge(file: Multipart::Post::UploadIO.new(file, mime_type, file_name))
|
155
|
-
)
|
156
|
-
|
157
|
-
request['User-Agent'] = UserAgent.string(@config.app_name, @config.app_version)
|
158
|
-
|
159
|
-
# Set BearerToken if needed
|
160
|
-
authentication.update(request) unless no_auth
|
161
|
-
|
162
|
-
logger.log_request_info(request)
|
163
|
-
|
164
|
-
http.request(request, &block)
|
165
|
-
end
|
166
|
-
|
167
|
-
logger.log_response_info(response, @host)
|
168
|
-
|
169
|
-
return if block
|
170
|
-
|
171
|
-
logger.debug(response.body) if response.body
|
172
|
-
|
173
|
-
parse(response, response_class)
|
174
|
-
end
|
175
|
-
|
176
121
|
def iterable_request(path, response: nil, response_class: nil, params: {}, &block)
|
177
122
|
json_response = ::JSON.parse(response.body)
|
178
123
|
response = parse(response, response_class)
|
179
124
|
remainder = remaining_count(json_response)
|
180
125
|
|
181
126
|
while remainder > 0
|
182
|
-
params = { page_size: json_response[
|
183
|
-
|
184
|
-
if json_response[
|
185
|
-
params[:record_index] = json_response[
|
186
|
-
elsif json_response[
|
187
|
-
|
188
|
-
params[:record_index] = (
|
189
|
-
json_response["record_index"] + json_response["page_size"]
|
190
|
-
)
|
127
|
+
params = { page_size: json_response['page_size'] }
|
128
|
+
|
129
|
+
if json_response['record_index'] && json_response['record_index'] == 0
|
130
|
+
params[:record_index] = json_response['page_size']
|
131
|
+
elsif json_response['record_index'] && json_response['record_index'] != 0
|
132
|
+
params[:record_index] = (json_response['record_index'] + json_response['page_size'])
|
191
133
|
end
|
192
134
|
|
193
|
-
if json_response[
|
194
|
-
params[:page] = json_response[
|
135
|
+
if json_response['total_pages']
|
136
|
+
params[:page] = json_response['page'] + 1
|
195
137
|
end
|
196
138
|
|
197
139
|
request = build_request(path: path, type: Get, params: params)
|
@@ -202,15 +144,11 @@ module Vonage
|
|
202
144
|
json_response = ::JSON.parse(paginated_response.body)
|
203
145
|
remainder = remaining_count(json_response)
|
204
146
|
|
205
|
-
if response.respond_to?(
|
206
|
-
collection_name = collection_name(response[
|
207
|
-
response[
|
208
|
-
*next_response["_embedded"][collection_name]
|
209
|
-
)
|
147
|
+
if response.respond_to?('_embedded')
|
148
|
+
collection_name = collection_name(response['_embedded'])
|
149
|
+
response['_embedded'][collection_name].push(*next_response['_embedded'][collection_name])
|
210
150
|
else
|
211
|
-
response[collection_name(response)].push(
|
212
|
-
*next_response[collection_name(next_response)]
|
213
|
-
)
|
151
|
+
response[collection_name(response)].push(*next_response[collection_name(next_response)])
|
214
152
|
end
|
215
153
|
end
|
216
154
|
|
@@ -218,51 +156,43 @@ module Vonage
|
|
218
156
|
end
|
219
157
|
|
220
158
|
def remaining_count(params)
|
221
|
-
if params.key?(
|
222
|
-
params[
|
223
|
-
elsif params.key?(
|
224
|
-
params[
|
225
|
-
(
|
226
|
-
if params["record_index"] == 0
|
227
|
-
params["page_size"]
|
228
|
-
else
|
229
|
-
(params["record_index"] + params["page_size"])
|
230
|
-
end
|
231
|
-
)
|
159
|
+
if params.key?('total_pages')
|
160
|
+
params['total_pages'] - params['page']
|
161
|
+
elsif params.key?('count')
|
162
|
+
params['count'] - (params['record_index'] == 0 ? params['page_size'] : (params['record_index'] + params['page_size']))
|
232
163
|
else
|
233
164
|
0
|
234
165
|
end
|
235
166
|
end
|
236
167
|
|
237
168
|
def collection_name(params)
|
238
|
-
@collection_name ||=
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
"events"
|
169
|
+
@collection_name ||= case
|
170
|
+
when params.respond_to?('calls')
|
171
|
+
'calls'
|
172
|
+
when params.respond_to?('users')
|
173
|
+
'users'
|
174
|
+
when params.respond_to?('legs')
|
175
|
+
'legs'
|
176
|
+
when params.respond_to?('data')
|
177
|
+
'data'
|
178
|
+
when params.respond_to?('conversations')
|
179
|
+
'conversations'
|
180
|
+
when params.respond_to?('applications')
|
181
|
+
'applications'
|
182
|
+
when params.respond_to?('records')
|
183
|
+
'records'
|
184
|
+
when params.respond_to?('reports')
|
185
|
+
'reports'
|
186
|
+
when params.respond_to?('networks')
|
187
|
+
'networks'
|
188
|
+
when params.respond_to?('countries')
|
189
|
+
'countries'
|
190
|
+
when params.respond_to?('media')
|
191
|
+
'media'
|
192
|
+
when params.respond_to?('numbers')
|
193
|
+
'numbers'
|
194
|
+
when params.respond_to?('events')
|
195
|
+
'events'
|
266
196
|
else
|
267
197
|
params.entity.attributes.keys[0].to_s
|
268
198
|
end
|
@@ -273,7 +203,7 @@ module Vonage
|
|
273
203
|
when Net::HTTPNoContent
|
274
204
|
response_class.new(nil, response)
|
275
205
|
when Net::HTTPSuccess
|
276
|
-
if response['Content-Type']
|
206
|
+
if response['Content-Type'].split(';').first == 'application/json'
|
277
207
|
entity = ::JSON.parse(response.body, object_class: Vonage::Entity)
|
278
208
|
|
279
209
|
response_class.new(entity, response)
|
@@ -295,8 +225,8 @@ module Vonage
|
|
295
225
|
case self.class.host
|
296
226
|
when :rest_host
|
297
227
|
@config.rest_host
|
298
|
-
when :
|
299
|
-
@config.
|
228
|
+
when :video_host
|
229
|
+
@config.video_host
|
300
230
|
else
|
301
231
|
@config.api_host
|
302
232
|
end
|
data/lib/vonage/numbers.rb
CHANGED
@@ -5,8 +5,6 @@ module Vonage
|
|
5
5
|
class Numbers < Namespace
|
6
6
|
include Keys
|
7
7
|
|
8
|
-
self.authentication = Basic
|
9
|
-
|
10
8
|
self.host = :rest_host
|
11
9
|
|
12
10
|
# Retrieve all the inbound numbers associated with your Vonage account.
|
@@ -54,7 +52,7 @@ module Vonage
|
|
54
52
|
# @see https://developer.nexmo.com/api/developer/numbers#getOwnedNumbers
|
55
53
|
#
|
56
54
|
def list(params = nil)
|
57
|
-
request(
|
55
|
+
request('/account/numbers', params: params, response_class: ListResponse)
|
58
56
|
end
|
59
57
|
|
60
58
|
# Retrieve inbound numbers that are available for the specified country.
|
@@ -102,7 +100,7 @@ module Vonage
|
|
102
100
|
# @see https://developer.nexmo.com/api/developer/numbers#getAvailableNumbers
|
103
101
|
#
|
104
102
|
def search(params)
|
105
|
-
request(
|
103
|
+
request('/number/search', params: params, response_class: ListResponse)
|
106
104
|
end
|
107
105
|
|
108
106
|
# Request to purchase a specific inbound number.
|
@@ -127,12 +125,7 @@ module Vonage
|
|
127
125
|
# @see https://developer.nexmo.com/api/developer/numbers#buyANumber
|
128
126
|
#
|
129
127
|
def buy(params)
|
130
|
-
request(
|
131
|
-
"/number/buy",
|
132
|
-
params: params,
|
133
|
-
type: Post,
|
134
|
-
response_class: Response
|
135
|
-
)
|
128
|
+
request('/number/buy', params: params, type: Post, response_class: Response)
|
136
129
|
end
|
137
130
|
|
138
131
|
# Cancel your subscription for a specific inbound number.
|
@@ -157,12 +150,7 @@ module Vonage
|
|
157
150
|
# @see https://developer.nexmo.com/api/developer/numbers#cancelANumber
|
158
151
|
#
|
159
152
|
def cancel(params)
|
160
|
-
request(
|
161
|
-
"/number/cancel",
|
162
|
-
params: params,
|
163
|
-
type: Post,
|
164
|
-
response_class: Response
|
165
|
-
)
|
153
|
+
request('/number/cancel', params: params, type: Post, response_class: Response)
|
166
154
|
end
|
167
155
|
|
168
156
|
# Change the behaviour of a number that you own.
|
@@ -210,25 +198,14 @@ module Vonage
|
|
210
198
|
# @see https://developer.nexmo.com/api/developer/numbers#updateANumber
|
211
199
|
#
|
212
200
|
def update(params)
|
213
|
-
request(
|
214
|
-
"/number/update",
|
215
|
-
params: camelcase(params),
|
216
|
-
type: Post,
|
217
|
-
response_class: Response
|
218
|
-
)
|
201
|
+
request('/number/update', params: camelcase(params), type: Post, response_class: Response)
|
219
202
|
end
|
220
203
|
|
221
204
|
private
|
222
205
|
|
223
206
|
# A specific implementation of iterable_request for Numbers, because the Numbers API
|
224
207
|
# handles pagination differently to other Vonage APIs
|
225
|
-
def iterable_request(
|
226
|
-
path,
|
227
|
-
response: nil,
|
228
|
-
response_class: nil,
|
229
|
-
params: {},
|
230
|
-
&block
|
231
|
-
)
|
208
|
+
def iterable_request(path, response: nil, response_class: nil, params: {}, &block)
|
232
209
|
response = parse(response, response_class)
|
233
210
|
params[:index] = 1 unless params.has_key?(:index)
|
234
211
|
size = params.fetch(:size, 10)
|
data/lib/vonage/server_error.rb
CHANGED
data/lib/vonage/signature.rb
CHANGED
data/lib/vonage/sms.rb
CHANGED
@@ -47,6 +47,14 @@ module Vonage
|
|
47
47
|
# @option params [String] :type
|
48
48
|
# The format of the message body.
|
49
49
|
#
|
50
|
+
# @option params [String] :vcard
|
51
|
+
# A business card in [vCard format](https://en.wikipedia.org/wiki/VCard).
|
52
|
+
# Depends on **:type** option having the value `vcard`.
|
53
|
+
#
|
54
|
+
# @option params [String] :vcal
|
55
|
+
# A calendar event in [vCal format](https://en.wikipedia.org/wiki/VCal).
|
56
|
+
# Depends on **:type** option having the value `vcal`.
|
57
|
+
#
|
50
58
|
# @option params [String] :body
|
51
59
|
# Hex encoded binary data.
|
52
60
|
# Depends on **:type** option having the value `binary`.
|
@@ -59,6 +67,18 @@ module Vonage
|
|
59
67
|
# The value of the [protocol identifier](https://en.wikipedia.org/wiki/GSM_03.40#Protocol_Identifier) to use.
|
60
68
|
# Ensure that the value is aligned with **:udh**.
|
61
69
|
#
|
70
|
+
# @option params [String] :title
|
71
|
+
# The title for a wappush SMS.
|
72
|
+
# Depends on **:type** option having the value `wappush`.
|
73
|
+
#
|
74
|
+
# @option params [String] :url
|
75
|
+
# The URL of your website.
|
76
|
+
# Depends on **:type** option having the value `wappush`.
|
77
|
+
#
|
78
|
+
# @option params [String] :validity
|
79
|
+
# The availability for an SMS in milliseconds.
|
80
|
+
# Depends on **:type** option having the value `wappush`.
|
81
|
+
#
|
62
82
|
# @option params [String] :client_ref
|
63
83
|
# You can optionally include your own reference of up to 40 characters.
|
64
84
|
#
|
data/lib/vonage/version.rb
CHANGED
@@ -0,0 +1,187 @@
|
|
1
|
+
# typed: true
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Vonage
|
5
|
+
class Video::Archives < 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 archives for a specified Vonage application.
|
15
|
+
#
|
16
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
17
|
+
#
|
18
|
+
# @param [optional, Integer] :offset
|
19
|
+
#
|
20
|
+
# @param [optional, Integer] :count
|
21
|
+
#
|
22
|
+
# @param [optional, String] :session_id
|
23
|
+
#
|
24
|
+
# TODO: add auto_advance option
|
25
|
+
#
|
26
|
+
# @return [ListResponse]
|
27
|
+
#
|
28
|
+
# @see TODO: add docs link
|
29
|
+
#
|
30
|
+
def list(application_id: @config.application_id, **params)
|
31
|
+
# TODO: raise error if application_id is nil
|
32
|
+
|
33
|
+
request('/v2/project/' + application_id + '/archive', params: params, response_class: Video::ListResponse)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Return information for specified archive.
|
37
|
+
#
|
38
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
39
|
+
#
|
40
|
+
# @param [required, String] archive_id
|
41
|
+
#
|
42
|
+
# @return [Response]
|
43
|
+
#
|
44
|
+
# @see TODO: add docs link
|
45
|
+
#
|
46
|
+
def info(application_id: @config.application_id, archive_id:)
|
47
|
+
# TODO: raise error if application_id is nil
|
48
|
+
|
49
|
+
request('/v2/project/' + application_id + '/archive/' + archive_id)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Create a new archive.
|
53
|
+
#
|
54
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
55
|
+
#
|
56
|
+
# @param [required, String] :session_id
|
57
|
+
#
|
58
|
+
# @param [optional, String] :hasAudio
|
59
|
+
#
|
60
|
+
# @param [optional, String] :hasVideo
|
61
|
+
#
|
62
|
+
# @param [optional, String] :name
|
63
|
+
#
|
64
|
+
# @param [optional, String] :outputMode
|
65
|
+
#
|
66
|
+
# @param [optional, String] :resolution
|
67
|
+
#
|
68
|
+
# @param [optional, String] :streamMode
|
69
|
+
#
|
70
|
+
# @param [optional, String] :multiArchiveTag
|
71
|
+
#
|
72
|
+
# @param [optional, Hash] :layout
|
73
|
+
#
|
74
|
+
# @option layout [optional, String] :type
|
75
|
+
#
|
76
|
+
# @option layout [optional, String] :stylesheet
|
77
|
+
#
|
78
|
+
# @option layout [optional, String] :screenshareType
|
79
|
+
#
|
80
|
+
# @return [Response]
|
81
|
+
#
|
82
|
+
# @see TODO: add docs link
|
83
|
+
#
|
84
|
+
def start(application_id: @config.application_id, **params)
|
85
|
+
# TODO: raise error if application_id is nil
|
86
|
+
# TODO: raise error if session_id is nil
|
87
|
+
|
88
|
+
request('/v2/project/' + application_id + '/archive', params: params, type: Post)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Stop recording a specified archive.
|
92
|
+
#
|
93
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
94
|
+
#
|
95
|
+
# @param [required, String] archive_id
|
96
|
+
#
|
97
|
+
# @return [Response]
|
98
|
+
#
|
99
|
+
# @see TODO: add docs link
|
100
|
+
#
|
101
|
+
def stop(application_id: @config.application_id, archive_id:)
|
102
|
+
# TODO: raise error if application_id is nil
|
103
|
+
|
104
|
+
request('/v2/project/' + application_id + '/archive/' + archive_id + '/stop', type: Post)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Delete a specified archive.
|
108
|
+
#
|
109
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
110
|
+
#
|
111
|
+
# @param [required, String] archive_id
|
112
|
+
#
|
113
|
+
# @return [Response]
|
114
|
+
#
|
115
|
+
# @see TODO: add docs link
|
116
|
+
#
|
117
|
+
def delete(application_id: @config.application_id, archive_id:)
|
118
|
+
# TODO: raise error if application_id is nil
|
119
|
+
|
120
|
+
request('/v2/project/' + application_id + '/archive/' + archive_id, type: Delete)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Add a stream to a composed archive that was started with the streamMode set to "manual".
|
124
|
+
#
|
125
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
126
|
+
#
|
127
|
+
# @param [required, String] archive_id
|
128
|
+
#
|
129
|
+
# @param [required, String] add_stream The ID of the stream to be added
|
130
|
+
#
|
131
|
+
# @param [optional, Boolean] has_audio
|
132
|
+
#
|
133
|
+
# @param [optional, Boolean] has_video
|
134
|
+
#
|
135
|
+
# @return [Response]
|
136
|
+
#
|
137
|
+
# @see TODO: add docs link
|
138
|
+
#
|
139
|
+
def add_stream(application_id: @config.application_id, archive_id:, **params)
|
140
|
+
# TODO: raise error if application_id is nil
|
141
|
+
# TODO: raise error if add_stream is nil
|
142
|
+
|
143
|
+
request('/v2/project/' + application_id + '/archive/' + archive_id + '/streams', params: camelcase(params), type: Patch)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Remove a stream from a composed archive that was started with the streamMode set to "manual".
|
147
|
+
#
|
148
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
149
|
+
#
|
150
|
+
# @param [required, String] archive_id
|
151
|
+
#
|
152
|
+
# @param [required, String] remove_stream The ID of the stream to be removed
|
153
|
+
#
|
154
|
+
# @return [Response]
|
155
|
+
#
|
156
|
+
# @see TODO: add docs link
|
157
|
+
#
|
158
|
+
def remove_stream(application_id: @config.application_id, archive_id:, **params)
|
159
|
+
# TODO: raise error if application_id is nil
|
160
|
+
# TODO: raise error if remove_stream is nil
|
161
|
+
|
162
|
+
request('/v2/project/' + application_id + '/archive/' + archive_id + '/streams', params: camelcase(params), type: Patch)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Change the layout of a composed archive while it is being recorded.
|
166
|
+
#
|
167
|
+
# @param [optional, String] :application_id (Required unless already set at Client instantiation or set in ENV)
|
168
|
+
#
|
169
|
+
# @param [required, String] archive_id
|
170
|
+
#
|
171
|
+
# @param [optional, String] type
|
172
|
+
#
|
173
|
+
# @param [optional, String] stylesheet
|
174
|
+
#
|
175
|
+
# @param [optional, String] screenshare_type
|
176
|
+
#
|
177
|
+
# @return [Response]
|
178
|
+
#
|
179
|
+
# @see TODO: add docs link
|
180
|
+
#
|
181
|
+
def change_layout(application_id: @config.application_id, archive_id:, **params)
|
182
|
+
# TODO: raise error if application_id is nil
|
183
|
+
|
184
|
+
request('/v2/project/' + application_id + '/archive/' + archive_id + '/layout', params: camelcase(params), type: Put)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|