LineItem retrieved with invalid attributes
Opened this issue · 1 comments
clevep commented
LineItem objects loaded from my Account contain invalid values for the attributes:
advertiser_user_id
bid_unit
charge_by
So if I load a LineItem and then immediately save it, I am greeted with errors like this:
>>> line_item = account.line_items().next()
>>> line_item.save()
BadRequest: <BadRequest object at 0x7fc24b5bd9a8 code=400 details=[{'message': 'Expected a value in APP_CLICK, APP_INSTALL, VIEW, VIEW_3S_100PCT, VIEW_6S, got "LINK_CLICK" for bid_unit', 'code': 'INVALID_PARAMETER', 'parameter': 'bid_unit'}, {'message': 'Expected a value in APP_CLICK, APP_INSTALL, got "LINK_CLICK" for charge_by', 'code': 'INVALID_PARAMETER', 'parameter': 'charge_by'}, {'message': 'setting advertiser_user_id is not allowed', 'code': 'INVALID_PARAMETER', 'parameter': 'advertiser_user_id'}]>
I am able to work around this by explicitly setting all of these attributes to None
before saving, but it does not seem like they should populate with invalid values.
osowskit commented
Over time, parameters and options can get deprecated between versions. This results in campaigns that may no longer be possible to modify or the previous values are not valid. In the above scenario, it seems that the line items attempted to save these incorrectly. Let us know if you find additional examples and we can attempt to work around these.