I'm working with an API that has dozens of parameters in a given function:
api.update_customer(a='', b='', c='', ..., x='', y='', z='')
I'll only need to update one or a few parameters when I call it, for instance:
api.update_customer(email='[email protected]')
...but I won't know in advance which object needs updating (maybe email, maybe phone number, etc).
How can I build a wrapper around this call so I can pass in both the parameter name and its new value?
def update_customer_details(key, value):
api.update_customer(key=value)