Module: Driftrock::Service::Api::Administrative
- Includes:
- Driftrock::Service::Api
- Defined in:
- lib/driftrock-service/api/administrative.rb
Defined Under Namespace
Modules: URLs
Instance Method Summary collapse
- #activate_app(app_id) ⇒ Object
- #add_channel(channel_name, channel_data) ⇒ Object
- #add_company(company_data) ⇒ Object
- #add_profile_for_channel(channel_name, profile_id) ⇒ Object
- #add_twitter_details(username, password) ⇒ Object
- #auth_token(app_id, timestamp, company_id) ⇒ Object
- #channel_types ⇒ Object
- #driftrock_login(validation_data) ⇒ Object
- #get_app(app_id) ⇒ Object
- #get_channel(channel_name) ⇒ Object
- #get_companies ⇒ Object
- #get_company(company_id) ⇒ Object
- #get_user(user_session_id) ⇒ Object
- #list_apps ⇒ Object
- #new_account(user_data) ⇒ Object
- #new_company(company_data) ⇒ Object
- #new_token_for_channel(channel_name, token) ⇒ Object
- #user_admin?(user_session_id) ⇒ Boolean
Methods included from Driftrock::Service::Api
Instance Method Details
#activate_app(app_id) ⇒ Object
32 33 34 |
# File 'lib/driftrock-service/api/administrative.rb', line 32 def activate_app(app_id) post(URLs::APPS+"/#{app_id}/activate") end |
#add_channel(channel_name, channel_data) ⇒ Object
40 41 42 |
# File 'lib/driftrock-service/api/administrative.rb', line 40 def add_channel(channel_name, channel_data) post(URLs::CHANNELS+"/#{channel_name}", channel_data) end |
#add_company(company_data) ⇒ Object
64 65 66 |
# File 'lib/driftrock-service/api/administrative.rb', line 64 def add_company(company_data) post(URLs::USERS+"/company", company_data) end |
#add_profile_for_channel(channel_name, profile_id) ⇒ Object
48 49 50 |
# File 'lib/driftrock-service/api/administrative.rb', line 48 def add_profile_for_channel(channel_name, profile_id) post(URLs::CHANNELS+"/#{channel_name}/profile", {profile_id: profile_id}) end |
#add_twitter_details(username, password) ⇒ Object
22 23 24 |
# File 'lib/driftrock-service/api/administrative.rb', line 22 def add_twitter_details(username, password) post(URLs::CHANNELS+"/temp/connect_twitter", {username: username, password: password}) end |
#auth_token(app_id, timestamp, company_id) ⇒ Object
26 27 28 29 30 |
# File 'lib/driftrock-service/api/administrative.rb', line 26 def auth_token(app_id, , company_id) response = post(URLs::APPS+"/#{app_id}/auth_token", {company_id: company_id, timestamp: }) response['token'] end |
#channel_types ⇒ Object
36 37 38 |
# File 'lib/driftrock-service/api/administrative.rb', line 36 def channel_types get(URLs::CHANNELS+"/types") end |
#driftrock_login(validation_data) ⇒ Object
56 57 58 |
# File 'lib/driftrock-service/api/administrative.rb', line 56 def driftrock_login(validation_data) post(URLs::USERS+"/login", validation_data) end |
#get_app(app_id) ⇒ Object
18 19 20 |
# File 'lib/driftrock-service/api/administrative.rb', line 18 def get_app(app_id) get(URLs::APPS+"/#{app_id}") end |
#get_channel(channel_name) ⇒ Object
44 45 46 |
# File 'lib/driftrock-service/api/administrative.rb', line 44 def get_channel(channel_name) get(URLs::CHANNELS+"/#{channel_name}") end |
#get_companies ⇒ Object
76 77 78 |
# File 'lib/driftrock-service/api/administrative.rb', line 76 def get_companies get(URLs::USERS+"/companies") end |
#get_company(company_id) ⇒ Object
72 73 74 |
# File 'lib/driftrock-service/api/administrative.rb', line 72 def get_company(company_id) get(URLs::USERS+"/company/#{company_id}") end |
#get_user(user_session_id) ⇒ Object
68 69 70 |
# File 'lib/driftrock-service/api/administrative.rb', line 68 def get_user(user_session_id) get(URLs::USERS+"/#{user_session_id}") end |
#list_apps ⇒ Object
14 15 16 |
# File 'lib/driftrock-service/api/administrative.rb', line 14 def list_apps get(URLs::APPS+"/") end |
#new_account(user_data) ⇒ Object
60 61 62 |
# File 'lib/driftrock-service/api/administrative.rb', line 60 def new_account(user_data) post(URLs::USERS+"/new", user_data) end |
#new_company(company_data) ⇒ Object
85 86 87 |
# File 'lib/driftrock-service/api/administrative.rb', line 85 def new_company(company_data) post(URLs::COMPANIES+"/new", company_data) end |