Class: Twilio::REST::Preview::TrustedComms::BrandedChannelContext::ChannelList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb

Overview

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 [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version, branded_channel_sid: nil) ⇒ ChannelList

Initialize the ChannelList

Parameters:

  • version (Version)

    Version that contains the resource

  • branded_channel_sid (String) (defaults to: nil)

    The unique SID identifier of the Branded Channel.


23
24
25
26
27
28
29
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb', line 23

def initialize(version, branded_channel_sid: nil)
  super(version)

  # Path Solution
  @solution = {branded_channel_sid: branded_channel_sid}
  @uri = "/BrandedChannels/#{@solution[:branded_channel_sid]}/Channels"
end

Instance Method Details

#create(phone_number_sid: nil) ⇒ ChannelInstance

Create the ChannelInstance

Parameters:

  • phone_number_sid (String) (defaults to: nil)

    The unique SID identifier of the Phone Number of the Phone number to be assigned to the Branded Channel.

Returns:


36
37
38
39
40
41
42
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb', line 36

def create(phone_number_sid: nil)
  data = Twilio::Values.of({'PhoneNumberSid' => phone_number_sid, })

  payload = @version.create('POST', @uri, data: data)

  ChannelInstance.new(@version, payload, branded_channel_sid: @solution[:branded_channel_sid], )
end

#to_sObject

Provide a user friendly representation


46
47
48
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb', line 46

def to_s
  '#<Twilio.Preview.TrustedComms.ChannelList>'
end