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
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 571 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
Returns The unique id of the Account that is responsible for this resource.
612 613 614 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 612 def account_sid @properties['account_sid'] end |
#cidr_prefix_length ⇒ String
Returns An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used.
630 631 632 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 630 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
597 598 599 600 601 602 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 597 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
Returns 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.
642 643 644 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 642 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns 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.
648 649 650 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 648 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the IpAddressInstance
661 662 663 664 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 661 def delete context.delete end |
#fetch ⇒ IpAddressInstance
Fetch the IpAddressInstance
669 670 671 672 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 669 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable descriptive text for this resource, up to 255 characters long.
618 619 620 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 618 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
702 703 704 705 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 702 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.IpAddressInstance #{values}>" end |
#ip_access_control_list_sid ⇒ String
Returns The unique id of the IpAccessControlList resource that includes this resource.
636 637 638 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 636 def ip_access_control_list_sid @properties['ip_access_control_list_sid'] end |
#ip_address ⇒ String
Returns An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today.
624 625 626 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 624 def ip_address @properties['ip_address'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
606 607 608 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 606 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
695 696 697 698 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 695 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
680 681 682 683 684 685 686 687 688 689 690 691 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 680 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
Returns The URI for this resource, relative to ‘api.twilio.com`.
654 655 656 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb', line 654 def uri @properties['uri'] end |