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



14
15
16
# File 'lib/fog/brightbox/models/compute/collaboration.rb', line 14

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

#destroyObject



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

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

#resendObject



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

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

#saveObject

Raises:

  • (Fog::Errors::Error)


18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fog/brightbox/models/compute/collaboration.rb', line 18

def save
  raise Fog::Errors::Error.new("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