Class: Twilio::REST::Preview::TrustedComms::BusinessContext::BrandContext::BrandedChannelContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb,
lib/twilio-ruby/rest/preview/trusted_comms/business/brand/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, business_sid, brand_sid, sid) ⇒ BrandedChannelContext

Initialize the BrandedChannelContext

Parameters:

  • version (Version)

    Version that contains the resource

  • business_sid (String)

    The unique SID identifier of the Business.

  • brand_sid (String)

    The unique SID identifier of the Brand.

  • sid (String)

    The unique SID identifier of the Branded Channel.



84
85
86
87
88
89
90
91
92
93
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb', line 84

def initialize(version, business_sid, brand_sid, sid)
  super(version)

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

  # Dependents
  @channels = nil
end

Instance Method Details

#channelsChannelList, ChannelContext

Access the channels

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb', line 114

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

  @channels
end

#fetchBrandedChannelInstance

Fetch the BrandedChannelInstance

Returns:



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb', line 98

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

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

#inspectObject

Provide a detailed, user friendly representation



136
137
138
139
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb', line 136

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

#to_sObject

Provide a user friendly representation



129
130
131
132
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb', line 129

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