Class: Phaxio::Resources::Public::AreaCode

Inherits:
Phaxio::Resource show all
Defined in:
lib/phaxio/resources/public/area_code.rb

Overview

Information about area codes for provisioning numbers.

See Also:

  • Phaxio::Resources::PhoneNumber.list_available_area_codes

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Phaxio::Resource

response_collection, response_record

Instance Attribute Details

#area_codeInteger

Returns The actual area code.

Returns:

  • (Integer)

    The actual area code.



# File 'lib/phaxio/resources/public/area_code.rb', line 14

#cityString

Returns The city associated with this area code.

Returns:

  • (String)

    The city associated with this area code.



# File 'lib/phaxio/resources/public/area_code.rb', line 17

#countryString

Returns The country associated with this area code.

Returns:

  • (String)

    The country associated with this area code.



# File 'lib/phaxio/resources/public/area_code.rb', line 23

#country_codeInteger

Returns The country code associated with this area code.

Returns:

  • (Integer)

    The country code associated with this area code.



# File 'lib/phaxio/resources/public/area_code.rb', line 11

#stateString

Returns The state associated with this area code.

Returns:

  • (String)

    The state associated with this area code.



# File 'lib/phaxio/resources/public/area_code.rb', line 20

#toll_freetrue | false

Returns Indicates whether this area code is toll free.

Returns:

  • (true | false)

    Indicates whether this area code is toll free.



29
# File 'lib/phaxio/resources/public/area_code.rb', line 29

has_normal_attributes %w[country_code area_code city state country toll_free]

Class Method Details

.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::AreaCode>

Note:

This action accepts paging parameters:

  • per_page [Integer] - The maximum number of results to return per call (i.e. “page”). Max 1000.

  • page [Integer] - The page number to return for the request. 1-based.

Displays a list of area codes available for purchasing Phaxio numbers. This operation requires no authentication and can be used without passing an API key.

Parameters:

  • params (Hash) (defaults to: {})

    A hash of parameters to send to Phaxio.

    • toll_free [true|false] - If set to true, only toll free area codes will be returned. If specified and set to false, only non-toll free area codes will be returned.

    • country_code [Integer] - An E.164 country code you’d like to filter by.

    • country [String] - A two character country abbreviation (ISO 3166; e.g. “US” or “CA”) you’d like to filter by.

    • state [String] - A two character state or province abbreviation (ISO 3166; e.g. “IL” or “YT”) you’d like to filter by. When using this parameter, country_code or country must also be provided.

Returns:

Raises:

See Also:



50
51
52
53
# File 'lib/phaxio/resources/public/area_code.rb', line 50

def list params = {}
  response = Client.request :get, available_area_codes_endpoint, params
  AreaCode.response_collection response
end