twilio-ruby 5.40.4 → 5.45.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 (155) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +104 -0
  3. data/{LICENSE.md → LICENSE} +0 -0
  4. data/PULL_REQUEST_TEMPLATE.md +3 -3
  5. data/README.md +18 -2
  6. data/lib/twilio-ruby.rb +1 -1
  7. data/lib/twilio-ruby/jwt/access_token.rb +7 -2
  8. data/lib/twilio-ruby/rest/accounts.rb +12 -0
  9. data/lib/twilio-ruby/rest/accounts/v1.rb +14 -0
  10. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +186 -0
  11. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +200 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -1
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +201 -0
  14. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +13 -1
  15. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +6 -1
  16. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +5 -22
  17. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +25 -40
  18. data/lib/twilio-ruby/rest/client.rb +29 -3
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +10 -2
  20. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +13 -3
  21. data/lib/twilio-ruby/rest/events/v1/subscription.rb +12 -5
  22. data/lib/twilio-ruby/rest/insights.rb +8 -0
  23. data/lib/twilio-ruby/rest/insights/v1.rb +15 -0
  24. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
  25. data/lib/twilio-ruby/rest/insights/v1/room.rb +487 -0
  26. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +378 -0
  27. data/lib/twilio-ruby/rest/ip_messaging.rb +8 -10
  28. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -8
  29. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +29 -68
  30. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +198 -313
  31. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +32 -59
  32. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +23 -55
  33. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +28 -71
  34. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +31 -59
  35. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +19 -39
  36. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +29 -51
  37. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +12 -18
  38. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -6
  39. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +29 -66
  40. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +116 -205
  41. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +23 -50
  42. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +41 -91
  43. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +23 -50
  44. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +42 -118
  45. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +46 -100
  46. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +36 -89
  47. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +19 -41
  48. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +29 -53
  49. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +23 -53
  50. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +27 -56
  51. data/lib/twilio-ruby/rest/preview.rb +5 -18
  52. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +5 -22
  53. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +21 -39
  54. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +12 -27
  55. data/lib/twilio-ruby/rest/preview/trusted_comms/{business.rb → branded_channel.rb} +63 -77
  56. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +165 -0
  57. data/lib/twilio-ruby/rest/serverless/v1/service.rb +5 -5
  58. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +4 -4
  59. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +4 -4
  60. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +4 -4
  61. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +4 -4
  62. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +4 -4
  63. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -4
  64. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +4 -4
  65. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +4 -4
  66. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  67. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +4 -4
  68. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +4 -4
  69. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +15 -5
  70. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +15 -5
  71. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +28 -5
  72. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +15 -5
  73. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +28 -5
  74. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +15 -5
  75. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -9
  76. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -16
  77. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +21 -24
  78. data/lib/twilio-ruby/rest/verify/v2/form.rb +4 -4
  79. data/lib/twilio-ruby/rest/verify/v2/service.rb +54 -33
  80. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +3 -3
  81. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +23 -35
  82. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +36 -61
  83. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +59 -57
  84. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +4 -4
  85. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +6 -6
  86. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +6 -6
  87. data/lib/twilio-ruby/rest/video/v1/room.rb +20 -0
  88. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +150 -0
  89. data/lib/twilio-ruby/twiml/voice_response.rb +7 -4
  90. data/lib/twilio-ruby/util/configuration.rb +5 -1
  91. data/lib/twilio-ruby/version.rb +1 -1
  92. data/spec/integration/accounts/v1/auth_token_promotion_spec.rb +44 -0
  93. data/spec/integration/accounts/v1/secondary_auth_token_spec.rb +69 -0
  94. data/spec/integration/api/v2010/account/call/event_spec.rb +102 -0
  95. data/spec/integration/api/v2010/account/call/recording_spec.rb +4 -0
  96. data/spec/integration/api/v2010/account/call_spec.rb +20 -10
  97. data/spec/integration/api/v2010/account/conference/participant_spec.rb +30 -0
  98. data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +4 -2
  99. data/spec/integration/conversations/v1/conversation_spec.rb +1 -1
  100. data/spec/integration/conversations/v1/service/conversation_spec.rb +1 -1
  101. data/spec/integration/events/v1/sink/sink_test_spec.rb +1 -1
  102. data/spec/integration/events/v1/subscription_spec.rb +49 -0
  103. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  104. data/spec/integration/insights/v1/room/participant_spec.rb +147 -0
  105. data/spec/integration/insights/v1/room_spec.rb +164 -0
  106. data/spec/integration/ip_messaging/v1/credential_spec.rb +13 -13
  107. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +11 -11
  108. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +14 -14
  109. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +14 -14
  110. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +25 -25
  111. data/spec/integration/ip_messaging/v1/service/role_spec.rb +13 -13
  112. data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
  113. data/spec/integration/ip_messaging/v1/service/user_spec.rb +17 -17
  114. data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
  115. data/spec/integration/ip_messaging/v2/credential_spec.rb +13 -13
  116. data/spec/integration/ip_messaging/v2/service/binding_spec.rb +11 -11
  117. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +11 -11
  118. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +13 -13
  119. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +17 -17
  120. data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +15 -15
  121. data/spec/integration/ip_messaging/v2/service/channel_spec.rb +29 -29
  122. data/spec/integration/ip_messaging/v2/service/role_spec.rb +13 -13
  123. data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +9 -9
  124. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +20 -20
  125. data/spec/integration/ip_messaging/v2/service/user_spec.rb +21 -21
  126. data/spec/integration/ip_messaging/v2/service_spec.rb +29 -29
  127. data/spec/integration/lookups/v1/phone_number_spec.rb +7 -7
  128. data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +4 -2
  129. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel → branded_channel}/channel_spec.rb +4 -8
  130. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel_spec.rb → branded_channel_spec.rb} +5 -9
  131. data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +1 -1
  132. data/spec/integration/trunking/v1/trunk/recording_spec.rb +2 -6
  133. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +56 -20
  134. data/spec/integration/verify/v2/service/entity/factor_spec.rb +11 -26
  135. data/spec/integration/verify/v2/service/entity_spec.rb +4 -12
  136. data/spec/integration/verify/v2/service_spec.rb +8 -4
  137. data/spec/integration/video/v1/room/room_recording_rule_spec.rb +89 -0
  138. data/spec/integration/video/v1/room_spec.rb +10 -5
  139. data/spec/jwt/access_token_spec.rb +9 -1
  140. data/spec/rest/client_spec.rb +24 -2
  141. data/twilio-ruby.gemspec +2 -1
  142. metadata +42 -28
  143. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +0 -243
  144. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +0 -233
  145. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +0 -260
  146. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +0 -189
  147. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +0 -108
  148. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb +0 -260
  149. data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +0 -342
  150. data/spec/integration/preview/trusted_comms/branded_call_spec.rb +0 -59
  151. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +0 -48
  152. data/spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb +0 -56
  153. data/spec/integration/preview/trusted_comms/business/insights_spec.rb +0 -12
  154. data/spec/integration/preview/trusted_comms/business_spec.rb +0 -46
  155. data/spec/integration/preview/trusted_comms/phone_call_spec.rb +0 -59
