Sha256: 700e3da7d43814fb53cf68d7fca03bacea15cb793fe2d7d581e30ecfd88e8f17

Contents?: true

Size: 1.89 KB

Versions: 15

Compression:

Stored size: 1.89 KB

Contents

require 'fog/core/model'

module Fog
  module Support
    class StormOnDemand
      class Ticket < Fog::Model
        identity :id
        attribute :accnt
        attribute :account
        attribute :body
        attribute :closed
        attribute :email
        attribute :handler
        attribute :last_responded
        attribute :received
        attribute :secid
        attribute :status
        attribute :subject
        attribute :type

        def initialize(attributes={})
          super
        end

        def add_feedback(options)
          requires :identity
          res = service.add_feedback({:id => identity}.merge!(options)).body
          res['feedback'].to_i == 1 ? true : false
        end

        def add_transaction_feedback(options)
          requires :identity
          requires :secid
          params = {:ticket_id => identity,
                    :secid => secid}.merge!(options)
          service.add_transaction_feedback(params).body
        end

        def authenticate(options)
          requires :identity
          requires :secid
          params = {:id => identity, :secid => secid}.merge!(options)
          service.authenticate(params).body
        end

        def close
          requires :identity
          requires :secid
          res = service.close_ticket(:id => identity, :secid => secid).body
          res['closed'].to_i == 1 ? true : false
        end

        def reopen
          requires :identity
          requires :secid
          res = service.reopen_ticket(:id => identity, :secid => secid).body
          res['reopened'].to_i == 1 ? true : false
        end

        def reply(options)
          requires :identity
          requires :secid
          res = service.reply_ticket({:id => identity,
                                      :secid => secid}.merge!(options)).body
          res['reply'].to_i == 1 ? true : false
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/storm_on_demand/models/support/ticket.rb
fog-1.25.0 lib/fog/storm_on_demand/models/support/ticket.rb
nsidc-fog-1.24.1 lib/fog/storm_on_demand/models/support/ticket.rb
fog-1.24.0 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.11 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.10 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.9 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.8 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.7 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.6 lib/fog/storm_on_demand/models/support/ticket.rb
fog-1.23.0 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.4 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.3 lib/fog/storm_on_demand/models/support/ticket.rb
ns-fog-1.22.2 lib/fog/storm_on_demand/models/support/ticket.rb
fog-1.22.1 lib/fog/storm_on_demand/models/support/ticket.rb