Class: CiscoWebex::Tasks

Inherits:
ContactCenter show all
Defined in:
lib/CC/Tasks.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) ⇒ Tasks

initialize object with stored token



7
8
9
10
11
12
13
14
15
# File 'lib/CC/Tasks.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::Task"
		return false
	else
		@auth_token = token if token
		@org_id =  org_id
	end
end

Instance Method Details

#get(id = nil) ⇒ Object



31
32
33
34
# File 'lib/CC/Tasks.rb', line 31

def get(id=nil)
	params = { "id"=> id } if id
	return CiscoWebex::Toolbox.search(search(), params)
end

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



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

def list(params={}, limit=5000)
	params['from'] = CiscoWebex::Toolbox:WebexTime.shift("now", -86400, "CC") if ! params.has_key?('from')
	return CiscoWebex::RestCC.get(@auth_token, "/v1/tasks", {}, limit)['data'] rescue false
end

#search(params = {}) ⇒ Object



26
27
28
29
# File 'lib/CC/Tasks.rb', line 26

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

#thisObject



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

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