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

Public Class Methods

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

Initialize the IpAccessControlListContext @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] sid A 34 character string that uniquely identifies the resource

to fetch.

@return [IpAccessControlListContext] IpAccessControlListContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb
169 def initialize(version, account_sid, sid)
170   super(version)
171 
172   # Path Solution
173   @solution = {account_sid: account_sid, sid: sid, }
174   @uri = "/Accounts/#{@solution[:account_sid]}/SIP/IpAccessControlLists/#{@solution[:sid]}.json"
175 
176   # Dependents
177   @ip_addresses = nil
178 end

Public Instance Methods

delete() click to toggle source

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

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb
215 def delete
216    @version.delete('DELETE', @uri)
217 end
fetch() click to toggle source

Fetch the IpAccessControlListInstance @return [IpAccessControlListInstance] Fetched IpAccessControlListInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb
183 def fetch
184   payload = @version.fetch('GET', @uri)
185 
186   IpAccessControlListInstance.new(
187       @version,
188       payload,
189       account_sid: @solution[:account_sid],
190       sid: @solution[:sid],
191   )
192 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.rb
250 def inspect
251   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
252   "#<Twilio.Api.V2010.IpAccessControlListContext #{context}>"
253 end
ip_addresses(sid=:unset) click to toggle source

Access the ip_addresses @return [IpAddressList] @return [IpAddressContext] if sid was passed.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb
223 def ip_addresses(sid=:unset)
224   raise ArgumentError, 'sid cannot be nil' if sid.nil?
225 
226   if sid != :unset
227     return IpAddressContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
228   end
229 
230   unless @ip_addresses
231     @ip_addresses = IpAddressList.new(
232         @version,
233         account_sid: @solution[:account_sid],
234         ip_access_control_list_sid: @solution[:sid],
235     )
236   end
237 
238   @ip_addresses
239 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.rb
243 def to_s
244   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
245   "#<Twilio.Api.V2010.IpAccessControlListContext #{context}>"
246 end
update(friendly_name: nil) click to toggle source

Update the IpAccessControlListInstance @param [String] friendly_name A human readable descriptive text, up to 64

characters long.

@return [IpAccessControlListInstance] Updated IpAccessControlListInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb
199 def update(friendly_name: nil)
200   data = Twilio::Values.of({'FriendlyName' => friendly_name, })
201 
202   payload = @version.update('POST', @uri, data: data)
203 
204   IpAccessControlListInstance.new(
205       @version,
206       payload,
207       account_sid: @solution[:account_sid],
208       sid: @solution[:sid],
209   )
210 end