twilio-ruby 5.41.0 → 5.42.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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +28 -0
  3. data/{LICENSE.md → LICENSE} +0 -0
  4. data/PULL_REQUEST_TEMPLATE.md +3 -3
  5. data/README.md +2 -2
  6. data/lib/twilio-ruby/jwt/access_token.rb +7 -2
  7. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +5 -22
  8. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +25 -40
  9. data/lib/twilio-ruby/rest/insights.rb +8 -0
  10. data/lib/twilio-ruby/rest/insights/v1.rb +15 -0
  11. data/lib/twilio-ruby/rest/insights/v1/room.rb +487 -0
  12. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +385 -0
  13. data/lib/twilio-ruby/rest/ip_messaging.rb +8 -10
  14. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -8
  15. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +29 -68
  16. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +198 -313
  17. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +32 -59
  18. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +23 -55
  19. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +28 -71
  20. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +31 -59
  21. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +19 -39
  22. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +29 -51
  23. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +12 -18
  24. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -6
  25. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +29 -66
  26. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +116 -205
  27. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +23 -50
  28. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +41 -91
  29. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +23 -50
  30. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +42 -118
  31. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +46 -100
  32. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +36 -89
  33. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +19 -41
  34. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +29 -53
  35. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +23 -53
  36. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +27 -56
  37. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +5 -22
  38. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +21 -39
  39. data/lib/twilio-ruby/rest/verify/v2/form.rb +4 -4
  40. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +3 -3
  41. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +20 -34
  42. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +22 -46
  43. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +24 -42
  44. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +4 -4
  45. data/lib/twilio-ruby/rest/video/v1/room.rb +20 -0
  46. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +150 -0
  47. data/lib/twilio-ruby/version.rb +1 -1
  48. data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +4 -2
  49. data/spec/integration/events/v1/sink/sink_test_spec.rb +1 -1
  50. data/spec/integration/insights/v1/room/participant_spec.rb +149 -0
  51. data/spec/integration/insights/v1/room_spec.rb +164 -0
  52. data/spec/integration/ip_messaging/v1/credential_spec.rb +13 -13
  53. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +11 -11
  54. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +14 -14
  55. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +14 -14
  56. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +25 -25
  57. data/spec/integration/ip_messaging/v1/service/role_spec.rb +13 -13
  58. data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
  59. data/spec/integration/ip_messaging/v1/service/user_spec.rb +17 -17
  60. data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
  61. data/spec/integration/ip_messaging/v2/credential_spec.rb +13 -13
  62. data/spec/integration/ip_messaging/v2/service/binding_spec.rb +11 -11
  63. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +11 -11
  64. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +13 -13
  65. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +17 -17
  66. data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +15 -15
  67. data/spec/integration/ip_messaging/v2/service/channel_spec.rb +29 -29
  68. data/spec/integration/ip_messaging/v2/service/role_spec.rb +13 -13
  69. data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +9 -9
  70. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +20 -20
  71. data/spec/integration/ip_messaging/v2/service/user_spec.rb +21 -21
  72. data/spec/integration/ip_messaging/v2/service_spec.rb +29 -29
  73. data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +4 -2
  74. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +4 -12
  75. data/spec/integration/verify/v2/service/entity/factor_spec.rb +5 -15
  76. data/spec/integration/verify/v2/service/entity_spec.rb +4 -12
  77. data/spec/integration/video/v1/room/room_recording_rule_spec.rb +89 -0
  78. data/spec/integration/video/v1/room_spec.rb +10 -5
  79. data/spec/jwt/access_token_spec.rb +9 -1
  80. data/twilio-ruby.gemspec +1 -1
  81. metadata +13 -4
@@ -12,7 +12,7 @@ module Twilio
12
12
  class V2 < Version
13
13
  class ServiceContext < InstanceContext
14
14
  ##
15
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
16
  class WebhookList < ListResource
17
17
  ##
18
18
  # Initialize the WebhookList
@@ -139,7 +139,7 @@ module Twilio
139
139
  end
140
140
 
141
141
  ##
142
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
142
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
143
143
  class WebhookPage < Page
144
144
  ##
145
145
  # Initialize the WebhookPage
