Class: Fog::Brightbox::Compute::ApiClient

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

Instance Method Summary collapse

Methods included from ModelHelper

#collection_name, #resource_name

Instance Method Details

#destroyObject



33
34
35
36
37
# File 'lib/fog/brightbox/models/compute/api_client.rb', line 33

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

#reset_secretObject



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

def reset_secret
  requires :identity
  service.reset_secret_api_client(identity)
  true
end

#saveObject

Raises:

  • (Fog::Errors::Error)


21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fog/brightbox/models/compute/api_client.rb', line 21

def save
  raise Fog::Errors::Error, "Resaving an existing object may create a duplicate" if persisted?
  options = {
    name: name,
    description: description,
    permissions_group: permissions_group
  }.delete_if { |_k, v| v.nil? || v == "" }
  data = service.create_api_client(options)
  merge_attributes(data)
  true
end