Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnContext::AssignedAddOnExtensionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil, sid: nil) ⇒ AssignedAddOnExtensionInstance

Initialize the AssignedAddOnExtensionInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created the resource.

  • resource_sid (String) (defaults to: nil)

    The SID of the Phone Number to which the Add-on is assigned.

  • assigned_add_on_sid (String) (defaults to: nil)

    The SID that uniquely identifies the assigned Add-on installation.

  • sid (String) (defaults to: nil)

    The Twilio-provided string that uniquely identifies the resource to fetch.


243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 243

def initialize(version, payload, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'resource_sid' => payload['resource_sid'],
      'assigned_add_on_sid' => payload['assigned_add_on_sid'],
      'friendly_name' => payload['friendly_name'],
      'product_name' => payload['product_name'],
      'unique_name' => payload['unique_name'],
      'uri' => payload['uri'],
      'enabled' => payload['enabled'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


294
295
296
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 294

def 
  @properties['account_sid']
end

#assigned_add_on_sidString

Returns The SID that uniquely identifies the assigned Add-on installation.

Returns:

  • (String)

    The SID that uniquely identifies the assigned Add-on installation


306
307
308
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 306

def assigned_add_on_sid
  @properties['assigned_add_on_sid']
end

#contextAssignedAddOnExtensionContext

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

Returns:


273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 273

def context
  unless @instance_context
    @instance_context = AssignedAddOnExtensionContext.new(
        @version,
        @params['account_sid'],
        @params['resource_sid'],
        @params['assigned_add_on_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#enabledBoolean

Returns Whether the Extension will be invoked.

Returns:

  • (Boolean)

    Whether the Extension will be invoked


336
337
338
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 336

def enabled
  @properties['enabled']
end

#fetchAssignedAddOnExtensionInstance

Fetch the AssignedAddOnExtensionInstance

Returns:


343
344
345
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 343

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


312
313
314
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 312

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation


356
357
358
359
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 356

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

#product_nameString

Returns A string that you assigned to describe the Product this Extension is used within.

Returns:

  • (String)

    A string that you assigned to describe the Product this Extension is used within


318
319
320
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 318

def product_name
  @properties['product_name']
end

#resource_sidString

Returns The SID of the Phone Number to which the Add-on is assigned.

Returns:

  • (String)

    The SID of the Phone Number to which the Add-on is assigned


300
301
302
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 300

def resource_sid
  @properties['resource_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


288
289
290
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 288

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


349
350
351
352
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 349

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


324
325
326
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 324

def unique_name
  @properties['unique_name']
end

#uriString

Returns The URI of the resource, relative to `api.twilio.com`.

Returns:


330
331
332
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 330

def uri
  @properties['uri']
end