Programmatically declaring memory and cpu

Regarding Docker for Mac, and Docker for Windows, is it possible to declare both memory and CPU settings via a convenient API. docker-machine had this convenience. Thanks.