twilio-ruby 5.40.4 → 5.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +22 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/accounts.rb +12 -0
  5. data/lib/twilio-ruby/rest/accounts/v1.rb +14 -0
  6. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +186 -0
  7. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +200 -0
  8. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +10 -2
  9. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +13 -3
  10. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
  11. data/lib/twilio-ruby/rest/preview.rb +8 -0
  12. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +15 -0
  13. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +225 -0
  14. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +165 -0
  15. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +0 -26
  16. data/lib/twilio-ruby/rest/verify/v2/service.rb +51 -30
  17. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +12 -15
  18. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +38 -18
  19. data/lib/twilio-ruby/version.rb +1 -1
  20. data/spec/integration/accounts/v1/auth_token_promotion_spec.rb +44 -0
  21. data/spec/integration/accounts/v1/secondary_auth_token_spec.rb +69 -0
  22. data/spec/integration/conversations/v1/conversation_spec.rb +1 -1
  23. data/spec/integration/conversations/v1/service/conversation_spec.rb +1 -1
  24. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  25. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel → branded_channel}/channel_spec.rb +4 -8
  26. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel_spec.rb → branded_channel_spec.rb} +5 -9
  27. data/spec/integration/preview/trusted_comms/business_spec.rb +0 -1
  28. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +52 -8
  29. data/spec/integration/verify/v2/service/entity/factor_spec.rb +7 -12
  30. data/spec/integration/verify/v2/service_spec.rb +8 -4
  31. metadata +14 -11
  32. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +0 -233
  33. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +0 -260
  34. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +0 -189
  35. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +0 -48
@@ -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,48 +0,0 @@
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 'Brand' do
12
- it "can fetch" do
13
- @holodeck.mock(Twilio::Response.new(500, ''))
14
-
15
- expect {
16
- @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
- .brands('BZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
18
- }.to raise_exception(Twilio::REST::TwilioError)
19
-
20
- expect(
21
- @holodeck.has_request?(Holodeck::Request.new(
22
- method: 'get',
23
- url: 'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Brands/BZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
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
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
- "business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
- "sid": "BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
- "links": {
36
- "branded_channels": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Brands/BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/BrandedChannels"
37
- },
38
- "url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Brands/BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
39
- }
40
- ]
41
- ))
42
-
43
- actual = @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
44
- .brands('BZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
45
-
46
- expect(actual).to_not eq(nil)
47
- end
48
- end