class Twilio::REST::Voice::V1::IpRecordInstance
Public Class Methods
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
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
@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
@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
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
@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
@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 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 the IpRecordInstance
@return [IpRecordInstance] Fetched IpRecordInstance
# File lib/twilio-ruby/rest/voice/v1/ip_record.rb 312 def fetch 313 context.fetch 314 end
@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
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
@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
@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
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 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
@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