@@ -14,17 +14,15 @@ describe 'Entity' do
14
14
 
15
15
  expect {
16
16
  @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
- .entities.create(identity: 'identity', twilio_sandbox_mode: 'twilio_sandbox_mode')
17
+ .entities.create(identity: 'identity')
18
18
  }.to raise_exception(Twilio::REST::TwilioError)
19
19
 
20
20
  values = {'Identity' => 'identity', }
21
- headers = {'Twilio-Sandbox-Mode' => 'twilio_sandbox_mode', }
22
21
  expect(
23
22
  @holodeck.has_request?(Holodeck::Request.new(
24
23
  method: 'post',
25
24
  url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities',
26
25
  data: values,
27
- headers: headers,
28
26
  ))).to eq(true)
29
27
  end
30
28
 
@@ -59,15 +57,13 @@ describe 'Entity' do
59
57
 
60
58
  expect {
61
59
  @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
62
- .entities('identity').delete(twilio_sandbox_mode: 'twilio_sandbox_mode')
60
+ .entities('identity').delete()
63
61
  }.to raise_exception(Twilio::REST::TwilioError)
64
62
 
65
- headers = {'Twilio-Sandbox-Mode' => 'twilio_sandbox_mode', }
66
63
  expect(
67
64
  @holodeck.has_request?(Holodeck::Request.new(
68
65
  method: 'delete',
69
66
  url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity',
70
- headers: headers,
71
67
  ))).to eq(true)
