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

Parameters:

  • id (Integer)

    of the invitation

Returns:

See Also:



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

Parameters:

  • email (String)

    to send invitation to

  • args (Hash)

    to pass to HTTParty @option [String] name @option [String] role_id

See Also:



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.

Returns:

  • (Hashie::Mash)


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

Returns:

  • (Array)

    array of Hashie::Mashes

See Also:



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.

Returns:

  • (Array)

    array of Hashie::Mashes



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.

Parameters:

  • id (Integer)

    to update

  • role (Integer)

    id to assign to invite

Returns:

  • (Hashie::Mash)

See Also:



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