Automatically generating client code