72
68
  end
73
69
 
@@ -88,15 +84,13 @@ describe 'Entity' do
88
84
 
89
85
  expect {
90
86
  @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
91
- .entities('identity').fetch(twilio_sandbox_mode: 'twilio_sandbox_mode')
87
+ .entities('identity').fetch()
92
88
  }.to raise_exception(Twilio::REST::TwilioError)
93
89
 
94
- headers = {'Twilio-Sandbox-Mode' => 'twilio_sandbox_mode', }
95
90
  expect(
96
91
  @holodeck.has_request?(Holodeck::Request.new(
97
92
  method: 'get',
98
93
  url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity',
99
- headers: headers,
100
94
  ))).to eq(true)
101
95
  end
102
96
 
@@ -131,15 +125,13 @@ describe 'Entity' do
131
125
 
132
126
  expect {
133
127
  @client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
134
- .entities.list(twilio_sandbox_mode: 'twilio_sandbox_mode')
128
+ .entities.list()
135
129
  }.to raise_exception(Twilio::REST::TwilioError)
136
130
 
137
- headers = {'Twilio-Sandbox-Mode' => 'twilio_sandbox_mode', }
138
131
  expect(
139
132
  @holodeck.has_request?(Holodeck::Request.new(
140
133
  method: 'get',
141
134
  url: 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities',
142
- headers: headers,
143
135
  ))).to eq(true)
144
136
  end
145
137
 
@@ -44,7 +44,8 @@ describe 'Service' do
44
44
  "custom_code_enabled": true,
45
45
  "push": {
46
46
  "include_date": true,
47
- "notify_service_sid": null
47
+ "apn_credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
+ "fcm_credential_sid": null
48
49
  },
49
50
  "date_created": "2015-07-30T20:00:00Z",
50
51
  "date_updated": "2015-07-30T20:00:00Z",
@@ -100,7 +101,8 @@ describe 'Service' do
100
101
  "custom_code_enabled": true,
101
102
  "push": {
102
103
  "include_date": true,
103
- "notify_service_sid": null
104
+ "apn_credential_sid": null,
105
+ "fcm_credential_sid": null
104
106
  },
105
107
  "date_created": "2015-07-30T20:00:00Z",
106
108
  "date_updated": "2015-07-30T20:00:00Z",
@@ -192,7 +194,8 @@ describe 'Service' do
192
194
  "custom_code_enabled": true,
193
195
  "push": {
194
196
  "include_date": true,
195
- "notify_service_sid": null
197
+ "apn_credential_sid": null,
198
+ "fcm_credential_sid": null
196
199
  },
197
200
  "date_created": "2015-07-30T20:00:00Z",
198
201
  "date_updated": "2015-07-30T20:00:00Z",
@@ -250,7 +253,8 @@ describe 'Service' do
250
253
  "custom_code_enabled": true,
251
254
  "push": {
252
255
  "include_date": true,
253
- "notify_service_sid": null
256
+ "apn_credential_sid": null,
257
+ "fcm_credential_sid": "CRbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
254
258
  },
255
259
  "date_created": "2015-07-30T20:00:00Z",
256
260
  "date_updated": "2015-07-30T20:00:00Z",
@@ -0,0 +1,89 @@
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 'RecordingRules' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .recording_rules.fetch()
18
+ }.to raise_exception(Twilio::REST::TwilioError)
19
+
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RecordingRules',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "date_created": "2015-07-30T20:00:00Z",
34
+ "date_updated": "2015-07-30T20:00:00Z",
35
+ "rules": [
36
+ {
37
+ "type": "include",
38
+ "all": true
39
+ }
40
+ ]
41
+ }
42
+ ]
43
+ ))
44
+
45
+ actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
46
+ .recording_rules.fetch()
47
+
48
+ expect(actual).to_not eq(nil)
49
+ end
50
+
51
+ it "can update" do
52
+ @holodeck.mock(Twilio::Response.new(500, ''))
53
+
54
+ expect {
55
+ @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
56
+ .recording_rules.update()
57
+ }.to raise_exception(Twilio::REST::TwilioError)
58
+
59
+ expect(
60
+ @holodeck.has_request?(Holodeck::Request.new(
61
+ method: 'post',
62
+ url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RecordingRules',
63
+ ))).to eq(true)
64
+ end
65
+
66
+ it "receives update responses" do
67
+ @holodeck.mock(Twilio::Response.new(
68
+ 200,
69
+ %q[
70
+ {
71
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72
+ "date_created": "2015-07-30T20:00:00Z",
73
+ "date_updated": "2015-07-30T20:00:00Z",
74
+ "rules": [
75
+ {
76
+ "type": "include",
77
+ "all": true
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ ))
83
+
84
+ actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
85
+ .recording_rules.update()
86
+
87
+ expect(actual).to_not eq(nil)
88
+ end
89
+ end
@@ -49,7 +49,8 @@ describe 'Room' do
49
49
  "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
50
50
  "links": {
51
51
  "participants": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
52
- "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings"
52
+ "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings",
53
+ "recording_rules": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RecordingRules"
53
54
  }
54
55
  }
55
56
  ]
@@ -100,7 +101,8 @@ describe 'Room' do
100
101
  "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
101
102
  "links": {
102
103
  "participants": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
103
- "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings"
104
+ "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings",
105
+ "recording_rules": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RecordingRules"
104
106
  }
105
107
  }
106
108
  ]
@@ -137,7 +139,8 @@ describe 'Room' do
137
139
  "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
138
140
  "links": {
139
141
  "participants": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
140
- "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings"
142
+ "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings",
143
+ "recording_rules": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RecordingRules"
141
144
  }
142
145
  }
143
146
  ]
@@ -214,7 +217,8 @@ describe 'Room' do
214
217
  "url": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c",
215
218
  "links": {
216
219
  "participants": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c/Participants",
217
- "recordings": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c/Recordings"
220
+ "recordings": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c/Recordings",
221
+ "recording_rules": "https://video.twilio.com/v1/Rooms/RM4070b618362c1682b2385b1f9982833c/RecordingRules"
218
222
  }
219
223
  }
220
224
  ],
@@ -278,7 +282,8 @@ describe 'Room' do
278
282
  "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
279
283
  "links": {
280
284
  "participants": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
281
- "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings"
285
+ "recordings": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings",
286
+ "recording_rules": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RecordingRules"
282
287
  }
283
288
  }
284
289
  ]
@@ -14,10 +14,18 @@ describe Twilio::JWT::AccessToken do
14
14
  expect(payload['grants'].count).to eq(0)
15
15
  end
16
16
 
17
- it 'should add the proper headers' do
17
+ it 'should add the proper headers without region' do
18
18
  scat = Twilio::JWT::AccessToken.new 'AC123', 'SK123', 'secret'
19
19
  _, headers = JWT.decode scat.to_s, 'secret'
20
20
  expect(headers['cty']).to eq('twilio-fpa;v=1')
21
+ expect(headers['twr']).to be_nil
22
+ end
23
+
24
+ it 'should add the proper headers with region' do
25
+ scat = Twilio::JWT::AccessToken.new 'AC123', 'SK123', 'secret', region: 'foo'
26
+ _, headers = JWT.decode scat.to_s, 'secret'
27
+ expect(headers['cty']).to eq('twilio-fpa;v=1')
28
+ expect(headers['twr']).to eq('foo')
21
29
  end
22
30
 
23
31
  it 'identity should exist in the grants' do
@@ -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|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
22
  spec.require_paths = ['lib']
23
23
  spec.required_ruby_version = '>= 2.0.0'
