Method: JSS::PatchSource.valid_patch_source_id

Defined in:
lib/jss/api_object/patch_source.rb

.valid_patch_source_id(ident, refresh = false, api: JSS.api) ⇒ 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:

  • the name or id to validate

  • (defaults to: false)

    Should the data be re-read from the server

  • (defaults to: JSS.api)

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

Returns:

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

See Also:



251
252
253
254
255
# File 'lib/jss/api_object/patch_source.rb', line 251

def self.valid_patch_source_id(ident, refresh = false, api: JSS.api)
  id = JSS::PatchInternalSource.valid_id ident, refresh, api: api
  id ||= JSS::PatchExternalSource.valid_id ident, refresh, api: api
  id
end