Class: CiscoWebex::UserProfiles

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

initialize object with stored token



7
8
9
10
11
12
13
14
15
16
# File 'lib/CC/UserProfiles.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::User"
		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



39
40
41
# File 'lib/CC/UserProfiles.rb', line 39

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

#delete(id) ⇒ Object



43
44
45
# File 'lib/CC/UserProfiles.rb', line 43

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

#get(id, limit = 5000) ⇒ Object



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

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

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



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

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

#patch(id, params) ⇒ Object



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

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

#save(params = {}) ⇒ Object



35
36
37
# File 'lib/CC/UserProfiles.rb', line 35

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

#search(params = {}) ⇒ Object



30
31
32
33
# File 'lib/CC/UserProfiles.rb', line 30

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

#thisObject



18
19
20
# File 'lib/CC/UserProfiles.rb', line 18

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

#update(id, params) ⇒ Object



47
48
49
# File 'lib/CC/UserProfiles.rb', line 47

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