Class: CiscoWebex::Licenses

Inherits:
Admin
  • Object
show all
Defined in:
lib/Admin/Licenses.rb

Constant Summary

Constants inherited from Admin

Admin::BASE_URL

Instance Method Summary collapse

Methods inherited from Admin

#audit_events, #authorizations, #head, #licenses, #me, #organizations, #people, #post, #put, #resource_groups, #roles

Constructor Details

#initialize(token = nil) ⇒ Licenses

initialize object with stored token



6
7
8
9
10
11
12
13
# File 'lib/Admin/Licenses.rb', line 6

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

Instance Method Details

#create(params) ⇒ Object



32
33
34
# File 'lib/Admin/Licenses.rb', line 32

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

#delete(id) ⇒ Object



36
37
38
# File 'lib/Admin/Licenses.rb', line 36

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

#get(id) ⇒ Object



19
20
21
# File 'lib/Admin/Licenses.rb', line 19

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

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



23
24
25
# File 'lib/Admin/Licenses.rb', line 23

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

#patch(id, params) ⇒ Object



44
45
46
47
# File 'lib/Admin/Licenses.rb', line 44

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

#search(params = {}) ⇒ Object



27
28
29
30
# File 'lib/Admin/Licenses.rb', line 27

def search(params={})
	params = { "name"=> params } if params.class == String
	return CiscoWebex::Toolbox.search(list(), params)				
end

#thisObject



15
16
17
# File 'lib/Admin/Licenses.rb', line 15

def this()
	puts "CiscoWebex::Teams::Licenses"
end

#update(id, params) ⇒ Object



40
41
42
# File 'lib/Admin/Licenses.rb', line 40

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