Class: Twilio::REST::Lookups::V2::PhoneNumberContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Lookups::V2::PhoneNumberContext
- Defined in:
- lib/twilio-ruby/rest/lookups/v2/phone_number.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line1: :unset, address_line2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset, last_verified_date: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance.
-
#initialize(version, phone_number) ⇒ PhoneNumberContext
constructor
Initialize the PhoneNumberContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, phone_number) ⇒ PhoneNumberContext
Initialize the PhoneNumberContext
51 52 53 54 55 56 57 58 59 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 51 def initialize(version, phone_number) super(version) # Path Solution @solution = { phone_number: phone_number, } @uri = "/PhoneNumbers/#{@solution[:phone_number]}" end |
Instance Method Details
#fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line1: :unset, address_line2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset, last_verified_date: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 76 def fetch( fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line1: :unset, address_line2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset, last_verified_date: :unset ) params = Twilio::Values.of({ 'Fields' => fields, 'CountryCode' => country_code, 'FirstName' => first_name, 'LastName' => last_name, 'AddressLine1' => address_line1, 'AddressLine2' => address_line2, 'City' => city, 'State' => state, 'PostalCode' => postal_code, 'AddressCountryCode' => address_country_code, 'NationalId' => national_id, 'DateOfBirth' => date_of_birth, 'LastVerifiedDate' => last_verified_date, }) payload = @version.fetch('GET', @uri, params: params) PhoneNumberInstance.new( @version, payload, phone_number: @solution[:phone_number], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
126 127 128 129 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 126 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Lookups.V2.PhoneNumberContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
119 120 121 122 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 119 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Lookups.V2.PhoneNumberContext #{context}>" end |