Class: Twilio::REST::Api::V2010::AccountContext::AddressInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::AddressInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/address.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that is responsible for the Address resource.
-
#city ⇒ String
The city in which the address is located.
-
#context ⇒ AddressContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#customer_name ⇒ String
The name associated with the address.This property has a maximum length of 16 4-byte characters, or 21 3-byte characters.
-
#date_created ⇒ Time
The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the AddressInstance.
-
#dependent_phone_numbers ⇒ dependent_phone_numbers
Access the dependent_phone_numbers.
-
#emergency_enabled ⇒ Boolean
Whether emergency calling has been enabled on this number.
-
#fetch ⇒ AddressInstance
Fetch the AddressInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ AddressInstance
constructor
Initialize the AddressInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The ISO country code of the address.
-
#postal_code ⇒ String
The postal code of the address.
-
#region ⇒ String
The state or region of the address.
-
#sid ⇒ String
The unique string that that we created to identify the Address resource.
-
#street ⇒ String
The number and street address of the address.
-
#street_secondary ⇒ String
The additional number and street address of the address.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset, street_secondary: :unset) ⇒ AddressInstance
Update the AddressInstance.
-
#uri ⇒ String
The URI of the resource, relative to
https://api.twilio.com. -
#validated ⇒ Boolean
Whether the address has been validated to comply with local regulation.
-
#verified ⇒ Boolean
Whether the address has been verified to comply with regulation.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ AddressInstance
Initialize the AddressInstance
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 676 def initialize(version, payload , account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'city' => payload['city'], 'customer_name' => payload['customer_name'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'iso_country' => payload['iso_country'], 'postal_code' => payload['postal_code'], 'region' => payload['region'], 'sid' => payload['sid'], 'street' => payload['street'], 'uri' => payload['uri'], 'emergency_enabled' => payload['emergency_enabled'], 'validated' => payload['validated'], 'verified' => payload['verified'], 'street_secondary' => payload['street_secondary'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
718 719 720 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 718 def account_sid @properties['account_sid'] end |
#city ⇒ String
724 725 726 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 724 def city @properties['city'] end |
#context ⇒ AddressContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
709 710 711 712 713 714 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 709 def context unless @instance_context @instance_context = AddressContext.new(@version , @params['account_sid'], @params['sid']) end @instance_context end |
#customer_name ⇒ String
730 731 732 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 730 def customer_name @properties['customer_name'] end |
#date_created ⇒ Time
736 737 738 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 736 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
742 743 744 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 742 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the AddressInstance
815 816 817 818 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 815 def delete context.delete end |
#dependent_phone_numbers ⇒ dependent_phone_numbers
Access the dependent_phone_numbers
868 869 870 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 868 def dependent_phone_numbers context.dependent_phone_numbers end |
#emergency_enabled ⇒ Boolean
790 791 792 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 790 def emergency_enabled @properties['emergency_enabled'] end |
#fetch ⇒ AddressInstance
Fetch the AddressInstance
823 824 825 826 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 823 def fetch context.fetch end |
#friendly_name ⇒ String
748 749 750 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 748 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
881 882 883 884 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 881 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AddressInstance #{values}>" end |
#iso_country ⇒ String
754 755 756 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 754 def iso_country @properties['iso_country'] end |
#postal_code ⇒ String
760 761 762 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 760 def postal_code @properties['postal_code'] end |
#region ⇒ String
766 767 768 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 766 def region @properties['region'] end |
#sid ⇒ String
772 773 774 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 772 def sid @properties['sid'] end |
#street ⇒ String
778 779 780 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 778 def street @properties['street'] end |
#street_secondary ⇒ String
808 809 810 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 808 def street_secondary @properties['street_secondary'] end |
#to_s ⇒ Object
Provide a user friendly representation
874 875 876 877 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 874 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AddressInstance #{values}>" end |
#update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset, street_secondary: :unset) ⇒ AddressInstance
Update the AddressInstance
840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 840 def update( friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset, street_secondary: :unset ) context.update( friendly_name: friendly_name, customer_name: customer_name, street: street, city: city, region: region, postal_code: postal_code, emergency_enabled: emergency_enabled, auto_correct_address: auto_correct_address, street_secondary: street_secondary, ) end |
#uri ⇒ String
784 785 786 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 784 def uri @properties['uri'] end |
#validated ⇒ Boolean
796 797 798 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 796 def validated @properties['validated'] end |
#verified ⇒ Boolean
802 803 804 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 802 def verified @properties['verified'] end |