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

Public Class Methods

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

Initialize the IpAddressContext @param [Version] version Version that contains the resource @param [String] account_sid The unique id of the

{Account}[https://www.twilio.com/docs/iam/api/account] responsible for this
resource.

@param [String] ip_access_control_list_sid The IpAccessControlList Sid that

identifies the IpAddress resources to fetch.

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

resource to fetch.

@return [IpAddressContext] IpAddressContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
194 def initialize(version, account_sid, ip_access_control_list_sid, sid)
195   super(version)
196 
197   # Path Solution
198   @solution = {
199       account_sid: account_sid,
200       ip_access_control_list_sid: ip_access_control_list_sid,
201       sid: sid,
202   }
203   @uri = "/Accounts/#{@solution[:account_sid]}/SIP/IpAccessControlLists/#{@solution[:ip_access_control_list_sid]}/IpAddresses/#{@solution[:sid]}.json"
204 end

Public Instance Methods

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
253 def delete
254    @version.delete('DELETE', @uri)
255 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
209 def fetch
210   payload = @version.fetch('GET', @uri)
211 
212   IpAddressInstance.new(
213       @version,
214       payload,
215       account_sid: @solution[:account_sid],
216       ip_access_control_list_sid: @solution[:ip_access_control_list_sid],
217       sid: @solution[:sid],
218   )
219 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
266 def inspect
267   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
268   "#<Twilio.Api.V2010.IpAddressContext #{context}>"
269 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
259 def to_s
260   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
261   "#<Twilio.Api.V2010.IpAddressContext #{context}>"
262 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
232 def update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset)
233   data = Twilio::Values.of({
234       'IpAddress' => ip_address,
235       'FriendlyName' => friendly_name,
236       'CidrPrefixLength' => cidr_prefix_length,
237   })
238 
239   payload = @version.update('POST', @uri, data: data)
240 
241   IpAddressInstance.new(
242       @version,
243       payload,
244       account_sid: @solution[:account_sid],
245       ip_access_control_list_sid: @solution[:ip_access_control_list_sid],
246       sid: @solution[:sid],
247   )
248 end