Module: Cloudability::Client::Organizations

Included in:
Cloudability::Client
Defined in:
lib/cloudability/client/organizations.rb

Instance Method Summary collapse

Instance Method Details

#delete_invite(id) ⇒ Object Also known as: delete_invitation

Delete an invitation to the authenticated user’s organization



54
55
56
57
# File 'lib/cloudability/client/organizations.rb', line 54

def delete_invite(id)
  request = delete "/1/organizations/invitations/#{id}"
  Hashie::Mash.new request
end

#invite_user(email, options = {}) ⇒ Object Also known as: invite

Create a new invitation to the authenticated user’s organization



41
42
43
44
45
46
# File 'lib/cloudability/client/organizations.rb', line 41

def invite_user(email, options={})
  options[:email] = email

  request = post '/1/organizations/invitations', options
  Hashie::Mash.new request
end

#my_organizationHashie::Mash Also known as: organization

Get information about the authenticted user’s organization NOTE: This requires that you are the organization admin.



9
10
11
12
# File 'lib/cloudability/client/organizations.rb', line 9

def my_organization
  request = get '/1/organizations'
  Hashie::Mash.new request
end

#organization_invitationsArray Also known as: invitations

List all invitations to the authenticated user’s organization



19
20
21
22
# File 'lib/cloudability/client/organizations.rb', line 19

def organization_invitations
  request = get '/1/organizations/invitations'
  convert_to_mashes request
end

#organization_rolesArray Also known as: roles

Retrieve your organizations roles.



28
29
30
31
# File 'lib/cloudability/client/organizations.rb', line 28

def organization_roles
  request = get '/1/organizations/roles'
  convert_to_mashes request
end

#update_invite(id, role_id) ⇒ Hashie::Mash Also known as: update_invitation

Update a user’s invitation to an organization.



66
67
68
69
70
71
72
# File 'lib/cloudability/client/organizations.rb', line 66

def update_invite(id, role_id)
  options = {}
  options[:role_id] = role_id

  request = put "/1/organizations/invitations/#{id}", options
  Hashie::Mash.new request
end