twilio-ruby 5.48.0 → 5.49.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +21 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010.rb +5 -4
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +4 -4
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +4 -4
  8. data/lib/twilio-ruby/rest/autopilot/v1.rb +5 -4
  9. data/lib/twilio-ruby/rest/bulkexports/v1.rb +10 -8
  10. data/lib/twilio-ruby/rest/chat/v1.rb +10 -8
  11. data/lib/twilio-ruby/rest/chat/v2.rb +10 -8
  12. data/lib/twilio-ruby/rest/client.rb +1 -1
  13. data/lib/twilio-ruby/rest/conversations/v1.rb +25 -20
  14. data/lib/twilio-ruby/rest/events/v1.rb +20 -16
  15. data/lib/twilio-ruby/rest/events/v1/event_type.rb +4 -4
  16. data/lib/twilio-ruby/rest/events/v1/schema.rb +4 -4
  17. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +4 -4
  18. data/lib/twilio-ruby/rest/events/v1/sink.rb +4 -4
  19. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +3 -3
  20. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +3 -3
  21. data/lib/twilio-ruby/rest/events/v1/subscription.rb +4 -4
  22. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +3 -3
  23. data/lib/twilio-ruby/rest/fax/v1.rb +5 -4
  24. data/lib/twilio-ruby/rest/flex_api/v1.rb +15 -12
  25. data/lib/twilio-ruby/rest/insights.rb +1 -1
  26. data/lib/twilio-ruby/rest/insights/v1.rb +11 -9
  27. data/lib/twilio-ruby/rest/insights/v1/room.rb +55 -43
  28. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +22 -22
  29. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +10 -8
  30. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +10 -8
  31. data/lib/twilio-ruby/rest/lookups/v1.rb +5 -4
  32. data/lib/twilio-ruby/rest/messaging/v1.rb +10 -8
  33. data/lib/twilio-ruby/rest/monitor/v1.rb +10 -8
  34. data/lib/twilio-ruby/rest/notify/v1.rb +10 -8
  35. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +10 -8
  36. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +5 -4
  37. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +10 -8
  38. data/lib/twilio-ruby/rest/preview/marketplace.rb +10 -8
  39. data/lib/twilio-ruby/rest/preview/sync.rb +5 -4
  40. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +5 -4
  41. data/lib/twilio-ruby/rest/preview/understand.rb +5 -4
  42. data/lib/twilio-ruby/rest/preview/wireless.rb +15 -12
  43. data/lib/twilio-ruby/rest/proxy/v1.rb +5 -4
  44. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -1
  45. data/lib/twilio-ruby/rest/serverless/v1.rb +5 -4
  46. data/lib/twilio-ruby/rest/studio/v1.rb +5 -4
  47. data/lib/twilio-ruby/rest/studio/v2.rb +5 -4
  48. data/lib/twilio-ruby/rest/supersim/v1.rb +25 -20
  49. data/lib/twilio-ruby/rest/sync/v1.rb +5 -4
  50. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +9 -16
  51. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +9 -15
  52. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +22 -33
  53. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +9 -15
  54. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +22 -35
  55. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +9 -15
  56. data/lib/twilio-ruby/rest/taskrouter/v1.rb +5 -4
  57. data/lib/twilio-ruby/rest/trunking/v1.rb +5 -4
  58. data/lib/twilio-ruby/rest/trusthub/v1.rb +35 -28
  59. data/lib/twilio-ruby/rest/verify/v2.rb +15 -12
  60. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +4 -3
  61. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +64 -13
  62. data/lib/twilio-ruby/rest/video/v1.rb +20 -16
  63. data/lib/twilio-ruby/rest/voice/v1.rb +20 -16
  64. data/lib/twilio-ruby/rest/wireless/v1.rb +15 -12
  65. data/lib/twilio-ruby/twiml/voice_response.rb +22 -0
  66. data/lib/twilio-ruby/version.rb +1 -1
  67. data/spec/integration/api/v2010/account/message_spec.rb +37 -0
  68. data/spec/integration/messaging/v1/brand_registration_spec.rb +2 -2
  69. data/spec/integration/verify/v2/service/entity/factor_spec.rb +3 -3
  70. metadata +2 -2
