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

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb,
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]

Defined Under Namespace

Classes: ChannelInstance, ChannelList, ChannelPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ BrandedChannelContext

Initialize the BrandedChannelContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique SID identifier of the Branded Channel.


73
74
75
76
77
78
79
80
81
82
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 73

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/BrandedChannels/#{@solution[:sid]}"

  # Dependents
  @channels = nil
end

Instance Method Details

#channelsChannelList, ChannelContext

Access the channels

Returns:


97
98
99
100
101
102
103
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 97

def channels
  unless @channels
    @channels = ChannelList.new(@version, branded_channel_sid: @solution[:sid], )
  end

  @channels
end

#fetchBrandedChannelInstance

Fetch the BrandedChannelInstance

Returns:


87
88
89
90
91
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 87

def fetch
  payload = @version.fetch('GET', @uri)

  BrandedChannelInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


114
115
116
117
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 114

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
end

#to_sObject

Provide a user friendly representation


107
108
109
110
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 107

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
end