Class: Telapi::AvailablePhoneNumber
- Defined in:
- lib/telapi/available_phone_number.rb
Overview
Wraps TelAPI Available Phone Number functionality
Class Method Summary collapse
-
.list(country_code, num_type, optional_params = {}) ⇒ Object
Returns a resource collection containing Telapi::AvailablePhoneNumber objects See www.telapi.com/docs/api/rest/available-phone-numbers/list/.
Methods inherited from Resource
Methods included from Network
api_uri, default_options, delete, get, post, response_format
Constructor Details
This class inherits a constructor from Telapi::Resource
Class Method Details
.list(country_code, num_type, optional_params = {}) ⇒ Object
Returns a resource collection containing Telapi::AvailablePhoneNumber objects See www.telapi.com/docs/api/rest/available-phone-numbers/list/
Required params:
country_code
-
country code (ISO), see en.wikipedia.org/wiki/ISO_3166-1_alpha-2
num_type
-
Local or TollFree
Optional params is a hash containing:
AreaCode
-
valid area code, e.g. 415
Contains
-
0-9, lower and upper case letters of the alphabet (Aa-Zz), or *
InRegion
-
valid region (state or province) abbreviation
InPostalCode
-
valid postal code
18 19 20 21 |
# File 'lib/telapi/available_phone_number.rb', line 18 def list(country_code, num_type, optional_params = {}) response = Network.get(['AvailablePhoneNumbers', country_code, num_type], optional_params) ResourceCollection.new(response, 'available_phone_numbers', self) end |