@@ -29,11 +29,12 @@ module Twilio
29
29
  # @return [Twilio::REST::Video::V1::CompositionList]
30
30
  def compositions(sid=:unset)
31
31
  if sid.nil?
32
- raise ArgumentError, 'sid cannot be nil'
33
- elsif sid == :unset
34
- @compositions ||= CompositionList.new self
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ end
34
+ if sid == :unset
35
+ @compositions ||= CompositionList.new self
35
36
  else
36
- CompositionContext.new(self, sid)
37
+ CompositionContext.new(self, sid)
37
38
  end
38
39
  end
39
40
 
@@ -43,11 +44,12 @@ module Twilio
43
44
  # @return [Twilio::REST::Video::V1::CompositionHookList]
44
45
  def composition_hooks(sid=:unset)
45
46
  if sid.nil?
46
- raise ArgumentError, 'sid cannot be nil'
47
- elsif sid == :unset
48
- @composition_hooks ||= CompositionHookList.new self
47
+ raise ArgumentError, 'sid cannot be nil'
48
+ end
49
+ if sid == :unset
50
+ @composition_hooks ||= CompositionHookList.new self
49
51
  else
50
- CompositionHookContext.new(self, sid)
52
+ CompositionHookContext.new(self, sid)
51
53
  end
52
54
  end
53
55
 
@@ -63,11 +65,12 @@ module Twilio
63
65
  # @return [Twilio::REST::Video::V1::RecordingList]
64
66
  def recordings(sid=:unset)
65
67
  if sid.nil?
66
- raise ArgumentError, 'sid cannot be nil'
67
- elsif sid == :unset
68
- @recordings ||= RecordingList.new self
68
+ raise ArgumentError, 'sid cannot be nil'
69
+ end
70
+ if sid == :unset
71
+ @recordings ||= RecordingList.new self
69
72
  else
70
- RecordingContext.new(self, sid)
73
+ RecordingContext.new(self, sid)
71
74
  end
72
75
  end
73
76
 
@@ -83,11 +86,12 @@ module Twilio
83
86
  # @return [Twilio::REST::Video::V1::RoomList]
84
87
  def rooms(sid=:unset)
85
88
  if sid.nil?
86
- raise ArgumentError, 'sid cannot be nil'
87
- elsif sid == :unset
88
- @rooms ||= RoomList.new self
89
+ raise ArgumentError, 'sid cannot be nil'
90
+ end
91
+ if sid == :unset
92
+ @rooms ||= RoomList.new self
89
93
  else
90
- RoomContext.new(self, sid)
94
+ RoomContext.new(self, sid)
91
95
  end
92
96
  end
93
97
 
@@ -29,11 +29,12 @@ module Twilio
29
29
  # @return [Twilio::REST::Voice::V1::ByocTrunkList]
30
30
  def byoc_trunks(sid=:unset)
31
31
  if sid.nil?
32
- raise ArgumentError, 'sid cannot be nil'
33
- elsif sid == :unset
34
- @byoc_trunks ||= ByocTrunkList.new self
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ end
34
+ if sid == :unset
35
+ @byoc_trunks ||= ByocTrunkList.new self
35
36
  else
36
- ByocTrunkContext.new(self, sid)
37
+ ByocTrunkContext.new(self, sid)
37
38
  end
38
39
  end
39
40
 
@@ -44,11 +45,12 @@ module Twilio
44
45
  # @return [Twilio::REST::Voice::V1::ConnectionPolicyList]
45
46
  def connection_policies(sid=:unset)
46
47
  if sid.nil?
47
- raise ArgumentError, 'sid cannot be nil'
48
- elsif sid == :unset
49
- @connection_policies ||= ConnectionPolicyList.new self
48
+ raise ArgumentError, 'sid cannot be nil'
49
+ end
50
+ if sid == :unset
51
+ @connection_policies ||= ConnectionPolicyList.new self
50
52
  else
51
- ConnectionPolicyContext.new(self, sid)
53
+ ConnectionPolicyContext.new(self, sid)
52
54
  end
53
55
  end
54
56
 
@@ -65,11 +67,12 @@ module Twilio
65
67
  # @return [Twilio::REST::Voice::V1::IpRecordList]
66
68
  def ip_records(sid=:unset)
67
69
  if sid.nil?
68
- raise ArgumentError, 'sid cannot be nil'
69
- elsif sid == :unset
70
- @ip_records ||= IpRecordList.new self
70
+ raise ArgumentError, 'sid cannot be nil'
71
+ end
72
+ if sid == :unset
73
+ @ip_records ||= IpRecordList.new self
71
74
  else
72
- IpRecordContext.new(self, sid)
75
+ IpRecordContext.new(self, sid)
73
76
  end
74
77
  end
75
78
 
@@ -80,11 +83,12 @@ module Twilio
80
83
  # @return [Twilio::REST::Voice::V1::SourceIpMappingList]
81
84
  def source_ip_mappings(sid=:unset)
82
85
  if sid.nil?
83
- raise ArgumentError, 'sid cannot be nil'
84
- elsif sid == :unset
85
- @source_ip_mappings ||= SourceIpMappingList.new self
86
+ raise ArgumentError, 'sid cannot be nil'
87
+ end
88
+ if sid == :unset
89
+ @source_ip_mappings ||= SourceIpMappingList.new self
86
90
  else
87
- SourceIpMappingContext.new(self, sid)
91
+ SourceIpMappingContext.new(self, sid)
88
92
  end
89
93
  end
90
94
 
@@ -33,11 +33,12 @@ module Twilio
33
33
  # @return [Twilio::REST::Wireless::V1::CommandList]
34
34
  def commands(sid=:unset)
35
35
  if sid.nil?
36
- raise ArgumentError, 'sid cannot be nil'
37
- elsif sid == :unset
38
- @commands ||= CommandList.new self
36
+ raise ArgumentError, 'sid cannot be nil'
37
+ end
38
+ if sid == :unset
39
+ @commands ||= CommandList.new self
39
40
  else
40
- CommandContext.new(self, sid)
41
+ CommandContext.new(self, sid)
41
42
  end
42
43
  end
43
44
 
@@ -47,11 +48,12 @@ module Twilio
47
48
  # @return [Twilio::REST::Wireless::V1::RatePlanList]
48
49
  def rate_plans(sid=:unset)
49
50
  if sid.nil?
50
- raise ArgumentError, 'sid cannot be nil'
51
- elsif sid == :unset
52
- @rate_plans ||= RatePlanList.new self
51
+ raise ArgumentError, 'sid cannot be nil'
52
+ end
53
+ if sid == :unset
54
+ @rate_plans ||= RatePlanList.new self
53
55
  else
54
- RatePlanContext.new(self, sid)
56
+ RatePlanContext.new(self, sid)
55
57
  end
56
58
  end
57
59
 
@@ -61,11 +63,12 @@ module Twilio
61
63
  # @return [Twilio::REST::Wireless::V1::SimList]
62
64
  def sims(sid=:unset)
63
65
  if sid.nil?
64
- raise ArgumentError, 'sid cannot be nil'
65
- elsif sid == :unset
66
- @sims ||= SimList.new self
66
+ raise ArgumentError, 'sid cannot be nil'
67
+ end
68
+ if sid == :unset
69
+ @sims ||= SimList.new self
67
70
  else
68
- SimContext.new(self, sid)
71
+ SimContext.new(self, sid)
69
72
  end
70
73
  end
71
74
 
@@ -1159,6 +1159,28 @@ module Twilio
1159
1159
  yield(stream) if block_given?
1160
1160
  append(stream)
1161
1161
  end
1162
+
1163
+ ##
1164
+ # Create a new <VirtualAgent> element
1165
+ # connector_name:: Defines the conversation profile Dialogflow needs to use
1166
+ # language:: Language to be used by Dialogflow to transcribe speech
1167
+ # sentiment_analysis:: Whether sentiment analysis needs to be enabled or not
1168
+ # status_callback:: URL to post status callbacks from Twilio
1169
+ # keyword_args:: additional attributes
1170
+ def virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, **keyword_args)
1171
+ append(VirtualAgent.new(connector_name: connector_name, language: language, sentiment_analysis: sentiment_analysis, status_callback: status_callback, **keyword_args))
1172
+ end
1173
+ end
1174
+
1175
+ ##
1176
+ # <VirtualAgent> TwiML Noun
1177
+ class VirtualAgent < TwiML
1178
+ def initialize(**keyword_args)
1179
+ super(**keyword_args)
1180
+ @name = 'VirtualAgent'
1181
+
1182
+ yield(self) if block_given?
1183
+ end
1162
1184
  end
