Class: CiscoWebex::Rooms

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

Direct Known Subclasses

Tabs

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) ⇒ Rooms

initialize object with stored token



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

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

Instance Method Details

#create(params) ⇒ Object



47
48
49
# File 'lib/Messaging/Rooms.rb', line 47

def create(params)
	return CiscoWebex::Rest.post(@auth_token, "/v1/rooms", params) rescue false
end

#delete(id) ⇒ Object



51
52
53
# File 'lib/Messaging/Rooms.rb', line 51

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

#get(id) ⇒ Object



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

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

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



38
39
40
# File 'lib/Messaging/Rooms.rb', line 38

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

#patch(id, params) ⇒ Object



59
60
61
62
# File 'lib/Messaging/Rooms.rb', line 59

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

#search(params = {}) ⇒ Object



42
43
44
45
# File 'lib/Messaging/Rooms.rb', line 42

def search(params={})
	params = { "type"=> params } if params.class = String
	return list(params)			
end

#tabsObject



30
31
32
# File 'lib/Messaging/Rooms.rb', line 30

def tabs()
	return @tabs
end

#templateObject



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

def template()
	return OpenStruct.new({
							  "title"=> "",
							  "teamId"=> "",
							  "classificationId"=> "",
							  "isLocked"=> false,
							  "isAnnouncementOnly"=> false
							})
end

#thisObject



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

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

#update(id, params) ⇒ Object



55
56
57
# File 'lib/Messaging/Rooms.rb', line 55

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