twilio-ruby 5.35.0 → 5.36.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +28 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +87 -87
  5. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  6. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +71 -71
  7. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  8. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  9. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  10. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  11. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +6 -3
  12. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  13. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +239 -0
  14. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  15. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +197 -0
  16. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  17. data/lib/twilio-ruby/rest/supersim.rb +11 -1
  18. data/lib/twilio-ruby/rest/supersim/v1.rb +16 -1
  19. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +10 -1
  20. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  21. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +53 -12
  22. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  23. data/lib/twilio-ruby/rest/verify.rb +9 -0
  24. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  25. data/lib/twilio-ruby/rest/verify/v2/form.rb +197 -0
  26. data/lib/twilio-ruby/rest/verify/v2/service.rb +26 -0
  27. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +379 -0
  28. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +500 -0
  29. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor/challenge.rb +494 -0
  30. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -4
  31. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -4
  32. data/lib/twilio-ruby/version.rb +1 -1
  33. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  34. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  35. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  36. data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
  37. data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
  38. data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
  39. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
  40. data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
  41. data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
  42. data/spec/integration/supersim/v1/fleet_spec.rb +4 -0
  43. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  44. data/spec/integration/supersim/v1/network_access_profile_spec.rb +20 -5
  45. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  46. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  47. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  48. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  49. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  50. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  51. data/spec/integration/verify/v2/form_spec.rb +48 -0
  52. data/spec/integration/verify/v2/service/entity/factor/challenge_spec.rb +353 -0
  53. data/spec/integration/verify/v2/service/entity/factor_spec.rb +298 -0
  54. data/spec/integration/verify/v2/service/entity_spec.rb +201 -0
  55. data/spec/integration/verify/v2/service_spec.rb +24 -4
  56. metadata +29 -2
