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]
        when :start then 0
        when :end then -1
        else JSS::Validate.integer(opts[:position])
        end

      # if the given position is past the end, set it to -1 (the end)
      opts[:position] = -1 if opts[:position] > @packages.size

      id = JSS::Script.valid_id identifier, api: @api
      raise JSS::NoSuchItemError, "No script matches '#{identifier}'" unless id
      id
    end
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]
        when :start then 0
        when :end then -1
        else JSS::Validate.integer(opts[:position])
        end

      # if the given position is past the end, set it to -1 (the end)
      opts[:position] = -1 if opts[:position] > @packages.size

      id = JSS::Script.valid_id identifier, api: @api
      raise JSS::NoSuchItemError, "No script matches '#{identifier}'" unless id
      id
    end
raise an error if a script being added isn't valid

 @see #add_script

 @return [Integer, nil] the valid id for the package