Class: Fog::Brightbox::Compute::Collaboration

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

Instance Method Summary collapse

Methods included from ModelHelper

#collection_name, #resource_name

Instance Method Details

#account_idObject



25
26
27
# File 'lib/fog/brightbox/models/compute/collaboration.rb', line 25

def 
  ["id"] || [:id]
end

#destroyObject



49
50
51
52
53
54
# File 'lib/fog/brightbox/models/compute/collaboration.rb', line 49

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

#resendObject



42
43
44
45
46
47
# File 'lib/fog/brightbox/models/compute/collaboration.rb', line 42

def resend
  requires :identity
  data = service.resend_collaboration(identity)
  merge_attributes(data)
  true
end

#saveObject

Raises:

  • (Fog::Errors::Error)


29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/fog/brightbox/models/compute/collaboration.rb', line 29

def save
  raise Fog::Errors::Error, "Resaving an existing object may create a duplicate" if identity

  options = {
    role: role,
    email: email
  }.delete_if { |_k, v| v.nil? || v == "" }

  data = service.create_collaboration(options)
  merge_attributes(data)
  true
end