Class: Twilio::REST::Lookups::V2::PhoneNumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Lookups::V2::PhoneNumberInstance
- 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
-
#call_forwarding ⇒ Hash
An object that contains call forwarding status information.
-
#caller_name ⇒ Hash
An object that contains caller name information.
-
#calling_country_code ⇒ String
International dialing prefix.
-
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country_code ⇒ String
Phone number’s ISO country code.
-
#disposable_phone_number_risk ⇒ Hash
An object that contains disposable phone number risk information.
-
#fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line_1: :unset, address_line_2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance.
-
#identity_match ⇒ Hash
An object that contains identity match information.
-
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
constructor
Initialize the PhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#line_type_intelligence ⇒ Hash
An object that contains line type information.
-
#live_activity ⇒ Hash
An object that contains live activity information.
-
#national_format ⇒ String
Phone number in national format.
-
#phone_number ⇒ String
Phone number in E.164 format.
-
#sim_swap ⇒ Hash
An object that contains SIM swap information.
-
#sms_pumping_risk ⇒ Hash
An object that contains sms pumping risk information.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the resource.
-
#valid ⇒ Boolean
Boolean which indicates if the phone number is valid.
-
#validation_errors ⇒ Array[phone_number.ValidationError]
Contains reasons why a phone number is invalid.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
Initialize the PhoneNumberInstance
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 158 def initialize(version, payload, phone_number: nil) super(version) # Marshaled Properties @properties = { 'calling_country_code' => payload['calling_country_code'], 'country_code' => payload['country_code'], 'phone_number' => payload['phone_number'], 'national_format' => payload['national_format'], 'valid' => payload['valid'], 'validation_errors' => payload['validation_errors'], 'caller_name' => payload['caller_name'], 'sim_swap' => payload['sim_swap'], 'call_forwarding' => payload['call_forwarding'], 'live_activity' => payload['live_activity'], 'line_type_intelligence' => payload['line_type_intelligence'], 'identity_match' => payload['identity_match'], 'sms_pumping_risk' => payload['sms_pumping_risk'], 'disposable_phone_number_risk' => payload['disposable_phone_number_risk'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'phone_number' => phone_number || @properties['phone_number'], } end |
Instance Method Details
#call_forwarding ⇒ Hash
Returns An object that contains call forwarding status information.
246 247 248 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 246 def call_forwarding @properties['call_forwarding'] end |
#caller_name ⇒ Hash
Returns An object that contains caller name information.
234 235 236 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 234 def caller_name @properties['caller_name'] end |
#calling_country_code ⇒ String
Returns International dialing prefix.
198 199 200 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 198 def calling_country_code @properties['calling_country_code'] end |
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 189 def context unless @instance_context @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], ) end @instance_context end |
#country_code ⇒ String
Returns Phone number’s ISO country code.
204 205 206 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 204 def country_code @properties['country_code'] end |
#disposable_phone_number_risk ⇒ Hash
Returns An object that contains disposable phone number risk information.
276 277 278 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 276 def disposable_phone_number_risk @properties['disposable_phone_number_risk'] end |
#fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line_1: :unset, address_line_2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 316 def fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line_1: :unset, address_line_2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset) context.fetch( fields: fields, country_code: country_code, first_name: first_name, last_name: last_name, address_line_1: address_line_1, address_line_2: address_line_2, city: city, state: state, postal_code: postal_code, address_country_code: address_country_code, national_id: national_id, date_of_birth: date_of_birth, ) end |
#identity_match ⇒ Hash
Returns An object that contains identity match information.
264 265 266 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 264 def identity_match @properties['identity_match'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 342 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V2.PhoneNumberInstance #{values}>" end |
#line_type_intelligence ⇒ Hash
Returns An object that contains line type information.
258 259 260 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 258 def line_type_intelligence @properties['line_type_intelligence'] end |
#live_activity ⇒ Hash
Returns An object that contains live activity information.
252 253 254 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 252 def live_activity @properties['live_activity'] end |
#national_format ⇒ String
Returns Phone number in national format.
216 217 218 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 216 def national_format @properties['national_format'] end |
#phone_number ⇒ String
Returns Phone number in E.164 format.
210 211 212 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 210 def phone_number @properties['phone_number'] end |
#sim_swap ⇒ Hash
Returns An object that contains SIM swap information.
240 241 242 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 240 def sim_swap @properties['sim_swap'] end |
#sms_pumping_risk ⇒ Hash
Returns An object that contains sms pumping risk information.
270 271 272 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 270 def sms_pumping_risk @properties['sms_pumping_risk'] end |
#to_s ⇒ Object
Provide a user friendly representation
335 336 337 338 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 335 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V2.PhoneNumberInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
282 283 284 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 282 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Boolean which indicates if the phone number is valid.
222 223 224 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 222 def valid @properties['valid'] end |
#validation_errors ⇒ Array[phone_number.ValidationError]
Returns Contains reasons why a phone number is invalid.
228 229 230 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 228 def validation_errors @properties['validation_errors'] end |