com.twilio.sdk.resource.instance.lookups
Class PhoneNumber

java.lang.Object
  extended by com.twilio.sdk.resource.Resource<C>
      extended by com.twilio.sdk.resource.InstanceResource<C>
          extended by com.twilio.sdk.resource.NextGenInstanceResource<LookupsClient>
              extended by com.twilio.sdk.resource.instance.lookups.PhoneNumber

public class PhoneNumber
extends NextGenInstanceResource<LookupsClient>


Nested Class Summary
static class PhoneNumber.Type
           
 
Constructor Summary
PhoneNumber(LookupsClient client)
           
PhoneNumber(LookupsClient client, Map<String,Object> properties)
           
PhoneNumber(LookupsClient client, String number)
           
PhoneNumber(LookupsClient client, String number, Map<String,String> filters)
           
 
Method Summary
 String getCarrierName()
          Only available if carrier information was requested.
 String getCountryCode()
           
 Integer getErrorCode()
           
 String getFormattedNumber()
           
 String getMobileCountryCode()
          The country code for the mobile carrier, or null.
 String getMobileNetworkCode()
          The mobile carrier's network code, or null.
 String getPhoneNumber()
           
 String getResourceLocation()
          Gets the resource location.
 PhoneNumber.Type getType()
           
 String getUrl()
           
 
Methods inherited from class com.twilio.sdk.resource.InstanceResource
getObject, getProperty, update, update
 
Methods inherited from class com.twilio.sdk.resource.Resource
setRequestAccountSid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhoneNumber

public PhoneNumber(LookupsClient client)

PhoneNumber

public PhoneNumber(LookupsClient client,
                   Map<String,Object> properties)

PhoneNumber

public PhoneNumber(LookupsClient client,
                   String number)

PhoneNumber

public PhoneNumber(LookupsClient client,
                   String number,
                   Map<String,String> filters)
Method Detail

getPhoneNumber

public String getPhoneNumber()
Returns:
The phone number, in E.164 format (e.g. "+14158675309")

getCountryCode

public String getCountryCode()
Returns:
The ISO 3166-1 alpha-2 country code for this phone number's country.

getFormattedNumber

public String getFormattedNumber()
Returns:
The phone number in localized format, e.g. "(415) 867-5309"

getMobileCountryCode

public String getMobileCountryCode()
The country code for the mobile carrier, or null. Only available if carrier information was requested and the number is a mobile number.

Returns:
Mobile carrier country code

getMobileNetworkCode

public String getMobileNetworkCode()
The mobile carrier's network code, or null. Only populated if carrier information was requested and the number is a mobile number.

Returns:
Mobile carrier network code

getCarrierName

public String getCarrierName()
Only available if carrier information was requested.

Returns:
The carrier name

getType

public PhoneNumber.Type getType()
Returns:
Number type, or null if carrier information wasn't requested or lookup failed

getErrorCode

public Integer getErrorCode()
Returns:
Error code, if carrier lookup failed

getUrl

public String getUrl()
Returns:
This resource's URL

getResourceLocation

public String getResourceLocation()
Description copied from class: Resource
Gets the resource location.

Returns:
the resource location


Copyright © 2011 Twilio, Inc. All Rights Reserved.