Class: Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
Defined Under Namespace
Classes: IpAddressContext, IpAddressInstance, IpAddressList, IpAddressPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the IpAccessControlListInstance.
-
#fetch ⇒ IpAccessControlListInstance
Fetch a IpAccessControlListInstance.
-
#initialize(version, account_sid, sid) ⇒ IpAccessControlListContext
constructor
Initialize the IpAccessControlListContext.
-
#ip_addresses(sid = :unset) ⇒ IpAddressList, IpAddressContext
Access the ip_addresses.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: nil) ⇒ IpAccessControlListInstance
Update the IpAccessControlListInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ IpAccessControlListContext
Initialize the IpAccessControlListContext
191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 191 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/SIP/IpAccessControlLists/#{@solution[:sid]}.json" # Dependents @ip_addresses = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the IpAccessControlListInstance
252 253 254 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 252 def delete @version.delete('delete', @uri) end |
#fetch ⇒ IpAccessControlListInstance
Fetch a IpAccessControlListInstance
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 208 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) IpAccessControlListInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#ip_addresses(sid = :unset) ⇒ IpAddressList, IpAddressContext
Access the ip_addresses
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 260 def ip_addresses(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return IpAddressContext.new( @version, @solution[:account_sid], @solution[:sid], sid, ) end unless @ip_addresses @ip_addresses = IpAddressList.new( @version, account_sid: @solution[:account_sid], ip_access_control_list_sid: @solution[:sid], ) end @ip_addresses end |
#to_s ⇒ Object
Provide a user friendly representation
285 286 287 288 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 285 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.IpAccessControlListContext #{context}>" end |
#update(friendly_name: nil) ⇒ IpAccessControlListInstance
Update the IpAccessControlListInstance
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 230 def update(friendly_name: nil) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) payload = @version.update( 'POST', @uri, data: data, ) IpAccessControlListInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |