In the python SDK: extract the REST client code to the Resource class.