aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/activity_notifications.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-08-27 01:32:30 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-08-27 01:32:30 +0100
commit921818bca208f0c70e85ec670074cb3905cbbc82 (patch)
tree4aa67ad2bb2083bd486db3f99680d6d08a2c36b3 /vendor/github.com/google/go-github/github/activity_notifications.go
parent7f1c9358805302344a89c1fed4eab1342931b061 (diff)
Update dependencies
Diffstat (limited to 'vendor/github.com/google/go-github/github/activity_notifications.go')
-rw-r--r--vendor/github.com/google/go-github/github/activity_notifications.go21
1 files changed, 8 insertions, 13 deletions
diff --git a/vendor/github.com/google/go-github/github/activity_notifications.go b/vendor/github.com/google/go-github/github/activity_notifications.go
index 8890388..b538a7b 100644
--- a/vendor/github.com/google/go-github/github/activity_notifications.go
+++ b/vendor/github.com/google/go-github/github/activity_notifications.go
@@ -96,20 +96,17 @@ func (s *ActivityService) ListRepositoryNotifications(owner, repo string, opt *N
}
type markReadOptions struct {
- LastReadAt time.Time `url:"last_read_at,omitempty"`
+ LastReadAt time.Time `json:"last_read_at,omitempty"`
}
// MarkNotificationsRead marks all notifications up to lastRead as read.
//
// GitHub API Docs: https://developer.github.com/v3/activity/notifications/#mark-as-read
func (s *ActivityService) MarkNotificationsRead(lastRead time.Time) (*Response, error) {
- u := fmt.Sprintf("notifications")
- u, err := addOptions(u, markReadOptions{lastRead})
- if err != nil {
- return nil, err
+ opts := &markReadOptions{
+ LastReadAt: lastRead,
}
-
- req, err := s.client.NewRequest("PUT", u, nil)
+ req, err := s.client.NewRequest("PUT", "notifications", opts)
if err != nil {
return nil, err
}
@@ -122,13 +119,11 @@ func (s *ActivityService) MarkNotificationsRead(lastRead time.Time) (*Response,
//
// GitHub API Docs: https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository
func (s *ActivityService) MarkRepositoryNotificationsRead(owner, repo string, lastRead time.Time) (*Response, error) {
- u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo)
- u, err := addOptions(u, markReadOptions{lastRead})
- if err != nil {
- return nil, err
+ opts := &markReadOptions{
+ LastReadAt: lastRead,
}
-
- req, err := s.client.NewRequest("PUT", u, nil)
+ u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo)
+ req, err := s.client.NewRequest("PUT", u, opts)
if err != nil {
return nil, err
}