Class: Phaxio::Resources::Ata

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

Overview

Provides functionality for managing ATAs.

Defined Under Namespace

Classes: ProvisioningURLs, Reference

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Phaxio::Resource

response_collection, response_record

Instance Attribute Details

#descriptionString



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


#domainString



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


#expiry_timeTime



52
53
54
# File 'lib/phaxio/resources/ata.rb', line 52

has_time_attributes %w[
  last_registered expiry_time
]

#groupString



# File 'lib/phaxio/resources/ata.rb', line 32


#idInteger



# File 'lib/phaxio/resources/ata.rb', line 8


#last_registeredTime



# File 'lib/phaxio/resources/ata.rb', line 46


#mac_addressString



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


#nameString



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


#passwordString



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_uriString



# File 'lib/phaxio/resources/ata.rb', line 26


#user_agentString



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


#user_phone_numberString



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


#usernameString



# 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>

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.

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

Raises:

  • Phaxio::Error::PhaxioError

See Also:



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