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

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 that created this AssignedAddOn resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 266

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  || @properties['resource_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the resource.

Returns:



308
309
310
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 308

def 
    @properties['account_sid']
end

#configurationHash

Returns A JSON string that represents the current configuration of this Add-on installation.

Returns:

  • (Hash)

    A JSON string that represents the current configuration of this Add-on installation.



332
333
334
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 332

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:



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

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 and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



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

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AssignedAddOnInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

def delete

    context.delete
end

#descriptionString

Returns A short description of the functionality that the Add-on provides.

Returns:

  • (String)

    A short description of the functionality that the Add-on provides.



326
327
328
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 326

def description
    @properties['description']
end

#extensionsextensions

Access the extensions

Returns:



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

def extensions
    context.extensions
end

#fetchAssignedAddOnInstance

Fetch the AssignedAddOnInstance

Returns:



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

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.



320
321
322
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 320

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



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

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 to which the Add-on is assigned.

Returns:

  • (String)

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



314
315
316
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 314

def resource_sid
    @properties['resource_sid']
end

#sidString

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

Returns:

  • (String)

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



302
303
304
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 302

def sid
    @properties['sid']
end

#subresource_urisHash

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

Returns:

  • (Hash)

    A list of related resources identified by their relative URIs.



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

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



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

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. It can be used in place of the resource’s ‘sid` in the URL to address the resource.

Returns:

  • (String)

    An application-defined string that uniquely identifies the resource. It can be used in place of the resource’s ‘sid` in the URL to address the resource.



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

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`.



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

def uri
    @properties['uri']
end