Class: Twilio::REST::Marketplace::V1::AvailableAddOnContext::AvailableAddOnExtensionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, available_add_on_sid: nil, sid: nil) ⇒ AvailableAddOnExtensionInstance

Initialize the AvailableAddOnExtensionInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this AvailableAddOnExtension resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 222

def initialize(version, payload , available_add_on_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'available_add_on_sid' => payload['available_add_on_sid'],
        'friendly_name' => payload['friendly_name'],
        'product_name' => payload['product_name'],
        'unique_name' => payload['unique_name'],
        'url' => payload['url'],
    }

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

Instance Method Details

#available_add_on_sidString

Returns The SID of the AvailableAddOn resource to which this extension applies.

Returns:

  • (String)

    The SID of the AvailableAddOn resource to which this extension applies.



259
260
261
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 259

def available_add_on_sid
    @properties['available_add_on_sid']
end

#contextAvailableAddOnExtensionContext

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

Returns:



244
245
246
247
248
249
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 244

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

#fetchAvailableAddOnExtensionInstance

Fetch the AvailableAddOnExtensionInstance

Returns:



290
291
292
293
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 290

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



265
266
267
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 265

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



304
305
306
307
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 304

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

#product_nameString

Returns The name of the Product this Extension is used within.

Returns:

  • (String)

    The name of the Product this Extension is used within.



271
272
273
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 271

def product_name
    @properties['product_name']
end

#sidString

Returns The unique string that we created to identify the AvailableAddOnExtension resource.

Returns:

  • (String)

    The unique string that we created to identify the AvailableAddOnExtension resource.



253
254
255
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 253

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



297
298
299
300
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 297

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

#unique_nameString

Returns An application-defined string that uniquely identifies the resource.

Returns:

  • (String)

    An application-defined string that uniquely identifies the resource.



277
278
279
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 277

def unique_name
    @properties['unique_name']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



283
284
285
# File 'lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb', line 283

def url
    @properties['url']
end