All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twilio.sdk.LookupsClient Maven / Gradle / Ivy

There is a newer version: 7.0.0-rc-10
Show newest version
package com.twilio.sdk;

import com.twilio.sdk.resource.instance.lookups.PhoneNumber;

import java.util.HashMap;
import java.util.Map;

public class LookupsClient extends TwilioClient {

	public static final String DEFAULT_VERSION = "v1";

	public LookupsClient(final String accountSid, final String authToken) {
		super(accountSid, authToken, "https://lookups.twilio.com");
	}

	public LookupsClient(final String accountSid, final String authToken, final String endpoint) {
		super(accountSid, authToken, endpoint);
	}

	public PhoneNumber getPhoneNumber(final String number) {
		return getPhoneNumber(number, null, false);
	}

	public PhoneNumber getPhoneNumber(final String number, final Boolean includeCarrierInfo) {
		return getPhoneNumber(number, null, includeCarrierInfo);
	}

	public PhoneNumber getPhoneNumber(final String number, final String countryCode, final Boolean includeCarrierInfo) {
		Map params = new HashMap();
		if (includeCarrierInfo) {
			params.put("Type", "carrier");
		}

		if (countryCode != null) {
			params.put("CountryCode", countryCode);
		}

		return new PhoneNumber(this, number, params);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy