Sha256: c7dd3e74d8bde83c223f2c173a501dcf6bdb1b651b0153717a904ae41660a14a

Contents?: true

Size: 929 Bytes

Versions: 7

Compression:

Stored size: 929 Bytes

Contents

module Fog
  module Compute
    class Brightbox
      class ApiClient < Fog::Model
        identity :id
        attribute :name
        attribute :description
        attribute :secret
        attribute :revoked_at, :type => :time
        attribute :account_id

        def save
          raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
          options = {
            :name => name,
            :description => description
          }.delete_if {|k,v| v.nil? || v == "" }
          data = connection.create_api_client(options)
          merge_attributes(data)
          true
        end

        def destroy
          requires :identity
          connection.destroy_api_client(identity)
          true
        end

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

Version data entries

7 entries across 7 versions & 5 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/brightbox/models/compute/api_client.rb
fog-nirvanix-1.8.1 lib/fog/brightbox/models/compute/api_client.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/brightbox/models/compute/api_client.rb
fog-sgonyea-1.8.1 lib/fog/brightbox/models/compute/api_client.rb
fog-1.8.0 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/brightbox/models/compute/api_client.rb
fog-1.7.0 lib/fog/brightbox/models/compute/api_client.rb