twilio-ruby 5.42.0 → 5.43.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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +27 -0
  3. data/README.md +18 -2
  4. data/lib/twilio-ruby.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +20 -0
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +201 -0
  7. data/lib/twilio-ruby/rest/client.rb +29 -3
  8. data/lib/twilio-ruby/rest/events/v1/subscription.rb +12 -5
  9. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -8
  10. data/lib/twilio-ruby/rest/serverless/v1/service.rb +5 -5
  11. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +4 -4
  12. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +4 -4
  13. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +4 -4
  14. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +4 -4
  15. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +4 -4
  16. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -4
  17. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +4 -4
  18. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +4 -4
  19. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  20. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +4 -4
  21. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +4 -4
  22. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +15 -5
  23. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +15 -5
  24. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +28 -5
  25. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +15 -5
  26. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +28 -5
  27. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +15 -5
  28. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -9
  29. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -16
  30. data/lib/twilio-ruby/rest/verify/v2/service.rb +3 -3
  31. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +3 -1
  32. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +5 -3
  33. data/lib/twilio-ruby/util/configuration.rb +5 -1
  34. data/lib/twilio-ruby/version.rb +1 -1
  35. data/spec/integration/api/v2010/account/call/event_spec.rb +102 -0
  36. data/spec/integration/api/v2010/account/call_spec.rb +20 -10
  37. data/spec/integration/events/v1/subscription_spec.rb +49 -0
  38. data/spec/integration/insights/v1/room/participant_spec.rb +0 -2
  39. data/spec/rest/client_spec.rb +24 -2
  40. data/twilio-ruby.gemspec +1 -0
  41. metadata +19 -2
@@ -26,7 +26,7 @@ module Twilio
26
26
  ##
27
27
  # Create the ServiceInstance
28
28
  # @param [String] friendly_name A descriptive string that you create to describe
29
- # the verification service. It can be up to 64 characters long. **This value
29
+ # the verification service. It can be up to 30 characters long. **This value
30
30
  # should not contain PII.**
31
31
  # @param [String] code_length The length of the verification code to generate.
32
32
  # Must be an integer value between 4 and 10, inclusive.
@@ -241,7 +241,7 @@ module Twilio
241
241
  ##
242
242
  # Update the ServiceInstance
243
243
  # @param [String] friendly_name A descriptive string that you create to describe
244
- # the verification service. It can be up to 64 characters long. **This value
244
+ # the verification service. It can be up to 30 characters long. **This value
245
245
  # should not contain PII.**
246
246
  # @param [String] code_length The length of the verification code to generate.
247
247
  # Must be an integer value between 4 and 10, inclusive.
@@ -584,7 +584,7 @@ module Twilio
584
584
  ##
585
585
  # Update the ServiceInstance
586
586
  # @param [String] friendly_name A descriptive string that you create to describe
587
- # the verification service. It can be up to 64 characters long. **This value
587
+ # the verification service. It can be up to 30 characters long. **This value
588
588
  # should not contain PII.**
589
589
  # @param [String] code_length The length of the verification code to generate.
590
590
  # Must be an integer value between 4 and 10, inclusive.
@@ -30,7 +30,9 @@ module Twilio
30
30
  ##
31
31
  # Create the EntityInstance
32
32
  # @param [String] identity The unique external identifier for the Entity of the
33
- # Service
33
+ # Service. This identifier should be immutable, not PII, length between 8 and 64
34
+ # characters, and generated by your external system, such as your user's UUID,
35
+ # GUID, or SID.
34
36
  # @return [EntityInstance] Created EntityInstance
35
37
  def create(identity: nil)
36
38
  data = Twilio::Values.of({'Identity' => identity, })
@@ -33,8 +33,10 @@ module Twilio
33
33
  ##
34
34
  # Create the ChallengeInstance
35
35
  # @param [String] factor_sid The unique SID identifier of the Factor.
36
- # @param [Time] expiration_date The future date in which this Challenge will
37
- # expire, given in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
36
+ # @param [Time] expiration_date The date-time when this Challenge expires, given
37
+ # in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format. The default value
38
+ # is five (5) minutes after Challenge creation. The max value is sixty (60)
39
+ # minutes after creation.
38
40
  # @param [String] details_message Shown to the user when the push notification
39
41
  # arrives. Required when `factor_type` is `push`
40
42
  # @param [Hash] details_fields A list of objects that describe the Fields included
@@ -379,7 +381,7 @@ module Twilio
379
381
  end
380
382
 
381
383
  ##
382
- # @return [Time] The date this Challenge is expired
384
+ # @return [Time] The date-time when this Challenge expires
383
385
  def expiration_date
