lib/jamf/api/classic/api_objects/patch_title.rb in ruby-jss-2.1.0b5 vs lib/jamf/api/classic/api_objects/patch_title.rb in ruby-jss-2.1.0

- old
+ new

@@ -152,11 +152,11 @@ LATEST_VERSION_ID = 'Latest'.freeze # when fetching a specific version, this is a valid version UNKNOWN_VERSION_ID = 'Unknown'.freeze - REPORTS_RSRC_BASE = '/patchreports/patchsoftwaretitleid'.freeze + REPORTS_RSRC_BASE = 'patchreports/patchsoftwaretitleid'.freeze # Class Methods ####################################### # The same as @see APIObject.all but also takes an optional @@ -231,11 +231,11 @@ cnx = api if api all(refresh, cnx: cnx).map { |i| i[:source_name_id] } end - # Get a patch report for a softwaretitle, withouth fetching an instance. + # Get a patch report for a softwaretitle, without fetching an instance. # Defaults to reporting all versions. Specifiying a version will be faster. # # The Hash returned has 3 keys: # - :total_comptuters [Integer] total computers found for the requested version(s) # - :total versions [Integer] How many versions does this title have? @@ -267,10 +267,11 @@ rsrc = patch_report_rsrc title_id, version # TODO: remove this and adjust parsing when jamf fixes the JSON raw_report = XMLWorkaround.data_via_xml(rsrc, PATCH_REPORT_DATA_MAP, cnx)[:patch_report] + report = {} report[:total_computers] = raw_report[:total_computers] report[:total_versions] = raw_report[:total_versions] if raw_report[:versions].is_a? Hash @@ -310,11 +311,11 @@ # Patch titles only have an id-based GET resource in the API. # so all other lookup values have to be converted to ID before # the call to super # - def self.fetch(identifier = nil, **params) + def self.fetch(identifier = nil, **params) # default connection if unspecified cnx = params.delete :cnx cnx ||= params.delete :api # backward compatibility, deprecated cnx ||= Jamf.cnx @@ -470,10 +471,9 @@ end # wrapper to fetch versions after creating def create super - end # wrapper to clear @changed_pkgs after updating def update response = super