Updating an existing coupon in WooCommerce

$coupon = new WC_Coupon( $coupon_id );
$coupon->set_discount_type( 'percent' );
$coupon->set_amount( 25.00 );
$coupon->save();
moon.krysta@mailxu.com stuber_brandon@mailxu.com strysko.annis@mailxu.com