@@ -0,0 +1,266 @@
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 a BrandedChannelInstance
97
+ # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
98
+ def fetch
99
+ params = Twilio::Values.of({})
100
+
101
+ payload = @version.fetch(
102
+ 'GET',
103
+ @uri,
104
+ params,
105
+ )
106
+
107
+ BrandedChannelInstance.new(
108
+ @version,
109
+ payload,
110
+ business_sid: @solution[:business_sid],
111
+ brand_sid: @solution[:brand_sid],
112
+ sid: @solution[:sid],
113
+ )
114
+ end
115
+
116
+ ##
117
+ # Access the channels
118
+ # @return [ChannelList]
119
+ # @return [ChannelContext]
120
+ def channels
121
+ unless @channels
122
+ @channels = ChannelList.new(
123
+ @version,
124
+ business_sid: @solution[:business_sid],
125
+ brand_sid: @solution[:brand_sid],
126
+ branded_channel_sid: @solution[:sid],
127
+ )
128
+ end
129
+
130
+ @channels
131
+ end
132
+
133
+ ##
134
+ # Provide a user friendly representation
135
+ def to_s
136
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
137
+ "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
138
+ end
139
+
140
+ ##
141
+ # Provide a detailed, user friendly representation
142
+ def inspect
143
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
144
+ "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
145
+ end
146
+ end
147
+
148
+ ##
149
+ # 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.
150
+ class BrandedChannelInstance < InstanceResource
151
+ ##
152
+ # Initialize the BrandedChannelInstance
153
+ # @param [Version] version Version that contains the resource
154
+ # @param [Hash] payload payload that contains response from Twilio
155
+ # @param [String] business_sid The unique SID identifier of the Business.
156
+ # @param [String] brand_sid The unique SID identifier of the Brand.
157
+ # @param [String] sid The unique SID identifier of the Branded Channel.
158
+ # @return [BrandedChannelInstance] BrandedChannelInstance
159
+ def initialize(version, payload, business_sid: nil, brand_sid: nil, sid: nil)
160
+ super(version)
161
+
162
+ # Marshaled Properties
163
+ @properties = {
164
+ 'account_sid' => payload['account_sid'],
165
+ 'business_sid' => payload['business_sid'],
166
+ 'brand_sid' => payload['brand_sid'],
167
+ 'sid' => payload['sid'],
168
+ 'links' => payload['links'],
169
+ 'url' => payload['url'],
170
+ }
171
+
172
+ # Context
173
+ @instance_context = nil
174
+ @params = {
175
+ 'business_sid' => business_sid,
176
+ 'brand_sid' => brand_sid,
177
+ 'sid' => sid || @properties['sid'],
178
+ }
179
+ end
180
+
181
+ ##
182
+ # Generate an instance context for the instance, the context is capable of
183
+ # performing various actions. All instance actions are proxied to the context
184
+ # @return [BrandedChannelContext] BrandedChannelContext for this BrandedChannelInstance
185
+ def context
186
+ unless @instance_context
187
+ @instance_context = BrandedChannelContext.new(
188
+ @version,
189
+ @params['business_sid'],
190
+ @params['brand_sid'],
191
+ @params['sid'],
192
+ )
193
+ end
194
+ @instance_context
195
+ end
196
+
197
+ ##
198
+ # @return [String] Account Sid.
199
+ def account_sid
200
+ @properties['account_sid']
201
+ end
202
+
203
+ ##
204
+ # @return [String] Business Sid.
205
+ def business_sid
206
+ @properties['business_sid']
207
+ end
208
+
209
+ ##
210
+ # @return [String] Brand Sid.
211
+ def brand_sid
212
+ @properties['brand_sid']
213
+ end
214
+
215
+ ##
216
+ # @return [String] Branded Channel Sid.
217
+ def sid
218
+ @properties['sid']
219
+ end
220
+
221
+ ##
222
+ # @return [String] Nested resource URLs.
223
+ def links
224
+ @properties['links']
225
+ end
226
+
227
+ ##
228
+ # @return [String] The URL of this resource.
229
+ def url
230
+ @properties['url']
231
+ end
232
+
233
+ ##
234
+ # Fetch a BrandedChannelInstance
235
+ # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
236
+ def fetch
237
+ context.fetch
238
+ end
239
+
240
+ ##
241
+ # Access the channels
242
+ # @return [channels] channels
243
+ def channels
244
+ context.channels
245
+ end
246
+
247
+ ##
248
+ # Provide a user friendly representation
249
+ def to_s
250
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
251
+ "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
252
+ end
253
+
254
+ ##
255
+ # Provide a detailed, user friendly representation
256
+ def inspect
257
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
258
+ "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
259
+ end
260
+ end
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end
@@ -0,0 +1,197 @@
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
+ # Retrieve a single page of ChannelInstance records from the API.
41
+ # Request is executed immediately.
42
+ # @param [String] phone_number_sid The unique SID identifier of the Phone Number
43
+ # of the Phone number to be assigned to the Branded Channel.
44
+ # @param [String] phone_number The phone number given in [E.164
45
+ # format](https://www.twilio.com/docs/glossary/what-e164) to assign to the Branded
46
+ # Channel. It must be a Twilio number that from your account.
47
+ # @return [ChannelInstance] Newly created ChannelInstance
48
+ def create(phone_number_sid: nil, phone_number: nil)
49
+ data = Twilio::Values.of({'PhoneNumberSid' => phone_number_sid, 'PhoneNumber' => phone_number, })
50
+
51
+ payload = @version.create(
52
+ 'POST',
53
+ @uri,
54
+ data: data
55
+ )
56
+
57
+ ChannelInstance.new(
58
+ @version,
59
+ payload,
60
+ business_sid: @solution[:business_sid],
61
+ brand_sid: @solution[:brand_sid],
62
+ branded_channel_sid: @solution[:branded_channel_sid],
63
+ )
64
+ end
65
+
66
+ ##
67
+ # Provide a user friendly representation
68
+ def to_s
69
+ '#<Twilio.Preview.TrustedComms.ChannelList>'
70
+ end
71
+ end
72
+
73
+ ##
74
+ # 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.
75
+ class ChannelPage < Page
76
+ ##
77
+ # Initialize the ChannelPage
78
+ # @param [Version] version Version that contains the resource
79
+ # @param [Response] response Response from the API
80
+ # @param [Hash] solution Path solution for the resource
81
+ # @return [ChannelPage] ChannelPage
82
+ def initialize(version, response, solution)
83
+ super(version, response)
84
+
85
+ # Path Solution
86
+ @solution = solution
87
+ end
88
+
89
+ ##
90
+ # Build an instance of ChannelInstance
91
+ # @param [Hash] payload Payload response from the API
92
+ # @return [ChannelInstance] ChannelInstance
93
+ def get_instance(payload)
94
+ ChannelInstance.new(
95
+ @version,
96
+ payload,
97
+ business_sid: @solution[:business_sid],
98
+ brand_sid: @solution[:brand_sid],
99
+ branded_channel_sid: @solution[:branded_channel_sid],
100
+ )
101
+ end
102
+
103
+ ##
104
+ # Provide a user friendly representation
105
+ def to_s
106
+ '<Twilio.Preview.TrustedComms.ChannelPage>'
107
+ end
108
+ end
109
+
110
+ ##
111
+ # 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.
112
+ class ChannelInstance < InstanceResource
113
+ ##
114
+ # Initialize the ChannelInstance
115
+ # @param [Version] version Version that contains the resource
116
+ # @param [Hash] payload payload that contains response from Twilio
117
+ # @param [String] business_sid The unique SID identifier of the Business.
118
+ # @param [String] brand_sid The unique SID identifier of the Brand.
119
+ # @param [String] branded_channel_sid The unique SID identifier of the Branded
120
+ # Channel.
121
+ # @return [ChannelInstance] ChannelInstance
122
+ def initialize(version, payload, business_sid: nil, brand_sid: nil, branded_channel_sid: nil)
123
+ super(version)
124
+
125
+ # Marshaled Properties
126
+ @properties = {
127
+ 'account_sid' => payload['account_sid'],
128
+ 'business_sid' => payload['business_sid'],
129
+ 'brand_sid' => payload['brand_sid'],
130
+ 'branded_channel_sid' => payload['branded_channel_sid'],
131
+ 'phone_number_sid' => payload['phone_number_sid'],
132
+ 'phone_number' => payload['phone_number'],
133
+ 'url' => payload['url'],
134
+ }
135
+ end
136
+
137
+ ##
138
+ # @return [String] Account Sid.
139
+ def account_sid
140
+ @properties['account_sid']
141
+ end
142
+
143
+ ##
144
+ # @return [String] Business Sid.
145
+ def business_sid
146
+ @properties['business_sid']
147
+ end
148
+
149
+ ##
150
+ # @return [String] Brand Sid.
151
+ def brand_sid
152
+ @properties['brand_sid']
153
+ end
154
+
155
+ ##
156
+ # @return [String] Branded Channel Sid.
157
+ def branded_channel_sid
158
+ @properties['branded_channel_sid']
159
+ end
160
+
161
+ ##
162
+ # @return [String] Phone Number Sid to be branded.
163
+ def phone_number_sid
164
+ @properties['phone_number_sid']
165
+ end
166
+
167
+ ##
168
+ # @return [String] Twilio number to assign to the Branded Channel
169
+ def phone_number
170
+ @properties['phone_number']
171
+ end
172
+
173
+ ##
174
+ # @return [String] The URL of this resource.
175
+ def url
176
+ @properties['url']
177
+ end
178
+
179
+ ##
180
+ # Provide a user friendly representation
181
+ def to_s
182
+ "<Twilio.Preview.TrustedComms.ChannelInstance>"
183
+ end
184
+
185
+ ##
186
+ # Provide a detailed, user friendly representation
187
+ def inspect
188
+ "<Twilio.Preview.TrustedComms.ChannelInstance>"
189
+ end
190
+ end
191
+ end
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end