Implement endpoint for APIv4: GET /users/{user_id}/audits (#5472)

Этот коммит содержится в:
Saturnino Abril
2017-02-21 21:07:57 +09:00
коммит произвёл George Goldberg
родитель 7068307a1c
Коммит 5c19d9be7f
7 изменённых файлов: 113 добавлений и 47 удалений

Просмотреть файл

@@ -459,6 +459,17 @@ func (c *Client4) RevokeSession(userId, sessionId string) (bool, *Response) {
}
}
// GetAudits returns a list of audit based on the provided user id string.
func (c *Client4) GetAudits(userId string, page int, perPage int, etag string) (Audits, *Response) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)
if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/audits"+query, etag); err != nil {
return nil, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return AuditsFromJson(r.Body), BuildResponse(r)
}
}
// Team Section
// CreateTeam creates a team in the system based on the provided team struct.