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

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb,
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: BrandedChannelContext, BrandedChannelInstance, BrandedChannelList, BrandedChannelPage

Instance Method Summary collapse

Constructor Details

#initialize(version, business_sid, sid) ⇒ BrandContext

Initialize the BrandContext

Parameters:

  • version (Version)

    Version that contains the resource

  • business_sid (String)

    The unique SID identifier of the Business.

  • sid (String)

    The unique SID identifier of the Brand.



76
77
78
79
80
81
82
83
84
85
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 76

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

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

  # Dependents
  @branded_channels = nil
end

Instance Method Details

#branded_channels(sid = :unset) ⇒ BrandedChannelList, BrandedChannelContext

Access the branded_channels

Returns:

Raises:

  • (ArgumentError)


100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 100

def branded_channels(sid=:unset)
  raise ArgumentError, 'sid cannot be nil' if sid.nil?

  if sid != :unset
    return BrandedChannelContext.new(@version, @solution[:business_sid], @solution[:sid], sid, )
  end

  unless @branded_channels
    @branded_channels = BrandedChannelList.new(
        @version,
        business_sid: @solution[:business_sid],
        brand_sid: @solution[:sid],
    )
  end

  @branded_channels
end

#fetchBrandInstance

Fetch the BrandInstance

Returns:



90
91
92
93
94
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 90

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

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

#inspectObject

Provide a detailed, user friendly representation



127
128
129
130
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 127

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

#to_sObject

Provide a user friendly representation



120
121
122
123
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 120

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