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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The unique SID identifier of the Branded Channel.


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

Returns Account Sid.

Returns:

  • (String)

    Account Sid.


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

def 
  @properties['account_sid']
end

#brand_sidString

Returns Brand Sid.

Returns:

  • (String)

    Brand Sid.


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

Returns Business Sid.

Returns:

  • (String)

    Business Sid.


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

Returns:


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

Returns:


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

Returns:


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

Returns Nested resource URLs.

Returns:

  • (String)

    Nested resource URLs.


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

def links
  @properties['links']
end

#sidString

Returns Branded Channel Sid.

Returns:

  • (String)

    Branded Channel Sid.


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

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.


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

def url
  @properties['url']
end