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 SID of the [Account](www.twilio.com/docs/api/rest/account) that created the resource.

  • resource_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

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



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

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 SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



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

def 
  @properties['account_sid']
end

#configurationHash

Returns A JSON string that represents the current configuration.

Returns:

  • (Hash)

    A JSON string that represents the current configuration



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

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:



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

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 RFC 2822 date and time in GMT that the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was created



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

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was last updated



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the AssignedAddOnInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



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

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



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

def description
  @properties['description']
end

#extensionsextensions

Access the extensions

Returns:



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

def extensions
  context.extensions
end

#fetchAssignedAddOnInstance

Fetch a AssignedAddOnInstance

Returns:



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

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



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

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#resource_sidString

Returns The SID of the Phone Number that installed this Add-on.

Returns:

  • (String)

    The SID of the Phone Number that installed this Add-on



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

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



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

def sid
  @properties['sid']
end

#subresource_urisString

Returns A list of related resources identified by their relative URIs.

Returns:

  • (String)

    A list of related resources identified by their relative URIs



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

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



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

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



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

def unique_name
  @properties['unique_name']
end

#uriString

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

Returns:

  • (String)

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



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

def uri
  @properties['uri']
end