384
386
  @properties['expiration_date']
385
387
  end
@@ -3,7 +3,7 @@
3
3
  module Twilio
4
4
  module Util
5
5
  class Configuration
6
- attr_accessor :account_sid, :auth_token, :http_client, :region, :edge
6
+ attr_accessor :account_sid, :auth_token, :http_client, :region, :edge, :logger
7
7
 
8
8
  def account_sid=(value)
9
9
  @account_sid = value
@@ -24,6 +24,10 @@ module Twilio
24
24
  def edge=(value)
25
25
  @edge = value
26
26
  end
27
+
28
+ def logger=(value)
29
+ @logger = value
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.42.0'
2
+ VERSION = '5.43.0'
3
3
  end
@@ -0,0 +1,102 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Event' do
12
+ it "can read" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
18
+ .events.list()
19
+ }.to raise_exception(Twilio::REST::TwilioError)
20
+
21
+ expect(
22
+ @holodeck.has_request?(Holodeck::Request.new(
23
+ method: 'get',
24
+ url: 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json',
25
+ ))).to eq(true)
26
+ end
27
+
28
+ it "receives read_full responses" do
29
+ @holodeck.mock(Twilio::Response.new(
30
+ 200,
31
+ %q[
32
+ {
33
+ "events": [
34
+ {
35
+ "request": {
36
+ "method": "POST",
37
+ "url": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
38
+ "parameters": {
39
+ "status_callback_method": "POST",
40
+ "twiml": "<Response><Say>Hi!</Say></Response>",
41
+ "trim": "trim-silence",
42
+ "timeout": "55",
43
+ "method": "POST",
44
+ "from": "+987654321",
45
+ "to": "+123456789",
46
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47
+ "machine_detection_timeout": "0"
48
+ }
49
+ },
50
+ "response": {
51
+ "response_code": 201,
52
+ "request_duration": 50,
53
+ "content_type": "application/json",
54
+ "response_body": "{\\"sid\\": \\"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\"}",
55
+ "date_created": "Tue, 11 Aug 2020 17:44:08 +0000"
56
+ }
57
+ }
58
+ ],
59
+ "end": 0,
60
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0",
61
+ "next_page_uri": null,
62
+ "page": 0,
63
+ "page_size": 50,
64
+ "previous_page_uri": null,
65
+ "start": 0,
66
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0"
67
+ }
68
+ ]
69
+ ))
70
+
71
+ actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
72
+ .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
73
+ .events.list()
74
+
75
+ expect(actual).to_not eq(nil)
76
+ end
77
+
78
+ it "receives read_empty responses" do
79
+ @holodeck.mock(Twilio::Response.new(
80
+ 200,
81
+ %q[
82
+ {
83
+ "events": [],
84
+ "end": 0,
85
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0",
86
+ "next_page_uri": null,
87
+ "page": 0,
88
+ "page_size": 50,
89
+ "previous_page_uri": null,
90
+ "start": 0,
91
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0"
92
+ }
93
+ ]
94
+ ))
95
+
96
+ actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
97
+ .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
98
+ .events.list()
99
+
100
+ expect(actual).to_not eq(nil)
101
+ end
102
+ end
@@ -57,7 +57,8 @@ describe 'Call' do
57
57
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
58
58
  "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json",
59
59
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
60
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
60
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
61
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
61
62
  },
62
63
  "to": "+14158675309",
63
64
  "to_formatted": "(415) 867-5309",
@@ -105,7 +106,8 @@ describe 'Call' do
105
106
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
106
107
  "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json",
107
108
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
108
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
109
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
110
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
109
111
  },
110
112
  "to": "+14158675309",
111
113
  "to_formatted": "(415) 867-5309",
@@ -195,7 +197,8 @@ describe 'Call' do
195
197
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
196
198
  "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json",
197
199
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
198
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
200
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
201
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
199
202
  },
200
203
  "to": "+13051913581",
201
204
  "to_formatted": "(305) 191-3581",
@@ -260,7 +263,8 @@ describe 'Call' do
260
263
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
261
264
  "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
262
265
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
263
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
266
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
267
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
264
268
  },
265
269
  "to": "+13051913581",
266
270
  "to_formatted": "(305) 191-3581",
@@ -295,7 +299,8 @@ describe 'Call' do
295
299
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
296
300
  "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
297
301
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
298
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json"
302
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
303
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json"
299
304
  },
300
305
  "to": "+13051913580",
301
306
  "to_formatted": "(305) 191-3580",
@@ -355,7 +360,8 @@ describe 'Call' do
355
360
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
356
361
  "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
357
362
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
358
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
363
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
364
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
359
365
  },
360
366
  "to": "+13051913581",
