Class: Phaxio::Resources::PhoneNumber
- Inherits:
-
Phaxio::Resource
- Object
- Phaxio::Resource
- Phaxio::Resources::PhoneNumber
- Defined in:
- lib/phaxio/resources/phone_number.rb
Overview
Provides functionality for viewing and managing phone numbers.
Defined Under Namespace
Classes: Reference
Instance Attribute Summary collapse
-
#callback_url ⇒ String
The callback URL associated with the phone number.
-
#city ⇒ String
The city associated with the phone number.
-
#cost ⇒ Integer
The cost of the phone number in cents.
-
#country ⇒ String
The country associated with the phone number.
-
#last_billed_at ⇒ Time
The last time the phone number was billed.
-
#phone_number ⇒ String
The phone number itself, in E.164 format.
-
#provisioned_at ⇒ Time
The time at which the phone number was provisioned.
-
#state ⇒ String
The state associated with the phone number.
Class Method Summary collapse
-
.create(params = {}) ⇒ Phaxio::Resources::PhoneNumber
(also: provision)
Provision a new phone number.
-
.delete(phone_number, params = {}) ⇒ Object
(also: release)
Release a phone number that you no longer need.
-
.get(phone_number, params = {}) ⇒ Phaxio::Resources::PhoneNumber
(also: find, retrieve)
Get information about a specific phone number.
-
.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::PhoneNumber>
Get a list of phone numbers that you currently own on Phaxio.
Methods inherited from Phaxio::Resource
response_collection, response_record
Instance Attribute Details
#callback_url ⇒ String
Returns The callback URL associated with the phone number.
26 |
# File 'lib/phaxio/resources/phone_number.rb', line 26 has_normal_attributes %w(phone_number city state country cost callback_url) |
#city ⇒ String
Returns The city associated with the phone number.
|
# File 'lib/phaxio/resources/phone_number.rb', line 11
|
#cost ⇒ Integer
Returns The cost of the phone number in cents.
|
# File 'lib/phaxio/resources/phone_number.rb', line 20
|
#country ⇒ String
Returns The country associated with the phone number.
|
# File 'lib/phaxio/resources/phone_number.rb', line 17
|
#last_billed_at ⇒ Time
Returns The last time the phone number was billed.
34 |
# File 'lib/phaxio/resources/phone_number.rb', line 34 has_time_attributes %w(provisioned_at last_billed_at) |
#phone_number ⇒ String
Returns The phone number itself, in E.164 format.
|
# File 'lib/phaxio/resources/phone_number.rb', line 8
|
#provisioned_at ⇒ Time
Returns The time at which the phone number was provisioned.
|
# File 'lib/phaxio/resources/phone_number.rb', line 28
|
#state ⇒ String
Returns The state associated with the phone number.
|
# File 'lib/phaxio/resources/phone_number.rb', line 14
|
Class Method Details
.create(params = {}) ⇒ Phaxio::Resources::PhoneNumber Also known as: provision
Provision a new phone number.
74 75 76 77 |
# File 'lib/phaxio/resources/phone_number.rb', line 74 def create params = {} response = Client.request :post, phone_numbers_endpoint, params response_record response end |
.delete(phone_number, params = {}) ⇒ Object Also known as: release
Release a phone number that you no longer need. Once a phone number is released you will no longer be charged for it.
120 121 122 123 |
# File 'lib/phaxio/resources/phone_number.rb', line 120 def delete phone_number, params = {} Client.request :delete, phone_number_endpoint(phone_number), params true end |
.get(phone_number, params = {}) ⇒ Phaxio::Resources::PhoneNumber Also known as: find, retrieve
Get information about a specific phone number.
88 89 90 91 |
# File 'lib/phaxio/resources/phone_number.rb', line 88 def get phone_number, params = {} response = Client.request :get, phone_number_endpoint(phone_number.to_s), params response_record response end |
.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::PhoneNumber>
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.
Get a list of phone numbers that you currently own on Phaxio.
106 107 108 109 |
# File 'lib/phaxio/resources/phone_number.rb', line 106 def list params = {} response = Client.request :get, phone_numbers_endpoint, params response_collection response end |