Method: Jamf::Matchable#match

Defined in:
lib/jamf/api/classic/api_objects/matchable.rb

#match(term, api: nil, cnx: Jamf.cnx) ⇒ Array<Hash>

Perform a match, returning an Array of Hashes, one for each item matched

At the moment, it appears the search is an “exact match” search regardless of the prefs of the user connected to the API.

Parameters:

  • term (String)

    the term to match.

Returns:

Raises:



70
71
72
73
74
75
76
77
# File 'lib/jamf/api/classic/api_objects/matchable.rb', line 70

def match(term, api: nil, cnx: Jamf.cnx)
  cnx = api if api

  raise Jamf::InvalidDataError, 'Match term may not be empty' if term.to_s.empty?

  rsrc = "#{self::RSRC_BASE}/#{Jamf::Matchable::MATCH_RSRC}/#{CGI.escape term.to_s}"
  cnx.c_get(rsrc)[self::RSRC_LIST_KEY]
end