class Twilio::REST::Voice::V1::SourceIpMappingInstance
Public Class Methods
Initialize the SourceIpMappingInstance
@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 [SourceIpMappingInstance] SourceIpMappingInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 224 def initialize(version, payload, sid: nil) 225 super(version) 226 227 # Marshaled Properties 228 @properties = { 229 'sid' => payload['sid'], 230 'ip_record_sid' => payload['ip_record_sid'], 231 'sip_domain_sid' => payload['sip_domain_sid'], 232 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 233 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 234 'url' => payload['url'], 235 } 236 237 # Context 238 @instance_context = nil 239 @params = {'sid' => sid || @properties['sid'], } 240 end
Public Instance Methods
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SourceIpMappingContext] SourceIpMappingContext
for this SourceIpMappingInstance
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 246 def context 247 unless @instance_context 248 @instance_context = SourceIpMappingContext.new(@version, @params['sid'], ) 249 end 250 @instance_context 251 end
@return [Time] The RFC 2822 date and time in GMT that the resource was created
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 273 def date_created 274 @properties['date_created'] 275 end
@return [Time] The RFC 2822 date and time in GMT that the resource was last updated
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 279 def date_updated 280 @properties['date_updated'] 281 end
Delete the SourceIpMappingInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 308 def delete 309 context.delete 310 end
Fetch the SourceIpMappingInstance
@return [SourceIpMappingInstance] Fetched SourceIpMappingInstance
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 292 def fetch 293 context.fetch 294 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 321 def inspect 322 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 323 "<Twilio.Voice.V1.SourceIpMappingInstance #{values}>" 324 end
@return [String] The unique string that identifies an IP Record
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 261 def ip_record_sid 262 @properties['ip_record_sid'] 263 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 255 def sid 256 @properties['sid'] 257 end
@return [String] The unique string that identifies a SIP Domain
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 267 def sip_domain_sid 268 @properties['sip_domain_sid'] 269 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 314 def to_s 315 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 316 "<Twilio.Voice.V1.SourceIpMappingInstance #{values}>" 317 end
Update the SourceIpMappingInstance
@param [String] sip_domain_sid
The SID of the SIP Domain
that the IP Record
should be mapped to.
@return [SourceIpMappingInstance] Updated SourceIpMappingInstance
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 301 def update(sip_domain_sid: nil) 302 context.update(sip_domain_sid: sip_domain_sid, ) 303 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb 285 def url 286 @properties['url'] 287 end