@@ -170,7 +170,7 @@ module Twilio
170
170
  end
171
171
 
172
172
  ##
173
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
173
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
174
174
  class WebhookContext < InstanceContext
175
175
  ##
176
176
  # Initialize the WebhookContext
@@ -243,7 +243,7 @@ module Twilio
243
243
  end
244
244
 
245
245
  ##
246
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
246
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
247
247
  class WebhookInstance < InstanceResource
248
248
  ##
249
249
  # Initialize the WebhookInstance
@@ -244,6 +244,7 @@ module Twilio
244
244
  # Dependents
245
245
  @recordings = nil
246
246
  @participants = nil
247
+ @recording_rules = nil
247
248
  end
248
249
 
249
250
  ##
@@ -304,6 +305,18 @@ module Twilio
304
305
  @participants
305
306
  end
306
307
 
308
+ ##
309
+ # Access the recording_rules
310
+ # @return [RecordingRulesList]
311
+ # @return [RecordingRulesContext]
312
+ def recording_rules
313
+ unless @recording_rules
314
+ @recording_rules = RecordingRulesList.new(@version, room_sid: @solution[:sid], )
315
+ end
316
+
317
+ @recording_rules
318
+ end
319
+
307
320
  ##
308
321
  # Provide a user friendly representation
309
322
  def to_s
@@ -505,6 +518,13 @@ module Twilio
505
518
  context.participants
506
519
  end
507
520
 
521
+ ##
522
+ # Access the recording_rules
523
+ # @return [recording_rules] recording_rules
524
+ def recording_rules
525
+ context.recording_rules
526
+ end
527
+
508
528
  ##
509
529
  # Provide a user friendly representation
510
530
  def to_s
@@ -0,0 +1,150 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Video < Domain
12
+ class V1 < Version
13
+ class RoomContext < InstanceContext
14
+ ##
15
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
+ class RecordingRulesList < ListResource
17
+ ##
18
+ # Initialize the RecordingRulesList
19
+ # @param [Version] version Version that contains the resource
20
+ # @param [String] room_sid The SID of the Room resource for the Recording Rules
21
+ # @return [RecordingRulesList] RecordingRulesList
22
+ def initialize(version, room_sid: nil)
23
+ super(version)
24
+
25
+ # Path Solution
26
+ @solution = {room_sid: room_sid}
27
+ @uri = "/Rooms/#{@solution[:room_sid]}/RecordingRules"
28
+ end
29
+
30
+ ##
31
+ # Fetch the RecordingRulesInstance
32
+ # @return [RecordingRulesInstance] Fetched RecordingRulesInstance
33
+ def fetch
34
+ payload = @version.fetch('GET', @uri)
35
+
36
+ RecordingRulesInstance.new(@version, payload, room_sid: @solution[:room_sid], )
37
+ end
38
+
39
+ ##
40
+ # Update the RecordingRulesInstance
41
+ # @param [Hash] rules A JSON-encoded array of recording rules.
42
+ # @return [RecordingRulesInstance] Updated RecordingRulesInstance
43
+ def update(rules: :unset)
44
+ data = Twilio::Values.of({'Rules' => Twilio.serialize_object(rules), })
45
+
46
+ payload = @version.update('POST', @uri, data: data)
47
+
48
+ RecordingRulesInstance.new(@version, payload, room_sid: @solution[:room_sid], )
49
+ end
50
+
51
+ ##
52
+ # Provide a user friendly representation
53
+ def to_s
54
+ '#<Twilio.Video.V1.RecordingRulesList>'
55
+ end
56
+ end
57
+
58
+ ##
59
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
60
+ class RecordingRulesPage < Page
61
+ ##
62
+ # Initialize the RecordingRulesPage
63
+ # @param [Version] version Version that contains the resource
64
+ # @param [Response] response Response from the API
65
+ # @param [Hash] solution Path solution for the resource
66
+ # @return [RecordingRulesPage] RecordingRulesPage
67
+ def initialize(version, response, solution)
68
+ super(version, response)
69
+
70
+ # Path Solution
71
+ @solution = solution
72
+ end
73
+
74
+ ##
75
+ # Build an instance of RecordingRulesInstance
76
+ # @param [Hash] payload Payload response from the API
77
+ # @return [RecordingRulesInstance] RecordingRulesInstance
78
+ def get_instance(payload)
79
+ RecordingRulesInstance.new(@version, payload, room_sid: @solution[:room_sid], )
80
+ end
81
+
82
+ ##
83
+ # Provide a user friendly representation
84
+ def to_s
85
+ '<Twilio.Video.V1.RecordingRulesPage>'
86
+ end
87
+ end
88
+
89
+ ##
90
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
91
+ class RecordingRulesInstance < InstanceResource
92
+ ##
93
+ # Initialize the RecordingRulesInstance
94
+ # @param [Version] version Version that contains the resource
95
+ # @param [Hash] payload payload that contains response from Twilio
96
+ # @param [String] room_sid The SID of the Room resource for the Recording Rules
97
+ # @return [RecordingRulesInstance] RecordingRulesInstance
98
+ def initialize(version, payload, room_sid: nil)
99
+ super(version)
100
+
101
+ # Marshaled Properties
102
+ @properties = {
103
+ 'room_sid' => payload['room_sid'],
104
+ 'rules' => payload['rules'],
105
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
106
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
107
+ }
108
+ end
109
+
110
+ ##
111
+ # @return [String] The SID of the Room resource for the Recording Rules
112
+ def room_sid
113
+ @properties['room_sid']
114
+ end
115
+
116
+ ##
117
+ # @return [String] A collection of recording Rules that describe how to include or exclude matching tracks for recording
118
+ def rules
119
+ @properties['rules']
120
+ end
121
+
122
+ ##
123
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
124
+ def date_created
125
+ @properties['date_created']
126
+ end
127
+
128
+ ##
129
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
130
+ def date_updated
131
+ @properties['date_updated']
132
+ end
133
+
134
+ ##
135
+ # Provide a user friendly representation
136
+ def to_s
137
+ "<Twilio.Video.V1.RecordingRulesInstance>"
138
+ end
139
+
140
+ ##
141
+ # Provide a detailed, user friendly representation
142
+ def inspect
143
+ "<Twilio.Video.V1.RecordingRulesInstance>"
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
149
+ end
150
+ end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.41.0'
2
+ VERSION = '5.42.0'
3
3
  end
