Sha256: 30033710653c3f79d796452eca977e35b882e8885096cf0706a3b726067753f1

Contents?: true

Size: 1.47 KB

Versions: 15

Compression:

Stored size: 1.47 KB

Contents

#
module JSS

  #
  module ManagementHistory

    # PolicyLog - A Computer policy log history entry
    #
    # This should only be instantiated by the ManagementHistory.policy_logs method
    # when mixed in to Computers.
    #
    # That method will return an array of these objects.
    #
    class PolicyLog < ImmutableStruct.new(

      :policy_id,
      :policy_name,
      :username,
      :date_completed_epoch,
      :status
    )
      include JSS::ManagementHistory::HashLike

      def initialize(args = {})
        # we want the status as a Symbol
        args[:status] &&= args[:status].downcase.to_sym
        super
      end

      # @!attribute [r] policy_id
      #   @return [Integer]  the jss id of the poolicy

      alias id policy_id

      # @!attribute [r] policy_name
      #   @return [String] the name of the policy.

      alias name policy_name

      # @!attribute [r] username
      #   @return [String] The username active for the policy

      # @!attribute [r] date_completed_epoch
      #   @return [Integer] When the policy completed, as
      #   a unix epoch timestamp with milliseconds

      # @!attribute [r] status
      #   @return [Symbol] :completed or :failed

      # @return [Time] When the policy completed, as a ruby
      #   Time object
      def date_completed
        JSS.epoch_to_time(@date_completed_epoch) if @date_completed_epoch
      end
      alias completed date_completed

    end # PolicyLog

  end # module ManagementHistory

end # module JSS

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ruby-jss-1.0.3b2 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-1.0.3b1 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-1.0.2 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-1.0.1 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-1.0.0 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-1.0.0b6 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-1.0.0b2 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.14.0 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.13.0 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.12.0 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.11.0 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.11.0b3 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.11.0b2 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.11.0b1 lib/jss/api_object/management_history/policy_log.rb
ruby-jss-0.11.0a6 lib/jss/api_object/management_history/policy_log.rb