class Twilio::REST::Preview::Marketplace::InstalledAddOnContext::InstalledAddOnExtensionInstance

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 help@twilio.com.

Public Class Methods

new(version, payload, installed_add_on_sid: nil, sid: nil) click to toggle source

Initialize the InstalledAddOnExtensionInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] installed_add_on_sid The SID of the InstalledAddOn resource to

which this extension applies.

@param [String] sid The SID of the InstalledAddOn Extension resource to fetch. @return [InstalledAddOnExtensionInstance] InstalledAddOnExtensionInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
228 def initialize(version, payload, installed_add_on_sid: nil, sid: nil)
229   super(version)
230 
231   # Marshaled Properties
232   @properties = {
233       'sid' => payload['sid'],
234       'installed_add_on_sid' => payload['installed_add_on_sid'],
235       'friendly_name' => payload['friendly_name'],
236       'product_name' => payload['product_name'],
237       'unique_name' => payload['unique_name'],
238       'enabled' => payload['enabled'],
239       'url' => payload['url'],
240   }
241 
242   # Context
243   @instance_context = nil
244   @params = {'installed_add_on_sid' => installed_add_on_sid, 'sid' => sid || @properties['sid'], }
245 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [InstalledAddOnExtensionContext] InstalledAddOnExtensionContext for this InstalledAddOnExtensionInstance

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
251 def context
252   unless @instance_context
253     @instance_context = InstalledAddOnExtensionContext.new(
254         @version,
255         @params['installed_add_on_sid'],
256         @params['sid'],
257     )
258   end
259   @instance_context
260 end
enabled() click to toggle source

@return [Boolean] Whether the Extension will be invoked

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
294 def enabled
295   @properties['enabled']
296 end
fetch() click to toggle source

Fetch the InstalledAddOnExtensionInstance @return [InstalledAddOnExtensionInstance] Fetched InstalledAddOnExtensionInstance

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
307 def fetch
308   context.fetch
309 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
276 def friendly_name
277   @properties['friendly_name']
278 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
328 def inspect
329   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
330   "<Twilio.Preview.Marketplace.InstalledAddOnExtensionInstance #{values}>"
331 end
installed_add_on_sid() click to toggle source

@return [String] The SID of the InstalledAddOn resource to which this extension applies

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
270 def installed_add_on_sid
271   @properties['installed_add_on_sid']
272 end
product_name() click to toggle source

@return [String] The name of the Extension's Product

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
282 def product_name
283   @properties['product_name']
284 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
264 def sid
265   @properties['sid']
266 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
321 def to_s
322   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
323   "<Twilio.Preview.Marketplace.InstalledAddOnExtensionInstance #{values}>"
324 end
unique_name() click to toggle source

@return [String] An application-defined string that uniquely identifies the resource

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
288 def unique_name
289   @properties['unique_name']
290 end
update(enabled: nil) click to toggle source

Update the InstalledAddOnExtensionInstance @param [Boolean] enabled Whether the Extension should be invoked. @return [InstalledAddOnExtensionInstance] Updated InstalledAddOnExtensionInstance

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
315 def update(enabled: nil)
316   context.update(enabled: enabled, )
317 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
300 def url
301   @properties['url']
302 end