Class: CiscoWebex::Webhooks

Inherits:
Messaging show all
Defined in:
lib/Messaging/Webhooks.rb

Instance Method Summary collapse

Methods inherited from Messaging

#audit_events, #classifications, #head, #me, #memberships, #messages, #people, #post, #put, #rooms, #teams, #webhooks

Constructor Details

#initialize(token = nil) ⇒ Webhooks

initialize object with stored token



6
7
8
9
10
11
12
13
14
# File 'lib/Messaging/Webhooks.rb', line 6

def initialize(token=nil)
	if token == nil
		STDERR.puts "Must provide API key for CiscoWebex::Messaging::Webhooks"
		return false
	else
		@auth_token = token if token
		@memberships = Memberships.new(@auth_token)
	end
end

Instance Method Details

#create(params) ⇒ Object



45
46
47
# File 'lib/Messaging/Webhooks.rb', line 45

def create(params)
	return CiscoWebex::Rest.post(@auth_token, "/v1/webhooks/#{id}", {}, limit) rescue false
end

#delete(id) ⇒ Object



49
50
51
# File 'lib/Messaging/Webhooks.rb', line 49

def delete(id)
	return CiscoWebex::Rest.delete(@auth_token, "/v1/webhooks/#{id}", {}, limit) rescue false
end

#get(id) ⇒ Object



32
33
34
# File 'lib/Messaging/Webhooks.rb', line 32

def get(id)
	return CiscoWebex::Rest.get(@auth_token, "/v1/webhooks/#{id}", {}, limit) rescue false
end

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



36
37
38
# File 'lib/Messaging/Webhooks.rb', line 36

def list(params={}, limit=5000)
	return CiscoWebex::Rest.get(@auth_token, "/v1/webhooks", {}, limit) rescue false
end

#patch(id, params) ⇒ Object



57
58
59
60
# File 'lib/Messaging/Webhooks.rb', line 57

def patch(id, params)
	STDERR.puts "CiscoWebex::Messaging::Webhooks.patch() - Metod not implemented"
	return false
end

#search(params = {}) ⇒ Object



40
41
42
43
# File 'lib/Messaging/Webhooks.rb', line 40

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

#templateObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/Messaging/Webhooks.rb', line 20

def template()
	return {
			  "name"=> "",
			  "targetUrl"=> "",
			  "resource"=> "",
			  "event"=> "",
			  "filter"=> "",
			  "secret"=> "",
			  "ownedBy"=> ""
			}
end

#thisObject



16
17
18
# File 'lib/Messaging/Webhooks.rb', line 16

def this()
	puts "CiscoWebex::Messaging::Webhooks"
end

#update(id, params) ⇒ Object



53
54
55
# File 'lib/Messaging/Webhooks.rb', line 53

def update(id, params)
	return CiscoWebex::Rest.put(@auth_token, "/v1/webhooks/#{id}", {}, limit) rescue false
end