Sha256: 99ff44fc60821ecb7c1f65876300f55f09a3d5aa58a8d57f5f9a988c15eef031

Contents?: true

Size: 924 Bytes

Versions: 27

Compression:

Stored size: 924 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 persisted?
          options = {
            :name => name,
            :description => description
          }.delete_if { |k, v| v.nil? || v == "" }
          data = service.create_api_client(options)
          merge_attributes(data)
          true
        end

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

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

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
fog-brightbox-0.1.0.dev2 lib/fog/brightbox/models/compute/api_client.rb
fog-brightbox-0.1.0.dev1 lib/fog/brightbox/models/compute/api_client.rb
fog-brightbox-0.0.2 lib/fog/brightbox/models/compute/api_client.rb
fog-1.21.0 providers/brightbox/lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/brightbox/models/compute/api_client.rb
fog-brightbox-0.0.1 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/brightbox/models/compute/api_client.rb
fog-1.20.0 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/brightbox/models/compute/api_client.rb
fog-1.19.0 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/brightbox/models/compute/api_client.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/brightbox/models/compute/api_client.rb