googleads / googleads-python-lib

The Python client library for Google's Ads APIs
Apache License 2.0
681 stars 974 forks source link

live_stream_events_service.performLiveStreamEventAction({'xsi_type': 'ActivateLiveStreamEvents'}, <Live_Streams_List>) executed and impacted all Live Streams configs #461

Open piyush2508 opened 4 years ago

piyush2508 commented 4 years ago

Variable Def -

Set ID of the LiveStreamEvent to get live stream events from.

LIVE_STREAM_EVENT_ID = 'INSERT_LIVE_STREAM_EVENT_ID_HERE'

Incorrect Usage - statement = (ad_manager.StatementBuilder(version='v202002') .Where(('Id = :id')) .WithBindVariable('id', int(live_stream_event_id)) .Limit(500))

Considering event id is not found via statement query will return all Live Streams and accidentally causing updateLiveStreamEvents to all LiveStreams

live_stream_events = live_stream_events_service.updateLiveStreamEvents( updated_live_stream_events)

https://github.com/googleads/googleads-python-lib/blob/41c17a88eabcac092592421a85c322132bf7e666/examples/ad_manager/v202002/live_stream_event_service/update_live_stream_events.py#L26

piyush2508 commented 4 years ago

I re-checked, it seems the reason for this issue is not the above variable but when I executed below query:

live_stream_events_service.performLiveStreamEventAction({'xsi_type': 'ActivateLiveStreamEvents'}, )

Query executed and updated all live events in the network.

Is there a way to avoid this? to make sure API doesn't execute if valid query/format is not passed.

piyush2508 commented 4 years ago

Expected Result: This Query should not execute.

christopherseeley commented 5 months ago

So the request here is to validate that the parameter is able to be serialized to the xsi type rather than silently serializing as null?