Class: BandwidthIris::Applications

Inherits:
Object
  • Object
show all
Extended by:
ClientWrapper
Includes:
ApiItem
Defined in:
lib/bandwidth-iris/applications.rb

Class Method Summary collapse

Methods included from ClientWrapper

wrap_client_arg

Methods included from ApiItem

#[], #[]=, #initialize, #to_data

Class Method Details

.complete_update_application(client, application_id, application_data) ⇒ Object



38
39
40
41
# File 'lib/bandwidth-iris/applications.rb', line 38

def self.complete_update_application(client, application_id, application_data)
  data = client.make_request(:put, client.("#{APPLICATIONS_PATH}/#{application_id}"), {:application => application_data})
  return data[0][:application]
end

.create_application(client, application_data) ⇒ Object



20
21
22
23
# File 'lib/bandwidth-iris/applications.rb', line 20

def self.create_application(client, application_data)
  data = client.make_request(:post, client.(APPLICATIONS_PATH), {:application => application_data})
  return data[0][:application]
end

.delete_application(client, application_id) ⇒ Object



44
45
46
# File 'lib/bandwidth-iris/applications.rb', line 44

def self.delete_application(client, application_id)
  client.make_request(:delete, client.("#{APPLICATIONS_PATH}/#{application_id}"))
end

.get_application(client, application_id) ⇒ Object



26
27
28
29
# File 'lib/bandwidth-iris/applications.rb', line 26

def self.get_application(client, application_id)
  data = client.make_request(:get, client.("#{APPLICATIONS_PATH}/#{application_id}"))
  return data[0][:application]
end

.get_application_sippeers(client, application_id) ⇒ Object



49
50
51
52
53
54
55
56
57
58
# File 'lib/bandwidth-iris/applications.rb', line 49

def self.get_application_sippeers(client, application_id)
  data = client.make_request(:get, client.("#{APPLICATIONS_PATH}/#{application_id}/associatedsippeers"))
  list = data[0][:associated_sip_peers][:associated_sip_peer]
  return [] if !list
  if list.is_a?(Array) then
    return list
  else
    return [list]
  end
end

.get_applications(client) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/bandwidth-iris/applications.rb', line 8

def self.get_applications(client)
  data = client.make_request(:get, client.(APPLICATIONS_PATH))
  list = data[0][:application_list][:application]
  return [] if !list
  if list.is_a?(Array) then
    return list
  else
    return [list]
  end
end

.partial_update_application(client, application_id, application_data) ⇒ Object



32
33
34
35
# File 'lib/bandwidth-iris/applications.rb', line 32

def self.partial_update_application(client, application_id, application_data)
  data = client.make_request(:patch, client.("#{APPLICATIONS_PATH}/#{application_id}"), {:application => application_data})
  return data[0][:application]
end