361
367
  "to_formatted": "(305) 191-3581",
@@ -390,7 +396,8 @@ describe 'Call' do
390
396
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
391
397
  "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
392
398
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
393
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json"
399
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
400
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json"
394
401
  },
395
402
  "to": "+13051913580",
396
403
  "to_formatted": "(305) 191-3580",
@@ -535,7 +542,8 @@ describe 'Call' do
535
542
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
536
543
  "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json",
537
544
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
538
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
545
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
546
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
539
547
  },
540
548
  "to": "+14158675309",
541
549
  "to_formatted": "(415) 867-5309",
@@ -583,7 +591,8 @@ describe 'Call' do
583
591
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
584
592
  "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json",
585
593
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
586
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
594
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
595
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
587
596
  },
588
597
  "to": "+14158675309",
589
598
  "to_formatted": "(415) 867-5309",
@@ -631,7 +640,8 @@ describe 'Call' do
631
640
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
632
641
  "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json",
633
642
  "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json",
634
- "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json"
643
+ "payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
644
+ "events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json"
635
645
  },
636
646
  "to": "+14158675309",
637
647
  "to_formatted": "(415) 867-5309",
@@ -96,6 +96,55 @@ describe 'Subscription' do
96
96
  expect(actual).to_not eq(nil)
97
97
  end
98
98
 
99
+ it "receives read_results_filtered_by_sink_sid responses" do
100
+ @holodeck.mock(Twilio::Response.new(
101
+ 200,
102
+ %q[
103
+ {
104
+ "subscriptions": [
105
+ {
106
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107
+ "date_created": "2015-07-30T20:00:00Z",
108
+ "date_updated": "2015-07-30T20:01:33Z",
109
+ "sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
110
+ "sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
111
+ "description": "A subscription",
112
+ "url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
113
+ "links": {
114
+ "subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents"
115
+ }
116
+ },
117
+ {
118
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
119
+ "date_created": "2015-07-30T20:00:00Z",
120
+ "date_updated": "2015-07-30T20:01:33Z",
121
+ "sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
122
+ "sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
123
+ "description": "Another subscription",
124
+ "url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
125
+ "links": {
126
+ "subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab/SubscribedEvents"
127
+ }
128
+ }
129
+ ],
130
+ "meta": {
131
+ "page": 0,
132
+ "page_size": 10,
133
+ "first_page_url": "https://events.twilio.com/v1/Subscriptions?SinkSid=DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=10&Page=0",
134
+ "previous_page_url": null,
135
+ "url": "https://events.twilio.com/v1/Subscriptions?SinkSid=DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=10&Page=0",
136
+ "next_page_url": null,
137
+ "key": "subscriptions"
138
+ }
139
+ }
140
+ ]
141
+ ))
142
+
143
+ actual = @client.events.v1.subscriptions.list()
144
+
145
+ expect(actual).to_not eq(nil)
146
+ end
147
+
99
148
  it "can fetch" do
100
149
  @holodeck.mock(Twilio::Response.new(500, ''))
101
150
 
@@ -36,7 +36,6 @@ describe 'Participant' do
36
36
  "end_reason": "disconnected_via_api",
37
37
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
38
  "error_code": 0,
39
- "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
39
  "media_region": "us1",
41
40
  "properties": {},
42
41
  "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -122,7 +121,6 @@ describe 'Participant' do
122
121
  "end_reason": "disconnected_via_api",
123
122
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
124
123
  "error_code": 53205,
125
- "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
126
124
  "media_region": "us1",
127
125
  "properties": {},
128
126
  "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'logger'
2
3
 
3
4
  describe Twilio::REST::ObsoleteClient do
4
5
  it 'raise an exception' do
@@ -57,6 +58,7 @@ describe Twilio::REST::Client do
57
58
  config.http_client = 'someClient'
58
59
  config.region = 'someRegion'
59
60
  config.edge = 'someEdge'
61
+ config.logger = 'someLogger'
60
62
  end
61
63
  end
62
64
 
@@ -67,16 +69,18 @@ describe Twilio::REST::Client do
67
69
  expect(@client.http_client).to eq('someClient')
68
70
  expect(@client.region).to eq('someRegion')
69
71
  expect(@client.edge).to eq('someEdge')
72
+ expect(@client.logger).to eq('someLogger')
70
73
  end
71
74
 
72
75
  it 'uses the arguments over global configuration' do
73
- @client = Twilio::REST::Client.new('myUser', 'myPassword', nil, 'myRegion', 'myClient')
76
+ @client = Twilio::REST::Client.new('myUser', 'myPassword', nil, 'myRegion', 'myClient', 'myLogger')
74
77
  @client.edge = 'myEdge'
