lib/jss/api_object/mdm.rb
def validate_command(command)
        raise JSS::NoSuchItemError, "Unknown command '#{command}'" unless COMMANDS.keys.include? command

        command = COMMANDS[command]

        case self::MDM_COMMAND_TARGET
        when *COMPUTER_TARGETS
          return command if COMPUTER_COMMANDS.include? command
          raise JSS::UnsupportedError, "'#{command}' cannot be sent to computers or computer groups"
        when *DEVICE_TARGETS
          return command if DEVICE_COMMANDS.include? command
          raise JSS::UnsupportedError, "'#{command}' cannot be sent to mobile devices or mobile device groups"
        end

        raise JSS::NoSuchItemError, "'#{command}' is known, but not available for computers or mobile devices. This is a bug. Please report it."
      end
# Validate that this command is known and can be sent to this kind of
# object, raising an error if not.
#
# @param command[Symbol] One of the symbolic commands as keys in COMMANDS
#
# @return [String] the matching value for the command symbol given
#
Validate that this command is known and can be sent to this kind of
object, raising an error if not.
Validate that this command is known and can be sent to this kind of object raising an error if not .
def validate_command(command)
        raise JSS::NoSuchItemError, "Unknown command '#{command}'" unless COMMANDS.keys.include? command
        command = COMMANDS[command]
        case self::MDM_COMMAND_TARGET
        when *COMPUTER_TARGETS
          return command if COMPUTER_COMMANDS.include? command
          raise JSS::UnsupportedError, "'#{command}' cannot be sent to computers or computer groups"
        when *DEVICE_TARGETS
          return command if DEVICE_COMMANDS.include? command
          raise JSS::UnsupportedError, "'#{command}' cannot be sent to mobile devices or mobile device groups"
        end
        raise JSS::NoSuchItemError, "'#{command}' is known, but not available for computers or mobile devices. This is a bug. Please report it."
      end
def validate_command ( command ) raise JSS :: NoSuchItemError , "Unknown command '#{command}'" unless COMMANDS . keys . include? command command = COMMANDS [ command ] case self :: MDM_COMMAND_TARGET when * COMPUTER_TARGETS return command if COMPUTER_COMMANDS . include? command raise JSS :: UnsupportedError , "'#{command}' cannot be sent to computers or computer groups" when * DEVICE_TARGETS return command if DEVICE_COMMANDS . include? command raise JSS :: UnsupportedError , "'#{command}' cannot be sent to mobile devices or mobile device groups" end raise JSS :: NoSuchItemError , "'#{command}' is known, but not available for computers or mobile devices. This is a bug. Please report it." end
Validate that this command is known and can be sent to this kind of
object, raising an error if not.
Validate that this command is known and can be sent to this kind of object raising an error if not .
the matching value for the command symbol given
the matching value for the command symbol given
String
command
One of the symbolic commands as keys in COMMANDS
One of the symbolic commands as keys in COMMANDS