Class: Phaxio::Resources::Ata
- Inherits:
-
Phaxio::Resource
- Object
- Phaxio::Resource
- Phaxio::Resources::Ata
- Defined in:
- lib/phaxio/resources/ata.rb
Overview
Provides functionality for managing ATAs.
Defined Under Namespace
Classes: ProvisioningURLs, Reference
Instance Attribute Summary collapse
-
#description ⇒ String
The description of the ATA.
-
#domain ⇒ String
The domain for the ATA.
-
#expiry_time ⇒ Time
The time at which the ATA’s registration expires.
-
#group ⇒ String
The name of the group which the ATA belongs to.
-
#id ⇒ Integer
The ID of the ATA.
-
#last_registered ⇒ Time
The time at which the ATA was last registered.
-
#mac_address ⇒ String
The mac address for the ATA.
-
#name ⇒ String
The name of the ATA.
-
#password ⇒ String
The password for the ATA.
-
#sip_uri ⇒ String
The SIP URI for the ATA.
-
#user_agent ⇒ String
The user agent for the ATA.
-
#user_phone_number ⇒ String
The user phone number associated with the ATA.
-
#username ⇒ String
The username for the ATA.
Class Method Summary collapse
-
.add_phone_number(id, phone_number, params = {}) ⇒ Phaxio::Resources::PhoneNumber::Reference
Add a phone number.
-
.create(params = {}) ⇒ Phaxio::Resources::Ata
Create an ATA.
-
.delete(id, params = {}) ⇒ Phaxio::Resources::Ata::Reference
Delete an ATA.
-
.get(id, params = {}) ⇒ Phaxio::Resources::Ata
(also: retrieve, find)
Get an ATA.
-
.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::Ata>
List ATAs.
-
.provisioning_urls(params = {}) ⇒ Phaxio::Resources::Ata::ProvisioningURLs
Get ATA provisioning URLs for your Phaxio account.
-
.regenerate_credentials(id, params = {}) ⇒ Phaxio::Resources::Ata
Regenerate credentials for an ATA.
-
.remove_phone_number(id, phone_number, params = {}) ⇒ Phaxio::Resources::PhoneNumber::Reference
Remove a phone number.
-
.update(id, params = {}) ⇒ Phaxio::Resources::Ata
Update an ATA.
Methods inherited from Phaxio::Resource
response_collection, response_record
Instance Attribute Details
#description ⇒ String
Returns the description of the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 14
|
#domain ⇒ String
Returns The domain for the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 20
|
#expiry_time ⇒ Time
Returns The time at which the ATA’s registration expires.
52 53 54 |
# File 'lib/phaxio/resources/ata.rb', line 52 has_time_attributes %w[ last_registered expiry_time ] |
#group ⇒ String
Returns The name of the group which the ATA belongs to.
|
# File 'lib/phaxio/resources/ata.rb', line 32
|
#id ⇒ Integer
Returns the ID of the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 8
|
#last_registered ⇒ Time
Returns The time at which the ATA was last registered.
|
# File 'lib/phaxio/resources/ata.rb', line 46
|
#mac_address ⇒ String
Returns The mac address for the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 29
|
#name ⇒ String
Returns the name of the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 11
|
#password ⇒ String
Returns The password for the ATA.
41 42 43 44 |
# File 'lib/phaxio/resources/ata.rb', line 41 has_normal_attributes %w[ id name description user_phone_number domain user_agent sip_uri mac_address group username password ] |
#sip_uri ⇒ String
Returns The SIP URI for the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 26
|
#user_agent ⇒ String
Returns The user agent for the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 23
|
#user_phone_number ⇒ String
Returns The user phone number associated with the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 17
|
#username ⇒ String
Returns The username for the ATA.
|
# File 'lib/phaxio/resources/ata.rb', line 35
|
Class Method Details
.add_phone_number(id, phone_number, params = {}) ⇒ Phaxio::Resources::PhoneNumber::Reference
Add a phone number
216 217 218 219 |
# File 'lib/phaxio/resources/ata.rb', line 216 def add_phone_number id, phone_number, params = {} response = Client.request :post, phone_number_endpoint(id, phone_number), params response_phone_number_reference response end |
.create(params = {}) ⇒ Phaxio::Resources::Ata
Create an ATA
137 138 139 140 |
# File 'lib/phaxio/resources/ata.rb', line 137 def create params = {} response = Client.request :post, atas_endpoint, params response_record response end |
.delete(id, params = {}) ⇒ Phaxio::Resources::Ata::Reference
Delete an ATA
200 201 202 203 |
# File 'lib/phaxio/resources/ata.rb', line 200 def delete id, params = {} response = Client.request :delete, ata_endpoint(id.to_i), params response_reference response end |
.get(id, params = {}) ⇒ Phaxio::Resources::Ata Also known as: retrieve, find
Get an ATA
153 154 155 156 |
# File 'lib/phaxio/resources/ata.rb', line 153 def get id, params = {} response = Client.request :get, ata_endpoint(id.to_i), params response_record response end |
.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::Ata>
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.
List ATAs
121 122 123 124 |
# File 'lib/phaxio/resources/ata.rb', line 121 def list params = {} response = Client.request :get, atas_endpoint, params response_collection response end |
.provisioning_urls(params = {}) ⇒ Phaxio::Resources::Ata::ProvisioningURLs
Get ATA provisioning URLs for your Phaxio account.
244 245 246 247 |
# File 'lib/phaxio/resources/ata.rb', line 244 def provisioning_urls params = {} response = Client.request :get, provisioning_urls_endpoint, params response_provisioning_urls response end |
.regenerate_credentials(id, params = {}) ⇒ Phaxio::Resources::Ata
Regenerate credentials for an ATA
186 187 188 189 |
# File 'lib/phaxio/resources/ata.rb', line 186 def regenerate_credentials id, params = {} response = Client.request :patch, regenerate_credentials_endpoint(id.to_i), params response_record response end |
.remove_phone_number(id, phone_number, params = {}) ⇒ Phaxio::Resources::PhoneNumber::Reference
Remove a phone number
232 233 234 235 |
# File 'lib/phaxio/resources/ata.rb', line 232 def remove_phone_number id, phone_number, params = {} response = Client.request :delete, phone_number_endpoint(id, phone_number), params response_phone_number_reference response end |
.update(id, params = {}) ⇒ Phaxio::Resources::Ata
Update an ATA
172 173 174 175 |
# File 'lib/phaxio/resources/ata.rb', line 172 def update id, params = {} response = Client.request :patch, ata_endpoint(id.to_i), params response_record response end |