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)

    The SID of the Account that created this IpAccessControlList resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 283

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 id of the [Account](www.twilio.com/docs/iam/api/account) that owns this resource.

Returns:



321
322
323
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 321

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:



306
307
308
309
310
311
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 306

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

#date_createdTime

Returns The date that this resource was created, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.

Returns:



333
334
335
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 333

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this resource was last updated, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.

Returns:



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the IpAccessControlListInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

def delete

    context.delete
end

#fetchIpAccessControlListInstance

Fetch the IpAccessControlListInstance

Returns:



366
367
368
369
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 366

def fetch

    context.fetch
end

#friendly_nameString

Returns A human readable descriptive text, up to 255 characters long.

Returns:

  • (String)

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



327
328
329
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 327

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#ip_addressesip_addresses

Access the ip_addresses

Returns:



387
388
389
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 387

def ip_addresses
    context.ip_addresses
end

#sidString

Returns A 34 character string that uniquely identifies this resource.

Returns:

  • (String)

    A 34 character string that uniquely identifies this resource.



315
316
317
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 315

def sid
    @properties['sid']
end

#subresource_urisHash

Returns A list of the IpAddress resources associated with this IP access control list resource.

Returns:

  • (Hash)

    A list of the IpAddress resources associated with this IP access control list resource.



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

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



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

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 255 characters long.

Returns:



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

def update(
    friendly_name: nil
)

    context.update(
        friendly_name: friendly_name, 
    )
end

#uriString

Returns The URI for this resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI for this resource, relative to ‘api.twilio.com`



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

def uri
    @properties['uri']
end