Class: Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, sid: nil) ⇒ IpAccessControlListInstance

Initialize the IpAccessControlListInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this resource.

  • sid (String) (defaults to: nil)

    The ip-access-control-list Sid that uniquely identifies this resource



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

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

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

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

Instance Method Details

#account_sidString

Returns The unique sid that identifies this account.

Returns:

  • (String)

    The unique sid that identifies this account



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

def 
  @properties['account_sid']
end

#contextIpAccessControlListContext

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

Returns:



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

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

#date_createdTime

Returns The date this resource was created.

Returns:

  • (Time)

    The date this resource was created



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

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this resource was last updated.

Returns:

  • (Time)

    The date this resource was last updated



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the IpAccessControlListInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



401
402
403
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 401

def delete
  context.delete
end

#fetchIpAccessControlListInstance

Fetch a IpAccessControlListInstance

Returns:



383
384
385
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 383

def fetch
  context.fetch
end

#friendly_nameString

Returns A human readable description of this resource.

Returns:

  • (String)

    A human readable description of this resource



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

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



421
422
423
424
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 421

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

#ip_addressesip_addresses

Access the ip_addresses

Returns:



408
409
410
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 408

def ip_addresses
  context.ip_addresses
end

#sidString

Returns A string that uniquely identifies this resource.

Returns:

  • (String)

    A string that uniquely identifies this resource



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

def sid
  @properties['sid']
end

#subresource_urisString

Returns The subresource_uris.

Returns:

  • (String)

    The subresource_uris



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

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



414
415
416
417
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 414

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

#update(friendly_name: nil) ⇒ IpAccessControlListInstance

Update the IpAccessControlListInstance

Parameters:

  • friendly_name (String) (defaults to: nil)

    A human readable descriptive text, up to 64 characters long.

Returns:



392
393
394
395
396
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 392

def update(friendly_name: nil)
  context.update(
      friendly_name: friendly_name,
  )
end

#uriString

Returns The URI for this resource.

Returns:

  • (String)

    The URI for this resource



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

def uri
  @properties['uri']
end