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

Returns the description of the ATA.

Returns:

  • (String)

    the description of the ATA.



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

#domainString

Returns The domain for the ATA.

Returns:

  • (String)

    The domain for the ATA.



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

#expiry_timeTime

Returns The time at which the ATA’s registration expires.

Returns:

  • (Time)

    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
]

#groupString

Returns The name of the group which the ATA belongs to.

Returns:

  • (String)

    The name of the group which the ATA belongs to.



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

#idInteger

Returns the ID of the ATA.

Returns:

  • (Integer)

    the ID of the ATA.



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

#last_registeredTime

Returns The time at which the ATA was last registered.

Returns:

  • (Time)

    The time at which the ATA was last registered.



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

#mac_addressString

Returns The mac address for the ATA.

Returns:

  • (String)

    The mac address for the ATA.



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

#nameString

Returns the name of the ATA.

Returns:

  • (String)

    the name of the ATA.



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

#passwordString

Returns The password for the ATA.

Returns:

  • (String)

    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_uriString

Returns The SIP URI for the ATA.

Returns:

  • (String)

    The SIP URI for the ATA.



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

#user_agentString

Returns The user agent for the ATA.

Returns:

  • (String)

    The user agent for the ATA.



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

#user_phone_numberString

Returns The user phone number associated with the ATA.

Returns:

  • (String)

    The user phone number associated with the ATA.



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

#usernameString

Returns The username for the ATA.

Returns:

  • (String)

    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

Parameters:

  • id (Integer)

    The ID of the ATA to which you want to add a number.

  • phone_number (String)

    The phone number to add to the ATA.

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

    Any parameters to send to Phaxio. This action takes no unique parameters.

Returns:

Raises:

See Also:



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

Parameters:

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

    Any parameters to send to Phaxio.

    • name [String] - A name used to identify the ATA.

    • description [String] - A longer description of the ATA.

    • domain [String] - A domain for the ATA.

    • mac_address [String] - A mac address for the ATA.

Returns:

Raises:

See Also:



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

Parameters:

  • id (Integer)

    The ID of the ATA to delete.

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

    Any parameters to send to Phaxio. This action takes no unique parameters.

Returns:

Raises:

See Also:



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

Parameters:

  • id (Integer)

    The ID of the ATA to retrieve information about.

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

    Any parameters to send to Phaxio.

    • with_credentials [Boolean] - If enabled, the username and password for the ATA will be included in the response.

Returns:

Raises:

See Also:



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

Parameters:

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

    Any parameters to send to Phaxio.

Returns:

Raises:

See Also:



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.

Parameters:

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

    Any parameters to send to Phaxio.

    • group [String] - If given, this action instead returns provisioning URLs for the named group.

Returns:

See Also:



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

Parameters:

  • id (Integer)

    The ID of the ATA for which credentials should be regenerated.

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

    Any parameters to send to Phaxio. This action takes no unique parameters.

Returns:

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

Parameters:

  • id (Integer)

    The ID of the ATA from which you want to remove the phone number.

  • phone_number (String)

    The phone number you want to remove.

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

    Any parameters to send to Phaxio. This action takes no unique parameters.

Returns:

Raises:

See Also:



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

Parameters:

  • id (Integer)

    The ID of the ATA to update.

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

    Any parameters to send to Phaxio.

    • name [String] - A name used to identify the ATA.

    • description [String] - A longer description of the ATA.

    • mac_address [String] - A mac address for the ATA.

Returns:

Raises:

See Also:



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