Class: Twilio::REST::Preview::Marketplace::AvailableAddOnContext::AvailableAddOnExtensionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.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, 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

  • available_add_on_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

    The SID of the AvailableAddOn Extension resource to fetch.


211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb', line 211

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, '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


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

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:


233
234
235
236
237
238
239
240
241
242
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb', line 233

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:


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

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


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

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#product_nameString

Returns The name of the Extension's Product.

Returns:

  • (String)

    The name of the Extension's Product


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

def product_name
  @properties['product_name']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


246
247
248
# File 'lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb', line 246

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


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

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Marketplace.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


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

def unique_name
  @properties['unique_name']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource


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

def url
  @properties['url']
end