Module: Caplinked::REST::Organizations

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

Instance Method Summary collapse

Instance Method Details

#add_organization_member(options = {}) ⇒ Object



19
20
21
22
# File 'lib/caplinked/rest/organizations.rb', line 19

def add_organization_member(options = {})
  body = options.stringify_keys.slice('user_id')
  perform_post('/api/v1/organization/memberships', {}, body.to_json, { 'Content-Type' => 'application/json' } )
end

#get_organization_info(options = {}) ⇒ Object



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

def get_organization_info(options = {})
  perform_get('/api/v1/organization')
end

#remove_organization_member(options = {}) ⇒ Object



24
25
26
27
# File 'lib/caplinked/rest/organizations.rb', line 24

def remove_organization_member(options = {})
  body = options.stringify_keys.slice('user_id')
  perform_delete('/api/v1/organization/memberships', {}, body.to_json, { 'Content-Type' => 'application/json' })
end

#show_organization_members(options = {}) ⇒ Object



29
30
31
# File 'lib/caplinked/rest/organizations.rb', line 29

def show_organization_members(options = {})
  perform_get('/api/v1/organization/memberships', nil )
end

#update_organization_info(options = {}) ⇒ Object



9
10
11
12
# File 'lib/caplinked/rest/organizations.rb', line 9

def update_organization_info(options = {})
  body = options.stringify_keys.slice('name', 'description', 'location', 'billing_email', 'url')
  perform_put('/api/v1/organization', {}, body.to_json, { 'Content-Type' => 'application/json' } )
end

#update_organization_support_info(options = {}) ⇒ Object



14
15
16
17
# File 'lib/caplinked/rest/organizations.rb', line 14

def update_organization_support_info(options = {})
  body = options.stringify_keys.slice('phone_number', 'email', 'website')
  perform_put('/api/v1/organization/support_information', {}, body.to_json, { 'Content-Type' => 'application/json' } )
end