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, IpAddressInstanceMetadata, IpAddressList, IpAddressListResponse, IpAddressPage, IpAddressPageMetadata
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the IpAccessControlListInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the IpAccessControlListInstanceMetadata.
-
#fetch ⇒ IpAccessControlListInstance
Fetch the IpAccessControlListInstance.
-
#fetch_with_metadata ⇒ IpAccessControlListInstance
Fetch the IpAccessControlListInstanceMetadata.
-
#initialize(version, account_sid, sid) ⇒ IpAccessControlListContext
constructor
Initialize the IpAccessControlListContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#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.
-
#update_with_metadata(friendly_name: nil) ⇒ IpAccessControlListInstance
Update the IpAccessControlListInstanceMetadata.
Constructor Details
#initialize(version, account_sid, sid) ⇒ IpAccessControlListContext
Initialize the IpAccessControlListContext
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 221 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
Delete the IpAccessControlListInstance
235 236 237 238 239 240 241 242 243 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 235 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the IpAccessControlListInstanceMetadata
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 248 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) ipAccessControlList_instance = IpAccessControlListInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) IpAccessControlListInstanceMetadata.new(@version, ipAccessControlList_instance, response.headers, response.status_code) end |
#fetch ⇒ IpAccessControlListInstance
Fetch the IpAccessControlListInstance
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 267 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) IpAccessControlListInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ IpAccessControlListInstance
Fetch the IpAccessControlListInstanceMetadata
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 287 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) ip_access_control_list_instance = IpAccessControlListInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) IpAccessControlListInstanceMetadata.new( @version, ip_access_control_list_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
399 400 401 402 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 399 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.IpAccessControlListContext #{context}>" end |
#ip_addresses(sid = :unset) ⇒ IpAddressList, IpAddressContext
Access the ip_addresses
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 374 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
392 393 394 395 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 392 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
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 314 def update( friendly_name: nil ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) IpAccessControlListInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#update_with_metadata(friendly_name: nil) ⇒ IpAccessControlListInstance
Update the IpAccessControlListInstanceMetadata
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 341 def ( friendly_name: nil ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) ip_access_control_list_instance = IpAccessControlListInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) IpAccessControlListInstanceMetadata.new( @version, ip_access_control_list_instance, response.headers, response.status_code ) end |