24
- spec.extra_rdoc_files = ['README.md', 'LICENSE.md']
24
+ spec.extra_rdoc_files = ['README.md', 'LICENSE']
25
25
  spec.rdoc_options = ['--line-numbers', '--inline-source', '--title', 'twilio-ruby', '--main', 'README.md']
26
26
 
27
27
  spec.add_dependency('jwt', '>= 1.5', '<= 2.5')
@@ -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.40.4
4
+ version: 5.45.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-09-28 00:00:00.000000000 Z
11
+ date: 2020-12-08 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:
@@ -195,7 +209,7 @@ executables: []
195
209
  extensions: []
196
210
  extra_rdoc_files:
197
211
  - README.md
198
- - LICENSE.md
212
+ - LICENSE
199
213
  files:
200
214
  - ".dockerignore"
201
215
  - ".gitignore"
@@ -209,7 +223,7 @@ files:
209
223
  - Dockerfile
210
224
  - Gemfile
211
225
  - ISSUE_TEMPLATE.md
212
- - LICENSE.md
226
+ - LICENSE
213
227
  - Makefile
214
228
  - PULL_REQUEST_TEMPLATE.md
215
229
  - README.md
@@ -241,9 +255,11 @@ files:
241
255
  - lib/twilio-ruby/jwt/task_router.rb
242
256
  - lib/twilio-ruby/rest/accounts.rb
243
257
  - lib/twilio-ruby/rest/accounts/v1.rb
258
+ - lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb
244
259
  - lib/twilio-ruby/rest/accounts/v1/credential.rb
245
260
  - lib/twilio-ruby/rest/accounts/v1/credential/aws.rb
246
261
  - lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb
262
+ - lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb
247
263
  - lib/twilio-ruby/rest/api.rb
248
264
  - lib/twilio-ruby/rest/api/v2010.rb
249
265
  - lib/twilio-ruby/rest/api/v2010/account.rb
@@ -261,6 +277,7 @@ files:
261
277
  - lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb
262
278
  - lib/twilio-ruby/rest/api/v2010/account/balance.rb
263
279
  - lib/twilio-ruby/rest/api/v2010/account/call.rb
280
+ - lib/twilio-ruby/rest/api/v2010/account/call/event.rb
264
281
  - lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb
265
282
  - lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb
266
283
  - lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
@@ -418,6 +435,8 @@ files:
418
435
  - lib/twilio-ruby/rest/insights/v1/call/event.rb
419
436
  - lib/twilio-ruby/rest/insights/v1/call/metric.rb
420
437
  - lib/twilio-ruby/rest/insights/v1/call/summary.rb
438
+ - lib/twilio-ruby/rest/insights/v1/room.rb
439
+ - lib/twilio-ruby/rest/insights/v1/room/participant.rb
421
440
  - lib/twilio-ruby/rest/ip_messaging.rb
422
441
  - lib/twilio-ruby/rest/ip_messaging/v1.rb
423
442
  - lib/twilio-ruby/rest/ip_messaging/v1/credential.rb
@@ -506,17 +525,11 @@ files:
506
525
  - lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
507
526
  - lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
508
527
  - lib/twilio-ruby/rest/preview/trusted_comms.rb
509
- - lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb
528
+ - lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb
529
+ - lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb
510
530
  - lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb
511
- - lib/twilio-ruby/rest/preview/trusted_comms/business.rb
512
- - lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb
513
- - lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb
514
- - lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb
515
- - lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb
516
- - lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb
517
531
  - lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
518
532
  - lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb
519
- - lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb
520
533
  - lib/twilio-ruby/rest/preview/understand.rb
521
534
  - lib/twilio-ruby/rest/preview/understand/assistant.rb
522
535
  - lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb
@@ -677,6 +690,7 @@ files:
677
690
  - lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb
678
691
  - lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb
679
692
  - lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
693
+ - lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb
680
694
  - lib/twilio-ruby/rest/voice.rb
681
695
  - lib/twilio-ruby/rest/voice/v1.rb
682
696
  - lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
@@ -711,9 +725,11 @@ files:
711
725
  - spec/holodeck/holodeck.rb
