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.
- checksums.yaml +4 -4
- data/CHANGES.md +22 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts.rb +12 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +14 -0
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +186 -0
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +200 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +10 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +13 -3
- data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
- data/lib/twilio-ruby/rest/preview.rb +8 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +15 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +225 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +165 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +0 -26
- data/lib/twilio-ruby/rest/verify/v2/service.rb +51 -30
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +12 -15
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +38 -18
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/accounts/v1/auth_token_promotion_spec.rb +44 -0
- data/spec/integration/accounts/v1/secondary_auth_token_spec.rb +69 -0
- data/spec/integration/conversations/v1/conversation_spec.rb +1 -1
- data/spec/integration/conversations/v1/service/conversation_spec.rb +1 -1
- data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
- data/spec/integration/preview/trusted_comms/{business/brand/branded_channel → branded_channel}/channel_spec.rb +4 -8
- data/spec/integration/preview/trusted_comms/{business/brand/branded_channel_spec.rb → branded_channel_spec.rb} +5 -9
- data/spec/integration/preview/trusted_comms/business_spec.rb +0 -1
- data/spec/integration/verify/v2/service/entity/challenge_spec.rb +52 -8
- data/spec/integration/verify/v2/service/entity/factor_spec.rb +7 -12
- data/spec/integration/verify/v2/service_spec.rb +8 -4
- metadata +14 -11
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +0 -233
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +0 -260
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +0 -189
- data/spec/integration/preview/trusted_comms/business/brand_spec.rb +0 -48
@@ -222,10 +222,13 @@ module Twilio
|
|
222
222
|
# switched to `inactive` state. Minimum value for this timer is 1 minute.
|
223
223
|
# @param [String] timers_closed ISO8601 duration when conversation will be
|
224
224
|
# switched to `closed` state. Minimum value for this timer is 10 minutes.
|
225
|
+
# @param [String] unique_name An application-defined string that uniquely
|
226
|
+
# identifies the resource. It can be used to address the resource in place of the
|
227
|
+
# resource's `sid` in the URL.
|
225
228
|
# @param [conversation.WebhookEnabledType] x_twilio_webhook_enabled The
|
226
229
|
# X-Twilio-Webhook-Enabled HTTP request header
|
227
230
|
# @return [ConversationInstance] Updated ConversationInstance
|
228
|
-
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, x_twilio_webhook_enabled: :unset)
|
231
|
+
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, unique_name: :unset, x_twilio_webhook_enabled: :unset)
|
229
232
|
data = Twilio::Values.of({
|
230
233
|
'FriendlyName' => friendly_name,
|
231
234
|
'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
|
@@ -235,6 +238,7 @@ module Twilio
|
|
235
238
|
'State' => state,
|
236
239
|
'Timers.Inactive' => timers_inactive,
|
237
240
|
'Timers.Closed' => timers_closed,
|
241
|
+
'UniqueName' => unique_name,
|
238
242
|
})
|
239
243
|
headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
|
240
244
|
|
@@ -473,10 +477,13 @@ module Twilio
|
|
473
477
|
# switched to `inactive` state. Minimum value for this timer is 1 minute.
|
474
478
|
# @param [String] timers_closed ISO8601 duration when conversation will be
|
475
479
|
# switched to `closed` state. Minimum value for this timer is 10 minutes.
|
480
|
+
# @param [String] unique_name An application-defined string that uniquely
|
481
|
+
# identifies the resource. It can be used to address the resource in place of the
|
482
|
+
# resource's `sid` in the URL.
|
476
483
|
# @param [conversation.WebhookEnabledType] x_twilio_webhook_enabled The
|
477
484
|
# X-Twilio-Webhook-Enabled HTTP request header
|
478
485
|
# @return [ConversationInstance] Updated ConversationInstance
|
479
|
-
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, x_twilio_webhook_enabled: :unset)
|
486
|
+
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, unique_name: :unset, x_twilio_webhook_enabled: :unset)
|
480
487
|
context.update(
|
481
488
|
friendly_name: friendly_name,
|
482
489
|
date_created: date_created,
|
@@ -486,6 +493,7 @@ module Twilio
|
|
486
493
|
state: state,
|
487
494
|
timers_inactive: timers_inactive,
|
488
495
|
timers_closed: timers_closed,
|
496
|
+
unique_name: unique_name,
|
489
497
|
x_twilio_webhook_enabled: x_twilio_webhook_enabled,
|
490
498
|
)
|
491
499
|
end
|
@@ -191,7 +191,9 @@ module Twilio
|
|
191
191
|
##
|
192
192
|
# Initialize the ConversationContext
|
193
193
|
# @param [Version] version Version that contains the resource
|
194
|
-
# @param [String] chat_service_sid The
|
194
|
+
# @param [String] chat_service_sid The SID of the {Conversation
|
195
|
+
# Service}[https://www.twilio.com/docs/conversations/api/service-resource] the
|
196
|
+
# Conversation resource is associated with.
|
195
197
|
# @param [String] sid A 34 character string that uniquely identifies this
|
196
198
|
# resource. Can also be the `unique_name` of the Conversation.
|
197
199
|
# @return [ConversationContext] ConversationContext
|
@@ -227,10 +229,13 @@ module Twilio
|
|
227
229
|
# switched to `inactive` state. Minimum value for this timer is 1 minute.
|
228
230
|
# @param [String] timers_closed ISO8601 duration when conversation will be
|
229
231
|
# switched to `closed` state. Minimum value for this timer is 10 minutes.
|
232
|
+
# @param [String] unique_name An application-defined string that uniquely
|
233
|
+
# identifies the resource. It can be used to address the resource in place of the
|
234
|
+
# resource's `sid` in the URL.
|
230
235
|
# @param [conversation.WebhookEnabledType] x_twilio_webhook_enabled The
|
231
236
|
# X-Twilio-Webhook-Enabled HTTP request header
|
232
237
|
# @return [ConversationInstance] Updated ConversationInstance
|
233
|
-
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, x_twilio_webhook_enabled: :unset)
|
238
|
+
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, unique_name: :unset, x_twilio_webhook_enabled: :unset)
|
234
239
|
data = Twilio::Values.of({
|
235
240
|
'FriendlyName' => friendly_name,
|
236
241
|
'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
|
@@ -240,6 +245,7 @@ module Twilio
|
|
240
245
|
'State' => state,
|
241
246
|
'Timers.Inactive' => timers_inactive,
|
242
247
|
'Timers.Closed' => timers_closed,
|
248
|
+
'UniqueName' => unique_name,
|
243
249
|
})
|
244
250
|
headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
|
245
251
|
|
@@ -503,10 +509,13 @@ module Twilio
|
|
503
509
|
# switched to `inactive` state. Minimum value for this timer is 1 minute.
|
504
510
|
# @param [String] timers_closed ISO8601 duration when conversation will be
|
505
511
|
# switched to `closed` state. Minimum value for this timer is 10 minutes.
|
512
|
+
# @param [String] unique_name An application-defined string that uniquely
|
513
|
+
# identifies the resource. It can be used to address the resource in place of the
|
514
|
+
# resource's `sid` in the URL.
|
506
515
|
# @param [conversation.WebhookEnabledType] x_twilio_webhook_enabled The
|
507
516
|
# X-Twilio-Webhook-Enabled HTTP request header
|
508
517
|
# @return [ConversationInstance] Updated ConversationInstance
|
509
|
-
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, x_twilio_webhook_enabled: :unset)
|
518
|
+
def update(friendly_name: :unset, date_created: :unset, date_updated: :unset, attributes: :unset, messaging_service_sid: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, unique_name: :unset, x_twilio_webhook_enabled: :unset)
|
510
519
|
context.update(
|
511
520
|
friendly_name: friendly_name,
|
512
521
|
date_created: date_created,
|
@@ -516,6 +525,7 @@ module Twilio
|
|
516
525
|
state: state,
|
517
526
|
timers_inactive: timers_inactive,
|
518
527
|
timers_closed: timers_closed,
|
528
|
+
unique_name: unique_name,
|
519
529
|
x_twilio_webhook_enabled: x_twilio_webhook_enabled,
|
520
530
|
)
|
521
531
|
end
|
@@ -140,6 +140,7 @@ module Twilio
|
|
140
140
|
'url' => payload['url'],
|
141
141
|
'attributes' => payload['attributes'],
|
142
142
|
'properties' => payload['properties'],
|
143
|
+
'trust' => payload['trust'],
|
143
144
|
}
|
144
145
|
|
145
146
|
# Context
|
@@ -272,6 +273,12 @@ module Twilio
|
|
272
273
|
@properties['properties']
|
273
274
|
end
|
274
275
|
|
276
|
+
##
|
277
|
+
# @return [Hash] The trust
|
278
|
+
def trust
|
279
|
+
@properties['trust']
|
280
|
+
end
|
281
|
+
|
275
282
|
##
|
276
283
|
# Fetch the CallSummaryInstance
|
277
284
|
# @param [call_summary.ProcessingState] processing_state The processing_state
|
@@ -186,6 +186,14 @@ module Twilio
|
|
186
186
|
self.trusted_comms.branded_calls()
|
187
187
|
end
|
188
188
|
|
189
|
+
##
|
190
|
+
# @param [String] sid The unique SID identifier of the Branded Channel.
|
191
|
+
# @return [Twilio::REST::Preview::TrustedComms::BrandedChannelInstance] if sid was passed.
|
192
|
+
# @return [Twilio::REST::Preview::TrustedComms::BrandedChannelList]
|
193
|
+
def branded_channels(sid=:unset)
|
194
|
+
self.trusted_comms.branded_channels(sid)
|
195
|
+
end
|
196
|
+
|
189
197
|
##
|
190
198
|
# @return [Twilio::REST::Preview::TrustedComms::BrandsInformationInstance]
|
191
199
|
def brands_information
|
@@ -16,6 +16,7 @@ module Twilio
|
|
16
16
|
super
|
17
17
|
@version = 'TrustedComms'
|
18
18
|
@branded_calls = nil
|
19
|
+
@branded_channels = nil
|
19
20
|
@brands_information = nil
|
20
21
|
@businesses = nil
|
21
22
|
@cps = nil
|
@@ -29,6 +30,20 @@ module Twilio
|
|
29
30
|
@branded_calls ||= BrandedCallList.new self
|
30
31
|
end
|
31
32
|
|
33
|
+
##
|
34
|
+
# @param [String] sid The unique SID identifier of the Branded Channel.
|
35
|
+
# @return [Twilio::REST::Preview::TrustedComms::BrandedChannelContext] if sid was passed.
|
36
|
+
# @return [Twilio::REST::Preview::TrustedComms::BrandedChannelList]
|
37
|
+
def branded_channels(sid=:unset)
|
38
|
+
if sid.nil?
|
39
|
+
raise ArgumentError, 'sid cannot be nil'
|
40
|
+
elsif sid == :unset
|
41
|
+
@branded_channels ||= BrandedChannelList.new self
|
42
|
+
else
|
43
|
+
BrandedChannelContext.new(self, sid)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
32
47
|
##
|
33
48
|
# @return [Twilio::REST::Preview::TrustedComms::BrandsInformationContext]
|
34
49
|
def brands_information
|
@@ -0,0 +1,225 @@
|
|
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
|
+
##
|
14
|
+
# 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
|
+
class BrandedChannelList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the BrandedChannelList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [BrandedChannelList] BrandedChannelList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'#<Twilio.Preview.TrustedComms.BrandedChannelList>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# 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.
|
36
|
+
class BrandedChannelPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the BrandedChannelPage
|
39
|
+
# @param [Version] version Version that contains the resource
|
40
|
+
# @param [Response] response Response from the API
|
41
|
+
# @param [Hash] solution Path solution for the resource
|
42
|
+
# @return [BrandedChannelPage] BrandedChannelPage
|
43
|
+
def initialize(version, response, solution)
|
44
|
+
super(version, response)
|
45
|
+
|
46
|
+
# Path Solution
|
47
|
+
@solution = solution
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Build an instance of BrandedChannelInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [BrandedChannelInstance] BrandedChannelInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
BrandedChannelInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.Preview.TrustedComms.BrandedChannelPage>'
|
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 BrandedChannelContext < InstanceContext
|
68
|
+
##
|
69
|
+
# Initialize the BrandedChannelContext
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @param [String] sid The unique SID identifier of the Branded Channel.
|
72
|
+
# @return [BrandedChannelContext] BrandedChannelContext
|
73
|
+
def initialize(version, sid)
|
74
|
+
super(version)
|
75
|
+
|
76
|
+
# Path Solution
|
77
|
+
@solution = {sid: sid, }
|
78
|
+
@uri = "/BrandedChannels/#{@solution[:sid]}"
|
79
|
+
|
80
|
+
# Dependents
|
81
|
+
@channels = nil
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Fetch the BrandedChannelInstance
|
86
|
+
# @return [BrandedChannelInstance] Fetched BrandedChannelInstance
|
87
|
+
def fetch
|
88
|
+
payload = @version.fetch('GET', @uri)
|
89
|
+
|
90
|
+
BrandedChannelInstance.new(@version, payload, sid: @solution[:sid], )
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Access the channels
|
95
|
+
# @return [ChannelList]
|
96
|
+
# @return [ChannelContext]
|
97
|
+
def channels
|
98
|
+
unless @channels
|
99
|
+
@channels = ChannelList.new(@version, branded_channel_sid: @solution[:sid], )
|
100
|
+
end
|
101
|
+
|
102
|
+
@channels
|
103
|
+
end
|
104
|
+
|
105
|
+
##
|
106
|
+
# Provide a user friendly representation
|
107
|
+
def to_s
|
108
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
109
|
+
"#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Provide a detailed, user friendly representation
|
114
|
+
def inspect
|
115
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
116
|
+
"#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# 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.
|
122
|
+
class BrandedChannelInstance < InstanceResource
|
123
|
+
##
|
124
|
+
# Initialize the BrandedChannelInstance
|
125
|
+
# @param [Version] version Version that contains the resource
|
126
|
+
# @param [Hash] payload payload that contains response from Twilio
|
127
|
+
# @param [String] sid The unique SID identifier of the Branded Channel.
|
128
|
+
# @return [BrandedChannelInstance] BrandedChannelInstance
|
129
|
+
def initialize(version, payload, sid: nil)
|
130
|
+
super(version)
|
131
|
+
|
132
|
+
# Marshaled Properties
|
133
|
+
@properties = {
|
134
|
+
'account_sid' => payload['account_sid'],
|
135
|
+
'business_sid' => payload['business_sid'],
|
136
|
+
'brand_sid' => payload['brand_sid'],
|
137
|
+
'sid' => payload['sid'],
|
138
|
+
'links' => payload['links'],
|
139
|
+
'url' => payload['url'],
|
140
|
+
}
|
141
|
+
|
142
|
+
# Context
|
143
|
+
@instance_context = nil
|
144
|
+
@params = {'sid' => sid || @properties['sid'], }
|
145
|
+
end
|
146
|
+
|
147
|
+
##
|
148
|
+
# Generate an instance context for the instance, the context is capable of
|
149
|
+
# performing various actions. All instance actions are proxied to the context
|
150
|
+
# @return [BrandedChannelContext] BrandedChannelContext for this BrandedChannelInstance
|
151
|
+
def context
|
152
|
+
unless @instance_context
|
153
|
+
@instance_context = BrandedChannelContext.new(@version, @params['sid'], )
|
154
|
+
end
|
155
|
+
@instance_context
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# @return [String] Account Sid.
|
160
|
+
def account_sid
|
161
|
+
@properties['account_sid']
|
162
|
+
end
|
163
|
+
|
164
|
+
##
|
165
|
+
# @return [String] Business Sid.
|
166
|
+
def business_sid
|
167
|
+
@properties['business_sid']
|
168
|
+
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# @return [String] Brand Sid.
|
172
|
+
def brand_sid
|
173
|
+
@properties['brand_sid']
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# @return [String] Branded Channel Sid.
|
178
|
+
def sid
|
179
|
+
@properties['sid']
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# @return [String] Nested resource URLs.
|
184
|
+
def links
|
185
|
+
@properties['links']
|
186
|
+
end
|
187
|
+
|
188
|
+
##
|
189
|
+
# @return [String] The URL of this resource.
|
190
|
+
def url
|
191
|
+
@properties['url']
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# Fetch the BrandedChannelInstance
|
196
|
+
# @return [BrandedChannelInstance] Fetched BrandedChannelInstance
|
197
|
+
def fetch
|
198
|
+
context.fetch
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Access the channels
|
203
|
+
# @return [channels] channels
|
204
|
+
def channels
|
205
|
+
context.channels
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# Provide a user friendly representation
|
210
|
+
def to_s
|
211
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
212
|
+
"<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# Provide a detailed, user friendly representation
|
217
|
+
def inspect
|
218
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
219
|
+
"<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
@@ -0,0 +1,165 @@
|
|
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 BrandedChannelContext < 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 ChannelList < ListResource
|
17
|
+
##
|
18
|
+
# Initialize the ChannelList
|
19
|
+
# @param [Version] version Version that contains the resource
|
20
|
+
# @param [String] branded_channel_sid The unique SID identifier of the Branded
|
21
|
+
# Channel.
|
22
|
+
# @return [ChannelList] ChannelList
|
23
|
+
def initialize(version, branded_channel_sid: nil)
|
24
|
+
super(version)
|
25
|
+
|
26
|
+
# Path Solution
|
27
|
+
@solution = {branded_channel_sid: branded_channel_sid}
|
28
|
+
@uri = "/BrandedChannels/#{@solution[:branded_channel_sid]}/Channels"
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Create the ChannelInstance
|
33
|
+
# @param [String] phone_number_sid The unique SID identifier of the Phone Number
|
34
|
+
# of the Phone number to be assigned to the Branded Channel.
|
35
|
+
# @return [ChannelInstance] Created ChannelInstance
|
36
|
+
def create(phone_number_sid: nil)
|
37
|
+
data = Twilio::Values.of({'PhoneNumberSid' => phone_number_sid, })
|
38
|
+
|
39
|
+
payload = @version.create('POST', @uri, data: data)
|
40
|
+
|
41
|
+
ChannelInstance.new(@version, payload, branded_channel_sid: @solution[:branded_channel_sid], )
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Provide a user friendly representation
|
46
|
+
def to_s
|
47
|
+
'#<Twilio.Preview.TrustedComms.ChannelList>'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# 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.
|
53
|
+
class ChannelPage < Page
|
54
|
+
##
|
55
|
+
# Initialize the ChannelPage
|
56
|
+
# @param [Version] version Version that contains the resource
|
57
|
+
# @param [Response] response Response from the API
|
58
|
+
# @param [Hash] solution Path solution for the resource
|
59
|
+
# @return [ChannelPage] ChannelPage
|
60
|
+
def initialize(version, response, solution)
|
61
|
+
super(version, response)
|
62
|
+
|
63
|
+
# Path Solution
|
64
|
+
@solution = solution
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# Build an instance of ChannelInstance
|
69
|
+
# @param [Hash] payload Payload response from the API
|
70
|
+
# @return [ChannelInstance] ChannelInstance
|
71
|
+
def get_instance(payload)
|
72
|
+
ChannelInstance.new(@version, payload, branded_channel_sid: @solution[:branded_channel_sid], )
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Provide a user friendly representation
|
77
|
+
def to_s
|
78
|
+
'<Twilio.Preview.TrustedComms.ChannelPage>'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# 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.
|
84
|
+
class ChannelInstance < InstanceResource
|
85
|
+
##
|
86
|
+
# Initialize the ChannelInstance
|
87
|
+
# @param [Version] version Version that contains the resource
|
88
|
+
# @param [Hash] payload payload that contains response from Twilio
|
89
|
+
# @param [String] branded_channel_sid The unique SID identifier of the Branded
|
90
|
+
# Channel.
|
91
|
+
# @return [ChannelInstance] ChannelInstance
|
92
|
+
def initialize(version, payload, branded_channel_sid: nil)
|
93
|
+
super(version)
|
94
|
+
|
95
|
+
# Marshaled Properties
|
96
|
+
@properties = {
|
97
|
+
'account_sid' => payload['account_sid'],
|
98
|
+
'business_sid' => payload['business_sid'],
|
99
|
+
'brand_sid' => payload['brand_sid'],
|
100
|
+
'branded_channel_sid' => payload['branded_channel_sid'],
|
101
|
+
'phone_number_sid' => payload['phone_number_sid'],
|
102
|
+
'phone_number' => payload['phone_number'],
|
103
|
+
'url' => payload['url'],
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
107
|
+
##
|
108
|
+
# @return [String] Account Sid.
|
109
|
+
def account_sid
|
110
|
+
@properties['account_sid']
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# @return [String] Business Sid.
|
115
|
+
def business_sid
|
116
|
+
@properties['business_sid']
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# @return [String] Brand Sid.
|
121
|
+
def brand_sid
|
122
|
+
@properties['brand_sid']
|
123
|
+
end
|
124
|
+
|
125
|
+
##
|
126
|
+
# @return [String] Branded Channel Sid.
|
127
|
+
def branded_channel_sid
|
128
|
+
@properties['branded_channel_sid']
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# @return [String] Phone Number Sid to be branded.
|
133
|
+
def phone_number_sid
|
134
|
+
@properties['phone_number_sid']
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# @return [String] Twilio number to assign to the Branded Channel
|
139
|
+
def phone_number
|
140
|
+
@properties['phone_number']
|
141
|
+
end
|
142
|
+
|
143
|
+
##
|
144
|
+
# @return [String] The URL of this resource.
|
145
|
+
def url
|
146
|
+
@properties['url']
|
147
|
+
end
|
148
|
+
|
149
|
+
##
|
150
|
+
# Provide a user friendly representation
|
151
|
+
def to_s
|
152
|
+
"<Twilio.Preview.TrustedComms.ChannelInstance>"
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# Provide a detailed, user friendly representation
|
157
|
+
def inspect
|
158
|
+
"<Twilio.Preview.TrustedComms.ChannelInstance>"
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|