Class: Twilio::REST::Preview::Marketplace::AvailableAddOnInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ AvailableAddOnInstance

Initialize the AvailableAddOnInstance

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 AvailableAddOn resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 230

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'pricing_type' => payload['pricing_type'],
        'configuration_schema' => payload['configuration_schema'],
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#configuration_schemaHash

Returns The JSON object with the configuration that must be provided when installing a given Add-on.

Returns:

  • (Hash)

    The JSON object with the configuration that must be provided when installing a given Add-on.



286
287
288
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 286

def configuration_schema
    @properties['configuration_schema']
end

#contextAvailableAddOnContext

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

Returns:



253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 253

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

#descriptionString

Returns A short description of the Add-on’s functionality.

Returns:

  • (String)

    A short description of the Add-on’s functionality.



274
275
276
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 274

def description
    @properties['description']
end

#extensionsextensions

Access the extensions

Returns:



313
314
315
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 313

def extensions
    context.extensions
end

#fetchAvailableAddOnInstance

Fetch the AvailableAddOnInstance

Returns:



305
306
307
308
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 305

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.



268
269
270
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 268

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



326
327
328
329
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 326

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

Returns The URLs of related resources.

Returns:

  • (Hash)

    The URLs of related resources.



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

def links
    @properties['links']
end

#pricing_typeString

Returns How customers are charged for using this Add-on.

Returns:

  • (String)

    How customers are charged for using this Add-on.



280
281
282
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 280

def pricing_type
    @properties['pricing_type']
end

#sidString

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

Returns:

  • (String)

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



262
263
264
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 262

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



319
320
321
322
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 319

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



292
293
294
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb', line 292

def url
    @properties['url']
end