class Twilio::REST::Voice::V1::SourceIpMappingContext

Public Class Methods

new(version, sid) click to toggle source

Initialize the SourceIpMappingContext @param [Version] version Version that contains the resource @param [String] sid The Twilio-provided string that uniquely identifies the IP

Record resource to fetch.

@return [SourceIpMappingContext] SourceIpMappingContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb
164 def initialize(version, sid)
165   super(version)
166 
167   # Path Solution
168   @solution = {sid: sid, }
169   @uri = "/SourceIpMappings/#{@solution[:sid]}"
170 end

Public Instance Methods

delete() click to toggle source

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

    # File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb
197 def delete
198    @version.delete('DELETE', @uri)
199 end
fetch() click to toggle source

Fetch the SourceIpMappingInstance @return [SourceIpMappingInstance] Fetched SourceIpMappingInstance

    # File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb
175 def fetch
176   payload = @version.fetch('GET', @uri)
177 
178   SourceIpMappingInstance.new(@version, payload, sid: @solution[:sid], )
179 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb
210 def inspect
211   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
212   "#<Twilio.Voice.V1.SourceIpMappingContext #{context}>"
213 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb
203 def to_s
204   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
205   "#<Twilio.Voice.V1.SourceIpMappingContext #{context}>"
206 end
update(sip_domain_sid: nil) click to toggle source

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
186 def update(sip_domain_sid: nil)
187   data = Twilio::Values.of({'SipDomainSid' => sip_domain_sid, })
188 
189   payload = @version.update('POST', @uri, data: data)
190 
191   SourceIpMappingInstance.new(@version, payload, sid: @solution[:sid], )
192 end