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
229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 229 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
243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 243 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
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 256 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
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 275 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
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 295 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
407 408 409 410 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 407 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
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 382 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
400 401 402 403 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 400 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
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 322 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
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 349 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 |