Class: CiscoWebex::Workspaces

Inherits:
Devices
  • Object
show all
Defined in:
lib/Devices/Workspaces.rb

Instance Method Summary collapse

Methods inherited from Devices

#configurations, #devices, #head, #me, #post, #put, #workspaces, #xapi

Constructor Details

#initialize(token = nil) ⇒ Workspaces

initialize object with stored token



7
8
9
10
11
12
13
14
# File 'lib/Devices/Workspaces.rb', line 7

def initialize(token=nil)
	if token == nil
		STDERR.puts "Must provide API key for CiscoWebex::Devices::Workspaces"
		return false
	else
		@auth_token = token if token
	end
end

Instance Method Details

#create(params) ⇒ Object



33
34
35
# File 'lib/Devices/Workspaces.rb', line 33

def create(params)
	return CiscoWebex::Rest.post(@auth_token, "/v1/workspaces", params) rescue false
end

#delete(id) ⇒ Object



37
38
39
# File 'lib/Devices/Workspaces.rb', line 37

def delete(id)
	return CiscoWebex::Rest.delete(@auth_token, "/v1/workspaces/#{id}") rescue false
end

#get(id) ⇒ Object



20
21
22
# File 'lib/Devices/Workspaces.rb', line 20

def get(id)
	return CiscoWebex::Rest.get(@auth_token, "/v1/workspaces/#{id}", {}, limit) rescue false
end

#list(params = {}, limit = 5000) ⇒ Object



24
25
26
# File 'lib/Devices/Workspaces.rb', line 24

def list(params={}, limit=5000)
	return CiscoWebex::Rest.get(@auth_token, "/v1/workspaces", params, limit) rescue false
end

#patch(id, params) ⇒ Object



45
46
47
48
# File 'lib/Devices/Workspaces.rb', line 45

def patch(id, params)
	STDERR.puts "CiscoWebex::Devices::Workspaces.patch() - Metod not implemented"
	return False
end

#search(params = {}) ⇒ Object



28
29
30
31
# File 'lib/Devices/Workspaces.rb', line 28

def search(params={})
	params = { "displayName"=> params } if params.class == String
	return CiscoWebex::Rest.get(@auth_token, "/v1/workspaces", params, limit) rescue false
end

#thisObject



16
17
18
# File 'lib/Devices/Workspaces.rb', line 16

def this()
	puts "CiscoWebex::Devices::Workspaces"
end

#update(id, params) ⇒ Object



41
42
43
# File 'lib/Devices/Workspaces.rb', line 41

def update(id, params)
	return CiscoWebex::Rest.put(@auth_token, "/v1/workspaces/#{id}", params) rescue false
end