Class: CiscoWebex::Calling

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

Direct Known Subclasses

Calls, EndpointControl, Locations, Voicemail

Instance Method Summary collapse

Constructor Details

#initialize(token = nil) ⇒ Calling

initialize object with stored token



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/Calling/Calling.rb', line 7

def initialize(token=nil)
	if not token
		raise "Must provide API key"
	else
		@auth_token = token if token
		@my_profile =  me()  # test token and store users profile
		if ! @my_profile
			raise "CiscoWebex::Calling API Token not valid!"
		else
			# initiate all class methods
			@call_control = CallControl.new(@auth_token)
			@calls = Calls.new(@auth_token)
			@voicemail = Voicemail.new(@auth_token)
		end
	end
end

Instance Method Details

#call_controlObject



60
61
62
# File 'lib/Calling/Calling.rb', line 60

def call_control()
	return @call_control
end

#callsObject



52
53
54
# File 'lib/Calling/Calling.rb', line 52

def calls()
	return @calls
end

#get(uri, params = nil, limit = 50000) ⇒ Object

access to REST API



29
30
31
# File 'lib/Calling/Calling.rb', line 29

def get(uri, params=nil, limit=50000)
	return CiscoWebex::Rest.get(@auth_token, uri, params, limit)
end

#head(uri, params = nil) ⇒ Object

access to REST API



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

def head(uri, params=nil)
	return CiscoWebex::Rest.head(@auth_token, uri, params)
end

#meObject



48
49
50
# File 'lib/Calling/Calling.rb', line 48

def me()
	return CiscoWebex::Rest.get(@auth_token, "/v1/people/me")
end

#post(uri, params = nil) ⇒ Object

access to REST API



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

def post(uri, params=nil)
	return CiscoWebex::Rest.post(@auth_token, uri, params)
end

#put(uri, params = nil) ⇒ Object

access to REST API



44
45
46
# File 'lib/Calling/Calling.rb', line 44

def put(uri, params=nil)
	return CiscoWebex::Rest.put(@auth_token, uri, params)
end

#thisObject



24
25
26
# File 'lib/Calling/Calling.rb', line 24

def this()
	puts "CiscoWebex::Calling"
end

#voicemailObject



56
57
58
# File 'lib/Calling/Calling.rb', line 56

def voicemail()
	return @voicemail
end