Class: Fog::Brightbox::Compute::Collaborations

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/brightbox/models/compute/collaborations.rb

Instance Method Summary collapse

Instance Method Details

#allObject



9
10
11
12
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 9

def all
  data = service.list_collaborations
  load(data)
end

#destroyObject



38
39
40
41
42
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 38

def destroy
  requires :identity
  service.delete_collaboration(identity)
  true
end

#get(identifier) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 14

def get(identifier)
  return nil if identifier.nil? || identifier == ""
  data = service.get_collaboration(identifier)
  new(data)
rescue Excon::Errors::NotFound
  nil
end

#invite(email, role) ⇒ Fog::Brightbox::Compute::Collaboration

Invites a user (via an email) to collaborate on the currently scoped account at the role level.

Parameters:

  • email (String)

    The email address to use for the invitation

  • role (String)

    The role being granted. Only (admin is currently supported

Returns:



30
31
32
33
34
35
36
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 30

def invite(email, role)
  return nil if email.nil? || email == ""
  return nil if role.nil? || role == ""
  options = { email: email, role: role }
  data = service.create_collaboration(options)
  new(data)
end