Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding unaggregated parameter to events.GetEvents #203

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion events.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,19 @@ func (client *Client) GetEvent(id int) (*Event, error) {
}

// GetEvents returns a slice of events from the query stream.
// unaggregated was added on as variadic to allow a non-breaking change.
// if addtional parameters are needed this will need to be changed to a struct input or fully variadic.
func (client *Client) GetEvents(start, end int,
priority, sources, tags string) ([]Event, error) {
priority, sources, tags string, unaggregated ...bool) ([]Event, error) {
// Since this is a GET request, we need to build a query string.
vals := url.Values{}
vals.Add("start", strconv.Itoa(start))
vals.Add("end", strconv.Itoa(end))

if len(unaggregated) > 0 {
vals.Add("unaggregated", strconv.FormatBool(unaggregated[0]))
}

if priority != "" {
vals.Add("priority", priority)
}
Expand Down