1163
1185
 
1164
1186
  ##
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.48.0'
2
+ VERSION = '5.49.0'
3
3
  end
@@ -137,6 +137,43 @@ describe 'Message' do
137
137
  expect(actual).to_not eq(nil)
138
138
  end
139
139
 
140
+ it "receives create_with_queued_status responses" do
141
+ @holodeck.mock(Twilio::Response.new(
142
+ 201,
143
+ %q[
144
+ {
145
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146
+ "api_version": "2010-04-01",
147
+ "body": "Hello! \ud83d\udc4d",
148
+ "date_created": "Thu, 30 Jul 2015 20:12:31 +0000",
149
+ "date_sent": "Thu, 30 Jul 2015 20:12:33 +0000",
150
+ "date_updated": "Thu, 30 Jul 2015 20:12:33 +0000",
151
+ "direction": "outbound-api",
152
+ "error_code": null,
153
+ "error_message": null,
154
+ "from": "+14155552345",
155
+ "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
156
+ "num_media": "0",
157
+ "num_segments": "1",
158
+ "price": null,
159
+ "price_unit": null,
160
+ "sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
161
+ "status": "queued",
162
+ "subresource_uris": {
163
+ "media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
164
+ },
165
+ "to": "+14155552345",
166
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
167
+ }
168
+ ]
169
+ ))
170
+
171
+ actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
172
+ .messages.create(to: '+15558675310')
173
+
174
+ expect(actual).to_not eq(nil)
175
+ end
176
+
140
177
  it "can delete" do
141
178
  @holodeck.mock(Twilio::Response.new(500, ''))
142
179
 
@@ -34,7 +34,7 @@ describe 'BrandRegistration' do
34
34
  "a2p_profile_bundle_sid": "BU3344409f7e067e279523808d267e2d85",
35
35
  "date_created": "2021-01-27T14:18:35Z",
36
36
  "date_updated": "2021-01-27T14:18:36Z",
37
- "status": "IN_PROGRESS",
37
+ "status": "PENDING",
38
38
  "tcr_id": "BXXXXXX",
39
39
  "failure_reason": "Registration error",
40
40
  "url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85"
@@ -83,7 +83,7 @@ describe 'BrandRegistration' do
83
83
  "a2p_profile_bundle_sid": "BU3344409f7e067e279523808d267e2d85",
84
84
  "date_created": "2021-01-27T14:18:35Z",
85
85
  "date_updated": "2021-01-27T14:18:36Z",
86
- "status": "IN_PROGRESS",
86
+ "status": "APPROVED",
87
87
  "tcr_id": "BXXXXXX",
88
88
  "failure_reason": "Registration error",
89
89
  "url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85"
@@ -27,7 +27,7 @@ describe 'Factor' do
27
27
  ))).to eq(true)
28
28
  end
29
29
 
30
- it "receives create responses" do
30
+ it "receives create_push responses" do
31
31
  @holodeck.mock(Twilio::Response.new(
32
32
  201,
33
33
  %q[
@@ -105,7 +105,7 @@ describe 'Factor' do
105
105
  ))).to eq(true)
106
106
  end
107
107
 
108
- it "receives fetch responses" do
108
+ it "receives fetch_push responses" do
109
109
  @holodeck.mock(Twilio::Response.new(
110
110
  200,
111
111
  %q[
@@ -242,7 +242,7 @@ describe 'Factor' do
242
242
  ))).to eq(true)
243
243
  end
244
244
 
245
- it "receives verify responses" do
245
+ it "receives verify_push responses" do
246
246
  @holodeck.mock(Twilio::Response.new(
247
247
  200,
248
248
  %q[
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.48.0
4
+ version: 5.49.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: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt