class Twilio::REST::Preview::TrustedComms::BrandedChannelContext::ChannelList

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.

Public Class Methods

new(version, branded_channel_sid: nil) click to toggle source

Initialize the ChannelList @param [Version] version Version that contains the resource @param [String] branded_channel_sid The unique SID identifier of the Branded

Channel.

@return [ChannelList] ChannelList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb
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

Public Instance Methods

create(phone_number_sid: nil) click to toggle source

Create the ChannelInstance @param [String] phone_number_sid The unique SID identifier of the Phone Number

of the Phone number to be assigned to the Branded Channel.

@return [ChannelInstance] Created ChannelInstance

   # File lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb
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
to_s() click to toggle source

Provide a user friendly representation

   # File lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb
46 def to_s
47   '#<Twilio.Preview.TrustedComms.ChannelList>'
48 end