Class: Twilio::REST::Preview::TrustedComms::BrandedChannelInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/branded_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, payload, sid: nil) ⇒ BrandedChannelInstance

Initialize the BrandedChannelInstance



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 129

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'business_sid' => payload['business_sid'],
      'brand_sid' => payload['brand_sid'],
      'sid' => payload['sid'],
      'links' => payload['links'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString



160
161
162
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 160

def 
  @properties['account_sid']
end

#brand_sidString



172
173
174
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 172

def brand_sid
  @properties['brand_sid']
end

#business_sidString



166
167
168
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 166

def business_sid
  @properties['business_sid']
end

#channelschannels

Access the channels



204
205
206
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 204

def channels
  context.channels
end

#contextBrandedChannelContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



151
152
153
154
155
156
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 151

def context
  unless @instance_context
    @instance_context = BrandedChannelContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#fetchBrandedChannelInstance

Fetch the BrandedChannelInstance



197
198
199
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 197

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



217
218
219
220
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 217

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
end


184
185
186
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 184

def links
  @properties['links']
end

#sidString



178
179
180
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 178

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



210
211
212
213
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 210

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
end

#urlString



190
191
192
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb', line 190

def url
  @properties['url']
end