The Giants have acquired right-hander Jake Barrett from the Arizona Diamondbacks for cash