twilio-ruby 5.40.4 → 5.45.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,260 +0,0 @@
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 Preview < Domain
12
- class TrustedComms < Version
13
- class BusinessContext < InstanceContext
14
- class BrandContext < InstanceContext
15
- ##
16
- # 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.
17
- class BrandedChannelList < ListResource
18
- ##
19
- # Initialize the BrandedChannelList
20
- # @param [Version] version Version that contains the resource
21
- # @param [String] business_sid The unique SID identifier of the Business.
22
- # @param [String] brand_sid The unique SID identifier of the Brand.
23
- # @return [BrandedChannelList] BrandedChannelList
24
- def initialize(version, business_sid: nil, brand_sid: nil)
25
- super(version)
26
-
27
- # Path Solution
28
- @solution = {business_sid: business_sid, brand_sid: brand_sid}
29
- end
30
-
31
- ##
32
- # Provide a user friendly representation
33
- def to_s
34
- '#<Twilio.Preview.TrustedComms.BrandedChannelList>'
35
- end
36
- end
37
-
38
- ##
39
- # 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.
40
- class BrandedChannelPage < Page
41
- ##
42
- # Initialize the BrandedChannelPage
43
- # @param [Version] version Version that contains the resource
44
- # @param [Response] response Response from the API
45
- # @param [Hash] solution Path solution for the resource
46
- # @return [BrandedChannelPage] BrandedChannelPage
47
- def initialize(version, response, solution)
48
- super(version, response)
49
-
50
- # Path Solution
51
- @solution = solution
52
- end
53
-
54
- ##
55
- # Build an instance of BrandedChannelInstance
56
- # @param [Hash] payload Payload response from the API
57
- # @return [BrandedChannelInstance] BrandedChannelInstance
58
- def get_instance(payload)
59
- BrandedChannelInstance.new(
60
- @version,
61
- payload,
62
- business_sid: @solution[:business_sid],
63
- brand_sid: @solution[:brand_sid],
64
- )
65
- end
66
-
67
- ##
68
- # Provide a user friendly representation
69
- def to_s
70
- '<Twilio.Preview.TrustedComms.BrandedChannelPage>'
71
- end
72
- end
73
-
74
- ##
75
- # 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.
76
- class BrandedChannelContext < InstanceContext
77
- ##
78
- # Initialize the BrandedChannelContext
79
- # @param [Version] version Version that contains the resource
80
- # @param [String] business_sid The unique SID identifier of the Business.
81
- # @param [String] brand_sid The unique SID identifier of the Brand.
82
- # @param [String] sid The unique SID identifier of the Branded Channel.
83
- # @return [BrandedChannelContext] BrandedChannelContext
84
- def initialize(version, business_sid, brand_sid, sid)
85
- super(version)
86
-
87
- # Path Solution
88
- @solution = {business_sid: business_sid, brand_sid: brand_sid, sid: sid, }
89
- @uri = "/Businesses/#{@solution[:business_sid]}/Brands/#{@solution[:brand_sid]}/BrandedChannels/#{@solution[:sid]}"
90
-
91
- # Dependents
92
- @channels = nil
93
- end
94
-
95
- ##
96
- # Fetch the BrandedChannelInstance
97
- # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
98
- def fetch
99
- payload = @version.fetch('GET', @uri)
100
-
101
- BrandedChannelInstance.new(
102
- @version,
103
- payload,
104
- business_sid: @solution[:business_sid],
105
- brand_sid: @solution[:brand_sid],
106
- sid: @solution[:sid],
107
- )
108
- end
109
-
110
- ##
111
- # Access the channels
112
- # @return [ChannelList]
113
- # @return [ChannelContext]
114
- def channels
115
- unless @channels
116
- @channels = ChannelList.new(
117
- @version,
118
- business_sid: @solution[:business_sid],
119
- brand_sid: @solution[:brand_sid],
120
- branded_channel_sid: @solution[:sid],
121
- )
122
- end
123
-
124
- @channels
125
- end
126
-
127
- ##
128
- # Provide a user friendly representation
129
- def to_s
130
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
131
- "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
132
- end
133
-
134
- ##
135
- # Provide a detailed, user friendly representation
136
- def inspect
137
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
138
- "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
139
- end
140
- end
141
-
142
- ##
143
- # 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.
144
- class BrandedChannelInstance < InstanceResource
145
- ##
146
- # Initialize the BrandedChannelInstance
147
- # @param [Version] version Version that contains the resource
148
- # @param [Hash] payload payload that contains response from Twilio
149
- # @param [String] business_sid The unique SID identifier of the Business.
150
- # @param [String] brand_sid The unique SID identifier of the Brand.
151
- # @param [String] sid The unique SID identifier of the Branded Channel.
152
- # @return [BrandedChannelInstance] BrandedChannelInstance
153
- def initialize(version, payload, business_sid: nil, brand_sid: nil, sid: nil)
154
- super(version)
155
-
156
- # Marshaled Properties
157
- @properties = {
158
- 'account_sid' => payload['account_sid'],
159
- 'business_sid' => payload['business_sid'],
160
- 'brand_sid' => payload['brand_sid'],
161
- 'sid' => payload['sid'],
162
- 'links' => payload['links'],
163
- 'url' => payload['url'],
164
- }
165
-
166
- # Context
167
- @instance_context = nil
168
- @params = {
169
- 'business_sid' => business_sid,
170
- 'brand_sid' => brand_sid,
171
- 'sid' => sid || @properties['sid'],
172
- }
173
- end
174
-
175
- ##
176
- # Generate an instance context for the instance, the context is capable of
177
- # performing various actions. All instance actions are proxied to the context
178
- # @return [BrandedChannelContext] BrandedChannelContext for this BrandedChannelInstance
179
- def context
180
- unless @instance_context
181
- @instance_context = BrandedChannelContext.new(
182
- @version,
183
- @params['business_sid'],
184
- @params['brand_sid'],
185
- @params['sid'],
186
- )
187
- end
188
- @instance_context
189
- end
190
-
191
- ##
192
- # @return [String] Account Sid.
193
- def account_sid
194
- @properties['account_sid']
195
- end
196
-
197
- ##
198
- # @return [String] Business Sid.
199
- def business_sid
200
- @properties['business_sid']
201
- end
202
-
203
- ##
204
- # @return [String] Brand Sid.
205
- def brand_sid
206
- @properties['brand_sid']
207
- end
208
-
209
- ##
210
- # @return [String] Branded Channel Sid.
211
- def sid
212
- @properties['sid']
213
- end
214
-
215
- ##
216
- # @return [String] Nested resource URLs.
217
- def links
218
- @properties['links']
219
- end
220
-
221
- ##
222
- # @return [String] The URL of this resource.
223
- def url
224
- @properties['url']
225
- end
226
-
227
- ##
228
- # Fetch the BrandedChannelInstance
229
- # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
230
- def fetch
231
- context.fetch
232
- end
233
-
234
- ##
235
- # Access the channels
236
- # @return [channels] channels
237
- def channels
238
- context.channels
239
- end
240
-
241
- ##
242
- # Provide a user friendly representation
243
- def to_s
244
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
245
- "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
246
- end
247
-
248
- ##
249
- # Provide a detailed, user friendly representation
250
- def inspect
251
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
252
- "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
253
- end
254
- end
255
- end
256
- end
257
- end
258
- end
259
- end
260
- end
@@ -1,189 +0,0 @@
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 Preview < Domain
12
- class TrustedComms < Version
13
- class BusinessContext < InstanceContext
14
- class BrandContext < InstanceContext
15
- class BrandedChannelContext < InstanceContext
16
- ##
17
- # 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.
18
- class ChannelList < ListResource
19
- ##
20
- # Initialize the ChannelList
21
- # @param [Version] version Version that contains the resource
22
- # @param [String] business_sid The unique SID identifier of the Business.
23
- # @param [String] brand_sid The unique SID identifier of the Brand.
24
- # @param [String] branded_channel_sid The unique SID identifier of the Branded
25
- # Channel.
26
- # @return [ChannelList] ChannelList
27
- def initialize(version, business_sid: nil, brand_sid: nil, branded_channel_sid: nil)
28
- super(version)
29
-
30
- # Path Solution
31
- @solution = {
32
- business_sid: business_sid,
33
- brand_sid: brand_sid,
34
- branded_channel_sid: branded_channel_sid
35
- }
36
- @uri = "/Businesses/#{@solution[:business_sid]}/Brands/#{@solution[:brand_sid]}/BrandedChannels/#{@solution[:branded_channel_sid]}/Channels"
37
- end
38
-
39
- ##
40
- # Create the ChannelInstance
41
- # @param [String] phone_number_sid The unique SID identifier of the Phone Number
42
- # of the Phone number to be assigned to the Branded Channel.
43
- # @return [ChannelInstance] Created ChannelInstance
44
- def create(phone_number_sid: nil)
45
- data = Twilio::Values.of({'PhoneNumberSid' => phone_number_sid, })
46
-
47
- payload = @version.create('POST', @uri, data: data)
48
-
49
- ChannelInstance.new(
50
- @version,
51
- payload,
52
- business_sid: @solution[:business_sid],
53
- brand_sid: @solution[:brand_sid],
54
- branded_channel_sid: @solution[:branded_channel_sid],
55
- )
56
- end
57
-
58
- ##
59
- # Provide a user friendly representation
60
- def to_s
61
- '#<Twilio.Preview.TrustedComms.ChannelList>'
62
- end
63
- end
64
-
65
- ##
66
- # 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.
67
- class ChannelPage < Page
68
- ##
69
- # Initialize the ChannelPage
70
- # @param [Version] version Version that contains the resource
71
- # @param [Response] response Response from the API
72
- # @param [Hash] solution Path solution for the resource
73
- # @return [ChannelPage] ChannelPage
74
- def initialize(version, response, solution)
75
- super(version, response)
76
-
77
- # Path Solution
78
- @solution = solution
79
- end
80
-
81
- ##
82
- # Build an instance of ChannelInstance
83
- # @param [Hash] payload Payload response from the API
84
- # @return [ChannelInstance] ChannelInstance
85
- def get_instance(payload)
86
- ChannelInstance.new(
87
- @version,
88
- payload,
89
- business_sid: @solution[:business_sid],
90
- brand_sid: @solution[:brand_sid],
91
- branded_channel_sid: @solution[:branded_channel_sid],
92
- )
93
- end
94
-
95
- ##
96
- # Provide a user friendly representation
97
- def to_s
98
- '<Twilio.Preview.TrustedComms.ChannelPage>'
99
- end
100
- end
101
-
102
- ##
103
- # 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.
104
- class ChannelInstance < InstanceResource
105
- ##
106
- # Initialize the ChannelInstance
107
- # @param [Version] version Version that contains the resource
108
- # @param [Hash] payload payload that contains response from Twilio
109
- # @param [String] business_sid The unique SID identifier of the Business.
110
- # @param [String] brand_sid The unique SID identifier of the Brand.
111
- # @param [String] branded_channel_sid The unique SID identifier of the Branded
112
- # Channel.
113
- # @return [ChannelInstance] ChannelInstance
114
- def initialize(version, payload, business_sid: nil, brand_sid: nil, branded_channel_sid: nil)
115
- super(version)
116
-
117
- # Marshaled Properties
118
- @properties = {
119
- 'account_sid' => payload['account_sid'],
120
- 'business_sid' => payload['business_sid'],
121
- 'brand_sid' => payload['brand_sid'],
122
- 'branded_channel_sid' => payload['branded_channel_sid'],
123
- 'phone_number_sid' => payload['phone_number_sid'],
124
- 'phone_number' => payload['phone_number'],
125
- 'url' => payload['url'],
126
- }
127
- end
128
-
129
- ##
130
- # @return [String] Account Sid.
131
- def account_sid
132
- @properties['account_sid']
133
- end
134
-
135
- ##
136
- # @return [String] Business Sid.
137
- def business_sid
138
- @properties['business_sid']
139
- end
140
-
141
- ##
142
- # @return [String] Brand Sid.
143
- def brand_sid
144
- @properties['brand_sid']
145
- end
146
-
147
- ##
148
- # @return [String] Branded Channel Sid.
149
- def branded_channel_sid
150
- @properties['branded_channel_sid']
151
- end
152
-
153
- ##
154
- # @return [String] Phone Number Sid to be branded.
155
- def phone_number_sid
156
- @properties['phone_number_sid']
157
- end
158
-
159
- ##
160
- # @return [String] Twilio number to assign to the Branded Channel
161
- def phone_number
162
- @properties['phone_number']
163
- end
164
-
165
- ##
166
- # @return [String] The URL of this resource.
167
- def url
168
- @properties['url']
169
- end
170
-
171
- ##
172
- # Provide a user friendly representation
173
- def to_s
174
- "<Twilio.Preview.TrustedComms.ChannelInstance>"
175
- end
176
-
177
- ##
178
- # Provide a detailed, user friendly representation
179
- def inspect
180
- "<Twilio.Preview.TrustedComms.ChannelInstance>"
181
- end
182
- end
183
- end
184
- end
185
- end
186
- end
187
- end
188
- end
189
- end
@@ -1,108 +0,0 @@
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 Preview < Domain
12
- class TrustedComms < Version
13
- class BusinessContext < InstanceContext
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.
16
- class InsightsList < ListResource
17
- ##
18
- # Initialize the InsightsList
19
- # @param [Version] version Version that contains the resource
20
- # @param [String] business_sid A 34 character string that uniquely identifies this
21
- # Business.
22
- # @return [InsightsList] InsightsList
23
- def initialize(version, business_sid: nil)
24
- super(version)
25
-
26
- # Path Solution
27
- @solution = {business_sid: business_sid}
28
-
29
- # Components
30
- @impressions_rate = nil
31
- end
32
-
33
- ##
34
- # Access the impressions_rate
35
- # @return [ImpressionsRateContext] ImpressionsRateContext
36
- def impressions_rate
37
- return ImpressionsRateContext.new(@version, @solution[:business_sid], )
38
- end
39
-
40
- ##
41
- # Provide a user friendly representation
42
- def to_s
43
- '#<Twilio.Preview.TrustedComms.InsightsList>'
44
- end
45
- end
46
-
47
- ##
48
- # 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.
49
- class InsightsPage < Page
50
- ##
51
- # Initialize the InsightsPage
52
- # @param [Version] version Version that contains the resource
53
- # @param [Response] response Response from the API
54
- # @param [Hash] solution Path solution for the resource
55
- # @return [InsightsPage] InsightsPage
56
- def initialize(version, response, solution)
57
- super(version, response)
58
-
59
- # Path Solution
60
- @solution = solution
61
- end
62
-
63
- ##
64
- # Build an instance of InsightsInstance
65
- # @param [Hash] payload Payload response from the API
66
- # @return [InsightsInstance] InsightsInstance
67
- def get_instance(payload)
68
- InsightsInstance.new(@version, payload, business_sid: @solution[:business_sid], )
69
- end
70
-
71
- ##
72
- # Provide a user friendly representation
73
- def to_s
74
- '<Twilio.Preview.TrustedComms.InsightsPage>'
75
- end
76
- end
77
-
78
- ##
79
- # 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.
80
- class InsightsInstance < InstanceResource
81
- ##
82
- # Initialize the InsightsInstance
83
- # @param [Version] version Version that contains the resource
84
- # @param [Hash] payload payload that contains response from Twilio
85
- # @param [String] business_sid A 34 character string that uniquely identifies this
86
- # Business.
87
- # @return [InsightsInstance] InsightsInstance
88
- def initialize(version, payload, business_sid: nil)
89
- super(version)
90
- end
91
-
92
- ##
93
- # Provide a user friendly representation
94
- def to_s
95
- "<Twilio.Preview.TrustedComms.InsightsInstance>"
96
- end
97
-
98
- ##
99
- # Provide a detailed, user friendly representation
100
- def inspect
101
- "<Twilio.Preview.TrustedComms.InsightsInstance>"
102
- end
103
- end
104
- end
105
- end
106
- end
107
- end
108
- end