Class: Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext::IpAddressInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext::IpAddressInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the Account that is responsible for this resource.
-
#cidr_prefix_length ⇒ String
An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic.
-
#context ⇒ IpAddressContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this resource was created, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
-
#date_updated ⇒ Time
The date that this resource was last updated, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
-
#delete ⇒ Boolean
Delete the IpAddressInstance.
-
#fetch ⇒ IpAddressInstance
Fetch the IpAddressInstance.
-
#friendly_name ⇒ String
A human readable descriptive text for this resource, up to 255 characters long.
-
#initialize(version, payload, account_sid: nil, ip_access_control_list_sid: nil, sid: nil) ⇒ IpAddressInstance
constructor
Initialize the IpAddressInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#ip_access_control_list_sid ⇒ String
The unique id of the IpAccessControlList resource that includes this resource.
-
#ip_address ⇒ String
An IP address in dotted decimal notation from which you want to accept traffic.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset) ⇒ IpAddressInstance
Update the IpAddressInstance.
-
#uri ⇒ String
The URI for this resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, ip_access_control_list_sid: nil, sid: nil) ⇒ IpAddressInstance
Initialize the IpAddressInstance
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 305 def initialize(version, payload , account_sid: nil, ip_access_control_list_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'ip_address' => payload['ip_address'], 'cidr_prefix_length' => payload['cidr_prefix_length'] == nil ? payload['cidr_prefix_length'] : payload['cidr_prefix_length'].to_i, 'ip_access_control_list_sid' => payload['ip_access_control_list_sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'uri' => payload['uri'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'ip_access_control_list_sid' => ip_access_control_list_sid || @properties['ip_access_control_list_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
345 346 347 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 345 def account_sid @properties['account_sid'] end |
#cidr_prefix_length ⇒ String
363 364 365 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 363 def cidr_prefix_length @properties['cidr_prefix_length'] end |
#context ⇒ IpAddressContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 330 def context unless @instance_context @instance_context = IpAddressContext.new(@version , @params['account_sid'], @params['ip_access_control_list_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
375 376 377 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 375 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
381 382 383 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 381 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the IpAddressInstance
394 395 396 397 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 394 def delete context.delete end |
#fetch ⇒ IpAddressInstance
Fetch the IpAddressInstance
402 403 404 405 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 402 def fetch context.fetch end |
#friendly_name ⇒ String
351 352 353 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 351 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
435 436 437 438 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 435 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.IpAddressInstance #{values}>" end |
#ip_access_control_list_sid ⇒ String
369 370 371 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 369 def ip_access_control_list_sid @properties['ip_access_control_list_sid'] end |
#ip_address ⇒ String
357 358 359 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 357 def ip_address @properties['ip_address'] end |
#sid ⇒ String
339 340 341 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 339 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
428 429 430 431 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 428 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.IpAddressInstance #{values}>" end |
#update(ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset) ⇒ IpAddressInstance
Update the IpAddressInstance
413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 413 def update( ip_address: :unset, friendly_name: :unset, cidr_prefix_length: :unset ) context.update( ip_address: ip_address, friendly_name: friendly_name, cidr_prefix_length: cidr_prefix_length, ) end |
#uri ⇒ String
387 388 389 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 387 def uri @properties['uri'] end |