Class: CiscoWebex::Admin
- Inherits:
-
Object
- Object
- CiscoWebex::Admin
- Defined in:
- lib/Admin/Admin.rb
Direct Known Subclasses
AuditEvents, Authorizations, Licenses, Organizations, People, ResourceGroups, Roles
Constant Summary collapse
- BASE_URL =
template = WebexTeamsTemplates()
"https://webexapis.com"
Instance Method Summary collapse
- #audit_events ⇒ Object
- #authorizations ⇒ Object
-
#get(uri, params = nil, limit = 50) ⇒ Object
access to REST API.
-
#head(uri, params = nil) ⇒ Object
access to REST API.
-
#initialize(token = nil) ⇒ Admin
constructor
initialize object with stored token.
- #licenses ⇒ Object
-
#me ⇒ Object
shortcut for getting the profile associated with the token.
- #organizations ⇒ Object
-
#people ⇒ Object
start sub classes.
-
#post(uri, params = nil) ⇒ Object
access to REST API.
-
#put(uri, params = nil) ⇒ Object
access to REST API.
- #resource_groups ⇒ Object
- #roles ⇒ Object
Constructor Details
#initialize(token = nil) ⇒ Admin
initialize object with stored token
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/Admin/Admin.rb', line 9 def initialize(token=nil) if not token raise "Must provide API key" else @auth_token = token if token @my_profile = me() rescue nil# test token and store users profile if @my_profile == nil raise "CiscoWebex::Admin - Bearer token not valid" else @people = People.new(@auth_token) @licenses = Licenses.new(@auth_token) @organizations = Organizations.new(@auth_token) @resource_groups = ResourceGroups.new(@auth_token) @roles = Roles.new(@auth_token) @audit_events = AuditEvents.new(@auth_token) @authorizations = Authorizations.new(@auth_token, @my_profile['orgId']) end end end |
Instance Method Details
#audit_events ⇒ Object
60 61 62 |
# File 'lib/Admin/Admin.rb', line 60 def audit_events() return @audit_events end |
#authorizations ⇒ Object
80 81 82 |
# File 'lib/Admin/Admin.rb', line 80 def () return @authorizations end |
#get(uri, params = nil, limit = 50) ⇒ Object
access to REST API
30 31 32 |
# File 'lib/Admin/Admin.rb', line 30 def get(uri, params=nil, limit=50) return CiscoWebex::Rest.get(@auth_token, uri, params, limit) end |
#head(uri, params = nil) ⇒ Object
access to REST API
35 36 37 |
# File 'lib/Admin/Admin.rb', line 35 def head(uri, params=nil) return CiscoWebex::Rest.head(@auth_token, uri, params) end |
#licenses ⇒ Object
64 65 66 |
# File 'lib/Admin/Admin.rb', line 64 def licenses() return @licenses end |
#me ⇒ Object
shortcut for getting the profile associated with the token
50 51 52 53 |
# File 'lib/Admin/Admin.rb', line 50 def me() return CiscoWebex::Rest.get(@auth_token, "/v1/people/me") end |
#organizations ⇒ Object
68 69 70 |
# File 'lib/Admin/Admin.rb', line 68 def organizations() return @organizations end |
#people ⇒ Object
start sub classes
56 57 58 |
# File 'lib/Admin/Admin.rb', line 56 def people() return @people end |
#post(uri, params = nil) ⇒ Object
access to REST API
40 41 42 |
# File 'lib/Admin/Admin.rb', line 40 def post(uri, params=nil) return CiscoWebex::Rest.post(@auth_token, uri, params) end |
#put(uri, params = nil) ⇒ Object
access to REST API
45 46 47 |
# File 'lib/Admin/Admin.rb', line 45 def put(uri, params=nil) return CiscoWebex::Rest.put(@auth_token, uri, params) end |
#resource_groups ⇒ Object
72 73 74 |
# File 'lib/Admin/Admin.rb', line 72 def resource_groups() return @resource_groups end |
#roles ⇒ Object
76 77 78 |
# File 'lib/Admin/Admin.rb', line 76 def roles() return @roles end |