class Github::Activity::Notifications

def create(*args)


'ignored': false
'subscribed': true
github.activity.notifications.create 'thread-id',
github = Github.new oauth_token: 'token'
= Examples
blocked from this thread.
* :ignored - boolean - deterimines if all notifications should be
received from this thread.
* :subscribed - boolean - determines if notifications should be
= Parameters

@mentioned).
a thread will mute all future notifications (until you comment or get
is unnecessary if the user is already subscribed to the repository. Ignoring
This lets you subscribe to a thread, or ignore it. Subscribing to a thread

Create a thread subscription
def create(*args)
  arguments(args, :required => [:thread_id])
  put_request("/notifications/threads/#{thread_id}/subscription", arguments.params)
end

def delete(*args)


github.activity.notifications.delete 'thread_id'
github = Github.new oauth_token: 'token'
= Examples

Delete a thread subscription
def delete(*args)
  arguments(args, :required => [:thread_id])
  delete_request("/notifications/threads/#{thread_id}/subscription", arguments.params)
end

def get(*args)


github.activity.notifications.get 'thread_id' { |thread| ... }
github.activity.notifications.get 'thread_id'
github = Github.new oauth_token: 'token'
= Examples

View a single thread
def get(*args)
  arguments(args, :required => [:thread_id])
  response = get_request("/notifications/threads/#{thread_id}", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end

def list(*args)


github.activity.notifications.list user: 'user-name', repo: 'repo-name'
github = Github.new
= Examples

List your notifications in a repository

github.activity.notifications.list
github = Github.new oauth_token: 'token'
= Examples

Example: “2012-10-09T23:39:01Z”.
UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
before the given time. The time should be passed in as
* :since - Optional string - filters out any notifications updated
participating or mentioned.
notifications in which the user is directly
* :participating - Optional boolean - true to show only
* :all - Optional boolean - true to show notifications marked as read.
= Parameters

List all notifications for the current user, grouped by repository.

List your notifications
def list(*args)
  params = arguments(args) do
    sift %w[ all participating since user repo]
  end.params
  response = if ( (user_name = params.delete("user")) &&
                  (repo_name = params.delete("repo")) )
    get_request("/repos/#{user_name}/#{repo_name}/notifications", params)
  else
    get_request("/notifications", params)
  end
  return response unless block_given?
  response.each { |el| yield el }
end

def mark(*args)


github.activity.notifications.mark thread_id: 'id', read: true
= Examples

Mark a thread as read

read: true
github.activity.notifications.mark user: 'user-name', repo: 'repo-name',
= Examples

Mark notifications as read in a repository

github.activity.notifications.mark read: true
github = Github.new oauth_token: 'token'
= Examples

Example: “2012-10-09T23:39:01Z”.
Expected in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
since this time will not be updated. Default: Now.
that notifications were checked. Anything updated
* :last_read_at - optional string time - describes the last point
* :read - boolean - Inverse of "unread"
* :unread - boolean - Changes the unread status of the threads.

= Parameters

Marking a notification as “read” removes it from the default view on GitHub.com.

Mark as read
def mark(*args)
  params = arguments(args) do
    sift %w[ unread read last_read_at user repo thread_id]
  end.params
  if ( (user_name = params.delete("user")) &&
       (repo_name = params.delete("repo")) )
    put_request("/repos/#{user_name}/#{repo_name}/notifications", params)
  elsif (thread_id = params.delete("thread_id"))
    patch_request("/notifications/threads/#{thread_id}", params)
  else
    put_request("/notifications", params)
  end
end

def subscribed?(*args)


github.activity.notifications.subscribed? 'thread-id'
github = Github.new oauth_token: 'token'
= Examples

Check to see if the current user is subscribed to a thread.
def subscribed?(*args)
  arguments(args, :required => [:thread_id])
  get_request("/notifications/threads/#{thread_id}/subscription", arguments.params)
end