### Home Classes Methods

### In Files

- lib/github_api/activity/notifications.rb

### Parent

Github::API

### Methods

- #all
- #create
- #delete
- #find
- #get
- #list
- #mark
- #remove
- #subscribed?

### Class/Module Index

Quicksearch

- Github
- Github::API
- Github::Activity
- Github::Activity::Events
- Github::Activity::Notifications
- Github::Activity::Starring
- Github::Activity::Watching
- Github::ApiFactory
- Github::Arguments
- Github::Authorization
- Github::Authorizations
- Github::AutoloadHelper
- Github::Client
- Github::Configuration
- Github::Connection
- Github::Constants
- Github::CoreExt
- Github::CoreExt::OrderedHash
- Github::Descendants
- Github::Emojis
- Github::Error
- Github::Error::BadRequest
- Github::Error::ClientError
- Github::Error::Forbidden
- Github::Error::GithubError
- Github::Error::InternalServerError
- Github::Error::InvalidOptions
- Github::Error::NotAcceptable
- Github::Error::NotFound
- Github::Error::RequiredParams
- Github::Error::ServiceError
- Github::Error::ServiceUnavailable
- Github::Error::Unauthorized
- Github::Error::UnknownValue
- Github::Error::UnprocessableEntity
- Github::Error::Validations
- Github::Gists
- Github::Gists::Comments
- Github::GitData
- Github::GitData::Blobs
- Github::GitData::Commits
- Github::GitData::References
- Github::GitData::Tags
- Github::GitData::Trees
- Github::Gitignore
- Github::Issues
- Github::Issues::Assignees
- Github::Issues::Comments
- Github::Issues::Events
- Github::Issues::Labels
- Github::Issues::Milestones
- Github::Jsonable
- Github::Markdown
- Github::Meta
- Github::MimeType
- Github::Normalizer
- Github::Orgs
- Github::Orgs::Members
- Github::Orgs::Teams
- Github::PageIterator
- Github::PageLinks
- Github::PagedRequest
- Github::Pagination
- Github::ParameterFilter
- Github::ParamsHash
- Github::PullRequests
- Github::PullRequests::Comments
- Github::RateLimit
- Github::Repos
- Github::Repos::Collaborators
- Github::Repos::Comments
- Github::Repos::Commits
- Github::Repos::Contents
- Github::Repos::Downloads
- Github::Repos::Forks
- Github::Repos::Hooks
- Github::Repos::Keys
- Github::Repos::Merging
- Github::Repos::PubSubHubbub
- Github::Repos::Statistics
- Github::Repos::Statuses
- Github::Request
- Github::Request::BasicAuth
- Github::Request::Jsonize
- Github::Request::OAuth2
- Github::Resource
- Github::Response
- Github::Response::Header
- Github::Response::Jsonize
- Github::Response::Mashify
- Github::Response::RaiseError
- Github::Response::Xmlize
- Github::ResponseWrapper
- Github::S3Uploader
- Github::Say
- Github::Scopes
- Github::Search
- Github::Users
- Github::Users::Emails
- Github::Users::Followers
- Github::Users::Keys
- Github::Utils
- Github::Utils::Url
- Github::VERSION
- Github::Validations
- Github::Validations::Format
- Github::Validations::Presence
- Github::Validations::Required
- Github::Validations::Token
- Hash

No matching classes.

# Github::Activity::Notifications

### Public Instance Methods

all(*args) click to toggle source
Alias for: list
create(*args) click to toggle source

Create a thread subscription

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

# Parameters

- `:subscribed` - boolean - determines if notifications should be

      received from this thread.

- `:ignored` - boolean - deterimines if all notifications should be

      blocked from this thread.

# Examples

    github = Github.new oauth_token: 'token'
    github.activity.notifications.create 'thread-id',
      'subscribed': true
      'ignored': false

    # File lib/github_api/activity/notifications.rb, line 136
    def create(*args)
      arguments(args, :required => [:thread_id])

      put_request("/notifications/threads/#{thread_id}/subscription", arguments.params)
    end

delete(*args) click to toggle source

Delete a thread subscription

# Examples

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

    # File lib/github_api/activity/notifications.rb, line 148
    def delete(*args)
      arguments(args, :required => [:thread_id])

      delete_request("/notifications/threads/#{thread_id}/subscription", arguments.params)
    end

Also aliased as: remove
find(*args) click to toggle source
Alias for: get
get(*args) click to toggle source

View a single thread

# Examples

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

    # File lib/github_api/activity/notifications.rb, line 52
    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

Also aliased as: find
list(*args) click to toggle source

List your notifications

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

# Parameters

- `:all` - Optional boolean - true to show notifications marked as read.

- `:participating` - Optional boolean - true to show only

      notifications in which the user is directly
      participating or mentioned.

- `:since` - Optional string - filters out any notifications updated

      before the given time. The time should be passed in as
      UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
      Example: “2012-10-09T23:39:01Z”.

# Examples

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

List your notifications in a repository

# Examples

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

    # File lib/github_api/activity/notifications.rb, line 29
    def list(*args)
      params = arguments(args) do
        sift ] 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

Also aliased as: all
mark(*args) click to toggle source

Mark as read

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

# Parameters

- `:unread` - boolean - Changes the unread status of the threads.

- `:read` - boolean - Inverse of "unread"

- `:last_read_at` - optional string time - describes the last point

      that notifications were checked. Anything updated
      since this time will not be updated. Default: Now.
      Expected in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
      Example: “2012-10-09T23:39:01Z”.

# Examples

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

Mark notifications as read in a repository

# Examples

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

Mark a thread as read

# Examples

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

    # File lib/github_api/activity/notifications.rb, line 90
    def mark(*args)
      params = arguments(args) do
        sift ] 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

remove(*args) click to toggle source
Alias for: delete
subscribed?(*args) click to toggle source

Check to see if the current user is subscribed to a thread.

# Examples

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

    # File lib/github_api/activity/notifications.rb, line 112
    def subscribed?(*args)
      arguments(args, :required => [:thread_id])

      get_request("/notifications/threads/#{thread_id}/subscription", arguments.params)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.