class Ari::Application

Attributes

bridge_ids[R]
channel_ids[R]
device_names[R]
endpoint_ids[R]
name[R]

Public Class Methods

get(options = {}) click to toggle source

GET /applications/%{applicationName}

Stasis application

Parameters:

applicationName (required) - Application’s name

# File lib/ari/resources/application.rb, line 38
def self.get(options = {})
  raise ArgumentError.new("Parameter applicationName must be passed in options hash.") unless options[:applicationName]
  path = '/applications/%{applicationName}' % options
  response = client(options).get(path, options)
  Application.new(response.merge(client: options[:client]))
end
list(options = {}) click to toggle source

GET /applications

Stasis applications

# File lib/ari/resources/application.rb, line 23
def self.list(options = {})
  path = '/applications'
  response = client(options).get(path, options)
  response.map { |hash| Application.new(hash.merge(client: options[:client])) }
end
subscribe(options = {}) click to toggle source

POST /applications/%{applicationName}/subscription

Stasis application

Parameters:

applicationName (required) - Application’s name eventSource (required) - URI for event source (channel:channelId}, bridge:{bridgeId}, endpoint:{tech, deviceState:{deviceName}

# File lib/ari/resources/application.rb, line 59
def self.subscribe(options = {})
  raise ArgumentError.new("Parameter applicationName must be passed in options hash.") unless options[:applicationName]
  raise ArgumentError.new("Parameter eventSource must be passed in options hash.") unless options[:eventSource]
  path = '/applications/%{applicationName}/subscription' % options
  response = client(options).post(path, options)
  Application.new(response.merge(client: options[:client]))
end
unsubscribe(options = {}) click to toggle source

DELETE /applications/%{applicationName}/subscription

Stasis application

Parameters:

applicationName (required) - Application’s name eventSource (required) - URI for event source (channel:channelId}, bridge:{bridgeId}, endpoint:{tech, deviceState:{deviceName}

# File lib/ari/resources/application.rb, line 81
def self.unsubscribe(options = {})
  raise ArgumentError.new("Parameter applicationName must be passed in options hash.") unless options[:applicationName]
  raise ArgumentError.new("Parameter eventSource must be passed in options hash.") unless options[:eventSource]
  path = '/applications/%{applicationName}/subscription' % options
  response = client(options).delete(path, options)
  Application.new(response.merge(client: options[:client]))
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

Public Instance Methods

get(options = {}) click to toggle source
# File lib/ari/resources/application.rb, line 45
def get(options = {})
  self.class.get(options.merge(applicationName: self.id, client: @client))
end
subscribe(options = {}) click to toggle source
# File lib/ari/resources/application.rb, line 67
def subscribe(options = {})
  self.class.subscribe(options.merge(applicationName: self.id, client: @client))
end
unsubscribe(options = {}) click to toggle source
# File lib/ari/resources/application.rb, line 91
def unsubscribe(options = {})
  self.class.unsubscribe(options.merge(applicationName: self.id, client: @client))
end