@@ -91,13 +91,15 @@ describe 'ExportCustomJob' do
91
91
 
92
92
  expect {
93
93
  @client.bulkexports.v1.exports('resource_type') \
94
- .export_custom_jobs.create()
94
+ .export_custom_jobs.create(start_day: 'start_day', end_day: 'end_day', friendly_name: 'friendly_name')
95
95
  }.to raise_exception(Twilio::REST::TwilioError)
96
96
 
97
+ values = {'StartDay' => 'start_day', 'EndDay' => 'end_day', 'FriendlyName' => 'friendly_name', }
97
98
  expect(
98
99
  @holodeck.has_request?(Holodeck::Request.new(
99
100
  method: 'post',
100
101
  url: 'https://bulkexports.twilio.com/v1/Exports/resource_type/Jobs',
102
+ data: values,
101
103
  ))).to eq(true)
102
104
  end
103
105
 
@@ -120,7 +122,7 @@ describe 'ExportCustomJob' do
120
122
  ))
121
123
 
122
124
  actual = @client.bulkexports.v1.exports('resource_type') \
123
- .export_custom_jobs.create()
125
+ .export_custom_jobs.create(start_day: 'start_day', end_day: 'end_day', friendly_name: 'friendly_name')
124
126
 
125
127
  expect(actual).to_not eq(nil)
126
128
  end
@@ -29,7 +29,7 @@ describe 'SinkTest' do
29
29
  201,
30
30
  %q[
31
31
  {
32
- "result": "valid"
32
+ "result": "submitted"
33
33
  }
34
34
  ]
35
35
  ))
