Class: CiscoWebex::EntryPointMappings

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

initialize object with stored token



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

Instance Method Details

#create(params) ⇒ Object



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

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

#delete(id) ⇒ Object



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

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

#get(id, limit = 5000) ⇒ Object



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

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

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



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

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

#patch(id, params) ⇒ Object



50
51
52
53
# File 'lib/CC/EntryPointMappings.rb', line 50

def patch(id, params)
	STDERR.puts "PATCH not Implemented."
	return False		
end

#save(params = {}) ⇒ Object



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

def save(params={})
	return CiscoWebex::RestCC.post(@auth_token, "/organization/#{@org_id}/dial-number/bulk", params) rescue false
end

#search(params = {}) ⇒ Object



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

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

#thisObject



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

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

#update(id, params) ⇒ Object



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

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