civisanalytics / civis-python

Civis API Python Client
BSD 3-Clause "New" or "Revised" License
34 stars 26 forks source link

[Serd-1694] service client #343

Closed ggarcia-civis closed 4 years ago

ggarcia-civis commented 4 years ago

Adding ServiceClient() method which takes a service id, optional base path (default is None), and optional swagger endpoint (default is '/endpoints'), then creates a client from the api spec and endpoints.

A lot of the work is being done in the helper functions and Endpoint class for the original APIClient, but small changes were needed in a few cases (mostly in regards to the url and making requests). These changes are overridden by the ServiceClient and ServiceEndpoint class.

ggarcia-civis commented 4 years ago

I have a few fixes to make, one moment

ggarcia-civis commented 4 years ago

Okay, ready for review when you all are @patr1ckm @elsander

elsander commented 4 years ago

Also, don't forget to update the changelog!

ggarcia-civis commented 4 years ago

I think I covered all the previous comments. Let me know if I missed anything.

patr1ckm commented 4 years ago

LGTM! Approving because APIClient already has an api_key parameter.