Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.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, sid: nil) ⇒ AssignedAddOnInstance

Initialize the AssignedAddOnInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The unique id of the Account that has installed this Add-on.

  • resource_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

    The Installed Add-on Sid that uniquely identifies the assignment



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 297

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

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'resource_sid' => payload['resource_sid'],
      'friendly_name' => payload['friendly_name'],
      'description' => payload['description'],
      'configuration' => payload['configuration'],
      'unique_name' => payload['unique_name'],
      'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
      'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
      'uri' => payload['uri'],
      'subresource_uris' => payload['subresource_uris'],
  }

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

Instance Method Details

#account_sidString

Returns The Account id that has installed this Add-on.

Returns:

  • (String)

    The Account id that has installed this Add-on



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

def 
  @properties['account_sid']
end

#configurationHash

Returns The JSON object representing the current configuration.

Returns:

  • (Hash)

    The JSON object representing the current configuration



372
373
374
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 372

def configuration
  @properties['configuration']
end

#contextAssignedAddOnContext

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

Returns:



328
329
330
331
332
333
334
335
336
337
338
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 328

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

#date_createdTime

Returns The date this Add-on was installed.

Returns:

  • (Time)

    The date this Add-on was installed



384
385
386
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 384

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this Add-on installation was last updated.

Returns:

  • (Time)

    The date this Add-on installation was last updated



390
391
392
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 390

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the AssignedAddOnInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



416
417
418
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 416

def delete
  context.delete
end

#descriptionString

Returns A short description of the Add-on functionality.

Returns:

  • (String)

    A short description of the Add-on functionality



366
367
368
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 366

def description
  @properties['description']
end

#extensionsextensions

Access the extensions

Returns:



423
424
425
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 423

def extensions
  context.extensions
end

#fetchAssignedAddOnInstance

Fetch a AssignedAddOnInstance

Returns:



409
410
411
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 409

def fetch
  context.fetch
end

#friendly_nameString

Returns A description of this Add-on installation.

Returns:

  • (String)

    A description of this Add-on installation



360
361
362
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 360

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



436
437
438
439
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 436

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

#resource_sidString

Returns The Phone Number id that has installed this Add-on.

Returns:

  • (String)

    The Phone Number id that has installed this Add-on



354
355
356
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 354

def resource_sid
  @properties['resource_sid']
end

#sidString

Returns A string that uniquely identifies this assigned Add-on installation.

Returns:

  • (String)

    A string that uniquely identifies this assigned Add-on installation



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

def sid
  @properties['sid']
end

#subresource_urisString

Returns The subresource_uris.

Returns:

  • (String)

    The subresource_uris



402
403
404
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 402

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



429
430
431
432
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 429

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

#unique_nameString

Returns The string that uniquely identifies this Add-on installation.

Returns:

  • (String)

    The string that uniquely identifies this Add-on installation



378
379
380
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 378

def unique_name
  @properties['unique_name']
end

#uriString

Returns The uri.

Returns:

  • (String)

    The uri



396
397
398
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 396

def uri
  @properties['uri']
end