Open gwillem opened 1 year ago
Hi @gwillem,
Thank you for your suggestion, that's a good point!
I need to find a work around, because I still want to keep the possibility to just use Campaign
object without using api
object.
Feel free to contribute if you have a good strategy. Busy week coming, so I will look into it this coming weekend
I still want to keep the possibility to just use Campaign object without using api object.
What is your use case? Perhaps its better to split into models and verbs? It's a common design, see for example https://github.com/chargebee/chargebee-python
Also, why are you pre-validating headers and why not just proxy the error from ML if the headers are faulty? What kind of OSError are you expecting?
The requests module already supports put and delete functions, why duplicate them in client.py?
Thanks for making this library!
FWIW, I think it's good Python practice to not execute remote calls upon instantiating a new object. In this case, creating an API object will run 7 identical calls to
/api/v2/stats
viaclient.check_headers()
.