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

Public Class Methods

new(version, payload, account_sid: nil, ip_access_control_list_sid: nil, sid: nil) click to toggle source

Initialize the IpAddressInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The unique id of the Account that is responsible for

this resource.

@param [String] ip_access_control_list_sid The unique id of the

IpAccessControlList resource that includes this resource.

@param [String] sid A 34 character string that uniquely identifies the IpAddress

resource to fetch.

@return [IpAddressInstance] IpAddressInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
284 def initialize(version, payload, account_sid: nil, ip_access_control_list_sid: nil, sid: nil)
285   super(version)
286 
287   # Marshaled Properties
288   @properties = {
289       'sid' => payload['sid'],
290       'account_sid' => payload['account_sid'],
291       'friendly_name' => payload['friendly_name'],
292       'ip_address' => payload['ip_address'],
293       'cidr_prefix_length' => payload['cidr_prefix_length'].to_i,
294       'ip_access_control_list_sid' => payload['ip_access_control_list_sid'],
295       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
296       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
297       'uri' => payload['uri'],
298   }
299 
300   # Context
301   @instance_context = nil
302   @params = {
303       'account_sid' => account_sid,
304       'ip_access_control_list_sid' => ip_access_control_list_sid,
305       'sid' => sid || @properties['sid'],
306   }
307 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique id of the Account that is responsible for this resource.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
333 def account_sid
334   @properties['account_sid']
335 end
cidr_prefix_length() click to toggle source

@return [String] An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
351 def cidr_prefix_length
352   @properties['cidr_prefix_length']
353 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [IpAddressContext] IpAddressContext for this IpAddressInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
313 def context
314   unless @instance_context
315     @instance_context = IpAddressContext.new(
316         @version,
317         @params['account_sid'],
318         @params['ip_access_control_list_sid'],
319         @params['sid'],
320     )
321   end
322   @instance_context
323 end
date_created() click to toggle source

@return [Time] The date that this resource was created, given as GMT in RFC 2822 format.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
363 def date_created
364   @properties['date_created']
365 end
date_updated() click to toggle source

@return [Time] The date that this resource was last updated, given as GMT in RFC 2822 format.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
369 def date_updated
370   @properties['date_updated']
371 end
delete() click to toggle source

Delete the IpAddressInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
408 def delete
409   context.delete
410 end
fetch() click to toggle source

Fetch the IpAddressInstance @return [IpAddressInstance] Fetched IpAddressInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
382 def fetch
383   context.fetch
384 end
friendly_name() click to toggle source

@return [String] A human readable descriptive text for this resource, up to 64 characters long.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
339 def friendly_name
340   @properties['friendly_name']
341 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
421 def inspect
422   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
423   "<Twilio.Api.V2010.IpAddressInstance #{values}>"
424 end
ip_access_control_list_sid() click to toggle source

@return [String] The unique id of the IpAccessControlList resource that includes this resource.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
357 def ip_access_control_list_sid
358   @properties['ip_access_control_list_sid']
359 end
ip_address() click to toggle source

@return [String] An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
345 def ip_address
346   @properties['ip_address']
347 end
sid() click to toggle source

@return [String] A 34 character string that uniquely identifies this resource.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
327 def sid
328   @properties['sid']
329 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
414 def to_s
415   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
416   "<Twilio.Api.V2010.IpAddressInstance #{values}>"
417 end
update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset) click to toggle source

Update the IpAddressInstance @param [String] ip_address An IP address in dotted decimal notation from which

you want to accept traffic. Any SIP requests from this IP address will be
allowed by Twilio. IPv4 only supported today.

@param [String] friendly_name A human readable descriptive text for this

resource, up to 64 characters long.

@param [String] cidr_prefix_length An integer representing the length of the

CIDR prefix to use with this IP address when accepting traffic. By default the
entire IP address is used.

@return [IpAddressInstance] Updated IpAddressInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
397 def update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset)
398   context.update(
399       ip_address: ip_address,
400       friendly_name: friendly_name,
401       cidr_prefix_length: cidr_prefix_length,
402   )
403 end
uri() click to toggle source

@return [String] The URI for this resource, relative to api.twilio.com

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
375 def uri
376   @properties['uri']
377 end