go-datadog-api
go-datadog-api copied to clipboard
Adding unaggregated parameter to events.GetEvents
This PR adds support for unaggregated parameter for query events.
See: https://docs.datadoghq.com/api/?lang=python#query-the-event-stream
~~This change is not backwards compatible as it changes the function signature. This function could potentially be rewritten to a variadiac to keep it backwards compatible if needed.~~
Made the new parameter variadic, if more parameters are needed, there would need to be a breaking change (new param or switch to struct), or all the parameters would need to move to be variadic.
@EricByers hey :wave: thanks for sending the PR. I'd much rather have a new method, e.g. GetEventsWithAggregation(start, end int, priority, sources, tags string, unaggregated bool) and keep the old function intact. I do understand that the variadic argument helps here, but I don't think that this solution scales well with potential new arguments.
The old GetEvents function could then just be a proxy to the new one, calling it with unaggregated=false. WDYT?