712
726
  - spec/holodeck/hologram.rb
713
727
  - spec/http/http_client_spec.rb
728
+ - spec/integration/accounts/v1/auth_token_promotion_spec.rb
714
729
  - spec/integration/accounts/v1/credential/aws_spec.rb
715
730
  - spec/integration/accounts/v1/credential/public_key_spec.rb
716
731
  - spec/integration/accounts/v1/credential_spec.rb
732
+ - spec/integration/accounts/v1/secondary_auth_token_spec.rb
717
733
  - spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb
718
734
  - spec/integration/api/v2010/account/address_spec.rb
719
735
  - spec/integration/api/v2010/account/application_spec.rb
@@ -727,6 +743,7 @@ files:
727
743
  - spec/integration/api/v2010/account/available_phone_number/voip_spec.rb
728
744
  - spec/integration/api/v2010/account/available_phone_number_spec.rb
729
745
  - spec/integration/api/v2010/account/balance_spec.rb
746
+ - spec/integration/api/v2010/account/call/event_spec.rb
730
747
  - spec/integration/api/v2010/account/call/feedback_spec.rb
731
748
  - spec/integration/api/v2010/account/call/feedback_summary_spec.rb
732
749
  - spec/integration/api/v2010/account/call/notification_spec.rb
@@ -868,6 +885,8 @@ files:
868
885
  - spec/integration/insights/v1/call/metric_spec.rb
869
886
  - spec/integration/insights/v1/call/summary_spec.rb
870
887
  - spec/integration/insights/v1/call_spec.rb
888
+ - spec/integration/insights/v1/room/participant_spec.rb
889
+ - spec/integration/insights/v1/room_spec.rb
871
890
  - spec/integration/ip_messaging/v1/credential_spec.rb
872
891
  - spec/integration/ip_messaging/v1/service/channel/invite_spec.rb
873
892
  - spec/integration/ip_messaging/v1/service/channel/member_spec.rb
@@ -936,17 +955,11 @@ files:
936
955
  - spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb
937
956
  - spec/integration/preview/sync/service/sync_map_spec.rb
938
957
  - spec/integration/preview/sync/service_spec.rb
939
- - spec/integration/preview/trusted_comms/branded_call_spec.rb
958
+ - spec/integration/preview/trusted_comms/branded_channel/channel_spec.rb
959
+ - spec/integration/preview/trusted_comms/branded_channel_spec.rb
940
960
  - spec/integration/preview/trusted_comms/brands_information_spec.rb
941
- - spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb
942
- - spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb
943
- - spec/integration/preview/trusted_comms/business/brand_spec.rb
944
- - spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
945
- - spec/integration/preview/trusted_comms/business/insights_spec.rb
946
- - spec/integration/preview/trusted_comms/business_spec.rb
947
961
  - spec/integration/preview/trusted_comms/cps_spec.rb
948
962
  - spec/integration/preview/trusted_comms/current_call_spec.rb
949
- - spec/integration/preview/trusted_comms/phone_call_spec.rb
950
963
  - spec/integration/preview/understand/assistant/assistant_fallback_actions_spec.rb
951
964
  - spec/integration/preview/understand/assistant/assistant_initiation_actions_spec.rb
952
965
  - spec/integration/preview/understand/assistant/dialogue_spec.rb
@@ -1082,6 +1095,7 @@ files:
1082
1095
  - spec/integration/video/v1/room/room_participant/room_participant_subscribe_rule_spec.rb
1083
1096
  - spec/integration/video/v1/room/room_participant/room_participant_subscribed_track_spec.rb
1084
1097
  - spec/integration/video/v1/room/room_participant_spec.rb
1098
+ - spec/integration/video/v1/room/room_recording_rule_spec.rb
1085
1099
  - spec/integration/video/v1/room_spec.rb
1086
1100
  - spec/integration/voice/v1/byoc_trunk_spec.rb
1087
1101
  - spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb
@@ -1151,9 +1165,11 @@ test_files:
1151
1165
  - spec/holodeck/holodeck.rb
1152
1166
  - spec/holodeck/hologram.rb
