Class: Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext::IpAddressInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the IpAddressInstance



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 284

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

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

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

Instance Method Details

#account_sidString



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

def 
  @properties['account_sid']
end

#cidr_prefix_lengthString



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

def cidr_prefix_length
  @properties['cidr_prefix_length']
end

#contextIpAddressContext

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



313
314
315
316
317
318
319
320
321
322
323
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 313

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

#date_createdTime



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

def date_created
  @properties['date_created']
end

#date_updatedTime



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the IpAddressInstance



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

def delete
  context.delete
end

#fetchIpAddressInstance

Fetch the IpAddressInstance



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

def fetch
  context.fetch
end

#friendly_nameString



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

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/ip_address.rb', line 421

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

#ip_access_control_list_sidString



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

def ip_access_control_list_sid
  @properties['ip_access_control_list_sid']
end

#ip_addressString



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

def ip_address
  @properties['ip_address']
end

#sidString



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

def sid
  @properties['sid']
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/ip_address.rb', line 414

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

#update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset) ⇒ IpAddressInstance

Update the IpAddressInstance



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

def update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset)
  context.update(
      ip_address: ip_address,
      friendly_name: friendly_name,
      cidr_prefix_length: cidr_prefix_length,
  )
end

#uriString



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

def uri
  @properties['uri']
end