Sha256: e531ecd99bd3db015ead2de8b3acc336c33c1e41c8a96c22a5631b5322e1f9fe

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

module Fog
  module Compute
    class Brightbox
      class Collaboration < Fog::Brightbox::Model
        identity :id
        attribute :status
        attribute :email
        attribute :role
        attribute :role_label
        attribute :account
        attribute :user
        attribute :inviter

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

        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

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

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

Version data entries

16 entries across 14 versions & 3 rubygems

Version Path
fog-brightbox-1.0.0.rc1 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.16.1 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.16.0 lib/fog/brightbox/models/compute/collaboration.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-brightbox-0.15.0/lib/fog/brightbox/models/compute/collaboration.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-brightbox-0.15.0/lib/fog/brightbox/models/compute/collaboration.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-brightbox-0.15.0/lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.15.0 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.14.0 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.13.0 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.12.0 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.11.0 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.10.1 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.10.0 lib/fog/brightbox/models/compute/collaboration.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-brightbox-0.9.0/lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.9.0 lib/fog/brightbox/models/compute/collaboration.rb
fog-brightbox-0.8.0 lib/fog/brightbox/models/compute/collaboration.rb