1153
1167
  - spec/http/http_client_spec.rb
1168
+ - spec/integration/accounts/v1/auth_token_promotion_spec.rb
1154
1169
  - spec/integration/accounts/v1/credential/aws_spec.rb
1155
1170
  - spec/integration/accounts/v1/credential/public_key_spec.rb
1156
1171
  - spec/integration/accounts/v1/credential_spec.rb
1172
+ - spec/integration/accounts/v1/secondary_auth_token_spec.rb
1157
1173
  - spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb
1158
1174
  - spec/integration/api/v2010/account/address_spec.rb
1159
1175
  - spec/integration/api/v2010/account/application_spec.rb
@@ -1167,6 +1183,7 @@ test_files:
1167
1183
  - spec/integration/api/v2010/account/available_phone_number/voip_spec.rb
1168
1184
  - spec/integration/api/v2010/account/available_phone_number_spec.rb
1169
1185
  - spec/integration/api/v2010/account/balance_spec.rb
1186
+ - spec/integration/api/v2010/account/call/event_spec.rb
1170
1187
  - spec/integration/api/v2010/account/call/feedback_spec.rb
1171
1188
  - spec/integration/api/v2010/account/call/feedback_summary_spec.rb
1172
1189
  - spec/integration/api/v2010/account/call/notification_spec.rb
@@ -1308,6 +1325,8 @@ test_files:
1308
1325
  - spec/integration/insights/v1/call/metric_spec.rb
1309
1326
  - spec/integration/insights/v1/call/summary_spec.rb
1310
1327
  - spec/integration/insights/v1/call_spec.rb
1328
+ - spec/integration/insights/v1/room/participant_spec.rb
1329
+ - spec/integration/insights/v1/room_spec.rb
1311
1330
  - spec/integration/ip_messaging/v1/credential_spec.rb
1312
1331
  - spec/integration/ip_messaging/v1/service/channel/invite_spec.rb
1313
1332
  - spec/integration/ip_messaging/v1/service/channel/member_spec.rb
@@ -1376,17 +1395,11 @@ test_files:
1376
1395
  - spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb
1377
1396
  - spec/integration/preview/sync/service/sync_map_spec.rb
1378
1397
  - spec/integration/preview/sync/service_spec.rb
1379
- - spec/integration/preview/trusted_comms/branded_call_spec.rb
1398
+ - spec/integration/preview/trusted_comms/branded_channel/channel_spec.rb
1399
+ - spec/integration/preview/trusted_comms/branded_channel_spec.rb
1380
1400
  - spec/integration/preview/trusted_comms/brands_information_spec.rb
1381
- - spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb
1382
- - spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb
1383
- - spec/integration/preview/trusted_comms/business/brand_spec.rb
1384
- - spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
1385
- - spec/integration/preview/trusted_comms/business/insights_spec.rb
1386
- - spec/integration/preview/trusted_comms/business_spec.rb
1387
1401
  - spec/integration/preview/trusted_comms/cps_spec.rb
1388
1402
  - spec/integration/preview/trusted_comms/current_call_spec.rb
1389
- - spec/integration/preview/trusted_comms/phone_call_spec.rb
1390
1403
  - spec/integration/preview/understand/assistant/assistant_fallback_actions_spec.rb
1391
1404
  - spec/integration/preview/understand/assistant/assistant_initiation_actions_spec.rb
1392
1405
  - spec/integration/preview/understand/assistant/dialogue_spec.rb
@@ -1522,6 +1535,7 @@ test_files:
1522
1535
  - spec/integration/video/v1/room/room_participant/room_participant_subscribe_rule_spec.rb
1523
1536
  - spec/integration/video/v1/room/room_participant/room_participant_subscribed_track_spec.rb
1524
1537
  - spec/integration/video/v1/room/room_participant_spec.rb
1538
+ - spec/integration/video/v1/room/room_recording_rule_spec.rb
1525
1539
  - spec/integration/video/v1/room_spec.rb
1526
1540
  - spec/integration/voice/v1/byoc_trunk_spec.rb
1527
1541
  - spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb