Method: Jamf::PatchSource.valid_patch_source_id

Defined in:
lib/jamf/api/classic/base_classes/patch_source.rb

.valid_patch_source_id(ident, refresh = false, api: nil, cnx: Jamf.cnx) ⇒ Integer?

Given a name or id for a Patch Source (internal or external) return the id if it exists, or nil if it doesn’t.

NOTE: does not indicate which kind of source it is, just that it exists and can be used as a source_id for a patch title.

Parameters:

  • ident (String, Integer)

    the name or id to validate

  • refresh (Boolean) (defaults to: false)

    Should the data be re-read from the server

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    an API connection to use for the query. Defaults to the corrently active API. See Connection

Returns:

  • (Integer, nil)

    the valid id or nil if it doesn’t exist.

See Also:



271
272
273
274
275
276
277
# File 'lib/jamf/api/classic/base_classes/patch_source.rb', line 271

def self.valid_patch_source_id(ident, refresh = false, api: nil, cnx: Jamf.cnx)
  cnx = api if api

  id = Jamf::PatchInternalSource.valid_id ident, refresh, cnx: cnx
  id ||= Jamf::PatchExternalSource.valid_id ident, refresh, cnx: cnx
  id
end