### Home Classes Methods

### In Files

- lib/github_api/authorizations.rb

### Parent

API

### Methods

- #all
- #create
- #delete
- #edit
- #find
- #get
- #list
- #remove
- #update

### 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::Authorizations

### Constants

VALID_AUTH_PARAM_NAMES

### Public Instance Methods

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

Create a new authorization

# Inputs

- `:scopes` - Optional array - A list of scopes that this authorization is in.

- `:note` - Optional string - A note to remind you what the OAuth token is for.

- `:note_url` - Optional string - A URL to remind you what the OAuth token is for.

# Examples

    github = Github.new :basic_auth => 'login:password'
    github.oauth.create
      "scopes" => ["public_repo"]

    # File lib/github_api/authorizations.rb, line 58
    def create(*args)
      _check_if_authenticated
      arguments(args) do
        sift VALID_AUTH_PARAM_NAMES
      end

      post_request("/authorizations", arguments.params)
    end

delete(*args) click to toggle source

Delete an authorization

# Examples

    github.oauth.delete 'authorization-id'

    # File lib/github_api/authorizations.rb, line 95
    def delete(*args)
      _check_if_authenticated
      arguments(args, :required => [:authorization_id])

      delete_request("/authorizations/#{authorization_id}", arguments.params)
    end

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

Get a single authorization

# Examples

    github = Github.new :basic_auth => 'login:password'
    github.oauth.get 'authorization-id'

    # File lib/github_api/authorizations.rb, line 38
    def get(*args)
      _check_if_authenticated
      arguments(args, :required => [:authorization_id])

      get_request("/authorizations/#{authorization_id}", arguments.params)
    end

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

List authorizations

# Examples

    github = Github.new :basic_auth => 'login:password'
    github.oauth.list
    github.oauth.list { |auth| ... }

    # File lib/github_api/authorizations.rb, line 22
    def list(*args)
      _check_if_authenticated
      arguments(args)

      response = get_request("/authorizations", arguments.params)
      return response unless block_given?
      response.each { |el| yield el }
    end

Also aliased as: all
remove(*args) click to toggle source
Alias for: delete
update(*args) click to toggle source

Update an existing authorization

# Inputs

- `:scopes` - Optional array - A list of scopes that this authorization is in.

- `:add_scopes` - Optional array - A list of scopes to add to this authorization.

- `:remove_scopes` - Optional array - A list of scopes to remove from this authorization.

- `:note` - Optional string - A note to remind you what the OAuth token is for.

- `:note_url` - Optional string - A URL to remind you what the OAuth token is for.

# Examples

    github = Github.new :basic_auth => 'login:password'
    github.oauth.update "authorization-id", "add_scopes" => ["repo"],

    # File lib/github_api/authorizations.rb, line 80
    def update(*args)
      _check_if_authenticated
      arguments(args, :required => [:authorization_id]) do
        sift VALID_AUTH_PARAM_NAMES
      end

      patch_request("/authorizations/#{authorization_id}", arguments.params)
    end

Also aliased as: edit

[Validate]

Generated with the Darkfish Rdoc Generator 2.