module Octokit::Client::Users

Overview

Methods for the Users API

See Also:

Direct including types

Defined in:

octokit/client/users.cr

Instance Method Summary

Instance Method Detail

def add_email(email) #

Add email address to user.

Example:

@client.add_email("[email protected]")

Note: Requires authenticated client.

See Also:


[View source]
def add_key(title, key) #

Add public key to user account.

Example:

@client.add_key("Personal projects key", "ssh-rsa AAA...")

Note: Requires authenticated client.

See Also:


[View source]
def all_users #

List all GitHub users

This provides a list of every user, in the order that they signed up for GitHub.

See Also:


[View source]
def emails(**options) #

List email addresses for a user.

Example:

@client.emails

Note: Requires an authenticated client.

See Also:


[View source]
def exchange_code_for_token(code, app_id = client_id, app_secret = client_secret) #

Retrieve access token

Example:

Octokit.client.exchange_code_for_token("aaaa", "xxxx", "yyyy", {accept: "application/json"})

See Also:


[View source]
def follow(user) #

Follow a user.

Example:

@client.follow("watzon")

Note: Requires an authenticated user.

See Also:


[View source]
def followers(user, **options) #

Get a user's followers

Example:

Octokit.client.followers("watzon")

See Also:


[View source]
def following(user, **options) #

Get a list of users the user is following

Example:

Octokit.client.following("watzon")

See Also:


[View source]
def follows?(user, target = nil) #

Check if you is following a user. Alternatively check if a given user is following a target user.

Examples:

@client.follows?("asterite")
@client.follows?("asterite", "waj")

Note: Requires an authenticated user.

See Also:


[View source]
def key(key_id) #

Get a public key.

Examples:

@client.key(1)

# Retrieve public key contents
public_key = @client.key(1)
public_key.key
# => Error

public_key[:key]
# => "ssh-rsa AAA..."

Note: when using dot notation to retrieve the values, ruby will return the hash key for the public keys value instead of the actual value, use symbol or key string to retrieve the value. See example.

Note: Requires an authenticated client.

See Also:


[View source]
def keys(user = nil) #

Get a list of public keys for a user.

Examples:

@client.keys
@client.keys("watzon")

Note: Requires an authenticated client.

See Also:


[View source]
def public_emails(**options) #

List public email addresses for a user.

Example:

@client.public_emails

Note: Requires an authenticated client.

See Also:


[View source]
def remove_email(email) #

Remove email from user.

Example:

@client.remove_email("[email protected]")

Note: Requires authenticated client.

See Also:


[View source]
def remove_key(id) #

Delete a public key.

Example:

@client.remove_key(1)

Note: Requires an authenticated client.

See Also:


[View source]
def starred(user = login, **options) #

Get a list of repos starred by a user.

Example:

Octokit.client.starred("watzon")

See Also:


[View source]
def starred?(repo) #

Check if you are starring a repo.

Example:

@client.starred?("watzon/octokit")

Note: Requires an authenticated client.

See Also:


[View source]
def subscriptions(user = login, **options) #

List repositories being watched by a user.

Example:

@client.subscriptions("watzon")

See Also:


[View source]
def toggle_email_visibility(options) #

Toggle the visibility of the users primary email addresses.

Example:

@client.toggle_email_visibility([{email: "[email protected]", visibility: "private"}])

Note: Requires authenticated client.

See Also:


[View source]
def unfollow(user) #

Unfollow a user.

Example:

@client.unfollow("watzon")

Note: Requires an authenticated user.

See Also:


[View source]
def update_user(**options) #

Update the authenticated user

Example:

Octokit.client.update_user(name: "Chris Watson", email: "[email protected]", company: "Manas Tech", location: "Buenos Aires", hireable: false)

See Also:


[View source]
def user(user = nil) #

[View source]
def validate_credentials(options = nil) #

Validate user username and password


[View source]