@@ -0,0 +1,149 @@
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 'Participant' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
18
+ }.to raise_exception(Twilio::REST::TwilioError)
19
+
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://insights.twilio.com/v1/Video/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
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
+ "publisher_info": {},
33
+ "edge_location": "Ashburn",
34
+ "join_time": "2015-07-30T20:00:00Z",
35
+ "leave_time": "2015-07-30T20:00:00Z",
36
+ "end_reason": "disconnected_via_api",
37
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "error_code": 0,
39
+ "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
+ "media_region": "us1",
41
+ "properties": {},
42
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
43
+ "error_code_url": "error_code_url",
44
+ "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45
+ "codecs": [
46
+ "VP8"
47
+ ],
48
+ "status": "in_progress",
49
+ "duration_sec": 50000000,
50
+ "participant_identity": "participant_identity",
51
+ "url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
52
+ }
53
+ ]
54
+ ))
55
+
56
+ actual = @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
57
+ .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
58
+
59
+ expect(actual).to_not eq(nil)
60
+ end
61
+
62
+ it "can read" do
63
+ @holodeck.mock(Twilio::Response.new(500, ''))
64
+
65
+ expect {
66
+ @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
67
+ .participants.list()
68
+ }.to raise_exception(Twilio::REST::TwilioError)
69
+
70
+ expect(
71
+ @holodeck.has_request?(Holodeck::Request.new(
72
+ method: 'get',
73
+ url: 'https://insights.twilio.com/v1/Video/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants',
74
+ ))).to eq(true)
75
+ end
76
+
77
+ it "receives read_empty responses" do
78
+ @holodeck.mock(Twilio::Response.new(
79
+ 200,
80
+ %q[
81
+ {
82
+ "meta": {
83
+ "url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
84
+ "key": "participants",
85
+ "first_page_url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
86
+ "page_size": 50,
87
+ "next_page_url": null,
88
+ "page": 0,
89
+ "previous_page_url": null
90
+ },
91
+ "participants": []
92
+ }
93
+ ]
94
+ ))
95
+
96
+ actual = @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
97
+ .participants.list()
98
+
99
+ expect(actual).to_not eq(nil)
100
+ end
101
+
102
+ it "receives read_full responses" do
103
+ @holodeck.mock(Twilio::Response.new(
104
+ 200,
105
+ %q[
106
+ {
107
+ "meta": {
108
+ "url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
109
+ "key": "participants",
110
+ "first_page_url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
111
+ "page_size": 50,
112
+ "next_page_url": null,
113
+ "page": 0,
114
+ "previous_page_url": null
115
+ },
116
+ "participants": [
117
+ {
118
+ "publisher_info": {},
119
+ "edge_location": "Ashburn",
120
+ "join_time": "2015-07-30T20:00:00Z",
121
+ "leave_time": "2015-07-30T20:00:00Z",
122
+ "end_reason": "disconnected_via_api",
123
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
124
+ "error_code": 53205,
125
+ "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
126
+ "media_region": "us1",
127
+ "properties": {},
128
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
129
+ "error_code_url": "error_code_url",
130
+ "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
131
+ "codecs": [
132
+ "VP8"
133
+ ],
134
+ "status": "in_progress",
135
+ "duration_sec": 50000000,
136
+ "participant_identity": "participant_identity",
137
+ "url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
138
+ }
139
+ ]
140
+ }
141
+ ]
142
+ ))
143
+
144
+ actual = @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
145
+ .participants.list()
146
+
147
+ expect(actual).to_not eq(nil)
148
+ end
149
+ end
@@ -0,0 +1,164 @@
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 'Room' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ expect(
20
+ @holodeck.has_request?(Holodeck::Request.new(
21
+ method: 'get',
22
+ url: 'https://insights.twilio.com/v1/Video/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
23
+ ))).to eq(true)
24
+ end
25
+
26
+ it "receives fetch responses" do
27
+ @holodeck.mock(Twilio::Response.new(
28
+ 200,
29
+ %q[
30
+ {
31
+ "room_type": "go",
32
+ "unique_participant_identities": 0,
33
+ "codecs": [
34
+ "VP8"
35
+ ],
36
+ "max_participants": 0,
37
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "create_time": "2015-07-30T20:00:00Z",
39
+ "end_reason": "room_ended_via_api",
40
+ "duration_sec": 50000000,
41
+ "room_status": "in_progress",
42
+ "media_region": "us1",
43
+ "recording_enabled": false,
44
+ "edge_location": "Ashburn",
45
+ "max_concurrent_participants": 0,
46
+ "unique_participants": 0,
47
+ "room_name": "room_name",
48
+ "created_method": "sdk",
49
+ "total_participant_duration_sec": 50000000,
50
+ "status_callback_method": "GET",
51
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
52
+ "end_time": "2015-07-30T20:00:00Z",
53
+ "total_recording_duration_sec": 50000000,
54
+ "processing_state": "complete",
55
+ "concurrent_participants": 0,
56
+ "status_callback": "http://www.example.com",
57
+ "url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
58
+ "links": {
59
+ "participants": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
60
+ }
61
+ }
62
+ ]
63
+ ))
64
+
65
+ actual = @client.insights.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
66
+
67
+ expect(actual).to_not eq(nil)
68
+ end
69
+
70
+ it "can read" do
71
+ @holodeck.mock(Twilio::Response.new(500, ''))
72
+
73
+ expect {
74
+ @client.insights.v1.rooms.list()
75
+ }.to raise_exception(Twilio::REST::TwilioError)
76
+
77
+ expect(
78
+ @holodeck.has_request?(Holodeck::Request.new(
79
+ method: 'get',
80
+ url: 'https://insights.twilio.com/v1/Video/Rooms',
81
+ ))).to eq(true)
82
+ end
83
+
84
+ it "receives read_empty responses" do
85
+ @holodeck.mock(Twilio::Response.new(
86
+ 200,
87
+ %q[
88
+ {
89
+ "meta": {
90
+ "first_page_url": "https://insights.twilio.com/v1/Video/Rooms?PageSize=50&Page=0",
91
+ "url": "https://insights.twilio.com/v1/Video/Rooms?PageSize=50&Page=0",
92
+ "page_size": 50,
93
+ "next_page_url": null,
94
+ "key": "rooms",
95
+ "page": 0,
96
+ "previous_page_url": null
97
+ },
98
+ "rooms": []
99
+ }
100
+ ]
101
+ ))
102
+
103
+ actual = @client.insights.v1.rooms.list()
104
+
105
+ expect(actual).to_not eq(nil)
106
+ end
107
+
108
+ it "receives read_full responses" do
109
+ @holodeck.mock(Twilio::Response.new(
110
+ 200,
111
+ %q[
112
+ {
113
+ "meta": {
114
+ "first_page_url": "https://insights.twilio.com/v1/Video/Rooms?PageSize=50&Page=0",
115
+ "url": "https://insights.twilio.com/v1/Video/Rooms?PageSize=50&Page=0",
116
+ "page_size": 50,
117
+ "next_page_url": null,
118
+ "key": "rooms",
119
+ "page": 0,
120
+ "previous_page_url": null
121
+ },
122
+ "rooms": [
123
+ {
124
+ "room_type": "go",
125
+ "unique_participant_identities": 0,
126
+ "codecs": [
127
+ "VP8"
128
+ ],
129
+ "max_participants": 0,
130
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
131
+ "create_time": "2015-07-30T20:00:00Z",
132
+ "end_reason": "room_ended_via_api",
133
+ "duration_sec": 50000000,
134
+ "room_status": "in_progress",
135
+ "media_region": "us1",
136
+ "recording_enabled": false,
137
+ "edge_location": "Ashburn",
138
+ "max_concurrent_participants": 0,
139
+ "unique_participants": 0,
140
+ "room_name": "room_name",
141
+ "created_method": "sdk",
142
+ "total_participant_duration_sec": 50000000,
143
+ "status_callback_method": "GET",
144
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
145
+ "end_time": "2015-07-30T20:00:00Z",
146
+ "total_recording_duration_sec": 50000000,
147
+ "processing_state": "complete",
148
+ "concurrent_participants": 0,
149
+ "status_callback": "http://www.example.com",
150
+ "url": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
151
+ "links": {
152
+ "participants": "https://insights.twilio.com/v1/Video/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
153
+ }
154
+ }
155
+ ]
156
+ }
157
+ ]
158
+ ))
159
+
160
+ actual = @client.insights.v1.rooms.list()
161
+
162
+ expect(actual).to_not eq(nil)
163
+ end
164
+ end