Norway's Casper Ruud played the perfect final in Geneva to defeat Denis Shapovalov and earn his second career ATP title.