class Twilio::REST::Voice::V1::IpRecordInstance

Public Class Methods

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

Initialize the IpRecordInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The Twilio-provided string that uniquely identifies the IP

Record resource to fetch.

@return [IpRecordInstance] IpRecordInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
230 def initialize(version, payload, sid: nil)
231   super(version)
232 
233   # Marshaled Properties
234   @properties = {
235       'account_sid' => payload['account_sid'],
236       'sid' => payload['sid'],
237       'friendly_name' => payload['friendly_name'],
238       'ip_address' => payload['ip_address'],
239       'cidr_prefix_length' => payload['cidr_prefix_length'].to_i,
240       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
241       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
242       'url' => payload['url'],
243   }
244 
245   # Context
246   @instance_context = nil
247   @params = {'sid' => sid || @properties['sid'], }
248 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
263 def account_sid
264   @properties['account_sid']
265 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. By default the entire IP address is used, which for IPv4 is value 32.

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
287 def cidr_prefix_length
288   @properties['cidr_prefix_length']
289 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 [IpRecordContext] IpRecordContext for this IpRecordInstance

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
254 def context
255   unless @instance_context
256     @instance_context = IpRecordContext.new(@version, @params['sid'], )
257   end
258   @instance_context
259 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
293 def date_created
294   @properties['date_created']
295 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
299 def date_updated
300   @properties['date_updated']
301 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
328 def delete
329   context.delete
330 end
fetch() click to toggle source

Fetch the IpRecordInstance @return [IpRecordInstance] Fetched IpRecordInstance

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
312 def fetch
313   context.fetch
314 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
275 def friendly_name
276   @properties['friendly_name']
277 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
341 def inspect
342   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
343   "<Twilio.Voice.V1.IpRecordInstance #{values}>"
344 end
ip_address() click to toggle source

@return [String] An IP address in dotted decimal notation, IPv4 only.

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
281 def ip_address
282   @properties['ip_address']
283 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
269 def sid
270   @properties['sid']
271 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
334 def to_s
335   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
336   "<Twilio.Voice.V1.IpRecordInstance #{values}>"
337 end
update(friendly_name: :unset) click to toggle source

Update the IpRecordInstance @param [String] friendly_name A descriptive string that you create to describe

the resource. It is not unique and can be up to 255 characters long.

@return [IpRecordInstance] Updated IpRecordInstance

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
321 def update(friendly_name: :unset)
322   context.update(friendly_name: friendly_name, )
323 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/voice/v1/ip_record.rb
305 def url
306   @properties['url']
307 end