class Jamf::DockItem
A Dock Item in the JSS
. These are rather simple. They have an ID, name, path, type, and contents which is read-only
@see Jamf::APIObject
Constants
- DOCK_ITEM_TYPE
The Dock Item type
- RSRC_BASE
The base for REST resources of this class
- RSRC_LIST_KEY
the hash key used for the JSON list output of all objects in the
JSS
- RSRC_OBJECT_KEY
The hash key used for the JSON object output. It’s also used in various error messages
Attributes
id[R]
Attributes
name[R]
path[R]
type[R]
Public Class Methods
new(**args)
click to toggle source
Constructor @see Jamf::APIObject.initialize
Calls superclass method
Jamf::APIObject::new
# File lib/jamf/api/classic/api_objects/dock_item.rb 89 def initialize(**args) 90 super 91 92 @type = 'App' if @init_data[:type].nil? 93 @type = @init_data[:type] 94 @path = @init_data[:path] 95 end
Public Instance Methods
path=(newval)
click to toggle source
set the path
@param newval the new app path
# File lib/jamf/api/classic/api_objects/dock_item.rb 117 def path=(newval) 118 raise Jamf::InvalidDataError, 'Path must be a String' unless newval.is_a? String 119 120 @path = newval 121 @need_to_update = true 122 end
type=(newval)
click to toggle source
set the type
@param newval the new app type
@return [void]
# File lib/jamf/api/classic/api_objects/dock_item.rb 106 def type=(newval) 107 raise Jamf::InvalidDataError, 'Type must be a string' unless newval.is_a? String 108 raise Jamf::InvalidDataError, "Type must be one of the following: #{DOCK_ITEM_TYPE}; not #{newval}" unless DOCK_ITEM_TYPE.include? newval.to_s 109 110 @type = newval 111 @need_to_update = true 112 end
Private Instance Methods
rest_xml()
click to toggle source
the xml formated data for adding or updating this in the JSS
# File lib/jamf/api/classic/api_objects/dock_item.rb 130 def rest_xml 131 doc = REXML::Document.new Jamf::Connection::XML_HEADER 132 ns = doc.add_element RSRC_OBJECT_KEY.to_s 133 ns.add_element('name').text = @name 134 ns.add_element('type').text = @type.to_s 135 ns.add_element('path').text = @path.to_s 136 doc.to_s 137 end