75
78
  expect(@client.account_sid).to eq('myUser')
76
79
  expect(@client.auth_token).to eq('myPassword')
77
80
  expect(@client.http_client).to eq('myClient')
78
81
  expect(@client.region).to eq('myRegion')
79
82
  expect(@client.edge).to eq('myEdge')
83
+ expect(@client.logger).to eq('myLogger')
80
84
  end
81
85
 
82
86
  class MyVersion < Twilio::REST::Version
@@ -97,13 +101,14 @@ describe Twilio::REST::Client do
97
101
  end
98
102
 
99
103
  context 'validation' do
100
- before do
104
+ before :all do
101
105
  Twilio.configure do |config|
102
106
  config.account_sid = 'someSid'
103
107
  config.auth_token = 'someToken'
104
108
  config.http_client = 'someClient'
105
109
  config.region = nil
106
110
  config.edge = nil
111
+ config.logger = nil
107
112
  end
108
113
  end
109
114
 
@@ -142,6 +147,23 @@ describe Twilio::REST::Client do
142
147
  end
143
148
  end
144
149
 
150
+ context 'logging' do
151
+ it 'logs the call details' do
152
+ @client.logger = Logger.new(STDOUT)
153
+ @holodeck.mock Twilio::Response.new(200, {})
154
+ expect {
155
+ @client.request('host', 'port', 'GET', 'http://foobar.com')
156
+ }.to output(/Host:foobar.com/).to_stdout_from_any_process
157
+ end
158
+
159
+ it 'does not log when the logger instance is not passed' do
160
+ @holodeck.mock Twilio::Response.new(200, {})
161
+ expect {
162
+ @client.request('host', 'port', 'GET', 'http://foobar.com')
163
+ }.to_not output(/Host:foobar.com/).to_stdout_from_any_process
164
+ end
165
+ end
166
+
145
167
  describe '#build_uri' do
146
168
  before(:all) do
147
169
  Twilio.configure do |config|
@@ -38,4 +38,5 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency 'rspec', '~> 3.0'
39
39
  spec.add_development_dependency 'rubocop', '~> 0.82.0'
40
40
  spec.add_development_dependency 'yard', '~> 0.9.9'
41
+ spec.add_development_dependency 'logger', '~> 1.4.2'
41
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.42.0
4
+ version: 5.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twilio API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-05 00:00:00.000000000 Z
11
+ date: 2020-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -188,6 +188,20 @@ dependencies:
188
188
  - - "~>"
189
189
  - !ruby/object:Gem::Version
190
190
  version: 0.9.9
191
+ - !ruby/object:Gem::Dependency
192
+ name: logger
193
+ requirement: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - "~>"
196
+ - !ruby/object:Gem::Version
197
+ version: 1.4.2
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: 1.4.2
191
205
  description: The official library for communicating with the Twilio REST API, building
192
206
  TwiML, and generating Twilio JWT Capability Tokens
193
207
  email:
@@ -263,6 +277,7 @@ files:
263
277
  - lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb
264
278
  - lib/twilio-ruby/rest/api/v2010/account/balance.rb
265
279
  - lib/twilio-ruby/rest/api/v2010/account/call.rb
280
+ - lib/twilio-ruby/rest/api/v2010/account/call/event.rb
266
281
  - lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb
267
282
  - lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb
268
283
  - lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
@@ -733,6 +748,7 @@ files:
733
748
  - spec/integration/api/v2010/account/available_phone_number/voip_spec.rb
734
749
  - spec/integration/api/v2010/account/available_phone_number_spec.rb
735
750
  - spec/integration/api/v2010/account/balance_spec.rb
751
+ - spec/integration/api/v2010/account/call/event_spec.rb
736
752
  - spec/integration/api/v2010/account/call/feedback_spec.rb
737
753
  - spec/integration/api/v2010/account/call/feedback_summary_spec.rb
738
754
  - spec/integration/api/v2010/account/call/notification_spec.rb
@@ -1177,6 +1193,7 @@ test_files:
1177
1193
  - spec/integration/api/v2010/account/available_phone_number/voip_spec.rb
1178
1194
  - spec/integration/api/v2010/account/available_phone_number_spec.rb
1179
1195
  - spec/integration/api/v2010/account/balance_spec.rb
1196
+ - spec/integration/api/v2010/account/call/event_spec.rb
1180
1197
  - spec/integration/api/v2010/account/call/feedback_spec.rb
1181
1198
  - spec/integration/api/v2010/account/call/feedback_summary_spec.rb
1182
1199
  - spec/integration/api/v2010/account/call/notification_spec.rb