MediaMath / t1-python

Python SDK for MediaMath Platform APIs
https://developer.mediamath.com/
Apache License 2.0
18 stars 30 forks source link

Deals microservice support #107

Closed FodT closed 7 years ago

FodT commented 7 years ago

With the deals microservice we need to be able to support different api_bases, url parameters and response bodies per entity type. At the moment all get()s of t1 entities go to the 'mgmt' path.

proposed changes:

introduce a lookup map of entity name to path name - use this to look up the correct API_BASE for each entity name

create an intermediate specialised 'Service' (name tbd, we already have a service module) class to deal with url building, parameter validation and entity instantiation.

move all url parameters into a 'request_params' dict passed into each Service's http call functions.

this of course raises a deprecation issue, for both the existing deals endpoint (and any future endpoints which will be decomposed into a separate service) and support for it in in t1-python, and a potential new interface exposed to t1-python (at the very least we are instantiating options dicts instead of a param list, and we could potentially directly call each service separately) - Open to discuss how this should look.

fsargent commented 7 years ago

+1 on Lookup map of entity names. 'uri helpers' for the service name

How will the functions developers use change when switching to the new service? Ideally this should be an infrastructure change, rather than one that requires changes by SDK users.

conoverm commented 7 years ago

Any updates on this?

FodT commented 7 years ago

@fsargent i don't think there'll be any change to the public interface, no. t1.get() can delegate, i think. @conoverm working on it!

FodT commented 7 years ago

@conoverm release 1.6.0 has preliminary support for Deals.