twilio-ruby 5.10.5 → 5.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -0
- data/CHANGES.md +10 -0
- data/Dockerfile +9 -0
- data/Makefile +11 -0
- data/README.md +5 -2
- data/lib/twilio-ruby/rest/api.rb +1 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +117 -32
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +30 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +112 -56
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +460 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +4 -4
- data/lib/twilio-ruby/rest/client.rb +1 -2
- data/lib/twilio-ruby/rest/preview.rb +8 -8
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/preview/understand/assistant/intent/field.rb +5 -2
- data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +8 -8
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +9 -9
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +10 -8
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +3 -7
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +3 -49
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/video.rb +18 -6
- data/lib/twilio-ruby/rest/video/v1.rb +27 -13
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +278 -0
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +278 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/recording_spec.rb +103 -0
- data/spec/integration/api/v2010/account/conference/recording_spec.rb +240 -0
- data/spec/integration/api/v2010/account/message_spec.rb +0 -5
- data/spec/integration/proxy/v1/service/session/participant_spec.rb +0 -48
- data/spec/integration/video/v1/composition_settings_spec.rb +86 -0
- data/spec/integration/video/v1/recording_settings_spec.rb +86 -0
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d8915509528831b439fb45ef8cb25d10790bebe
|
4
|
+
data.tar.gz: 54eb53c3d93bf543d7458ddc163fa504f9cc2f5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7657be54da4eaa33d4e81ccc580d1499e73dcc20e1bb27b5b01d367553aeb97f20e8b8c2cb0e6043209749b80ada1c15aea9cba8c3c71cf1052f939aca288d36
|
7
|
+
data.tar.gz: 54af734a54bd1118bbeacd9d19cfe2ef407bf9897b127053a13a22f444e73cfd7e4a1d9217ab3c51333a9d4c2fddd0843b9f8f30b9a47a889fb3b2dc0022b369
|
data/.travis.yml
CHANGED
@@ -12,6 +12,9 @@ rvm:
|
|
12
12
|
- 2.0.0
|
13
13
|
- jruby-9.1.9.0
|
14
14
|
|
15
|
+
services:
|
16
|
+
- docker
|
17
|
+
|
15
18
|
matrix:
|
16
19
|
fast_finish: true
|
17
20
|
|
@@ -19,3 +22,10 @@ before_install:
|
|
19
22
|
# Bundler on Travis may be too out of date
|
20
23
|
# Update bundler to a recent version.
|
21
24
|
- gem install bundler
|
25
|
+
deploy:
|
26
|
+
provider: script
|
27
|
+
script: make docker-build && make docker-push
|
28
|
+
skip_cleanup: true
|
29
|
+
on:
|
30
|
+
tags: true
|
31
|
+
rvm: "2.4.0"
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2018-07-05] Version 5.10.6
|
5
|
+
----------------------------
|
6
|
+
**Library**
|
7
|
+
- PR #413: Add Dockerfile and related changes to build the Docker image. Thanks to @jonatasbaldin!
|
8
|
+
|
9
|
+
**Api**
|
10
|
+
- Release `Call Recording Controls` feature support in helper libraries
|
11
|
+
- Add Voice Insights sub-category keys to usage records
|
12
|
+
|
13
|
+
|
4
14
|
[2018-06-21] Version 5.10.5
|
5
15
|
----------------------------
|
6
16
|
**Library**
|
data/Dockerfile
ADDED
data/Makefile
CHANGED
@@ -27,3 +27,14 @@ authors:
|
|
27
27
|
|
28
28
|
gem:
|
29
29
|
bundle exec rake build | sed -e 's/.*pkg/pkg/g' | sed -e "s/\.$$//g" | xargs gem push
|
30
|
+
|
31
|
+
API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
|
32
|
+
docker-build:
|
33
|
+
docker build -t twilio/twilio-ruby .
|
34
|
+
docker tag twilio/twilio-ruby twilio/twilio-ruby:${TRAVIS_TAG}
|
35
|
+
docker tag twilio/twilio-ruby twilio/twilio-ruby:apidefs-${API_DEFINITIONS_SHA}
|
36
|
+
|
37
|
+
docker-push:
|
38
|
+
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
|
39
|
+
docker push twilio/twilio-ruby:${TRAVIS_TAG}
|
40
|
+
docker push twilio/twilio-ruby:apidefs-${API_DEFINITIONS_SHA}
|
data/README.md
CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
|
|
27
27
|
To install using [Bundler][bundler] grab the latest stable version:
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
gem 'twilio-ruby', '~> 5.10.
|
30
|
+
gem 'twilio-ruby', '~> 5.10.6'
|
31
31
|
```
|
32
32
|
|
33
33
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
34
34
|
|
35
35
|
```bash
|
36
|
-
gem install twilio-ruby -v 5.10.
|
36
|
+
gem install twilio-ruby -v 5.10.6
|
37
37
|
```
|
38
38
|
|
39
39
|
To build and install the development branch yourself from the latest source:
|
@@ -50,6 +50,9 @@ make install
|
|
50
50
|
## Documentation
|
51
51
|
[Here][documentation]
|
52
52
|
|
53
|
+
## Docker Image
|
54
|
+
The `Dockerfile` present in this repository and its respective `twilio/twilio-ruby` Docker image are currently used by Twilio for testing purposes only.
|
55
|
+
|
53
56
|
## Feedback
|
54
57
|
During the Release Candidate period of this library, please leave all feedback and issues in the [Github Issues][issues] for `twilio-ruby`.
|
55
58
|
|
data/lib/twilio-ruby/rest/api.rb
CHANGED
@@ -207,8 +207,7 @@ module Twilio
|
|
207
207
|
end
|
208
208
|
|
209
209
|
##
|
210
|
-
# @param [String] sid A 34
|
211
|
-
# resource.
|
210
|
+
# @param [String] sid A unique 34-character string that identifies this resource.
|
212
211
|
# @return [Twilio::REST::Api::V2010::AccountContext::TranscriptionInstance] if sid was passed.
|
213
212
|
# @return [Twilio::REST::Api::V2010::AccountContext::TranscriptionList]
|
214
213
|
def transcriptions(sid=:unset)
|
@@ -16,8 +16,11 @@ module Twilio
|
|
16
16
|
##
|
17
17
|
# Initialize the RecordingList
|
18
18
|
# @param [Version] version Version that contains the resource
|
19
|
-
# @param [String] account_sid The
|
20
|
-
#
|
19
|
+
# @param [String] account_sid The unique ID of the
|
20
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) responsible for this
|
21
|
+
# recording.
|
22
|
+
# @param [String] call_sid A unique identifier for the call associated with the
|
23
|
+
# recording. This will always refer to the parent leg of a two leg call.
|
21
24
|
# @return [RecordingList] RecordingList
|
22
25
|
def initialize(version, account_sid: nil, call_sid: nil)
|
23
26
|
super(version)
|
@@ -27,13 +30,53 @@ module Twilio
|
|
27
30
|
@uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Recordings.json"
|
28
31
|
end
|
29
32
|
|
33
|
+
##
|
34
|
+
# Retrieve a single page of RecordingInstance records from the API.
|
35
|
+
# Request is executed immediately.
|
36
|
+
# @param [String] recording_status_callback_event The
|
37
|
+
# recording_status_callback_event
|
38
|
+
# @param [String] recording_status_callback The recording_status_callback
|
39
|
+
# @param [String] recording_status_callback_method The
|
40
|
+
# recording_status_callback_method
|
41
|
+
# @param [String] trim Possible values `trim-silence` or `do-not-trim`.
|
42
|
+
# `trim-silence` will trim the silence from the beginning and end of the
|
43
|
+
# recording. `do-not-trim` will not trim the silence. Defaults to `do-not-trim`
|
44
|
+
# @param [String] recording_channels The recording_channels
|
45
|
+
# @param [Boolean] play_beep Possible values : true or false. true will play a
|
46
|
+
# double beep before the recording is paused or stopped or a single beep after the
|
47
|
+
# recording is resumed. Defaults to false
|
48
|
+
# @return [RecordingInstance] Newly created RecordingInstance
|
49
|
+
def create(recording_status_callback_event: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, trim: :unset, recording_channels: :unset, play_beep: :unset)
|
50
|
+
data = Twilio::Values.of({
|
51
|
+
'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },
|
52
|
+
'RecordingStatusCallback' => recording_status_callback,
|
53
|
+
'RecordingStatusCallbackMethod' => recording_status_callback_method,
|
54
|
+
'Trim' => trim,
|
55
|
+
'RecordingChannels' => recording_channels,
|
56
|
+
'PlayBeep' => play_beep,
|
57
|
+
})
|
58
|
+
|
59
|
+
payload = @version.create(
|
60
|
+
'POST',
|
61
|
+
@uri,
|
62
|
+
data: data
|
63
|
+
)
|
64
|
+
|
65
|
+
RecordingInstance.new(
|
66
|
+
@version,
|
67
|
+
payload,
|
68
|
+
account_sid: @solution[:account_sid],
|
69
|
+
call_sid: @solution[:call_sid],
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
30
73
|
##
|
31
74
|
# Lists RecordingInstance records from the API as a list.
|
32
75
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
33
76
|
# memory before returning.
|
34
|
-
# @param [Time] date_created_before
|
35
|
-
# @param [Time] date_created
|
36
|
-
# @param [Time] date_created_after
|
77
|
+
# @param [Time] date_created_before Filter by date created
|
78
|
+
# @param [Time] date_created Filter by date created
|
79
|
+
# @param [Time] date_created_after Filter by date created
|
37
80
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
38
81
|
# guarantees to never return more than limit. Default is no limit
|
39
82
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -55,9 +98,9 @@ module Twilio
|
|
55
98
|
# Streams RecordingInstance records from the API as an Enumerable.
|
56
99
|
# This operation lazily loads records as efficiently as possible until the limit
|
57
100
|
# is reached.
|
58
|
-
# @param [Time] date_created_before
|
59
|
-
# @param [Time] date_created
|
60
|
-
# @param [Time] date_created_after
|
101
|
+
# @param [Time] date_created_before Filter by date created
|
102
|
+
# @param [Time] date_created Filter by date created
|
103
|
+
# @param [Time] date_created_after Filter by date created
|
61
104
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
62
105
|
# guarantees to never return more than limit. Default is no limit.
|
63
106
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -95,9 +138,9 @@ module Twilio
|
|
95
138
|
##
|
96
139
|
# Retrieve a single page of RecordingInstance records from the API.
|
97
140
|
# Request is executed immediately.
|
98
|
-
# @param [Time] date_created_before
|
99
|
-
# @param [Time] date_created
|
100
|
-
# @param [Time] date_created_after
|
141
|
+
# @param [Time] date_created_before Filter by date created
|
142
|
+
# @param [Time] date_created Filter by date created
|
143
|
+
# @param [Time] date_created_after Filter by date created
|
101
144
|
# @param [String] page_token PageToken provided by the API
|
102
145
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
103
146
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -178,8 +221,8 @@ module Twilio
|
|
178
221
|
# Initialize the RecordingContext
|
179
222
|
# @param [Version] version Version that contains the resource
|
180
223
|
# @param [String] account_sid The account_sid
|
181
|
-
# @param [String] call_sid The
|
182
|
-
# @param [String] sid The
|
224
|
+
# @param [String] call_sid The call Sid that uniquely identifies this resource
|
225
|
+
# @param [String] sid The recording Sid that uniquely identifies this resource
|
183
226
|
# @return [RecordingContext] RecordingContext
|
184
227
|
def initialize(version, account_sid, call_sid, sid)
|
185
228
|
super(version)
|
@@ -189,6 +232,29 @@ module Twilio
|
|
189
232
|
@uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Recordings/#{@solution[:sid]}.json"
|
190
233
|
end
|
191
234
|
|
235
|
+
##
|
236
|
+
# Update the RecordingInstance
|
237
|
+
# @param [recording.Status] status The status to change the recording to.
|
238
|
+
# Possible values : stopped, paused, in-progress
|
239
|
+
# @return [RecordingInstance] Updated RecordingInstance
|
240
|
+
def update(status: nil)
|
241
|
+
data = Twilio::Values.of({'Status' => status, })
|
242
|
+
|
243
|
+
payload = @version.update(
|
244
|
+
'POST',
|
245
|
+
@uri,
|
246
|
+
data: data,
|
247
|
+
)
|
248
|
+
|
249
|
+
RecordingInstance.new(
|
250
|
+
@version,
|
251
|
+
payload,
|
252
|
+
account_sid: @solution[:account_sid],
|
253
|
+
call_sid: @solution[:call_sid],
|
254
|
+
sid: @solution[:sid],
|
255
|
+
)
|
256
|
+
end
|
257
|
+
|
192
258
|
##
|
193
259
|
# Fetch a RecordingInstance
|
194
260
|
# @return [RecordingInstance] Fetched RecordingInstance
|
@@ -230,9 +296,12 @@ module Twilio
|
|
230
296
|
# Initialize the RecordingInstance
|
231
297
|
# @param [Version] version Version that contains the resource
|
232
298
|
# @param [Hash] payload payload that contains response from Twilio
|
233
|
-
# @param [String] account_sid The
|
234
|
-
#
|
235
|
-
#
|
299
|
+
# @param [String] account_sid The unique ID of the
|
300
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) responsible for this
|
301
|
+
# recording.
|
302
|
+
# @param [String] call_sid A unique identifier for the call associated with the
|
303
|
+
# recording. This will always refer to the parent leg of a two leg call.
|
304
|
+
# @param [String] sid The recording Sid that uniquely identifies this resource
|
236
305
|
# @return [RecordingInstance] RecordingInstance
|
237
306
|
def initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil)
|
238
307
|
super(version)
|
@@ -245,6 +314,7 @@ module Twilio
|
|
245
314
|
'conference_sid' => payload['conference_sid'],
|
246
315
|
'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
|
247
316
|
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
|
317
|
+
'start_time' => Twilio.deserialize_rfc2822(payload['start_time']),
|
248
318
|
'duration' => payload['duration'],
|
249
319
|
'sid' => payload['sid'],
|
250
320
|
'price' => payload['price'].to_f,
|
@@ -279,101 +349,116 @@ module Twilio
|
|
279
349
|
end
|
280
350
|
|
281
351
|
##
|
282
|
-
# @return [String] The
|
352
|
+
# @return [String] The unique sid that identifies this account
|
283
353
|
def account_sid
|
284
354
|
@properties['account_sid']
|
285
355
|
end
|
286
356
|
|
287
357
|
##
|
288
|
-
# @return [String] The
|
358
|
+
# @return [String] The version of the API in use during the recording.
|
289
359
|
def api_version
|
290
360
|
@properties['api_version']
|
291
361
|
end
|
292
362
|
|
293
363
|
##
|
294
|
-
# @return [String] The
|
364
|
+
# @return [String] The unique id for the call leg that corresponds to the recording.
|
295
365
|
def call_sid
|
296
366
|
@properties['call_sid']
|
297
367
|
end
|
298
368
|
|
299
369
|
##
|
300
|
-
# @return [String] The
|
370
|
+
# @return [String] The unique id for the conference associated with the recording, if a conference recording.
|
301
371
|
def conference_sid
|
302
372
|
@properties['conference_sid']
|
303
373
|
end
|
304
374
|
|
305
375
|
##
|
306
|
-
# @return [Time] The
|
376
|
+
# @return [Time] The date this resource was created
|
307
377
|
def date_created
|
308
378
|
@properties['date_created']
|
309
379
|
end
|
310
380
|
|
311
381
|
##
|
312
|
-
# @return [Time] The
|
382
|
+
# @return [Time] The date this resource was last updated
|
313
383
|
def date_updated
|
314
384
|
@properties['date_updated']
|
315
385
|
end
|
316
386
|
|
317
387
|
##
|
318
|
-
# @return [
|
388
|
+
# @return [Time] The start time of the recording, given in RFC 2822 format.
|
389
|
+
def start_time
|
390
|
+
@properties['start_time']
|
391
|
+
end
|
392
|
+
|
393
|
+
##
|
394
|
+
# @return [String] The length of the recording, in seconds.
|
319
395
|
def duration
|
320
396
|
@properties['duration']
|
321
397
|
end
|
322
398
|
|
323
399
|
##
|
324
|
-
# @return [String]
|
400
|
+
# @return [String] A string that uniquely identifies this recording
|
325
401
|
def sid
|
326
402
|
@properties['sid']
|
327
403
|
end
|
328
404
|
|
329
405
|
##
|
330
|
-
# @return [String] The
|
406
|
+
# @return [String] The one-time cost of creating this recording.
|
331
407
|
def price
|
332
408
|
@properties['price']
|
333
409
|
end
|
334
410
|
|
335
411
|
##
|
336
|
-
# @return [String] The
|
412
|
+
# @return [String] The URI for this resource
|
337
413
|
def uri
|
338
414
|
@properties['uri']
|
339
415
|
end
|
340
416
|
|
341
417
|
##
|
342
|
-
# @return [Hash]
|
418
|
+
# @return [Hash] Details for how to decrypt the recording.
|
343
419
|
def encryption_details
|
344
420
|
@properties['encryption_details']
|
345
421
|
end
|
346
422
|
|
347
423
|
##
|
348
|
-
# @return [String] The
|
424
|
+
# @return [String] The currency used in the Price property.
|
349
425
|
def price_unit
|
350
426
|
@properties['price_unit']
|
351
427
|
end
|
352
428
|
|
353
429
|
##
|
354
|
-
# @return [recording.Status] The status
|
430
|
+
# @return [recording.Status] The status of the recording.
|
355
431
|
def status
|
356
432
|
@properties['status']
|
357
433
|
end
|
358
434
|
|
359
435
|
##
|
360
|
-
# @return [String] The channels
|
436
|
+
# @return [String] The number of channels in the final recording file as an integer.
|
361
437
|
def channels
|
362
438
|
@properties['channels']
|
363
439
|
end
|
364
440
|
|
365
441
|
##
|
366
|
-
# @return [recording.Source] The
|
442
|
+
# @return [recording.Source] The way in which this recording was created.
|
367
443
|
def source
|
368
444
|
@properties['source']
|
369
445
|
end
|
370
446
|
|
371
447
|
##
|
372
|
-
# @return [String]
|
448
|
+
# @return [String] More information about the recording failure, if Status is failed.
|
373
449
|
def error_code
|
374
450
|
@properties['error_code']
|
375
451
|
end
|
376
452
|
|
453
|
+
##
|
454
|
+
# Update the RecordingInstance
|
455
|
+
# @param [recording.Status] status The status to change the recording to.
|
456
|
+
# Possible values : stopped, paused, in-progress
|
457
|
+
# @return [RecordingInstance] Updated RecordingInstance
|
458
|
+
def update(status: nil)
|
459
|
+
context.update(status: status, )
|
460
|
+
end
|
461
|
+
|
377
462
|
##
|
378
463
|
# Fetch a RecordingInstance
|
379
464
|
# @return [RecordingInstance] Fetched RecordingInstance
|
@@ -220,6 +220,7 @@ module Twilio
|
|
220
220
|
|
221
221
|
# Dependents
|
222
222
|
@participants = nil
|
223
|
+
@recordings = nil
|
223
224
|
end
|
224
225
|
|
225
226
|
##
|
@@ -294,6 +295,28 @@ module Twilio
|
|
294
295
|
@participants
|
295
296
|
end
|
296
297
|
|
298
|
+
##
|
299
|
+
# Access the recordings
|
300
|
+
# @return [RecordingList]
|
301
|
+
# @return [RecordingContext] if sid was passed.
|
302
|
+
def recordings(sid=:unset)
|
303
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
304
|
+
|
305
|
+
if sid != :unset
|
306
|
+
return RecordingContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
|
307
|
+
end
|
308
|
+
|
309
|
+
unless @recordings
|
310
|
+
@recordings = RecordingList.new(
|
311
|
+
@version,
|
312
|
+
account_sid: @solution[:account_sid],
|
313
|
+
conference_sid: @solution[:sid],
|
314
|
+
)
|
315
|
+
end
|
316
|
+
|
317
|
+
@recordings
|
318
|
+
end
|
319
|
+
|
297
320
|
##
|
298
321
|
# Provide a user friendly representation
|
299
322
|
def to_s
|
@@ -432,6 +455,13 @@ module Twilio
|
|
432
455
|
context.participants
|
433
456
|
end
|
434
457
|
|
458
|
+
##
|
459
|
+
# Access the recordings
|
460
|
+
# @return [recordings] recordings
|
461
|
+
def recordings
|
462
|
+
context.recordings
|
463
|
+
end
|
464
|
+
|
435
465
|
##
|
436
466
|
# Provide a user friendly representation
|
437
467
|
def to_s
|