numberly / appnexus-client

:snake: General purpose Python client for the AppNexus API
https://appnexus-client.readthedocs.io
MIT License
39 stars 19 forks source link

inventory-list-items nested into inventory-lists #49

Open Samuel29 opened 3 years ago

Samuel29 commented 3 years ago

Hi. I've just forked the repository to add some missing services, but I'm not familiar with Thingy. I'm especially interested in implementing the inventory-list and its nested inventory-list-items (cf doc here and there) so far, I've added the support for InventoryList. But I'm not sure about the way to fetch its children objects.

GET/POST /inventory-list/<ID>/item interacts with the list of items GET/POST /inventory-list/<ID>/item/<ITEM-ID> interacts with a single item

Could you provide some guidance?

ramnes commented 3 years ago

Hey there, glad to see someone from AppNexus playing with this project. :)

What's the Python API you'd expect? Something in these lines?

inventory_list = InventoryList.find_one()
print(inventory_list.items[0])

If so, you'd just have to add an InventoryList(Model) class inside models.py that defines an items property.

Samuel29 commented 3 years ago

Hello. Thanks for pointing that out, I'm realizing that my profile was outdated. I'm a former Appnexus folk. now I'm using the platform as a client :-)

Your proposal seems so obvious... I've been trying more complex changes lol. I'll give it a shot. Thanks for your prompt answer!

rambobinator commented 3 years ago

Hi,

Ramnes's snippet work but it's a read only solution, and maybe you'd like to query Items by Id and not getting the full inventory ?

We had the same issue with campaigns being now ALI/split, you should have a look on it: https://github.com/numberly/appnexus-client/pull/36

Also are inventory's item ids unique or are they just list indexes ?

Do not hesitate to PR changes you made.