id int32 0 24.9k | repo stringlengths 5 58 | path stringlengths 9 168 | func_name stringlengths 9 130 | original_string stringlengths 66 10.5k | language stringclasses 1
value | code stringlengths 66 10.5k | code_tokens list | docstring stringlengths 8 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 94 266 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,800 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/webhook.rb | JSS.WebHook.event= | def event=(new_val)
return nil if new_val == @event
raise JSS::InvalidDataError, 'Unknown webhook event' unless EVENTS.include? new_val
@event = new_val
@need_to_update = true
end | ruby | def event=(new_val)
return nil if new_val == @event
raise JSS::InvalidDataError, 'Unknown webhook event' unless EVENTS.include? new_val
@event = new_val
@need_to_update = true
end | [
"def",
"event",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@event",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Unknown webhook event'",
"unless",
"EVENTS",
".",
"include?",
"new_val",
"@event",
"=",
"new_val",
"@need_to_update",
"="... | Set the event handled by this webhook
Must be a member of the EVENTS Array
@param new_val[String] The event name
@return [void] | [
"Set",
"the",
"event",
"handled",
"by",
"this",
"webhook",
"Must",
"be",
"a",
"member",
"of",
"the",
"EVENTS",
"Array"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/webhook.rb#L185-L190 |
15,801 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/webhook.rb | JSS.WebHook.rest_xml | def rest_xml
validate_before_save
doc = REXML::Document.new APIConnection::XML_HEADER
webhook = doc.add_element 'webhook'
webhook.add_element('name').text = @name
webhook.add_element('enabled').text = @enabled
webhook.add_element('url').text = @url
webhook.add_element('content_... | ruby | def rest_xml
validate_before_save
doc = REXML::Document.new APIConnection::XML_HEADER
webhook = doc.add_element 'webhook'
webhook.add_element('name').text = @name
webhook.add_element('enabled').text = @enabled
webhook.add_element('url').text = @url
webhook.add_element('content_... | [
"def",
"rest_xml",
"validate_before_save",
"doc",
"=",
"REXML",
"::",
"Document",
".",
"new",
"APIConnection",
"::",
"XML_HEADER",
"webhook",
"=",
"doc",
".",
"add_element",
"'webhook'",
"webhook",
".",
"add_element",
"(",
"'name'",
")",
".",
"text",
"=",
"@na... | Return the REST XML for this webhook, with the current values,
for saving or updating | [
"Return",
"the",
"REST",
"XML",
"for",
"this",
"webhook",
"with",
"the",
"current",
"values",
"for",
"saving",
"or",
"updating"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/webhook.rb#L228-L238 |
15,802 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/computer_invitation.rb | JSS.ComputerInvitation.create | def create
new_invitation_id = super
jss_me = ComputerInvitation.fetch(id: new_invitation_id, name: 'set_by_request')
@name = jss_me.name
@invitation_type = jss_me.invitation_type
@create_account_if_does_not_exist = jss_me.create_account_if_does_not_exist
@expiration_date_epoch = js... | ruby | def create
new_invitation_id = super
jss_me = ComputerInvitation.fetch(id: new_invitation_id, name: 'set_by_request')
@name = jss_me.name
@invitation_type = jss_me.invitation_type
@create_account_if_does_not_exist = jss_me.create_account_if_does_not_exist
@expiration_date_epoch = js... | [
"def",
"create",
"new_invitation_id",
"=",
"super",
"jss_me",
"=",
"ComputerInvitation",
".",
"fetch",
"(",
"id",
":",
"new_invitation_id",
",",
"name",
":",
"'set_by_request'",
")",
"@name",
"=",
"jss_me",
".",
"name",
"@invitation_type",
"=",
"jss_me",
".",
... | Public Instance Methods
@see APIObject#initialize
Public Class Methods
Needed to support creation of new Computer Invitations to set their name.
@return [JSS::ComputerInvitation] | [
"Public",
"Instance",
"Methods"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/computer_invitation.rb#L172-L184 |
15,803 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/computer_invitation.rb | JSS.ComputerInvitation.rest_xml | def rest_xml
doc = REXML::Document.new APIConnection::XML_HEADER
obj = doc.add_element RSRC_OBJECT_KEY.to_s
obj.add_element('invitation_type').text = invitation_type
obj.add_element('create_account_if_does_not_exist').text = create_account_if_does_not_exist
if expiration_date_epoch
... | ruby | def rest_xml
doc = REXML::Document.new APIConnection::XML_HEADER
obj = doc.add_element RSRC_OBJECT_KEY.to_s
obj.add_element('invitation_type').text = invitation_type
obj.add_element('create_account_if_does_not_exist').text = create_account_if_does_not_exist
if expiration_date_epoch
... | [
"def",
"rest_xml",
"doc",
"=",
"REXML",
"::",
"Document",
".",
"new",
"APIConnection",
"::",
"XML_HEADER",
"obj",
"=",
"doc",
".",
"add_element",
"RSRC_OBJECT_KEY",
".",
"to_s",
"obj",
".",
"add_element",
"(",
"'invitation_type'",
")",
".",
"text",
"=",
"inv... | Sets invitation expiration 4 hours after request. | [
"Sets",
"invitation",
"expiration",
"4",
"hours",
"after",
"request",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/computer_invitation.rb#L192-L206 |
15,804 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable/icon.rb | JSS.Icon.save | def save(path, overwrite = false)
path = Pathname.new path
path = path + @name if path.directory? && @name
raise JSS::AlreadyExistsError, "The file #{path} already exists" if path.exist? unless overwrite
path.delete if path.exist?
path.jss_save @data
end | ruby | def save(path, overwrite = false)
path = Pathname.new path
path = path + @name if path.directory? && @name
raise JSS::AlreadyExistsError, "The file #{path} already exists" if path.exist? unless overwrite
path.delete if path.exist?
path.jss_save @data
end | [
"def",
"save",
"(",
"path",
",",
"overwrite",
"=",
"false",
")",
"path",
"=",
"Pathname",
".",
"new",
"path",
"path",
"=",
"path",
"+",
"@name",
"if",
"path",
".",
"directory?",
"&&",
"@name",
"raise",
"JSS",
"::",
"AlreadyExistsError",
",",
"\"The file ... | Save the icon to a file.
@param path[Pathname, String] The path to which the file should be saved.
If the path given is an existing directory, the icon's current filename will
be used, if known.
@param overwrite[Boolean] Overwrite the file if it exists? Defaults to false
@return [void] | [
"Save",
"the",
"icon",
"to",
"a",
"file",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable/icon.rb#L177-L184 |
15,805 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/categorizable.rb | JSS.Categorizable.category= | def category=(new_cat)
return nil unless updatable? || creatable?
# unset the category? Use nil or an empty string
if NON_CATEGORIES.include? new_cat
unset_category
return
end
new_name, new_id = evaluate_new_category(new_cat)
# no change, go home.
return nil ... | ruby | def category=(new_cat)
return nil unless updatable? || creatable?
# unset the category? Use nil or an empty string
if NON_CATEGORIES.include? new_cat
unset_category
return
end
new_name, new_id = evaluate_new_category(new_cat)
# no change, go home.
return nil ... | [
"def",
"category",
"=",
"(",
"new_cat",
")",
"return",
"nil",
"unless",
"updatable?",
"||",
"creatable?",
"# unset the category? Use nil or an empty string",
"if",
"NON_CATEGORIES",
".",
"include?",
"new_cat",
"unset_category",
"return",
"end",
"new_name",
",",
"new_id"... | Change the category of this object.
Any of the NON_CATEGORIES values will
unset the category
@param new_cat[Integer, String] The new category
@return [void] | [
"Change",
"the",
"category",
"of",
"this",
"object",
".",
"Any",
"of",
"the",
"NON_CATEGORIES",
"values",
"will",
"unset",
"the",
"category"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/categorizable.rb#L132-L151 |
15,806 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/categorizable.rb | JSS.Categorizable.parse_category | def parse_category
cat =
if self.class::CATEGORY_SUBSET == :top
@init_data[:category]
else
@init_data[self.class::CATEGORY_SUBSET][:category]
end
if cat.is_a? String
@category_name = cat
@category_id = JSS::Category.category_id_from_name @category... | ruby | def parse_category
cat =
if self.class::CATEGORY_SUBSET == :top
@init_data[:category]
else
@init_data[self.class::CATEGORY_SUBSET][:category]
end
if cat.is_a? String
@category_name = cat
@category_id = JSS::Category.category_id_from_name @category... | [
"def",
"parse_category",
"cat",
"=",
"if",
"self",
".",
"class",
"::",
"CATEGORY_SUBSET",
"==",
":top",
"@init_data",
"[",
":category",
"]",
"else",
"@init_data",
"[",
"self",
".",
"class",
"::",
"CATEGORY_SUBSET",
"]",
"[",
":category",
"]",
"end",
"if",
... | Parse the category data from any incoming API data
@return [void] description_of_returned_object | [
"Parse",
"the",
"category",
"data",
"from",
"any",
"incoming",
"API",
"data"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/categorizable.rb#L191-L207 |
15,807 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/categorizable.rb | JSS.Categorizable.add_category_to_xml | def add_category_to_xml(xmldoc)
return if category_name.to_s.empty?
cat_elem = REXML::Element.new('category')
if self.class::CATEGORY_DATA_TYPE == String
cat_elem.text = @category_name.to_s
elsif self.class::CATEGORY_DATA_TYPE == Hash
cat_elem.add_element('name').text = @categor... | ruby | def add_category_to_xml(xmldoc)
return if category_name.to_s.empty?
cat_elem = REXML::Element.new('category')
if self.class::CATEGORY_DATA_TYPE == String
cat_elem.text = @category_name.to_s
elsif self.class::CATEGORY_DATA_TYPE == Hash
cat_elem.add_element('name').text = @categor... | [
"def",
"add_category_to_xml",
"(",
"xmldoc",
")",
"return",
"if",
"category_name",
".",
"to_s",
".",
"empty?",
"cat_elem",
"=",
"REXML",
"::",
"Element",
".",
"new",
"(",
"'category'",
")",
"if",
"self",
".",
"class",
"::",
"CATEGORY_DATA_TYPE",
"==",
"Strin... | Add the category to the XML for POSTing or PUTting to the API.
@param xmldoc[REXML::Document] The in-construction XML document
@return [void] | [
"Add",
"the",
"category",
"to",
"the",
"XML",
"for",
"POSTing",
"or",
"PUTting",
"to",
"the",
"API",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/categorizable.rb#L221-L243 |
15,808 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/scopable.rb | JSS.Scopable.scope= | def scope= (new_scope)
raise JSS::InvalidDataError, "JSS::Scopable::Scope instance required" unless new_criteria.kind_of?(JSS::Scopable::Scope)
raise JSS::InvalidDataError, "Scope object must have target_key of :#{self.class::SCOPE_TARGET_KEY}" unless self.class::SCOPE_TARGET_KEY == new_scope.target_key
... | ruby | def scope= (new_scope)
raise JSS::InvalidDataError, "JSS::Scopable::Scope instance required" unless new_criteria.kind_of?(JSS::Scopable::Scope)
raise JSS::InvalidDataError, "Scope object must have target_key of :#{self.class::SCOPE_TARGET_KEY}" unless self.class::SCOPE_TARGET_KEY == new_scope.target_key
... | [
"def",
"scope",
"=",
"(",
"new_scope",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"JSS::Scopable::Scope instance required\"",
"unless",
"new_criteria",
".",
"kind_of?",
"(",
"JSS",
"::",
"Scopable",
"::",
"Scope",
")",
"raise",
"JSS",
"::",
"InvalidData... | Change the scope
@param new_scope[JSS::Scopable::Scope] the new scope
@return [void] | [
"Change",
"the",
"scope"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/scopable.rb#L98-L103 |
15,809 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mdm.rb | JSS.MDM.erase_device | def erase_device(passcode = '', preserve_data_plan: false)
self.class.erase_device @id, passcode: passcode, preserve_data_plan: preserve_data_plan, api: @api
end | ruby | def erase_device(passcode = '', preserve_data_plan: false)
self.class.erase_device @id, passcode: passcode, preserve_data_plan: preserve_data_plan, api: @api
end | [
"def",
"erase_device",
"(",
"passcode",
"=",
"''",
",",
"preserve_data_plan",
":",
"false",
")",
"self",
".",
"class",
".",
"erase_device",
"@id",
",",
"passcode",
":",
"passcode",
",",
"preserve_data_plan",
":",
"preserve_data_plan",
",",
"api",
":",
"@api",
... | Send an erase device command to this object
@param passcode[String] a six-char passcode, required for computers & computergroups
@return (see .send_mdm_command) | [
"Send",
"an",
"erase",
"device",
"command",
"to",
"this",
"object"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mdm.rb#L1033-L1035 |
15,810 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mdm.rb | JSS.MDM.wallpaper | def wallpaper(wallpaper_setting: nil, wallpaper_content: nil, wallpaper_id: nil)
self.class.wallpaper(
@id,
wallpaper_setting: wallpaper_setting,
wallpaper_content: wallpaper_content,
wallpaper_id: wallpaper_id,
api: @api
)
end | ruby | def wallpaper(wallpaper_setting: nil, wallpaper_content: nil, wallpaper_id: nil)
self.class.wallpaper(
@id,
wallpaper_setting: wallpaper_setting,
wallpaper_content: wallpaper_content,
wallpaper_id: wallpaper_id,
api: @api
)
end | [
"def",
"wallpaper",
"(",
"wallpaper_setting",
":",
"nil",
",",
"wallpaper_content",
":",
"nil",
",",
"wallpaper_id",
":",
"nil",
")",
"self",
".",
"class",
".",
"wallpaper",
"(",
"@id",
",",
"wallpaper_setting",
":",
"wallpaper_setting",
",",
"wallpaper_content"... | Send a wallpaper command to this object
@param wallpaper_setting[Symbol] :lock_screen, :home_screen, or :lock_and_home_screen
@param wallpaper_content[String,Pathname] The local path to a .png or .jpg to use
as the walpaper image, required if no wallpaper_id
@param wallpaper_id[Symbol] The id of an Icon in Jam... | [
"Send",
"a",
"wallpaper",
"command",
"to",
"this",
"object"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mdm.rb#L1171-L1179 |
15,811 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mdm.rb | JSS.MDM.enable_lost_mode | def enable_lost_mode(
message: nil,
phone_number: nil,
footnote: nil,
enforce_lost_mode: true,
play_sound: false
)
self.class.enable_lost_mode(
@id,
message: message,
phone_number: phone_number,
footnote: footnote,
play_... | ruby | def enable_lost_mode(
message: nil,
phone_number: nil,
footnote: nil,
enforce_lost_mode: true,
play_sound: false
)
self.class.enable_lost_mode(
@id,
message: message,
phone_number: phone_number,
footnote: footnote,
play_... | [
"def",
"enable_lost_mode",
"(",
"message",
":",
"nil",
",",
"phone_number",
":",
"nil",
",",
"footnote",
":",
"nil",
",",
"enforce_lost_mode",
":",
"true",
",",
"play_sound",
":",
"false",
")",
"self",
".",
"class",
".",
"enable_lost_mode",
"(",
"@id",
","... | Send a enable_lost_mode command to one or more targets
Either or both of message and phone number must be provided
@param message[String] The message to display on the lock screen
@param phone_number[String] The phone number to display on the lock screen
@param footnote[String] Optional footnote to display on t... | [
"Send",
"a",
"enable_lost_mode",
"command",
"to",
"one",
"or",
"more",
"targets"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mdm.rb#L1260-L1276 |
15,812 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.frequency= | def frequency=(freq)
raise JSS::InvalidDataError, "New frequency must be one of :#{FREQUENCIES.keys.join ', :'}" unless FREQUENCIES.key?(freq)
@frequency = FREQUENCIES[freq]
@need_to_update = true
end | ruby | def frequency=(freq)
raise JSS::InvalidDataError, "New frequency must be one of :#{FREQUENCIES.keys.join ', :'}" unless FREQUENCIES.key?(freq)
@frequency = FREQUENCIES[freq]
@need_to_update = true
end | [
"def",
"frequency",
"=",
"(",
"freq",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"New frequency must be one of :#{FREQUENCIES.keys.join ', :'}\"",
"unless",
"FREQUENCIES",
".",
"key?",
"(",
"freq",
")",
"@frequency",
"=",
"FREQUENCIES",
"[",
"freq",
"]",
... | Set a new frequency for this policy.
@param freq[Symbol] the desired frequency, must be one of the keys of {FREQUENCIES}
@return [void] | [
"Set",
"a",
"new",
"frequency",
"for",
"this",
"policy",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L718-L722 |
15,813 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.target_drive= | def target_drive=(path_to_drive)
raise JSS::InvalidDataError, 'Path to target drive must be absolute' unless path_to_drive.to_s.start_with? '/'
@target_drive = path_to_drive.to_s
@need_to_update = true
end | ruby | def target_drive=(path_to_drive)
raise JSS::InvalidDataError, 'Path to target drive must be absolute' unless path_to_drive.to_s.start_with? '/'
@target_drive = path_to_drive.to_s
@need_to_update = true
end | [
"def",
"target_drive",
"=",
"(",
"path_to_drive",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Path to target drive must be absolute'",
"unless",
"path_to_drive",
".",
"to_s",
".",
"start_with?",
"'/'",
"@target_drive",
"=",
"path_to_drive",
".",
"to_s",
"@ne... | Set a new target drive for this policy.
@param path_to_drive[String,Pathname] the full path to the target drive, must start with a '/'
@return [void] | [
"Set",
"a",
"new",
"target",
"drive",
"for",
"this",
"policy",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L730-L734 |
15,814 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.offline= | def offline=(new_val)
raise JSS::InvalidDataError, 'New value must be boolean true or false' unless JSS::TRUE_FALSE.include? new_val
@offline = new_val
@need_to_update = true
end | ruby | def offline=(new_val)
raise JSS::InvalidDataError, 'New value must be boolean true or false' unless JSS::TRUE_FALSE.include? new_val
@offline = new_val
@need_to_update = true
end | [
"def",
"offline",
"=",
"(",
"new_val",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be boolean true or false'",
"unless",
"JSS",
"::",
"TRUE_FALSE",
".",
"include?",
"new_val",
"@offline",
"=",
"new_val",
"@need_to_update",
"=",
"true",
"end"... | Set whether this policy is available offline.
@param new_val[Boolean]
@return [void] | [
"Set",
"whether",
"this",
"policy",
"is",
"available",
"offline",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L742-L746 |
15,815 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.set_trigger_event | def set_trigger_event(type, new_val)
raise JSS::InvalidDataError, "Trigger type must be one of #{TRIGGER_EVENTS.keys.join(', ')}" unless TRIGGER_EVENTS.key?(type)
if type == :custom
raise JSS::InvalidDataError, 'Custom triggers must be Strings' unless new_val.is_a? String
else
raise JS... | ruby | def set_trigger_event(type, new_val)
raise JSS::InvalidDataError, "Trigger type must be one of #{TRIGGER_EVENTS.keys.join(', ')}" unless TRIGGER_EVENTS.key?(type)
if type == :custom
raise JSS::InvalidDataError, 'Custom triggers must be Strings' unless new_val.is_a? String
else
raise JS... | [
"def",
"set_trigger_event",
"(",
"type",
",",
"new_val",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"Trigger type must be one of #{TRIGGER_EVENTS.keys.join(', ')}\"",
"unless",
"TRIGGER_EVENTS",
".",
"key?",
"(",
"type",
")",
"if",
"type",
"==",
":custom",
... | Change a trigger event
@param type[Symbol] the type of trigger, one of the keys of {TRIGGER_EVENTS}
@param new_val[Boolean] whether the type of trigger is active or not.
@return [void] | [
"Change",
"a",
"trigger",
"event"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L756-L765 |
15,816 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.server_side_activation= | def server_side_activation=(activation)
raise JSS::InvalidDataError, 'Activation must be a Time' unless activation.is_a? Time
@server_side_limitations[:activation] = activation
@need_to_update = true
end | ruby | def server_side_activation=(activation)
raise JSS::InvalidDataError, 'Activation must be a Time' unless activation.is_a? Time
@server_side_limitations[:activation] = activation
@need_to_update = true
end | [
"def",
"server_side_activation",
"=",
"(",
"activation",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Activation must be a Time'",
"unless",
"activation",
".",
"is_a?",
"Time",
"@server_side_limitations",
"[",
":activation",
"]",
"=",
"activation",
"@need_to_up... | Set Server Side Activation
@param activation[Time] Activation date and time
@return [void] | [
"Set",
"Server",
"Side",
"Activation"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L773-L777 |
15,817 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.server_side_expiration= | def server_side_expiration=(expiration)
raise JSS::InvalidDataError, 'Expiration must be a Time' unless expiration.is_a? Time
@server_side_limitations[:expiration] = expiration
@need_to_update = true
end | ruby | def server_side_expiration=(expiration)
raise JSS::InvalidDataError, 'Expiration must be a Time' unless expiration.is_a? Time
@server_side_limitations[:expiration] = expiration
@need_to_update = true
end | [
"def",
"server_side_expiration",
"=",
"(",
"expiration",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Expiration must be a Time'",
"unless",
"expiration",
".",
"is_a?",
"Time",
"@server_side_limitations",
"[",
":expiration",
"]",
"=",
"expiration",
"@need_to_up... | Set Server Side Expiration
@param expiration[Time] Expiration date and time
@return [void] | [
"Set",
"Server",
"Side",
"Expiration"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L785-L789 |
15,818 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.user_logged_in= | def user_logged_in=(logged_in_option)
raise JSS::InvalidDataError, "user_logged_in options: #{USER_LOGGED_IN.join(', ')}" unless USER_LOGGED_IN.include? logged_in_option
@reboot_options[:user_logged_in] = logged_in_option
@need_to_update = true
end | ruby | def user_logged_in=(logged_in_option)
raise JSS::InvalidDataError, "user_logged_in options: #{USER_LOGGED_IN.join(', ')}" unless USER_LOGGED_IN.include? logged_in_option
@reboot_options[:user_logged_in] = logged_in_option
@need_to_update = true
end | [
"def",
"user_logged_in",
"=",
"(",
"logged_in_option",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"user_logged_in options: #{USER_LOGGED_IN.join(', ')}\"",
"unless",
"USER_LOGGED_IN",
".",
"include?",
"logged_in_option",
"@reboot_options",
"[",
":user_logged_in",
"... | What to do at reboot when there is a User Logged In
@param logged_in_option[String] Any one of the Strings from USER_LOGGED_IN
@return [void] | [
"What",
"to",
"do",
"at",
"reboot",
"when",
"there",
"is",
"a",
"User",
"Logged",
"In"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L879-L883 |
15,819 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.reboot_message= | def reboot_message=(message)
raise JSS::InvalidDataError, 'Reboot message must be a String' unless message.is_a? String
@reboot_options[:message] = message
@need_to_update = true
end | ruby | def reboot_message=(message)
raise JSS::InvalidDataError, 'Reboot message must be a String' unless message.is_a? String
@reboot_options[:message] = message
@need_to_update = true
end | [
"def",
"reboot_message",
"=",
"(",
"message",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Reboot message must be a String'",
"unless",
"message",
".",
"is_a?",
"String",
"@reboot_options",
"[",
":message",
"]",
"=",
"message",
"@need_to_update",
"=",
"true... | Set Reboot Message
@param reboot_message[String] Text of Reboot Message
@return [void] description of returned object | [
"Set",
"Reboot",
"Message"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L891-L895 |
15,820 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.startup_disk= | def startup_disk=(startup_disk_option)
raise JSS::InvalidDataError, "#{startup_disk_option} is not a valid Startup Disk" unless startup_disk_option.is_a? String
@reboot_options[:startup_disk] = 'Specify Local Startup Disk'
self.specify_startup = startup_disk_option
@need_to_update = true
end | ruby | def startup_disk=(startup_disk_option)
raise JSS::InvalidDataError, "#{startup_disk_option} is not a valid Startup Disk" unless startup_disk_option.is_a? String
@reboot_options[:startup_disk] = 'Specify Local Startup Disk'
self.specify_startup = startup_disk_option
@need_to_update = true
end | [
"def",
"startup_disk",
"=",
"(",
"startup_disk_option",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"#{startup_disk_option} is not a valid Startup Disk\"",
"unless",
"startup_disk_option",
".",
"is_a?",
"String",
"@reboot_options",
"[",
":startup_disk",
"]",
"=",
... | Set Startup Disk
Only Supports 'Specify Local Startup Disk' at the moment
@param startup_disk_option[String]
@return [void] | [
"Set",
"Startup",
"Disk",
"Only",
"Supports",
"Specify",
"Local",
"Startup",
"Disk",
"at",
"the",
"moment"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L905-L910 |
15,821 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.specify_startup= | def specify_startup=(startup_volume)
raise JSS::InvalidDataError, "#{startup_volume} is not a valid Startup Disk" unless startup_volume.is_a? String
@reboot_options[:specify_startup] = startup_volume
@need_to_update = true
end | ruby | def specify_startup=(startup_volume)
raise JSS::InvalidDataError, "#{startup_volume} is not a valid Startup Disk" unless startup_volume.is_a? String
@reboot_options[:specify_startup] = startup_volume
@need_to_update = true
end | [
"def",
"specify_startup",
"=",
"(",
"startup_volume",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"#{startup_volume} is not a valid Startup Disk\"",
"unless",
"startup_volume",
".",
"is_a?",
"String",
"@reboot_options",
"[",
":specify_startup",
"]",
"=",
"startu... | Specify Startup Volume
Only Supports "Specify Local Startup Disk"
@param startup_volume[String] a Volume to reboot to
@return [void] | [
"Specify",
"Startup",
"Volume",
"Only",
"Supports",
"Specify",
"Local",
"Startup",
"Disk"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L919-L923 |
15,822 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.minutes_until_reboot= | def minutes_until_reboot=(minutes)
raise JSS::InvalidDataError, 'Minutes until reboot must be an Integer' unless minutes.is_a? Integer
@reboot_options[:minutes_until_reboot] = minutes
@need_to_update = true
end | ruby | def minutes_until_reboot=(minutes)
raise JSS::InvalidDataError, 'Minutes until reboot must be an Integer' unless minutes.is_a? Integer
@reboot_options[:minutes_until_reboot] = minutes
@need_to_update = true
end | [
"def",
"minutes_until_reboot",
"=",
"(",
"minutes",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Minutes until reboot must be an Integer'",
"unless",
"minutes",
".",
"is_a?",
"Integer",
"@reboot_options",
"[",
":minutes_until_reboot",
"]",
"=",
"minutes",
"@nee... | Reboot Options
Minutes Until Reboot
@param minutes[String] The number of minutes to delay prior to reboot
@return [void] | [
"Reboot",
"Options",
"Minutes",
"Until",
"Reboot"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L944-L948 |
15,823 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.run_command= | def run_command=(command)
raise JSS::InvalidDataError, 'Command to run must be a String' unless command.is_a? String
@files_processes[:run_command] = command
@need_to_update = true
end | ruby | def run_command=(command)
raise JSS::InvalidDataError, 'Command to run must be a String' unless command.is_a? String
@files_processes[:run_command] = command
@need_to_update = true
end | [
"def",
"run_command",
"=",
"(",
"command",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Command to run must be a String'",
"unless",
"command",
".",
"is_a?",
"String",
"@files_processes",
"[",
":run_command",
"]",
"=",
"command",
"@need_to_update",
"=",
"tr... | Set the unix shell command to be run on the client
@param command[String] the unix shell command to be run on the client
@return [void] | [
"Set",
"the",
"unix",
"shell",
"command",
"to",
"be",
"run",
"on",
"the",
"client"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L978-L982 |
15,824 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.set_search_for_process | def set_search_for_process(process, kill = false)
@files_processes[:search_for_process] = process.to_s
@files_processes[:kill_process] = kill ? true : false
@need_to_update = true
end | ruby | def set_search_for_process(process, kill = false)
@files_processes[:search_for_process] = process.to_s
@files_processes[:kill_process] = kill ? true : false
@need_to_update = true
end | [
"def",
"set_search_for_process",
"(",
"process",
",",
"kill",
"=",
"false",
")",
"@files_processes",
"[",
":search_for_process",
"]",
"=",
"process",
".",
"to_s",
"@files_processes",
"[",
":kill_process",
"]",
"=",
"kill",
"?",
"true",
":",
"false",
"@need_to_up... | Set the process name to search for, and if it should be killed if found.
Setter methods (which end with =) can't easily take
multiple arguments, so we instead name them "set_blah_blah"
rather than "blah_blah="
@param process[String] the process name to search for
@param kill[Boolean] should be process be killed... | [
"Set",
"the",
"process",
"name",
"to",
"search",
"for",
"and",
"if",
"it",
"should",
"be",
"killed",
"if",
"found",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1026-L1030 |
15,825 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.set_search_by_path | def set_search_by_path(path, delete = false)
raise JSS::InvalidDataError, 'Path to search for must be a String or a Pathname' unless path.is_a?(String) || path.is_a?(Pathname)
@files_processes[:search_by_path] = path.to_s
@files_processes[:delete_file] = delete ? true : false
@need_to_update = t... | ruby | def set_search_by_path(path, delete = false)
raise JSS::InvalidDataError, 'Path to search for must be a String or a Pathname' unless path.is_a?(String) || path.is_a?(Pathname)
@files_processes[:search_by_path] = path.to_s
@files_processes[:delete_file] = delete ? true : false
@need_to_update = t... | [
"def",
"set_search_by_path",
"(",
"path",
",",
"delete",
"=",
"false",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Path to search for must be a String or a Pathname'",
"unless",
"path",
".",
"is_a?",
"(",
"String",
")",
"||",
"path",
".",
"is_a?",
"(",
... | Set the path to search for, a String or Pathname, and whether or not to delete it if found.
Setter methods (which end with =) can't easily take
multiple arguments, so we instead name them "set_blah_blah"
rather than "blah_blah="
@param path[String,Pathname] the path to search for
@param delete[Boolean] should t... | [
"Set",
"the",
"path",
"to",
"search",
"for",
"a",
"String",
"or",
"Pathname",
"and",
"whether",
"or",
"not",
"to",
"delete",
"it",
"if",
"found",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1057-L1062 |
15,826 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.spotlight_search= | def spotlight_search=(term)
raise JSS::InvalidDataError, 'Spotlight search term must be a String' unless term.is_a? String
@files_processes[:spotlight_search] = term
@need_to_update = true
end | ruby | def spotlight_search=(term)
raise JSS::InvalidDataError, 'Spotlight search term must be a String' unless term.is_a? String
@files_processes[:spotlight_search] = term
@need_to_update = true
end | [
"def",
"spotlight_search",
"=",
"(",
"term",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Spotlight search term must be a String'",
"unless",
"term",
".",
"is_a?",
"String",
"@files_processes",
"[",
":spotlight_search",
"]",
"=",
"term",
"@need_to_update",
"=... | Set the term to seach for using spotlight
@param term[String] the term to seach for using spotlight
@return [void] | [
"Set",
"the",
"term",
"to",
"seach",
"for",
"using",
"spotlight"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1076-L1080 |
15,827 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.locate_file= | def locate_file=(term)
raise JSS::InvalidDataError, 'Term to locate must be a String' unless term.is_a? String
@files_processes[:locate_file] = term
@need_to_update = true
end | ruby | def locate_file=(term)
raise JSS::InvalidDataError, 'Term to locate must be a String' unless term.is_a? String
@files_processes[:locate_file] = term
@need_to_update = true
end | [
"def",
"locate_file",
"=",
"(",
"term",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Term to locate must be a String'",
"unless",
"term",
".",
"is_a?",
"String",
"@files_processes",
"[",
":locate_file",
"]",
"=",
"term",
"@need_to_update",
"=",
"true",
"e... | Set the term to seach for using the locate command
@param term[String] the term to seach for using the locate command
@return [void] | [
"Set",
"the",
"term",
"to",
"seach",
"for",
"using",
"the",
"locate",
"command"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1094-L1098 |
15,828 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.add_package | def add_package(identifier, **opts)
id = validate_package_opts(identifier, opts)
return nil if @packages.map { |p| p[:id] }.include? id
name = JSS::Package.map_all_ids_to(:name, api: @api)[id]
pkg_data = {
id: id,
name: name,
action: PACKAGE_ACTIONS[opts[:action]],
... | ruby | def add_package(identifier, **opts)
id = validate_package_opts(identifier, opts)
return nil if @packages.map { |p| p[:id] }.include? id
name = JSS::Package.map_all_ids_to(:name, api: @api)[id]
pkg_data = {
id: id,
name: name,
action: PACKAGE_ACTIONS[opts[:action]],
... | [
"def",
"add_package",
"(",
"identifier",
",",
"**",
"opts",
")",
"id",
"=",
"validate_package_opts",
"(",
"identifier",
",",
"opts",
")",
"return",
"nil",
"if",
"@packages",
".",
"map",
"{",
"|",
"p",
"|",
"p",
"[",
":id",
"]",
"}",
".",
"include?",
... | Add a package to the list of pkgs handled by this policy.
If the pkg already exists in the policy, nil is returned and
no changes are made.
@param [String,Integer] identifier the name or id of the package to add to this policy
@param position [Symbol, Integer] where to add this pkg among the list of
pkgs. Zero... | [
"Add",
"a",
"package",
"to",
"the",
"list",
"of",
"pkgs",
"handled",
"by",
"this",
"policy",
".",
"If",
"the",
"pkg",
"already",
"exists",
"in",
"the",
"policy",
"nil",
"is",
"returned",
"and",
"no",
"changes",
"are",
"made",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1136-L1156 |
15,829 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.remove_package | def remove_package(identifier)
removed = @packages.delete_if { |p| p[:id] == identifier || p[:name] == identifier }
@need_to_update = true if removed
removed
end | ruby | def remove_package(identifier)
removed = @packages.delete_if { |p| p[:id] == identifier || p[:name] == identifier }
@need_to_update = true if removed
removed
end | [
"def",
"remove_package",
"(",
"identifier",
")",
"removed",
"=",
"@packages",
".",
"delete_if",
"{",
"|",
"p",
"|",
"p",
"[",
":id",
"]",
"==",
"identifier",
"||",
"p",
"[",
":name",
"]",
"==",
"identifier",
"}",
"@need_to_update",
"=",
"true",
"if",
"... | Remove a package from this policy by name or id
@param identfier [String,Integer] the name or id of the package to remove
@return [Array, nil] the new packages array or nil if no change | [
"Remove",
"a",
"package",
"from",
"this",
"policy",
"by",
"name",
"or",
"id"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1164-L1168 |
15,830 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.add_script | def add_script(identifier, **opts)
id = validate_script_opts(identifier, opts)
return nil if @scripts.map { |s| s[:id] }.include? id
name = JSS::Script.map_all_ids_to(:name, api: @api)[id]
script_data = {
id: id,
name: name,
priority: SCRIPT_PRIORITIES[opts[:priority]]... | ruby | def add_script(identifier, **opts)
id = validate_script_opts(identifier, opts)
return nil if @scripts.map { |s| s[:id] }.include? id
name = JSS::Script.map_all_ids_to(:name, api: @api)[id]
script_data = {
id: id,
name: name,
priority: SCRIPT_PRIORITIES[opts[:priority]]... | [
"def",
"add_script",
"(",
"identifier",
",",
"**",
"opts",
")",
"id",
"=",
"validate_script_opts",
"(",
"identifier",
",",
"opts",
")",
"return",
"nil",
"if",
"@scripts",
".",
"map",
"{",
"|",
"s",
"|",
"s",
"[",
":id",
"]",
"}",
".",
"include?",
"id... | Add a script to the list of SCRIPT_PRIORITIESipts run by this policy.
If the script already exists in the policy, nil is returned and
no changes are made.
@param [String,Integer] identifier the name or id of the script to add to this policy
@param [Hash] opts the options for this script
@option [Symbol, Integer... | [
"Add",
"a",
"script",
"to",
"the",
"list",
"of",
"SCRIPT_PRIORITIESipts",
"run",
"by",
"this",
"policy",
".",
"If",
"the",
"script",
"already",
"exists",
"in",
"the",
"policy",
"nil",
"is",
"returned",
"and",
"no",
"changes",
"are",
"made",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1221-L1246 |
15,831 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.remove_script | def remove_script(identifier)
removed = @scripts.delete_if { |s| s[:id] == identifier || s[:name] == identifier }
@need_to_update = true if removed
removed
end | ruby | def remove_script(identifier)
removed = @scripts.delete_if { |s| s[:id] == identifier || s[:name] == identifier }
@need_to_update = true if removed
removed
end | [
"def",
"remove_script",
"(",
"identifier",
")",
"removed",
"=",
"@scripts",
".",
"delete_if",
"{",
"|",
"s",
"|",
"s",
"[",
":id",
"]",
"==",
"identifier",
"||",
"s",
"[",
":name",
"]",
"==",
"identifier",
"}",
"@need_to_update",
"=",
"true",
"if",
"re... | Remove a script from this policy by name or id
@param identfier [String,Integer] the name or id of the script to remove
@return [Array, nil] the new scripts array or nil if no change | [
"Remove",
"a",
"script",
"from",
"this",
"policy",
"by",
"name",
"or",
"id"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1254-L1258 |
15,832 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.run | def run(show_output = false)
return nil unless enabled?
output = JSS::Client.run_jamf('policy', "-id #{id}", show_output)
return nil if output.include? 'No policies were found for the ID'
$CHILD_STATUS.exitstatus.zero? ? true : false
end | ruby | def run(show_output = false)
return nil unless enabled?
output = JSS::Client.run_jamf('policy', "-id #{id}", show_output)
return nil if output.include? 'No policies were found for the ID'
$CHILD_STATUS.exitstatus.zero? ? true : false
end | [
"def",
"run",
"(",
"show_output",
"=",
"false",
")",
"return",
"nil",
"unless",
"enabled?",
"output",
"=",
"JSS",
"::",
"Client",
".",
"run_jamf",
"(",
"'policy'",
",",
"\"-id #{id}\"",
",",
"show_output",
")",
"return",
"nil",
"if",
"output",
".",
"includ... | Actions
Try to execute this policy on this machine.
@param show_output[Boolean] should the stdout and stderr of the
'jamf policy' command be sent to stdout in realtime?
@return [Boolean, nil] The success of the 'jamf policy' command, or nil
if the policy couldn't be executed (out of scope, policy disabled, et... | [
"Actions",
"Try",
"to",
"execute",
"this",
"policy",
"on",
"this",
"machine",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1306-L1311 |
15,833 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.flush_logs | def flush_logs(older_than: 0, period: :days)
raise JSS::NoSuchItemError, "Policy doesn't exist in the JSS. Use #create first." unless @in_jss
unless LOG_FLUSH_INTERVAL_INTEGERS.key?(older_than)
raise JSS::InvalidDataError, "older_than must be one of these integers: #{LOG_FLUSH_INTERVAL_INTEGERS.key... | ruby | def flush_logs(older_than: 0, period: :days)
raise JSS::NoSuchItemError, "Policy doesn't exist in the JSS. Use #create first." unless @in_jss
unless LOG_FLUSH_INTERVAL_INTEGERS.key?(older_than)
raise JSS::InvalidDataError, "older_than must be one of these integers: #{LOG_FLUSH_INTERVAL_INTEGERS.key... | [
"def",
"flush_logs",
"(",
"older_than",
":",
"0",
",",
"period",
":",
":days",
")",
"raise",
"JSS",
"::",
"NoSuchItemError",
",",
"\"Policy doesn't exist in the JSS. Use #create first.\"",
"unless",
"@in_jss",
"unless",
"LOG_FLUSH_INTERVAL_INTEGERS",
".",
"key?",
"(",
... | Flush all policy logs for this policy older than
some number of days, weeks, months or years.
With no parameters, flushes all logs
NOTE: Currently the API doesn't have a way to
flush only failed policies.
@param older_than[Integer] 0, 1, 2, 3, or 6
@param period[Symbol] :days, :weeks, :months, or :years
@re... | [
"Flush",
"all",
"policy",
"logs",
"for",
"this",
"policy",
"older",
"than",
"some",
"number",
"of",
"days",
"weeks",
"months",
"or",
"years",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1328-L1342 |
15,834 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.validate_package_opts | def validate_package_opts(identifier, opts)
opts[:position] ||= -1
opts[:action] ||= :install
opts[:feu] ||= false
opts[:fut] ||= false
opts[:update_autorun] ||= false
opts[:position] =
case opts[:position]
when :start then 0
when :end then -1
else JS... | ruby | def validate_package_opts(identifier, opts)
opts[:position] ||= -1
opts[:action] ||= :install
opts[:feu] ||= false
opts[:fut] ||= false
opts[:update_autorun] ||= false
opts[:position] =
case opts[:position]
when :start then 0
when :end then -1
else JS... | [
"def",
"validate_package_opts",
"(",
"identifier",
",",
"opts",
")",
"opts",
"[",
":position",
"]",
"||=",
"-",
"1",
"opts",
"[",
":action",
"]",
"||=",
":install",
"opts",
"[",
":feu",
"]",
"||=",
"false",
"opts",
"[",
":fut",
"]",
"||=",
"false",
"op... | raise an error if a package being added isn't valid
@see #add_package
@return [Integer, nil] the valid id for the package | [
"raise",
"an",
"error",
"if",
"a",
"package",
"being",
"added",
"isn",
"t",
"valid"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1355-L1383 |
15,835 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/policy.rb | JSS.Policy.validate_script_opts | def validate_script_opts(identifier, opts)
opts[:position] ||= -1
opts[:priority] ||= :after
raise JSS::InvalidDataError, "priority must be one of: :#{SCRIPT_PRIORITIES.keys.join ', :'}" unless \
SCRIPT_PRIORITIES.include? opts[:priority]
opts[:position] =
case opts[:position]
... | ruby | def validate_script_opts(identifier, opts)
opts[:position] ||= -1
opts[:priority] ||= :after
raise JSS::InvalidDataError, "priority must be one of: :#{SCRIPT_PRIORITIES.keys.join ', :'}" unless \
SCRIPT_PRIORITIES.include? opts[:priority]
opts[:position] =
case opts[:position]
... | [
"def",
"validate_script_opts",
"(",
"identifier",
",",
"opts",
")",
"opts",
"[",
":position",
"]",
"||=",
"-",
"1",
"opts",
"[",
":priority",
"]",
"||=",
":after",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"priority must be one of: :#{SCRIPT_PRIORITIES.keys.j... | raise an error if a script being added isn't valid
@see #add_script
@return [Integer, nil] the valid id for the package | [
"raise",
"an",
"error",
"if",
"a",
"script",
"being",
"added",
"isn",
"t",
"valid"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/policy.rb#L1391-L1411 |
15,836 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/extension_attribute.rb | JSS.ExtensionAttribute.web_display= | def web_display=(new_val)
return nil if @web_display == new_val
raise JSS::InvalidDataError, "inventory_display must be a string, one of: #{INVENTORY_DISPLAY_CHOICES.join(', ')}" unless WEB_DISPLAY_CHOICES.include? new_val
@web_display = new_val
@need_to_update = true
end | ruby | def web_display=(new_val)
return nil if @web_display == new_val
raise JSS::InvalidDataError, "inventory_display must be a string, one of: #{INVENTORY_DISPLAY_CHOICES.join(', ')}" unless WEB_DISPLAY_CHOICES.include? new_val
@web_display = new_val
@need_to_update = true
end | [
"def",
"web_display",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"@web_display",
"==",
"new_val",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"inventory_display must be a string, one of: #{INVENTORY_DISPLAY_CHOICES.join(', ')}\"",
"unless",
"WEB_DISPLAY_CHOICES",
"... | Change the inventory_display of this EA
@param new_val[String] the new value, which must be a member of INVENTORY_DISPLAY_CHOICES
@return [void] | [
"Change",
"the",
"inventory_display",
"of",
"this",
"EA"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/extension_attribute.rb#L214-L219 |
15,837 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/extension_attribute.rb | JSS.ExtensionAttribute.input_type= | def input_type=(new_val)
return nil if @input_type == new_val
raise JSS::InvalidDataError, "input_type must be a string, one of: #{INPUT_TYPES.join(', ')}" unless INPUT_TYPES.include? new_val
@input_type = new_val
@popup_choices = nil if @input_type == 'Text Field'
@need_to_update = true
... | ruby | def input_type=(new_val)
return nil if @input_type == new_val
raise JSS::InvalidDataError, "input_type must be a string, one of: #{INPUT_TYPES.join(', ')}" unless INPUT_TYPES.include? new_val
@input_type = new_val
@popup_choices = nil if @input_type == 'Text Field'
@need_to_update = true
... | [
"def",
"input_type",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"@input_type",
"==",
"new_val",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"input_type must be a string, one of: #{INPUT_TYPES.join(', ')}\"",
"unless",
"INPUT_TYPES",
".",
"include?",
"new_val",
... | Change the input type of this EA
@param new_val[String] the new value, which must be a member of INPUT_TYPES
@return [void] | [
"Change",
"the",
"input",
"type",
"of",
"this",
"EA"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/extension_attribute.rb#L227-L233 |
15,838 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/extension_attribute.rb | JSS.ExtensionAttribute.popup_choices= | def popup_choices=(new_val)
return nil if @popup_choices == new_val
raise JSS::InvalidDataError, 'popup_choices must be an Array' unless new_val.is_a?(Array)
# convert each one to a String,
# and check that it matches the @data_type
new_val.map! do |v|
v = v.to_s.strip
cas... | ruby | def popup_choices=(new_val)
return nil if @popup_choices == new_val
raise JSS::InvalidDataError, 'popup_choices must be an Array' unless new_val.is_a?(Array)
# convert each one to a String,
# and check that it matches the @data_type
new_val.map! do |v|
v = v.to_s.strip
cas... | [
"def",
"popup_choices",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"@popup_choices",
"==",
"new_val",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'popup_choices must be an Array'",
"unless",
"new_val",
".",
"is_a?",
"(",
"Array",
")",
"# convert each one t... | Change the Popup Choices of this EA
New value must be an Array, the items will be converted to Strings.
This automatically sets input_type to "Pop-up Menu"
Values are checked to ensure they match the @data_type
Note, Dates must be in the format "YYYY-MM-DD hh:mm:ss"
@param new_val[Array<#to_s>] the new values
... | [
"Change",
"the",
"Popup",
"Choices",
"of",
"this",
"EA",
"New",
"value",
"must",
"be",
"an",
"Array",
"the",
"items",
"will",
"be",
"converted",
"to",
"Strings",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/extension_attribute.rb#L247-L266 |
15,839 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/extension_attribute.rb | JSS.ExtensionAttribute.all_with_result | def all_with_result(search_type, desired_value)
raise JSS::NoSuchItemError, "EA Not In JSS! Use #create to create this #{self.class::RSRC_OBJECT_KEY}." unless @in_jss
raise JSS::InvalidDataError, 'Invalid search_type, see JSS::Criteriable::Criterion::SEARCH_TYPES' unless JSS::Criteriable::Criterion::SEARCH_... | ruby | def all_with_result(search_type, desired_value)
raise JSS::NoSuchItemError, "EA Not In JSS! Use #create to create this #{self.class::RSRC_OBJECT_KEY}." unless @in_jss
raise JSS::InvalidDataError, 'Invalid search_type, see JSS::Criteriable::Criterion::SEARCH_TYPES' unless JSS::Criteriable::Criterion::SEARCH_... | [
"def",
"all_with_result",
"(",
"search_type",
",",
"desired_value",
")",
"raise",
"JSS",
"::",
"NoSuchItemError",
",",
"\"EA Not In JSS! Use #create to create this #{self.class::RSRC_OBJECT_KEY}.\"",
"unless",
"@in_jss",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'Invali... | Get an Array of Hashes for all inventory objects
with a desired result in their latest report for this EA.
Each Hash is one inventory object (computer, mobile device, user), with these keys:
:id - the computer id
:name - the computer name
:value - the matching ext attr value for the objects latest report.
... | [
"Get",
"an",
"Array",
"of",
"Hashes",
"for",
"all",
"inventory",
"objects",
"with",
"a",
"desired",
"result",
"in",
"their",
"latest",
"report",
"for",
"this",
"EA",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/extension_attribute.rb#L288-L314 |
15,840 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/extension_attribute.rb | JSS.ExtensionAttribute.rest_rexml | def rest_rexml
ea = REXML::Element.new self.class::RSRC_OBJECT_KEY.to_s
ea.add_element('name').text = @name
ea.add_element('description').text = @description
ea.add_element('data_type').text = @data_type
ea.add_element('inventory_display').text = @web_display
it = ea.add_element('in... | ruby | def rest_rexml
ea = REXML::Element.new self.class::RSRC_OBJECT_KEY.to_s
ea.add_element('name').text = @name
ea.add_element('description').text = @description
ea.add_element('data_type').text = @data_type
ea.add_element('inventory_display').text = @web_display
it = ea.add_element('in... | [
"def",
"rest_rexml",
"ea",
"=",
"REXML",
"::",
"Element",
".",
"new",
"self",
".",
"class",
"::",
"RSRC_OBJECT_KEY",
".",
"to_s",
"ea",
".",
"add_element",
"(",
"'name'",
")",
".",
"text",
"=",
"@name",
"ea",
".",
"add_element",
"(",
"'description'",
")"... | Return a REXML object for this ext attr, with the current values.
Subclasses should augment this in their rest_xml methods
then return it .to_s, for saving or updating | [
"Return",
"a",
"REXML",
"object",
"for",
"this",
"ext",
"attr",
"with",
"the",
"current",
"values",
".",
"Subclasses",
"should",
"augment",
"this",
"in",
"their",
"rest_xml",
"methods",
"then",
"return",
"it",
".",
"to_s",
"for",
"saving",
"or",
"updating"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/extension_attribute.rb#L394-L408 |
15,841 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/extension_attribute/computer_extension_attribute.rb | JSS.ComputerExtensionAttribute.recon_display= | def recon_display= (new_val)
return nil if @recon_display == new_val
raise JSS::InvalidDataError, "recon_display must be a string, one of: #{RECON_DISPLAY_CHOICES.join(", ")}" unless RECON_DISPLAY_CHOICES.include? new_val
@recon_display = new_val
@need_to_update = true
end | ruby | def recon_display= (new_val)
return nil if @recon_display == new_val
raise JSS::InvalidDataError, "recon_display must be a string, one of: #{RECON_DISPLAY_CHOICES.join(", ")}" unless RECON_DISPLAY_CHOICES.include? new_val
@recon_display = new_val
@need_to_update = true
end | [
"def",
"recon_display",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"@recon_display",
"==",
"new_val",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"recon_display must be a string, one of: #{RECON_DISPLAY_CHOICES.join(\", \")}\"",
"unless",
"RECON_DISPLAY_CHOICES",
"... | Change the recon_display of this EA | [
"Change",
"the",
"recon_display",
"of",
"this",
"EA"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/extension_attribute/computer_extension_attribute.rb#L180-L185 |
15,842 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/patch_source/patch_external_source.rb | JSS.PatchExternalSource.validate_host_port | def validate_host_port(action)
raise JSS::UnsupportedError, "Cannot #{action} without first setting a host_name and port" if host_name.to_s.empty? || port.to_s.empty?
end | ruby | def validate_host_port(action)
raise JSS::UnsupportedError, "Cannot #{action} without first setting a host_name and port" if host_name.to_s.empty? || port.to_s.empty?
end | [
"def",
"validate_host_port",
"(",
"action",
")",
"raise",
"JSS",
"::",
"UnsupportedError",
",",
"\"Cannot #{action} without first setting a host_name and port\"",
"if",
"host_name",
".",
"to_s",
".",
"empty?",
"||",
"port",
".",
"to_s",
".",
"empty?",
"end"
] | raise an exeption if needed when trying to do something that needs
a host and port set
@param action[String] The action that needs a host and port
@return [void] | [
"raise",
"an",
"exeption",
"if",
"needed",
"when",
"trying",
"to",
"do",
"something",
"that",
"needs",
"a",
"host",
"and",
"port",
"set"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/patch_source/patch_external_source.rb#L139-L141 |
15,843 | PixarAnimationStudios/ruby-jss | lib/jss/db_connection.rb | JSS.DBConnection.valid_server? | def valid_server?(server, port = DFT_PORT)
mysql = Mysql.init
mysql.options Mysql::OPT_CONNECT_TIMEOUT, 5
begin
# this connection should get an access denied error if there is
# a mysql server there. I'm assuming no one will use this username
# and pw for anything real
... | ruby | def valid_server?(server, port = DFT_PORT)
mysql = Mysql.init
mysql.options Mysql::OPT_CONNECT_TIMEOUT, 5
begin
# this connection should get an access denied error if there is
# a mysql server there. I'm assuming no one will use this username
# and pw for anything real
... | [
"def",
"valid_server?",
"(",
"server",
",",
"port",
"=",
"DFT_PORT",
")",
"mysql",
"=",
"Mysql",
".",
"init",
"mysql",
".",
"options",
"Mysql",
"::",
"OPT_CONNECT_TIMEOUT",
",",
"5",
"begin",
"# this connection should get an access denied error if there is",
"# a mysq... | disconnect
Test that a given hostname is a MySQL server
@param server[String] The hostname to test
@return [Boolean] does the server host a MySQL server? | [
"disconnect",
"Test",
"that",
"a",
"given",
"hostname",
"is",
"a",
"MySQL",
"server"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/db_connection.rb#L240-L256 |
15,844 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_self_service_category | def add_self_service_category(new_cat, display_in: true, feature_in: false)
new_cat = JSS::Category.map_all_ids_to(:name, api: @api)[new_cat] if new_cat.is_a? Integer
feature_in = false if display_in == false
raise JSS::NoSuchItemError, "No category '#{new_cat}' in the JSS" unless JSS::Category.all_na... | ruby | def add_self_service_category(new_cat, display_in: true, feature_in: false)
new_cat = JSS::Category.map_all_ids_to(:name, api: @api)[new_cat] if new_cat.is_a? Integer
feature_in = false if display_in == false
raise JSS::NoSuchItemError, "No category '#{new_cat}' in the JSS" unless JSS::Category.all_na... | [
"def",
"add_self_service_category",
"(",
"new_cat",
",",
"display_in",
":",
"true",
",",
"feature_in",
":",
"false",
")",
"new_cat",
"=",
"JSS",
"::",
"Category",
".",
"map_all_ids_to",
"(",
":name",
",",
"api",
":",
"@api",
")",
"[",
"new_cat",
"]",
"if",... | Add or change one of the categories for this item in self service
@param new_cat[String, Integer] the name or id of a category where this
object should appear in SelfSvc
@param display_in[Boolean] should this item appear in the SelfSvc page for
the category? Only meaningful in applicable classes
@param featu... | [
"Add",
"or",
"change",
"one",
"of",
"the",
"categories",
"for",
"this",
"item",
"in",
"self",
"service"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L431-L454 |
15,845 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.self_service_user_removable= | def self_service_user_removable=(new_val, pw = @self_service_removal_password)
new_val, pw = *new_val if new_val.is_a? Array
pw = nil unless new_val == :with_auth
return if new_val == self_service_user_removable && pw == self_service_removal_password
validate_user_removable new_val
@sel... | ruby | def self_service_user_removable=(new_val, pw = @self_service_removal_password)
new_val, pw = *new_val if new_val.is_a? Array
pw = nil unless new_val == :with_auth
return if new_val == self_service_user_removable && pw == self_service_removal_password
validate_user_removable new_val
@sel... | [
"def",
"self_service_user_removable",
"=",
"(",
"new_val",
",",
"pw",
"=",
"@self_service_removal_password",
")",
"new_val",
",",
"pw",
"=",
"new_val",
"if",
"new_val",
".",
"is_a?",
"Array",
"pw",
"=",
"nil",
"unless",
"new_val",
"==",
":with_auth",
"return",
... | Set the value for user-removability of profiles, optionally
providing a password for removal, on iOS targets.
@param new_val[Symbol] One of the keys of PROFILE_REMOVAL_BY_USER,
:always, :never, or :with_auth
@param pw[String] A new password to use if removable :with_auth
@return [void] | [
"Set",
"the",
"value",
"for",
"user",
"-",
"removability",
"of",
"profiles",
"optionally",
"providing",
"a",
"password",
"for",
"removal",
"on",
"iOS",
"targets",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L479-L490 |
15,846 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.self_service_notification_type= | def self_service_notification_type=(type)
validate_notifications_supported
# HACK: Until jamf fixes bugs, you can only set notifications
# :off or :ssvc_only. If you want :ssvc_and_nctr, you must
# check the checkbox in the web-UI.
if @self_service_data_config[:notifications_supported] ==... | ruby | def self_service_notification_type=(type)
validate_notifications_supported
# HACK: Until jamf fixes bugs, you can only set notifications
# :off or :ssvc_only. If you want :ssvc_and_nctr, you must
# check the checkbox in the web-UI.
if @self_service_data_config[:notifications_supported] ==... | [
"def",
"self_service_notification_type",
"=",
"(",
"type",
")",
"validate_notifications_supported",
"# HACK: Until jamf fixes bugs, you can only set notifications",
"# :off or :ssvc_only. If you want :ssvc_and_nctr, you must",
"# check the checkbox in the web-UI.",
"if",
"@self_service_data_co... | How should self service notifications be displayed
@param type[Symbol] A key from SelfServable::NOTIFICATION_TYPES
@return [void] | [
"How",
"should",
"self",
"service",
"notifications",
"be",
"displayed"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L512-L526 |
15,847 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.self_service_reminder_frequency= | def self_service_reminder_frequency=(days)
return if days == self_service_reminder_frequency
validate_notification_reminders_supported
JSS::Validate.integer days
@self_service_reminder_frequency = days
@need_to_update = true
end | ruby | def self_service_reminder_frequency=(days)
return if days == self_service_reminder_frequency
validate_notification_reminders_supported
JSS::Validate.integer days
@self_service_reminder_frequency = days
@need_to_update = true
end | [
"def",
"self_service_reminder_frequency",
"=",
"(",
"days",
")",
"return",
"if",
"days",
"==",
"self_service_reminder_frequency",
"validate_notification_reminders_supported",
"JSS",
"::",
"Validate",
".",
"integer",
"days",
"@self_service_reminder_frequency",
"=",
"days",
"... | set reminder notification frequency
@param new_val[Integer] How many days between reminder notifications?
@return [void] | [
"set",
"reminder",
"notification",
"frequency"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L572-L578 |
15,848 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.icon= | def icon=(new_icon)
if new_icon.is_a? Integer
return if @icon && new_icon == @icon.id
validate_icon new_icon
@new_icon_id = new_icon
@need_to_update = true
else
unless uploadable? && defined?(self.class::UPLOAD_TYPES) && self.class::UPLOAD_TYPES.key?(:icon)
... | ruby | def icon=(new_icon)
if new_icon.is_a? Integer
return if @icon && new_icon == @icon.id
validate_icon new_icon
@new_icon_id = new_icon
@need_to_update = true
else
unless uploadable? && defined?(self.class::UPLOAD_TYPES) && self.class::UPLOAD_TYPES.key?(:icon)
... | [
"def",
"icon",
"=",
"(",
"new_icon",
")",
"if",
"new_icon",
".",
"is_a?",
"Integer",
"return",
"if",
"@icon",
"&&",
"new_icon",
"==",
"@icon",
".",
"id",
"validate_icon",
"new_icon",
"@new_icon_id",
"=",
"new_icon",
"@need_to_update",
"=",
"true",
"else",
"u... | Set a new Self Service icon for this object.
Since JSS::Icon objects are read-only,
the icon can only be changed by supplying the id number
of an icon already existing in the JSS, or a path to
a local file, which will be uploaded to the JSS and added
to this instance. Uploads
take effect immediately, but if an ... | [
"Set",
"a",
"new",
"Self",
"Service",
"icon",
"for",
"this",
"object",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L594-L609 |
15,849 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.parse_self_service_notifications | def parse_self_service_notifications(ss_data)
return unless @self_service_data_config[:notifications_supported]
# oldstyle/broken, we need the XML to know if notifications are turned on
if @self_service_data_config[:notifications_supported] == :ssvc_only && @in_jss
ssrsrc = "#{rest_rsrc}/subs... | ruby | def parse_self_service_notifications(ss_data)
return unless @self_service_data_config[:notifications_supported]
# oldstyle/broken, we need the XML to know if notifications are turned on
if @self_service_data_config[:notifications_supported] == :ssvc_only && @in_jss
ssrsrc = "#{rest_rsrc}/subs... | [
"def",
"parse_self_service_notifications",
"(",
"ss_data",
")",
"return",
"unless",
"@self_service_data_config",
"[",
":notifications_supported",
"]",
"# oldstyle/broken, we need the XML to know if notifications are turned on",
"if",
"@self_service_data_config",
"[",
":notifications_su... | parse incoming ssvc notification settings | [
"parse",
"incoming",
"ssvc",
"notification",
"settings"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L760-L788 |
15,850 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_self_service_xml | def add_self_service_xml(xdoc)
doc_root = xdoc.root
# whether or not we're in self service is usually not in the
# ssvc subset...
add_in_self_service_xml doc_root
subset_key = @self_service_data_config[:self_service_subset] ? @self_service_data_config[:self_service_subset] : :self_servic... | ruby | def add_self_service_xml(xdoc)
doc_root = xdoc.root
# whether or not we're in self service is usually not in the
# ssvc subset...
add_in_self_service_xml doc_root
subset_key = @self_service_data_config[:self_service_subset] ? @self_service_data_config[:self_service_subset] : :self_servic... | [
"def",
"add_self_service_xml",
"(",
"xdoc",
")",
"doc_root",
"=",
"xdoc",
".",
"root",
"# whether or not we're in self service is usually not in the",
"# ssvc subset...",
"add_in_self_service_xml",
"doc_root",
"subset_key",
"=",
"@self_service_data_config",
"[",
":self_service_su... | refresh icon
Add approriate XML for self service data to the XML document for this
item.
@param xdoc[REXML::Document] The XML Document to which we're adding Self
Service data
@return [void] | [
"refresh",
"icon",
"Add",
"approriate",
"XML",
"for",
"self",
"service",
"data",
"to",
"the",
"XML",
"document",
"for",
"this",
"item",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L814-L840 |
15,851 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_in_self_service_xml | def add_in_self_service_xml(doc_root)
return unless @self_service_data_config[:in_self_service_data_path]
in_ss_section, in_ss_elem = @self_service_data_config[:in_self_service_data_path]
in_ss_value = @in_self_service ? @self_service_data_config[:in_self_service] : @self_service_data_config[:not_in... | ruby | def add_in_self_service_xml(doc_root)
return unless @self_service_data_config[:in_self_service_data_path]
in_ss_section, in_ss_elem = @self_service_data_config[:in_self_service_data_path]
in_ss_value = @in_self_service ? @self_service_data_config[:in_self_service] : @self_service_data_config[:not_in... | [
"def",
"add_in_self_service_xml",
"(",
"doc_root",
")",
"return",
"unless",
"@self_service_data_config",
"[",
":in_self_service_data_path",
"]",
"in_ss_section",
",",
"in_ss_elem",
"=",
"@self_service_data_config",
"[",
":in_self_service_data_path",
"]",
"in_ss_value",
"=",
... | add_self_service_xml
add the correct XML indicating whether or not we're even in SSvc | [
"add_self_service_xml",
"add",
"the",
"correct",
"XML",
"indicating",
"whether",
"or",
"not",
"we",
"re",
"even",
"in",
"SSvc"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L843-L853 |
15,852 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_self_service_profile_xml | def add_self_service_profile_xml(ssvc, doc_root)
return unless self_service_payload == :profile
if self_service_targets.include? :ios
sec = ssvc.add_element('security')
sec.add_element('removal_disallowed').text = PROFILE_REMOVAL_BY_USER[@self_service_user_removable]
sec.add_element(... | ruby | def add_self_service_profile_xml(ssvc, doc_root)
return unless self_service_payload == :profile
if self_service_targets.include? :ios
sec = ssvc.add_element('security')
sec.add_element('removal_disallowed').text = PROFILE_REMOVAL_BY_USER[@self_service_user_removable]
sec.add_element(... | [
"def",
"add_self_service_profile_xml",
"(",
"ssvc",
",",
"doc_root",
")",
"return",
"unless",
"self_service_payload",
"==",
":profile",
"if",
"self_service_targets",
".",
"include?",
":ios",
"sec",
"=",
"ssvc",
".",
"add_element",
"(",
"'security'",
")",
"sec",
".... | add the xml specific to profiles | [
"add",
"the",
"xml",
"specific",
"to",
"profiles"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L856-L866 |
15,853 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_self_service_category_xml | def add_self_service_category_xml(ssvc)
cats = ssvc.add_element('self_service_categories')
return if self_service_categories.empty?
self_service_categories.each do |cat|
catelem = cats.add_element('category')
catelem.add_element('name').text = cat[:name]
catelem.add_element('di... | ruby | def add_self_service_category_xml(ssvc)
cats = ssvc.add_element('self_service_categories')
return if self_service_categories.empty?
self_service_categories.each do |cat|
catelem = cats.add_element('category')
catelem.add_element('name').text = cat[:name]
catelem.add_element('di... | [
"def",
"add_self_service_category_xml",
"(",
"ssvc",
")",
"cats",
"=",
"ssvc",
".",
"add_element",
"(",
"'self_service_categories'",
")",
"return",
"if",
"self_service_categories",
".",
"empty?",
"self_service_categories",
".",
"each",
"do",
"|",
"cat",
"|",
"catele... | add the xml for self-service categories | [
"add",
"the",
"xml",
"for",
"self",
"-",
"service",
"categories"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L869-L878 |
15,854 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_self_service_macos_xml | def add_self_service_macos_xml(ssvc)
return unless self_service_targets.include? :macos
ssvc.add_element('self_service_display_name').text = self_service_display_name if self_service_display_name
ssvc.add_element('install_button_text').text = self_service_install_button_text if self_service_install_bu... | ruby | def add_self_service_macos_xml(ssvc)
return unless self_service_targets.include? :macos
ssvc.add_element('self_service_display_name').text = self_service_display_name if self_service_display_name
ssvc.add_element('install_button_text').text = self_service_install_button_text if self_service_install_bu... | [
"def",
"add_self_service_macos_xml",
"(",
"ssvc",
")",
"return",
"unless",
"self_service_targets",
".",
"include?",
":macos",
"ssvc",
".",
"add_element",
"(",
"'self_service_display_name'",
")",
".",
"text",
"=",
"self_service_display_name",
"if",
"self_service_display_na... | set macOS settings in ssvc xml | [
"set",
"macOS",
"settings",
"in",
"ssvc",
"xml"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L881-L887 |
15,855 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.add_self_service_notification_xml | def add_self_service_notification_xml(ssvc)
return unless @self_service_data_config[:notifications_supported]
# oldstyle/broken, only sscv notifs
if @self_service_data_config[:notifications_supported] == :ssvc_only
ssvc.add_element('notification').text = self_service_notifications_enabled.to_... | ruby | def add_self_service_notification_xml(ssvc)
return unless @self_service_data_config[:notifications_supported]
# oldstyle/broken, only sscv notifs
if @self_service_data_config[:notifications_supported] == :ssvc_only
ssvc.add_element('notification').text = self_service_notifications_enabled.to_... | [
"def",
"add_self_service_notification_xml",
"(",
"ssvc",
")",
"return",
"unless",
"@self_service_data_config",
"[",
":notifications_supported",
"]",
"# oldstyle/broken, only sscv notifs",
"if",
"@self_service_data_config",
"[",
":notifications_supported",
"]",
"==",
":ssvc_only",... | set ssvc notification settings in xml | [
"set",
"ssvc",
"notification",
"settings",
"in",
"xml"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L891-L915 |
15,856 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.validate_user_removable | def validate_user_removable(new_val)
raise JSS::UnsupportedError, 'User removal settings not applicable to this class' unless self_service_payload == :profile
raise JSS::UnsupportedError, 'Removal :with_auth not applicable to this class' if new_val == :with_auth && !self_service_targets.include?(:ios)
... | ruby | def validate_user_removable(new_val)
raise JSS::UnsupportedError, 'User removal settings not applicable to this class' unless self_service_payload == :profile
raise JSS::UnsupportedError, 'Removal :with_auth not applicable to this class' if new_val == :with_auth && !self_service_targets.include?(:ios)
... | [
"def",
"validate_user_removable",
"(",
"new_val",
")",
"raise",
"JSS",
"::",
"UnsupportedError",
",",
"'User removal settings not applicable to this class'",
"unless",
"self_service_payload",
"==",
":profile",
"raise",
"JSS",
"::",
"UnsupportedError",
",",
"'Removal :with_aut... | Raise an error if user_removable settings are wrong | [
"Raise",
"an",
"error",
"if",
"user_removable",
"settings",
"are",
"wrong"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L918-L924 |
15,857 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/self_servable.rb | JSS.SelfServable.validate_icon | def validate_icon(id)
return nil unless JSS::DB_CNX.connected?
raise JSS::NoSuchItemError, "No icon with id #{id}" unless JSS::Icon.all_ids.include? id
end | ruby | def validate_icon(id)
return nil unless JSS::DB_CNX.connected?
raise JSS::NoSuchItemError, "No icon with id #{id}" unless JSS::Icon.all_ids.include? id
end | [
"def",
"validate_icon",
"(",
"id",
")",
"return",
"nil",
"unless",
"JSS",
"::",
"DB_CNX",
".",
"connected?",
"raise",
"JSS",
"::",
"NoSuchItemError",
",",
"\"No icon with id #{id}\"",
"unless",
"JSS",
"::",
"Icon",
".",
"all_ids",
".",
"include?",
"id",
"end"
... | Raise an error if an icon id is not valid | [
"Raise",
"an",
"error",
"if",
"an",
"icon",
"id",
"is",
"not",
"valid"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/self_servable.rb#L927-L930 |
15,858 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/advanced_search.rb | JSS.AdvancedSearch.update | def update(get_results = false)
orig_timeout = @api.cnx.options[:timeout]
@api.timeout = 1800
super()
requery_search_results if get_results
@api.timeout = orig_timeout
@id # remember to return the id
end | ruby | def update(get_results = false)
orig_timeout = @api.cnx.options[:timeout]
@api.timeout = 1800
super()
requery_search_results if get_results
@api.timeout = orig_timeout
@id # remember to return the id
end | [
"def",
"update",
"(",
"get_results",
"=",
"false",
")",
"orig_timeout",
"=",
"@api",
".",
"cnx",
".",
"options",
"[",
":timeout",
"]",
"@api",
".",
"timeout",
"=",
"1800",
"super",
"(",
")",
"requery_search_results",
"if",
"get_results",
"@api",
".",
"time... | Save any changes
If get_results is true, they'll be available in {#search_results}. This might be slow.
@param get_results[Boolean] should the results of the search be queried immediately?
@return [Integer] the id of the updated search | [
"Save",
"any",
"changes"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/advanced_search.rb#L191-L199 |
15,859 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/advanced_search.rb | JSS.AdvancedSearch.requery_search_results | def requery_search_results
orig_open_timeout = @api.cnx.options[:open_timeout]
orig_timeout = @api.cnx.options[:timeout]
@api.timeout = 1800
@api.open_timeout = 1800
begin
requery = self.class.fetch(id: @id)
@search_results = requery.search_results
@result_display_k... | ruby | def requery_search_results
orig_open_timeout = @api.cnx.options[:open_timeout]
orig_timeout = @api.cnx.options[:timeout]
@api.timeout = 1800
@api.open_timeout = 1800
begin
requery = self.class.fetch(id: @id)
@search_results = requery.search_results
@result_display_k... | [
"def",
"requery_search_results",
"orig_open_timeout",
"=",
"@api",
".",
"cnx",
".",
"options",
"[",
":open_timeout",
"]",
"orig_timeout",
"=",
"@api",
".",
"cnx",
".",
"options",
"[",
":timeout",
"]",
"@api",
".",
"timeout",
"=",
"1800",
"@api",
".",
"open_t... | Requery the API for the search results.
This can be very slow, so temporarily reset the API timeout to 30 minutes
@return [Array<Hash>] the new search results | [
"Requery",
"the",
"API",
"for",
"the",
"search",
"results",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/advanced_search.rb#L207-L220 |
15,860 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/advanced_search.rb | JSS.AdvancedSearch.display_fields= | def display_fields=(new_val)
raise JSS::InvalidDataError, 'display_fields must be an Array.' unless new_val.is_a? Array
return if new_val.sort == @display_fields.sort
@display_fields = new_val
@need_to_update = true
end | ruby | def display_fields=(new_val)
raise JSS::InvalidDataError, 'display_fields must be an Array.' unless new_val.is_a? Array
return if new_val.sort == @display_fields.sort
@display_fields = new_val
@need_to_update = true
end | [
"def",
"display_fields",
"=",
"(",
"new_val",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'display_fields must be an Array.'",
"unless",
"new_val",
".",
"is_a?",
"Array",
"return",
"if",
"new_val",
".",
"sort",
"==",
"@display_fields",
".",
"sort",
"@disp... | Set the list of fields to be retrieved with the
search results.
@param new_val[Array<String>] the new field names | [
"Set",
"the",
"list",
"of",
"fields",
"to",
"be",
"retrieved",
"with",
"the",
"search",
"results",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/advanced_search.rb#L244-L249 |
15,861 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/advanced_search.rb | JSS.AdvancedSearch.export | def export(output_file, format = :csv, overwrite = false)
raise JSS::InvalidDataError, "Export format must be one of: :#{EXPORT_FORMATS.join ', :'}" unless EXPORT_FORMATS.include? format
out = Pathname.new output_file
unless overwrite
raise JSS::AlreadyExistsError, "The output file already e... | ruby | def export(output_file, format = :csv, overwrite = false)
raise JSS::InvalidDataError, "Export format must be one of: :#{EXPORT_FORMATS.join ', :'}" unless EXPORT_FORMATS.include? format
out = Pathname.new output_file
unless overwrite
raise JSS::AlreadyExistsError, "The output file already e... | [
"def",
"export",
"(",
"output_file",
",",
"format",
"=",
":csv",
",",
"overwrite",
"=",
"false",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"Export format must be one of: :#{EXPORT_FORMATS.join ', :'}\"",
"unless",
"EXPORT_FORMATS",
".",
"include?",
"format",... | Export the display fields of the search results to a file.
@param output_file[String,Pathname] The file in which to store the exported results
@param format[Symbol] one of :csv, :tab, or :xml, defaults to :csv
@param overwrite[Boolean] should the output_file be overwrite if it exists? Defaults to false
@return ... | [
"Export",
"the",
"display",
"fields",
"of",
"the",
"search",
"results",
"to",
"a",
"file",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/advanced_search.rb#L272-L311 |
15,862 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/advanced_search.rb | JSS.AdvancedSearch.rest_xml | def rest_xml
doc = REXML::Document.new APIConnection::XML_HEADER
acs = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
acs.add_element('name').text = @name
acs.add_element('sort_1').text = @sort_1 if @sort_1
acs.add_element('sort_2').text = @sort_2 if @sort_2
acs.add_element('sort_3... | ruby | def rest_xml
doc = REXML::Document.new APIConnection::XML_HEADER
acs = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
acs.add_element('name').text = @name
acs.add_element('sort_1').text = @sort_1 if @sort_1
acs.add_element('sort_2').text = @sort_2 if @sort_2
acs.add_element('sort_3... | [
"def",
"rest_xml",
"doc",
"=",
"REXML",
"::",
"Document",
".",
"new",
"APIConnection",
"::",
"XML_HEADER",
"acs",
"=",
"doc",
".",
"add_element",
"self",
".",
"class",
"::",
"RSRC_OBJECT_KEY",
".",
"to_s",
"acs",
".",
"add_element",
"(",
"'name'",
")",
"."... | Clean up the inconsistent "Display Field" keys in the search results.
Sometimes spaces have been converted to underscores, sometimes not, sometimes both.
Same for dashes.
E.g :"Last Check-in"/:Last_Check_in/:"Last_Check-in", :Computer_Name, and :"Display Name"/:Display_Name
This ensures there's always the fully ... | [
"Clean",
"up",
"the",
"inconsistent",
"Display",
"Field",
"keys",
"in",
"the",
"search",
"results",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/advanced_search.rb#L337-L351 |
15,863 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.deploy_as_managed_app= | def deploy_as_managed_app=(new_val)
return nil if new_val == @deploy_as_managed_app
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@deploy_as_managed_app = new_val
@need_to_update = true
end | ruby | def deploy_as_managed_app=(new_val)
return nil if new_val == @deploy_as_managed_app
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@deploy_as_managed_app = new_val
@need_to_update = true
end | [
"def",
"deploy_as_managed_app",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@deploy_as_managed_app",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_boolean?",
"@deploy_as_managed_ap... | Set whether or not this app should be deployed as managed
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"this",
"app",
"should",
"be",
"deployed",
"as",
"managed"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L284-L289 |
15,864 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.remove_app_when_mdm_profile_is_removed= | def remove_app_when_mdm_profile_is_removed=(new_val)
return nil if new_val == @remove_app_when_mdm_profile_is_removed
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@remove_app_when_mdm_profile_is_removed = new_val
@need_to_update = true
end | ruby | def remove_app_when_mdm_profile_is_removed=(new_val)
return nil if new_val == @remove_app_when_mdm_profile_is_removed
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@remove_app_when_mdm_profile_is_removed = new_val
@need_to_update = true
end | [
"def",
"remove_app_when_mdm_profile_is_removed",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@remove_app_when_mdm_profile_is_removed",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_b... | Set whether or not this app should be removed when
the device is unmanaged
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"this",
"app",
"should",
"be",
"removed",
"when",
"the",
"device",
"is",
"unmanaged"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L299-L304 |
15,865 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.prevent_backup_of_app_data= | def prevent_backup_of_app_data=(new_val)
return nil if new_val == @prevent_backup_of_app_data
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@prevent_backup_of_app_data = new_val
@need_to_update = true
end | ruby | def prevent_backup_of_app_data=(new_val)
return nil if new_val == @prevent_backup_of_app_data
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@prevent_backup_of_app_data = new_val
@need_to_update = true
end | [
"def",
"prevent_backup_of_app_data",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@prevent_backup_of_app_data",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_boolean?",
"@prevent_ba... | Set whether or not the device should back up this app's data
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"the",
"device",
"should",
"back",
"up",
"this",
"app",
"s",
"data"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L312-L317 |
15,866 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.keep_description_and_icon_up_to_date= | def keep_description_and_icon_up_to_date=(new_val)
return nil if new_val == @keep_description_and_icon_up_to_date
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@keep_description_and_icon_up_to_date = new_val
@need_to_update = true
end | ruby | def keep_description_and_icon_up_to_date=(new_val)
return nil if new_val == @keep_description_and_icon_up_to_date
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@keep_description_and_icon_up_to_date = new_val
@need_to_update = true
end | [
"def",
"keep_description_and_icon_up_to_date",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@keep_description_and_icon_up_to_date",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_boole... | Set whether or not the jss should update info about this app from the app store
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"the",
"jss",
"should",
"update",
"info",
"about",
"this",
"app",
"from",
"the",
"app",
"store"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L326-L331 |
15,867 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.free= | def free=(new_val)
return nil if new_val == @free
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@free = new_val
@need_to_update = true
end | ruby | def free=(new_val)
return nil if new_val == @free
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@free = new_val
@need_to_update = true
end | [
"def",
"free",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@free",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_boolean?",
"@free",
"=",
"new_val",
"@need_to_update",
"=",... | Set whether or not this is a free app
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"this",
"is",
"a",
"free",
"app"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L339-L344 |
15,868 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.take_over_management= | def take_over_management=(new_val)
return nil if new_val == @take_over_management
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@take_over_management = new_val
@need_to_update = true
end | ruby | def take_over_management=(new_val)
return nil if new_val == @take_over_management
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@take_over_management = new_val
@need_to_update = true
end | [
"def",
"take_over_management",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@take_over_management",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_boolean?",
"@take_over_management",... | Set whether or not Jamf should manage this app even if the user installed
it on their own.
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"Jamf",
"should",
"manage",
"this",
"app",
"even",
"if",
"the",
"user",
"installed",
"it",
"on",
"their",
"own",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L353-L358 |
15,869 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.host_externally= | def host_externally=(new_val)
return nil if new_val == @host_externally
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@host_externally = new_val
@need_to_update = true
end | ruby | def host_externally=(new_val)
return nil if new_val == @host_externally
raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
@host_externally = new_val
@need_to_update = true
end | [
"def",
"host_externally",
"=",
"(",
"new_val",
")",
"return",
"nil",
"if",
"new_val",
"==",
"@host_externally",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be true or false'",
"unless",
"new_val",
".",
"jss_boolean?",
"@host_externally",
"=",
"new_... | Set whether or not this app's .ipa is hosted outside the Jamf server
@param new_val[Boolean] The new value
@return [void] | [
"Set",
"whether",
"or",
"not",
"this",
"app",
"s",
".",
"ipa",
"is",
"hosted",
"outside",
"the",
"Jamf",
"server"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L390-L395 |
15,870 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/mobile_device_application.rb | JSS.MobileDeviceApplication.save_ipa | def save_ipa(path, overwrite = false)
return nil unless @ipa[:data]
path = Pathname.new path
path = path + @ipa[:name] if path.directory? && @ipa[:name]
raise JSS::AlreadyExistsError, "The file #{path} already exists" if path.exist? && !overwrite
path.delete if path.exist?
path.jss_... | ruby | def save_ipa(path, overwrite = false)
return nil unless @ipa[:data]
path = Pathname.new path
path = path + @ipa[:name] if path.directory? && @ipa[:name]
raise JSS::AlreadyExistsError, "The file #{path} already exists" if path.exist? && !overwrite
path.delete if path.exist?
path.jss_... | [
"def",
"save_ipa",
"(",
"path",
",",
"overwrite",
"=",
"false",
")",
"return",
"nil",
"unless",
"@ipa",
"[",
":data",
"]",
"path",
"=",
"Pathname",
".",
"new",
"path",
"path",
"=",
"path",
"+",
"@ipa",
"[",
":name",
"]",
"if",
"path",
".",
"directory... | Save the application to a file.
@param path[Pathname, String] The path to which the file should be saved.
If the path given is an existing directory, the ipa's current filename will
be used, if known.
@param overwrite[Boolean] Overwrite the file if it exists? Defaults to false
@return [void] | [
"Save",
"the",
"application",
"to",
"a",
"file",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/mobile_device_application.rb#L433-L441 |
15,871 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/computer.rb | JSS.Computer.management_data | def management_data(subset: nil, only: nil)
raise JSS::NoSuchItemError, 'Computer not yet saved in the JSS' unless @in_jss
JSS::Computer.management_data @id, subset: subset, only: only, api: @api
end | ruby | def management_data(subset: nil, only: nil)
raise JSS::NoSuchItemError, 'Computer not yet saved in the JSS' unless @in_jss
JSS::Computer.management_data @id, subset: subset, only: only, api: @api
end | [
"def",
"management_data",
"(",
"subset",
":",
"nil",
",",
"only",
":",
"nil",
")",
"raise",
"JSS",
"::",
"NoSuchItemError",
",",
"'Computer not yet saved in the JSS'",
"unless",
"@in_jss",
"JSS",
"::",
"Computer",
".",
"management_data",
"@id",
",",
"subset",
":... | app usage
The 'computer management' data for this computer
NOTE: the data isn't cached locally, and the API is queried every time
@see {JSS::Computer.management_data} for details | [
"app",
"usage",
"The",
"computer",
"management",
"data",
"for",
"this",
"computer"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/computer.rb#L886-L889 |
15,872 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/computer.rb | JSS.Computer.set_management_to | def set_management_to(name, password)
password = nil unless name
@management_username = name
@management_password = password
@managed = name ? true : false
@need_to_update = true
end | ruby | def set_management_to(name, password)
password = nil unless name
@management_username = name
@management_password = password
@managed = name ? true : false
@need_to_update = true
end | [
"def",
"set_management_to",
"(",
"name",
",",
"password",
")",
"password",
"=",
"nil",
"unless",
"name",
"@management_username",
"=",
"name",
"@management_password",
"=",
"password",
"@managed",
"=",
"name",
"?",
"true",
":",
"false",
"@need_to_update",
"=",
"tr... | Set or unset management acct and password for this computer
@param name[String] the name of the management acct.
@param password[String] the password of the management acct
@return [void]
The changes will need to be pushed to the server with {#update}
before they take effect.
CAUTION: this does nothing to co... | [
"Set",
"or",
"unset",
"management",
"acct",
"and",
"password",
"for",
"this",
"computer"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/computer.rb#L953-L959 |
15,873 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/computer.rb | JSS.Computer.rest_xml | def rest_xml
doc = REXML::Document.new APIConnection::XML_HEADER
computer = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
general = computer.add_element('general')
general.add_element('name').text = @name
general.add_element('alt_mac_address').text = @alt_mac_address
general.add_... | ruby | def rest_xml
doc = REXML::Document.new APIConnection::XML_HEADER
computer = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
general = computer.add_element('general')
general.add_element('name').text = @name
general.add_element('alt_mac_address').text = @alt_mac_address
general.add_... | [
"def",
"rest_xml",
"doc",
"=",
"REXML",
"::",
"Document",
".",
"new",
"APIConnection",
"::",
"XML_HEADER",
"computer",
"=",
"doc",
".",
"add_element",
"self",
".",
"class",
"::",
"RSRC_OBJECT_KEY",
".",
"to_s",
"general",
"=",
"computer",
".",
"add_element",
... | Return a String with the XML Resource
for submitting changes to the JSS via
the API
For Computers, only some items can be changed via the API
In particular, any data gatherd by a Recon cannot be changed | [
"Return",
"a",
"String",
"with",
"the",
"XML",
"Resource",
"for",
"submitting",
"changes",
"to",
"the",
"JSS",
"via",
"the",
"API"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/computer.rb#L1113-L1142 |
15,874 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.get_rsrc | def get_rsrc(rsrc, format = :json)
# puts object_id
validate_connected
raise JSS::InvalidDataError, 'format must be :json or :xml' unless %i[json xml].include? format
# TODO: fix what rubocop is complaining about in the line below.
# (I doubt we want to CGI.escape the whole resource)
... | ruby | def get_rsrc(rsrc, format = :json)
# puts object_id
validate_connected
raise JSS::InvalidDataError, 'format must be :json or :xml' unless %i[json xml].include? format
# TODO: fix what rubocop is complaining about in the line below.
# (I doubt we want to CGI.escape the whole resource)
... | [
"def",
"get_rsrc",
"(",
"rsrc",
",",
"format",
"=",
":json",
")",
"# puts object_id",
"validate_connected",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'format must be :json or :xml'",
"unless",
"%i[",
"json",
"xml",
"]",
".",
"include?",
"format",
"# TODO: fix ... | disconnect
Get an arbitrary JSS resource
The first argument is the resource to get (the part of the API url
after the 'JSSResource/' )
By default we get the data in JSON, and parse it
into a ruby data structure (arrays, hashes, strings, etc)
with symbolized Hash keys.
@param rsrc[String] the resource to get
... | [
"disconnect",
"Get",
"an",
"arbitrary",
"JSS",
"resource"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L525-L542 |
15,875 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.put_rsrc | def put_rsrc(rsrc, xml)
validate_connected
# convert CRs & to
xml.gsub!(/\r/, ' ')
# send the data
@last_http_response = @cnx[rsrc].put(xml, content_type: 'text/xml')
rescue RestClient::ExceptionWithResponse => e
handle_http_error e
end | ruby | def put_rsrc(rsrc, xml)
validate_connected
# convert CRs & to
xml.gsub!(/\r/, ' ')
# send the data
@last_http_response = @cnx[rsrc].put(xml, content_type: 'text/xml')
rescue RestClient::ExceptionWithResponse => e
handle_http_error e
end | [
"def",
"put_rsrc",
"(",
"rsrc",
",",
"xml",
")",
"validate_connected",
"# convert CRs & to ",
"xml",
".",
"gsub!",
"(",
"/",
"\\r",
"/",
",",
"' '",
")",
"# send the data",
"@last_http_response",
"=",
"@cnx",
"[",
"rsrc",
"]",
".",
"put",
"(",
"xml"... | Change an existing JSS resource
@param rsrc[String] the API resource being changed, the URL part after 'JSSResource/'
@param xml[String] the xml specifying the changes.
@return [String] the xml response from the server. | [
"Change",
"an",
"existing",
"JSS",
"resource"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L552-L562 |
15,876 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.post_rsrc | def post_rsrc(rsrc, xml = '')
validate_connected
# convert CRs & to
xml.gsub!(/\r/, ' ') if xml
# send the data
@last_http_response = @cnx[rsrc].post xml, content_type: 'text/xml', accept: :json
rescue RestClient::ExceptionWithResponse => e
handle_http_error e
end | ruby | def post_rsrc(rsrc, xml = '')
validate_connected
# convert CRs & to
xml.gsub!(/\r/, ' ') if xml
# send the data
@last_http_response = @cnx[rsrc].post xml, content_type: 'text/xml', accept: :json
rescue RestClient::ExceptionWithResponse => e
handle_http_error e
end | [
"def",
"post_rsrc",
"(",
"rsrc",
",",
"xml",
"=",
"''",
")",
"validate_connected",
"# convert CRs & to ",
"xml",
".",
"gsub!",
"(",
"/",
"\\r",
"/",
",",
"' '",
")",
"if",
"xml",
"# send the data",
"@last_http_response",
"=",
"@cnx",
"[",
"rsrc",
"]... | Create a new JSS resource
@param rsrc[String] the API resource being created, the URL part after 'JSSResource/'
@param xml[String] the xml specifying the new object.
@return [String] the xml response from the server. | [
"Create",
"a",
"new",
"JSS",
"resource"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L572-L582 |
15,877 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.delete_rsrc | def delete_rsrc(rsrc, xml = nil)
validate_connected
raise MissingDataError, 'Missing :rsrc' if rsrc.nil?
# payload?
return delete_with_payload rsrc, xml if xml
# delete the resource
@last_http_response = @cnx[rsrc].delete
rescue RestClient::ExceptionWithResponse => e
hand... | ruby | def delete_rsrc(rsrc, xml = nil)
validate_connected
raise MissingDataError, 'Missing :rsrc' if rsrc.nil?
# payload?
return delete_with_payload rsrc, xml if xml
# delete the resource
@last_http_response = @cnx[rsrc].delete
rescue RestClient::ExceptionWithResponse => e
hand... | [
"def",
"delete_rsrc",
"(",
"rsrc",
",",
"xml",
"=",
"nil",
")",
"validate_connected",
"raise",
"MissingDataError",
",",
"'Missing :rsrc'",
"if",
"rsrc",
".",
"nil?",
"# payload?",
"return",
"delete_with_payload",
"rsrc",
",",
"xml",
"if",
"xml",
"# delete the reso... | post_rsrc
Delete a resource from the JSS
@param rsrc[String] the resource to create, the URL part after 'JSSResource/'
@return [String] the xml response from the server. | [
"post_rsrc",
"Delete",
"a",
"resource",
"from",
"the",
"JSS"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L590-L601 |
15,878 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.master_distribution_point | def master_distribution_point(refresh = false)
@master_distribution_point = nil if refresh
return @master_distribution_point if @master_distribution_point
all_dps = JSS::DistributionPoint.all refresh, api: self
@master_distribution_point =
case all_dps.size
when 0
rai... | ruby | def master_distribution_point(refresh = false)
@master_distribution_point = nil if refresh
return @master_distribution_point if @master_distribution_point
all_dps = JSS::DistributionPoint.all refresh, api: self
@master_distribution_point =
case all_dps.size
when 0
rai... | [
"def",
"master_distribution_point",
"(",
"refresh",
"=",
"false",
")",
"@master_distribution_point",
"=",
"nil",
"if",
"refresh",
"return",
"@master_distribution_point",
"if",
"@master_distribution_point",
"all_dps",
"=",
"JSS",
"::",
"DistributionPoint",
".",
"all",
"r... | Get the DistributionPoint instance for the master
distribution point in the JSS. If there's only one
in the JSS, return it even if not marked as master.
@param refresh[Boolean] re-read from the API?
@return [JSS::DistributionPoint] | [
"Get",
"the",
"DistributionPoint",
"instance",
"for",
"the",
"master",
"distribution",
"point",
"in",
"the",
"JSS",
".",
"If",
"there",
"s",
"only",
"one",
"in",
"the",
"JSS",
"return",
"it",
"even",
"if",
"not",
"marked",
"as",
"master",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L831-L846 |
15,879 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.my_distribution_point | def my_distribution_point(refresh = false)
@my_distribution_point = nil if refresh
return @my_distribution_point if @my_distribution_point
my_net_seg = my_network_segments[0]
@my_distribution_point = JSS::NetworkSegment.fetch(id: my_net_seg, api: self).distribution_point if my_net_seg
@my... | ruby | def my_distribution_point(refresh = false)
@my_distribution_point = nil if refresh
return @my_distribution_point if @my_distribution_point
my_net_seg = my_network_segments[0]
@my_distribution_point = JSS::NetworkSegment.fetch(id: my_net_seg, api: self).distribution_point if my_net_seg
@my... | [
"def",
"my_distribution_point",
"(",
"refresh",
"=",
"false",
")",
"@my_distribution_point",
"=",
"nil",
"if",
"refresh",
"return",
"@my_distribution_point",
"if",
"@my_distribution_point",
"my_net_seg",
"=",
"my_network_segments",
"[",
"0",
"]",
"@my_distribution_point",... | Get the DistributionPoint instance for the machine running
this code, based on its IP address. If none is defined for this IP address,
use the result of master_distribution_point
@param refresh[Boolean] should the distribution point be re-queried?
@return [JSS::DistributionPoint] | [
"Get",
"the",
"DistributionPoint",
"instance",
"for",
"the",
"machine",
"running",
"this",
"code",
"based",
"on",
"its",
"IP",
"address",
".",
"If",
"none",
"is",
"defined",
"for",
"this",
"IP",
"address",
"use",
"the",
"result",
"of",
"master_distribution_poi... | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L856-L864 |
15,880 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.network_segments_for_ip | def network_segments_for_ip(ip)
ok_ip = IPAddr.new(ip)
matches = []
network_ranges.each { |id, subnet| matches << id if subnet.include?(ok_ip) }
matches
end | ruby | def network_segments_for_ip(ip)
ok_ip = IPAddr.new(ip)
matches = []
network_ranges.each { |id, subnet| matches << id if subnet.include?(ok_ip) }
matches
end | [
"def",
"network_segments_for_ip",
"(",
"ip",
")",
"ok_ip",
"=",
"IPAddr",
".",
"new",
"(",
"ip",
")",
"matches",
"=",
"[",
"]",
"network_ranges",
".",
"each",
"{",
"|",
"id",
",",
"subnet",
"|",
"matches",
"<<",
"id",
"if",
"subnet",
".",
"include?",
... | def network_segments
Find the ids of the network segments that contain a given IP address.
Even tho IPAddr.include? will take a String or an IPAddr
I convert the ip to an IPAddr so that an exception will be raised if
the ip isn't a valid ip.
@param ip[String, IPAddr] the IP address to locate
@param refresh[Boo... | [
"def",
"network_segments",
"Find",
"the",
"ids",
"of",
"the",
"network",
"segments",
"that",
"contain",
"a",
"given",
"IP",
"address",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L899-L904 |
15,881 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.send_mobiledevice_mdm_command | def send_mobiledevice_mdm_command(targets, command, data = {})
JSS::MobileDevice.send_mdm_command(targets, command, opts: data, api: self)
end | ruby | def send_mobiledevice_mdm_command(targets, command, data = {})
JSS::MobileDevice.send_mdm_command(targets, command, opts: data, api: self)
end | [
"def",
"send_mobiledevice_mdm_command",
"(",
"targets",
",",
"command",
",",
"data",
"=",
"{",
"}",
")",
"JSS",
"::",
"MobileDevice",
".",
"send_mdm_command",
"(",
"targets",
",",
"command",
",",
"opts",
":",
"data",
",",
"api",
":",
"self",
")",
"end"
] | Send an MDM command to one or more mobile devices managed by
this JSS
see {JSS::MobileDevice.send_mdm_command}
@deprecated Please use JSS::MobileDevice.send_mdm_command or its
convenience methods. @see JSS::MDM | [
"Send",
"an",
"MDM",
"command",
"to",
"one",
"or",
"more",
"mobile",
"devices",
"managed",
"by",
"this",
"JSS"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L922-L924 |
15,882 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.verify_basic_args | def verify_basic_args(args)
# must have server, user, and pw
raise JSS::MissingDataError, 'No JSS :server specified, or in configuration.' unless args[:server]
raise JSS::MissingDataError, 'No JSS :user specified, or in configuration.' unless args[:user]
raise JSS::MissingDataError, "Missing :pw... | ruby | def verify_basic_args(args)
# must have server, user, and pw
raise JSS::MissingDataError, 'No JSS :server specified, or in configuration.' unless args[:server]
raise JSS::MissingDataError, 'No JSS :user specified, or in configuration.' unless args[:user]
raise JSS::MissingDataError, "Missing :pw... | [
"def",
"verify_basic_args",
"(",
"args",
")",
"# must have server, user, and pw",
"raise",
"JSS",
"::",
"MissingDataError",
",",
"'No JSS :server specified, or in configuration.'",
"unless",
"args",
"[",
":server",
"]",
"raise",
"JSS",
"::",
"MissingDataError",
",",
"'No ... | Raise execeptions if we don't have essential data for the connection
@param args[Hash] The args for #connect
@return [void] | [
"Raise",
"execeptions",
"if",
"we",
"don",
"t",
"have",
"essential",
"data",
"for",
"the",
"connection"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L1024-L1029 |
15,883 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.verify_server_version | def verify_server_version
@connected = true
# the jssuser resource is readable by anyone with a JSS acct
# regardless of their permissions.
# However, it's marked as 'deprecated'. Hopefully jamf will
# keep this basic level of info available for basic authentication
# and JSS versio... | ruby | def verify_server_version
@connected = true
# the jssuser resource is readable by anyone with a JSS acct
# regardless of their permissions.
# However, it's marked as 'deprecated'. Hopefully jamf will
# keep this basic level of info available for basic authentication
# and JSS versio... | [
"def",
"verify_server_version",
"@connected",
"=",
"true",
"# the jssuser resource is readable by anyone with a JSS acct",
"# regardless of their permissions.",
"# However, it's marked as 'deprecated'. Hopefully jamf will",
"# keep this basic level of info available for basic authentication",
"# a... | Verify that we can connect with the args provided, and that
the server version is high enough for this version of ruby-jss.
This makes the first API GET call and will raise an exception if things
are wrong, like failed authentication. Will also raise an exception
if the JSS version is too low
(see also JSS::Serve... | [
"Verify",
"that",
"we",
"can",
"connect",
"with",
"the",
"args",
"provided",
"and",
"that",
"the",
"server",
"version",
"is",
"high",
"enough",
"for",
"this",
"version",
"of",
"ruby",
"-",
"jss",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L1041-L1061 |
15,884 | PixarAnimationStudios/ruby-jss | lib/jss/api_connection.rb | JSS.APIConnection.build_rest_url | def build_rest_url(args)
@server_host = args[:server]
@port = args[:port].to_i
if args[:server_path]
# remove leading & trailing slashes in serverpath if any
@server_path = args[:server_path].sub %r{^/*(.*?)/*$}, Regexp.last_match(1)
# re-add single trailing slash
@ser... | ruby | def build_rest_url(args)
@server_host = args[:server]
@port = args[:port].to_i
if args[:server_path]
# remove leading & trailing slashes in serverpath if any
@server_path = args[:server_path].sub %r{^/*(.*?)/*$}, Regexp.last_match(1)
# re-add single trailing slash
@ser... | [
"def",
"build_rest_url",
"(",
"args",
")",
"@server_host",
"=",
"args",
"[",
":server",
"]",
"@port",
"=",
"args",
"[",
":port",
"]",
".",
"to_i",
"if",
"args",
"[",
":server_path",
"]",
"# remove leading & trailing slashes in serverpath if any",
"@server_path",
"... | Build the base URL for the API connection
@param args[Hash] The args for #connect
@return [String] The URI encoded URL | [
"Build",
"the",
"base",
"URL",
"for",
"the",
"API",
"connection"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_connection.rb#L1069-L1090 |
15,885 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/sitable.rb | JSS.Sitable.site= | def site=(new_site)
return nil unless updatable? || creatable?
# unset the site? Use nil or an empty string
if NON_SITES.include? new_site
unset_site
return
end
new_id = JSS::Site.valid_id new_site, api: @api
new_name = JSS::Site.map_all_ids_to(:name, api: @api)[new... | ruby | def site=(new_site)
return nil unless updatable? || creatable?
# unset the site? Use nil or an empty string
if NON_SITES.include? new_site
unset_site
return
end
new_id = JSS::Site.valid_id new_site, api: @api
new_name = JSS::Site.map_all_ids_to(:name, api: @api)[new... | [
"def",
"site",
"=",
"(",
"new_site",
")",
"return",
"nil",
"unless",
"updatable?",
"||",
"creatable?",
"# unset the site? Use nil or an empty string",
"if",
"NON_SITES",
".",
"include?",
"new_site",
"unset_site",
"return",
"end",
"new_id",
"=",
"JSS",
"::",
"Site",
... | cat assigned?
Change the site of this object.
Any of the NON_SITES values will
unset the site
@param new_site[Integer, String] The new site
@return [void] | [
"cat",
"assigned?",
"Change",
"the",
"site",
"of",
"this",
"object",
".",
"Any",
"of",
"the",
"NON_SITES",
"values",
"will",
"unset",
"the",
"site"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/sitable.rb#L120-L139 |
15,886 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/sitable.rb | JSS.Sitable.parse_site | def parse_site
site_data =
if self.class::SITE_SUBSET == :top
@init_data[:site]
elsif @init_data[self.class::SITE_SUBSET]
@init_data[self.class::SITE_SUBSET][:site]
end
site_data ||= { name: NO_SITE_NAME, id: NO_SITE_ID }
@site_name = site_data[:name]
... | ruby | def parse_site
site_data =
if self.class::SITE_SUBSET == :top
@init_data[:site]
elsif @init_data[self.class::SITE_SUBSET]
@init_data[self.class::SITE_SUBSET][:site]
end
site_data ||= { name: NO_SITE_NAME, id: NO_SITE_ID }
@site_name = site_data[:name]
... | [
"def",
"parse_site",
"site_data",
"=",
"if",
"self",
".",
"class",
"::",
"SITE_SUBSET",
"==",
":top",
"@init_data",
"[",
":site",
"]",
"elsif",
"@init_data",
"[",
"self",
".",
"class",
"::",
"SITE_SUBSET",
"]",
"@init_data",
"[",
"self",
".",
"class",
"::"... | Parse the site data from any incoming API data
@return [void] | [
"Parse",
"the",
"site",
"data",
"from",
"any",
"incoming",
"API",
"data"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/sitable.rb#L161-L172 |
15,887 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/sitable.rb | JSS.Sitable.add_site_to_xml | def add_site_to_xml(xmldoc)
root = xmldoc.root
site_elem =
if self.class::SITE_SUBSET == :top
root.add_element 'site'
else
parent_elem = root.elements[self.class::SITE_SUBSET.to_s]
parent_elem ||= root.add_element(self.class::SITE_SUBSET.to_s)
parent_e... | ruby | def add_site_to_xml(xmldoc)
root = xmldoc.root
site_elem =
if self.class::SITE_SUBSET == :top
root.add_element 'site'
else
parent_elem = root.elements[self.class::SITE_SUBSET.to_s]
parent_elem ||= root.add_element(self.class::SITE_SUBSET.to_s)
parent_e... | [
"def",
"add_site_to_xml",
"(",
"xmldoc",
")",
"root",
"=",
"xmldoc",
".",
"root",
"site_elem",
"=",
"if",
"self",
".",
"class",
"::",
"SITE_SUBSET",
"==",
":top",
"root",
".",
"add_element",
"'site'",
"else",
"parent_elem",
"=",
"root",
".",
"elements",
"[... | parse site
Add the site to the XML for POSTing or PUTting to the API.
@param xmldoc[REXML::Document] The in-construction XML document
@return [void] | [
"parse",
"site",
"Add",
"the",
"site",
"to",
"the",
"XML",
"for",
"POSTing",
"or",
"PUTting",
"to",
"the",
"API",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/sitable.rb#L180-L191 |
15,888 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/peripheral.rb | JSS.Peripheral.associate | def associate(computer)
if computer =~ /^d+$/
raise JSS::NoSuchItemError, "No computer in the JSS with id #{computer}" unless JSS::Computer.all_ids(api: @api).include? computer
@computer_id = computer
else
raise JSS::NoSuchItemError, "No computer in the JSS with name #{computer}" unl... | ruby | def associate(computer)
if computer =~ /^d+$/
raise JSS::NoSuchItemError, "No computer in the JSS with id #{computer}" unless JSS::Computer.all_ids(api: @api).include? computer
@computer_id = computer
else
raise JSS::NoSuchItemError, "No computer in the JSS with name #{computer}" unl... | [
"def",
"associate",
"(",
"computer",
")",
"if",
"computer",
"=~",
"/",
"/",
"raise",
"JSS",
"::",
"NoSuchItemError",
",",
"\"No computer in the JSS with id #{computer}\"",
"unless",
"JSS",
"::",
"Computer",
".",
"all_ids",
"(",
"api",
":",
"@api",
")",
".",
"i... | Associate this peripheral with a computer.
@param computer[String,Integer] the name or id of a computer in the JSS
@return [void] | [
"Associate",
"this",
"peripheral",
"with",
"a",
"computer",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/peripheral.rb#L233-L242 |
15,889 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/peripheral.rb | JSS.Peripheral.check_field | def check_field(field, value)
### get the field defs for this PeriphType, omitting the leading nil
@field_defs ||= JSS::PeripheralType.fetch(:name => @type, api: @api).fields.compact
### we must have the right number of fields, and they must have the same names
### as the definition
requi... | ruby | def check_field(field, value)
### get the field defs for this PeriphType, omitting the leading nil
@field_defs ||= JSS::PeripheralType.fetch(:name => @type, api: @api).fields.compact
### we must have the right number of fields, and they must have the same names
### as the definition
requi... | [
"def",
"check_field",
"(",
"field",
",",
"value",
")",
"### get the field defs for this PeriphType, omitting the leading nil",
"@field_defs",
"||=",
"JSS",
"::",
"PeripheralType",
".",
"fetch",
"(",
":name",
"=>",
"@type",
",",
"api",
":",
"@api",
")",
".",
"fields"... | check a field, the field name must match those defined in
the appropriate peripheral type.
If a field is a menu field, the value must also be one of those defined
in the periph type.
Raise an exception if wrong. | [
"check",
"a",
"field",
"the",
"field",
"name",
"must",
"match",
"those",
"defined",
"in",
"the",
"appropriate",
"peripheral",
"type",
".",
"If",
"a",
"field",
"is",
"a",
"menu",
"field",
"the",
"value",
"must",
"also",
"be",
"one",
"of",
"those",
"define... | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/peripheral.rb#L270-L286 |
15,890 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/patch_policy.rb | JSS.PatchPolicy.validate_patch_title | def validate_patch_title(a_title)
if a_title.is_a? JSS::PatchTitle
@patch_title = a_title
return a_title.id
end
raise JSS::MissingDataError, ':patch_title is required' unless a_title
title_id = JSS::PatchTitle.valid_id a_title
return title_id if title_id
raise JSS::No... | ruby | def validate_patch_title(a_title)
if a_title.is_a? JSS::PatchTitle
@patch_title = a_title
return a_title.id
end
raise JSS::MissingDataError, ':patch_title is required' unless a_title
title_id = JSS::PatchTitle.valid_id a_title
return title_id if title_id
raise JSS::No... | [
"def",
"validate_patch_title",
"(",
"a_title",
")",
"if",
"a_title",
".",
"is_a?",
"JSS",
"::",
"PatchTitle",
"@patch_title",
"=",
"a_title",
"return",
"a_title",
".",
"id",
"end",
"raise",
"JSS",
"::",
"MissingDataError",
",",
"':patch_title is required'",
"unles... | raise an error if the patch title we're trying to use isn't available in
the jss. If handed a PatchTitle instance, we assume it came from the JSS
@param new_title[String,Integer,JSS::PatchTitle] the title to validate
@return [Integer] the id of the valid title | [
"raise",
"an",
"error",
"if",
"the",
"patch",
"title",
"we",
"re",
"trying",
"to",
"use",
"isn",
"t",
"available",
"in",
"the",
"jss",
".",
"If",
"handed",
"a",
"PatchTitle",
"instance",
"we",
"assume",
"it",
"came",
"from",
"the",
"JSS"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/patch_policy.rb#L543-L552 |
15,891 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/patch_policy.rb | JSS.PatchPolicy.validate_target_version | def validate_target_version(tgt_vers)
raise JSS::MissingDataError, "target_version can't be nil" unless tgt_vers
JSS::Validate.non_empty_string tgt_vers
unless patch_title(:refresh).versions.key? tgt_vers
errmsg = "Version '#{tgt_vers}' does not exist for title: #{patch_title_name}."
... | ruby | def validate_target_version(tgt_vers)
raise JSS::MissingDataError, "target_version can't be nil" unless tgt_vers
JSS::Validate.non_empty_string tgt_vers
unless patch_title(:refresh).versions.key? tgt_vers
errmsg = "Version '#{tgt_vers}' does not exist for title: #{patch_title_name}."
... | [
"def",
"validate_target_version",
"(",
"tgt_vers",
")",
"raise",
"JSS",
"::",
"MissingDataError",
",",
"\"target_version can't be nil\"",
"unless",
"tgt_vers",
"JSS",
"::",
"Validate",
".",
"non_empty_string",
"tgt_vers",
"unless",
"patch_title",
"(",
":refresh",
")",
... | raise an exception if a given target version is not valid for this policy
Otherwise return it | [
"raise",
"an",
"exception",
"if",
"a",
"given",
"target",
"version",
"is",
"not",
"valid",
"for",
"this",
"policy",
"Otherwise",
"return",
"it"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/patch_policy.rb#L557-L571 |
15,892 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/patch_policy.rb | JSS.PatchPolicy.refetch_version_info | def refetch_version_info
tmp = self.class.fetch id: id
@release_date = tmp.release_date
@incremental_update = tmp.incremental_update
@reboot = tmp.reboot
@minimum_os = tmp.minimum_os
@kill_apps = tmp.kill_apps
end | ruby | def refetch_version_info
tmp = self.class.fetch id: id
@release_date = tmp.release_date
@incremental_update = tmp.incremental_update
@reboot = tmp.reboot
@minimum_os = tmp.minimum_os
@kill_apps = tmp.kill_apps
end | [
"def",
"refetch_version_info",
"tmp",
"=",
"self",
".",
"class",
".",
"fetch",
"id",
":",
"id",
"@release_date",
"=",
"tmp",
".",
"release_date",
"@incremental_update",
"=",
"tmp",
".",
"incremental_update",
"@reboot",
"=",
"tmp",
".",
"reboot",
"@minimum_os",
... | Update our local version data after the target_version is changed | [
"Update",
"our",
"local",
"version",
"data",
"after",
"the",
"target_version",
"is",
"changed"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/patch_policy.rb#L579-L586 |
15,893 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/user.rb | JSS.User.add_site | def add_site (site)
return nil if @sites.map{|s| s[:name]}.include? site
raise JSS::InvalidDataError, "No site in the JSS named #{site}" unless JSS::Site.all_names(api: @api).include? site
@sites << {:name => site}
@need_to_update = true
end | ruby | def add_site (site)
return nil if @sites.map{|s| s[:name]}.include? site
raise JSS::InvalidDataError, "No site in the JSS named #{site}" unless JSS::Site.all_names(api: @api).include? site
@sites << {:name => site}
@need_to_update = true
end | [
"def",
"add_site",
"(",
"site",
")",
"return",
"nil",
"if",
"@sites",
".",
"map",
"{",
"|",
"s",
"|",
"s",
"[",
":name",
"]",
"}",
".",
"include?",
"site",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"\"No site in the JSS named #{site}\"",
"unless",
"JS... | Add this user to a site
@param site[String] the name of the site
@return [void] | [
"Add",
"this",
"user",
"to",
"a",
"site"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/user.rb#L233-L238 |
15,894 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/user.rb | JSS.User.remove_site | def remove_site (site)
return nil unless @sites.map{|s| s[:name]}.include? site
@sites.reject!{|s| s[:name] == site}
@need_to_update = true
end | ruby | def remove_site (site)
return nil unless @sites.map{|s| s[:name]}.include? site
@sites.reject!{|s| s[:name] == site}
@need_to_update = true
end | [
"def",
"remove_site",
"(",
"site",
")",
"return",
"nil",
"unless",
"@sites",
".",
"map",
"{",
"|",
"s",
"|",
"s",
"[",
":name",
"]",
"}",
".",
"include?",
"site",
"@sites",
".",
"reject!",
"{",
"|",
"s",
"|",
"s",
"[",
":name",
"]",
"==",
"site",... | Remove this user from a site
@param site[String] the name of the site
@return [void] | [
"Remove",
"this",
"user",
"from",
"a",
"site"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/user.rb#L247-L251 |
15,895 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/network_segment.rb | JSS.NetworkSegment.overlap? | def overlap?(other_segment)
raise TypeError, 'Argument must be a JSS::NetworkSegment' unless \
other_segment.is_a? JSS::NetworkSegment
other_range = other_segment.range
range.include?(other_range.begin) || range.include?(other_range.end)
end | ruby | def overlap?(other_segment)
raise TypeError, 'Argument must be a JSS::NetworkSegment' unless \
other_segment.is_a? JSS::NetworkSegment
other_range = other_segment.range
range.include?(other_range.begin) || range.include?(other_range.end)
end | [
"def",
"overlap?",
"(",
"other_segment",
")",
"raise",
"TypeError",
",",
"'Argument must be a JSS::NetworkSegment'",
"unless",
"other_segment",
".",
"is_a?",
"JSS",
"::",
"NetworkSegment",
"other_range",
"=",
"other_segment",
".",
"range",
"range",
".",
"include?",
"(... | Does this network segment overlap with another?
@param other_segment[JSS::NetworkSegment] the other segment to check
@return [Boolean] Does the other segment overlap this one? | [
"Does",
"this",
"network",
"segment",
"overlap",
"with",
"another?"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/network_segment.rb#L304-L309 |
15,896 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/network_segment.rb | JSS.NetworkSegment.include? | def include?(thing)
if thing.is_a? JSS::NetworkSegment
@starting_address <= thing.range.begin && @ending_address >= thing.range.end
else
thing = IPAddr.new thing.to_s
range.include? thing
end
end | ruby | def include?(thing)
if thing.is_a? JSS::NetworkSegment
@starting_address <= thing.range.begin && @ending_address >= thing.range.end
else
thing = IPAddr.new thing.to_s
range.include? thing
end
end | [
"def",
"include?",
"(",
"thing",
")",
"if",
"thing",
".",
"is_a?",
"JSS",
"::",
"NetworkSegment",
"@starting_address",
"<=",
"thing",
".",
"range",
".",
"begin",
"&&",
"@ending_address",
">=",
"thing",
".",
"range",
".",
"end",
"else",
"thing",
"=",
"IPAdd... | Does this network segment include an address or another segment?
Inclusion means the other is completely inside this one.
@param thing[JSS::NetworkSegment, String, IPAddr] the other thing to check
@return [Boolean] Does this segment include the other? | [
"Does",
"this",
"network",
"segment",
"include",
"an",
"address",
"or",
"another",
"segment?",
"Inclusion",
"means",
"the",
"other",
"is",
"completely",
"inside",
"this",
"one",
"."
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/network_segment.rb#L318-L325 |
15,897 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/network_segment.rb | JSS.NetworkSegment.building= | def building=(newval)
new = JSS::Building.all.select { |b| (b[:id] == newval) || (b[:name] == newval) }[0]
raise JSS::MissingDataError, "No building matching '#{newval}'" unless new
@building = new[:name]
@need_to_update = true
end | ruby | def building=(newval)
new = JSS::Building.all.select { |b| (b[:id] == newval) || (b[:name] == newval) }[0]
raise JSS::MissingDataError, "No building matching '#{newval}'" unless new
@building = new[:name]
@need_to_update = true
end | [
"def",
"building",
"=",
"(",
"newval",
")",
"new",
"=",
"JSS",
"::",
"Building",
".",
"all",
".",
"select",
"{",
"|",
"b",
"|",
"(",
"b",
"[",
":id",
"]",
"==",
"newval",
")",
"||",
"(",
"b",
"[",
":name",
"]",
"==",
"newval",
")",
"}",
"[",
... | Does this network segment equal another?
equality means the ranges are equal
@param other_segment[JSS::NetworkSegment] the other segment to check
@return [Boolean] Does this segment include the other?
Set the building
@param newval[String, Integer] the new building by name or id, must be in the JSS
@return [... | [
"Does",
"this",
"network",
"segment",
"equal",
"another?",
"equality",
"means",
"the",
"ranges",
"are",
"equal"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/network_segment.rb#L346-L351 |
15,898 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/network_segment.rb | JSS.NetworkSegment.override_buildings= | def override_buildings=(newval)
raise JSS::InvalidDataError, 'New value must be boolean true or false' unless JSS::TRUE_FALSE.include? newval
@override_buildings = newval
@need_to_update = true
end | ruby | def override_buildings=(newval)
raise JSS::InvalidDataError, 'New value must be boolean true or false' unless JSS::TRUE_FALSE.include? newval
@override_buildings = newval
@need_to_update = true
end | [
"def",
"override_buildings",
"=",
"(",
"newval",
")",
"raise",
"JSS",
"::",
"InvalidDataError",
",",
"'New value must be boolean true or false'",
"unless",
"JSS",
"::",
"TRUE_FALSE",
".",
"include?",
"newval",
"@override_buildings",
"=",
"newval",
"@need_to_update",
"="... | set the override buildings option
@param newval[Boolean] the new override buildings option
@return [void] | [
"set",
"the",
"override",
"buildings",
"option"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/network_segment.rb#L359-L363 |
15,899 | PixarAnimationStudios/ruby-jss | lib/jss/api_object/network_segment.rb | JSS.NetworkSegment.department= | def department=(newval)
new = JSS::Department.all.select { |b| (b[:id] == newval) || (b[:name] == newval) }[0]
raise JSS::MissingDataError, "No department matching '#{newval}' in the JSS" unless new
@department = new[:name]
@need_to_update = true
end | ruby | def department=(newval)
new = JSS::Department.all.select { |b| (b[:id] == newval) || (b[:name] == newval) }[0]
raise JSS::MissingDataError, "No department matching '#{newval}' in the JSS" unless new
@department = new[:name]
@need_to_update = true
end | [
"def",
"department",
"=",
"(",
"newval",
")",
"new",
"=",
"JSS",
"::",
"Department",
".",
"all",
".",
"select",
"{",
"|",
"b",
"|",
"(",
"b",
"[",
":id",
"]",
"==",
"newval",
")",
"||",
"(",
"b",
"[",
":name",
"]",
"==",
"newval",
")",
"}",
"... | set the department
@param newval[String, Integer] the new dept by name or id, must be in the JSS
@return [void] | [
"set",
"the",
"department"
] | 4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9 | https://github.com/PixarAnimationStudios/ruby-jss/blob/4ab645bfaec8b2edb1ea146bfc2b10f0d62edee9/lib/jss/api_object/network_segment.rb#L371-L376 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.