Class: CiscoWebex::Sites

Inherits:
ContactCenter show all
Defined in:
lib/CC/Sites.rb

Instance Method Summary collapse

Methods inherited from ContactCenter

#address_books, #agent_profiles, #agents, #auxiliary_codes, #captures, #dial_plans, #entry_point_mappings, #entry_points, #head, #journey, #multimedia_profiles, #my_org, #outbound_ani, #post, #put, #queues, #sites, #skill_profiles, #skills, #subscriptions, #tasks, #teams, #user_profiles, #users

Constructor Details

#initialize(token = nil, org_id = nil) ⇒ Sites

initialize object with stored token



7
8
9
10
11
12
13
14
15
# File 'lib/CC/Sites.rb', line 7

def initialize(token=nil, org_id=nil)
	if token == nil || org_id == nil
		STDERR.puts "Must provide API key for CiscoWebex::ContactCenter::Site"
		return false
	else
		@auth_token = token if token
		@org_id =  org_id
	end
end

Instance Method Details

#create(params) ⇒ Object



34
35
36
# File 'lib/CC/Sites.rb', line 34

def create(params)
	return CiscoWebex::RestCC.post(@auth_token, "/organization/#{@org_id}/site", params) rescue false
end

#delete(id) ⇒ Object



38
39
40
# File 'lib/CC/Sites.rb', line 38

def delete(id)
	return CiscoWebex::RestCC.delete(@auth_token, "/organization/#{@org_id}/site/#{id}") rescue false
end

#get(id, limit = 5000) ⇒ Object



21
22
23
# File 'lib/CC/Sites.rb', line 21

def get(id, limit=5000)
	return CiscoWebex::RestCC.get(@auth_token, "/organization/#{@org_id}/site/#{id}", {}, limit)['data'] rescue false
end

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



25
26
27
# File 'lib/CC/Sites.rb', line 25

def list(params={}, limit=5000)
	return CiscoWebex::RestCC.get(@auth_token, "/organization/#{@org_id}/site", {}, limit)['data'] rescue false
end

#patch(id, params) ⇒ Object



46
47
48
# File 'lib/CC/Sites.rb', line 46

def patch(id, params)
	return CiscoWebex::RestCC.patch(@auth_token, "/organization/#{@org_id}/site/#{id}", params) rescue false
end

#search(params = {}) ⇒ Object



29
30
31
32
# File 'lib/CC/Sites.rb', line 29

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

#thisObject



17
18
19
# File 'lib/CC/Sites.rb', line 17

def this()
	puts "CiscoWebex::ContactCenter::Site - Org:#{@org_id}"
end

#update(id, params) ⇒ Object



42
43
44
# File 'lib/CC/Sites.rb', line 42

def update(id, params)
	return CiscoWebex::RestCC.put(@auth_token, "/organization/#{@org_id}/site/#{id}", params) rescue false
end