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
Instance Method Summary collapse
- #call_forwarding ⇒ CallForwardingInfo
- #caller_name ⇒ CallerNameInfo
-
#calling_country_code ⇒ String
International dialing prefix of the phone number defined in the E.164 standard.
-
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country_code ⇒ String
The phone number's ISO country code.
-
#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, verification_sid: :unset, partner_sub_id: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance.
- #identity_match ⇒ IdentityMatchInfo
-
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
constructor
Initialize the PhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #line_status ⇒ LineStatusInfo
- #line_type_intelligence ⇒ LineTypeIntelligenceInfo
-
#national_format ⇒ String
The phone number in national format.
-
#phone_number ⇒ String
The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
-
#phone_number_quality_score ⇒ Hash
An object that contains information of a mobile phone number quality score.
-
#pre_fill ⇒ Hash
An object that contains pre fill information.
- #reassigned_number ⇒ ReassignedNumberInfo
- #sim_swap ⇒ SimSwapInfo
- #sms_pumping_risk ⇒ SmsPumpingRiskInfo
-
#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 in a valid range that can be freely assigned by a carrier to a user.
-
#validation_errors ⇒ Array<ValidationError>
Contains reasons why a phone number is invalid.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
Initialize the PhoneNumberInstance
303 304 305 306 307 308 309 310 311 312 313 314 315 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 303 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'], 'line_type_intelligence' => payload['line_type_intelligence'], 'line_status' => payload['line_status'], 'identity_match' => payload['identity_match'], 'reassigned_number' => payload['reassigned_number'], 'sms_pumping_risk' => payload['sms_pumping_risk'], 'phone_number_quality_score' => payload['phone_number_quality_score'], 'pre_fill' => payload['pre_fill'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'phone_number' => phone_number || @properties['phone_number'] , } end |
Instance Method Details
#call_forwarding ⇒ CallForwardingInfo
394 395 396 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 394 def call_forwarding @properties['call_forwarding'] end |
#caller_name ⇒ CallerNameInfo
382 383 384 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 382 def caller_name @properties['caller_name'] end |
#calling_country_code ⇒ String
Returns International dialing prefix of the phone number defined in the E.164 standard.
346 347 348 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 346 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
337 338 339 340 341 342 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 337 def context unless @instance_context @instance_context = PhoneNumberContext.new(@version , @params['phone_number']) end @instance_context end |
#country_code ⇒ String
Returns The phone number's ISO country code.
352 353 354 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 352 def country_code @properties['country_code'] end |
#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, verification_sid: :unset, partner_sub_id: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 464 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, verification_sid: :unset, partner_sub_id: :unset ) context.fetch( fields: fields, country_code: country_code, first_name: first_name, last_name: last_name, address_line1: address_line1, address_line2: address_line2, city: city, state: state, postal_code: postal_code, address_country_code: address_country_code, national_id: national_id, date_of_birth: date_of_birth, last_verified_date: last_verified_date, verification_sid: verification_sid, partner_sub_id: partner_sub_id, ) end |
#identity_match ⇒ IdentityMatchInfo
412 413 414 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 412 def identity_match @properties['identity_match'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
510 511 512 513 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 510 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V2.PhoneNumberInstance #{values}>" end |
#line_status ⇒ LineStatusInfo
406 407 408 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 406 def line_status @properties['line_status'] end |
#line_type_intelligence ⇒ LineTypeIntelligenceInfo
400 401 402 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 400 def line_type_intelligence @properties['line_type_intelligence'] end |
#national_format ⇒ String
Returns The phone number in national format.
364 365 366 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 364 def national_format @properties['national_format'] end |
#phone_number ⇒ String
Returns The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
358 359 360 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 358 def phone_number @properties['phone_number'] end |
#phone_number_quality_score ⇒ Hash
Returns An object that contains information of a mobile phone number quality score. Quality score will return a risk score about the phone number.
430 431 432 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 430 def phone_number_quality_score @properties['phone_number_quality_score'] end |
#pre_fill ⇒ Hash
Returns An object that contains pre fill information. pre_fill will return PII information associated with the phone number like first name, last name, address line, country code, state and postal code.
436 437 438 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 436 def pre_fill @properties['pre_fill'] end |
#reassigned_number ⇒ ReassignedNumberInfo
418 419 420 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 418 def reassigned_number @properties['reassigned_number'] end |
#sim_swap ⇒ SimSwapInfo
388 389 390 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 388 def sim_swap @properties['sim_swap'] end |
#sms_pumping_risk ⇒ SmsPumpingRiskInfo
424 425 426 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 424 def sms_pumping_risk @properties['sms_pumping_risk'] end |
#to_s ⇒ Object
Provide a user friendly representation
503 504 505 506 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 503 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.
442 443 444 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 442 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Boolean which indicates if the phone number is in a valid range that can be freely assigned by a carrier to a user.
370 371 372 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 370 def valid @properties['valid'] end |
#validation_errors ⇒ Array<ValidationError>
Returns Contains reasons why a phone number is invalid. Possible values: TOO_SHORT, TOO_LONG, INVALID_BUT_POSSIBLE, INVALID_COUNTRY_CODE, INVALID_LENGTH, NOT_A_NUMBER.
376 377 378 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 376 def validation_errors @properties['validation_errors'] end |