Class: Kaseya::VSA::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/kaseya/vsa/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Api

Returns a new instance of Api.



5
6
7
# File 'lib/kaseya/vsa/api.rb', line 5

def initialize(connection)
  @connection = connection
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



3
4
5
# File 'lib/kaseya/vsa/api.rb', line 3

def connection
  @connection
end

Instance Method Details

#delete(path) ⇒ Object



25
26
27
# File 'lib/kaseya/vsa/api.rb', line 25

def delete(path)
  connection.delete(path)
end

#get_many(path, params = {}) ⇒ Object



9
10
11
# File 'lib/kaseya/vsa/api.rb', line 9

def get_many(path, params = {})
  Kaseya::Collection.new connection.get(path, params)
end

#get_one(path, params = {}) ⇒ Object



13
14
15
# File 'lib/kaseya/vsa/api.rb', line 13

def get_one(path, params = {})
  Kaseya::Response.new connection.get(path, params)
end

#post(path, params = {}) ⇒ Object



17
18
19
# File 'lib/kaseya/vsa/api.rb', line 17

def post(path, params = {})
  Kaseya::Result.new connection.post(path, params)
end

#put(path, params = {}) ⇒ Object



21
22
23
# File 'lib/kaseya/vsa/api.rb', line 21

def put(path, params = {})
  Kaseya::Result.new connection.put(path, params)
end