If a hub motor bike, avoid directing a hosepipe at the spindle entry points of the motor, especially if the cable enters through the spindle. Also avoid the controller box and any handlebar control unit. All in all it's best to use a sponge or cloth and do the job by hand, possibly rinsing with a very gentle hosepipe flow.
Fully sealed crank drives like Tillson's Panasonic unit should be hosepipe proof, I'm on record as riding one through deep water with the unit completely immersed.