Ash Barty capped a stellar week in Stuttgart by claiming both the singles and doubles title at the WTA 500 tournament.