lib/jss/api_object/management_history.rb
def mac_app_store_app_history(ident, status = nil, api: JSS.api)
        raise JSS::UnsupportedError, 'Only computers have mac app store apps' unless self == JSS::Computer

        hist = management_history(ident, :mac_app_store_applications, api: api)
        if status
          raise JSS::InvalidDataError, 'status must be one of :installed, :pending, or :failed' unless HIST_APP_STATUSES.include? status
          statuses_to_do = [status]
        else
          statuses_to_do = HIST_APP_STATUSES
        end # if status

        result = []

        statuses_to_do.each do |a_status|
          result += hist[a_status].map! do |app|
            # set the :status
            app[:status] = a_status
            JSS::ManagementHistory::MacAppStoreApp.new app
          end # map do |cmd|
        end # statuses_to_do.each do |a_status|

        result
      end
# The history of app store apps  for a computer
#
# @param ident [Type] The identifier for the object - id, name, sn, udid, etc.
#
# @param status [Symbol] Return only the :installed, :pending, or :failed apps
#
# @param api [JSS::APIConnection] The API connection to use for the query
#   defaults to the currently active connection
#
# @return [Array<JSS::ManagementHistory::MacAppStoreApp>] An array of MacAppStoreApp
#
The history of app store apps  for a computer
The history of app store apps for a computer
def mac_app_store_app_history(ident, status = nil, api: JSS.api)
        raise JSS::UnsupportedError, 'Only computers have mac app store apps' unless self == JSS::Computer
        hist = management_history(ident, :mac_app_store_applications, api: api)
        if status
          raise JSS::InvalidDataError, 'status must be one of :installed, :pending, or :failed' unless HIST_APP_STATUSES.include? status
          statuses_to_do = [status]
        else
          statuses_to_do = HIST_APP_STATUSES
        end 
        result = []
        statuses_to_do.each do |a_status|
          result += hist[a_status].map! do |app|
            app[:status] = a_status
            JSS::ManagementHistory::MacAppStoreApp.new app
          end 
        end 
        result
      end
def mac_app_store_app_history ( ident , status = nil , api : JSS . api ) raise JSS :: UnsupportedError , 'Only computers have mac app store apps' unless self == JSS :: Computer hist = management_history ( ident , :mac_app_store_applications , api : api ) if status raise JSS :: InvalidDataError , 'status must be one of :installed, :pending, or :failed' unless HIST_APP_STATUSES . include? status statuses_to_do = [ status ] else statuses_to_do = HIST_APP_STATUSES end result = [ ] statuses_to_do . each do | a_status | result += hist [ a_status ] . map! do | app | app [ :status ] = a_status JSS :: ManagementHistory :: MacAppStoreApp . new app end end result end
The history of app store apps  for a computer
The history of app store apps for a computer
# if status # set the :status # map do |cmd| # statuses_to_do.each do |a_status|
An array of MacAppStoreApp
An array of MacAppStoreApp
Array<JSS::ManagementHistory::MacAppStoreApp>
ident
The identifier for the object - id, name, sn, udid, etc.
The identifier for the object - id name sn udid etc .
status
Return only the :installed, :pending, or :failed apps
Return only the : installed : pending or : failed apps
api
The API connection to use for the query defaults to the currently active connection
The API connection to use for the query defaults to the currently active connection
the currently active connection