Module: Caplinked::REST::Workspaces

Included in:
API
Defined in:
lib/caplinked/rest/workspaces.rb

Instance Method Summary collapse

Instance Method Details

#create_workspace(options = {}) ⇒ Object



10
11
12
13
# File 'lib/caplinked/rest/workspaces.rb', line 10

def create_workspace(options = {})
  body = options.stringify_keys.slice('team_id', 'workspace')
  perform_post('/api/v1/workspaces', {}, body.to_json, {'Content-Type' => 'application/json'} )
end

#get_workspace_info(options = {}) ⇒ Object



15
16
17
18
19
# File 'lib/caplinked/rest/workspaces.rb', line 15

def get_workspace_info(options = {})
  params = options.stringify_keys.slice('id')
  id = params.delete('id')
  perform_get('/api/v1/workspaces/' + id.to_s, nil)
end

#list_all_workspaces_for_a_team(options = {}) ⇒ Object



5
6
7
8
# File 'lib/caplinked/rest/workspaces.rb', line 5

def list_all_workspaces_for_a_team(options = {})
  params = options.stringify_keys.slice('team_id')
  perform_get('/api/v1/workspaces', params)
end

#update_workspace_info(options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/caplinked/rest/workspaces.rb', line 21

def update_workspace_info(options = {})
  body = options.stringify_keys.slice('id', 'workspace')
  id = body.delete('id')
  perform_put('/api/v1/workspaces/' + id.to_s, {}, body.to_json, { 'Content-Type' => 'application/json' } )
end