module Octokit::Client::Users
Overview
Methods for the Users API
See Also:
Direct including types
Defined in:
octokit/client/users.crInstance Method Summary
-
#add_email(email)
Add email address to user.
-
#add_key(title, key)
Add public key to user account.
-
#all_users
List all GitHub users
-
#emails(**options)
List email addresses for a user.
-
#exchange_code_for_token(code, app_id = client_id, app_secret = client_secret)
Retrieve access token
-
#follow(user)
Follow a user.
-
#followers(user, **options)
Get a user's followers
-
#following(user, **options)
Get a list of users the user is following
-
#follows?(user, target = nil)
Check if you is following a user.
-
#key(key_id)
Get a public key.
-
#keys(user = nil)
Get a list of public keys for a user.
-
#public_emails(**options)
List public email addresses for a user.
-
#remove_email(email)
Remove email from user.
-
#remove_key(id)
Delete a public key.
-
#starred(user = login, **options)
Get a list of repos starred by a user.
-
#starred?(repo)
Check if you are starring a repo.
-
#subscriptions(user = login, **options)
List repositories being watched by a user.
-
#toggle_email_visibility(options)
Toggle the visibility of the users primary email addresses.
-
#unfollow(user)
Unfollow a user.
-
#update_user(**options)
Update the authenticated user
-
#user(user = nil)
Get a single user
-
#validate_credentials(options = nil)
Validate user username and password
Instance Method Detail
Add email address to user.
Example:
@client.add_email("[email protected]")
Note: Requires authenticated client.
See Also:
Add public key to user account.
Example:
@client.add_key("Personal projects key", "ssh-rsa AAA...")
Note: Requires authenticated client.
See Also:
List all GitHub users
This provides a list of every user, in the order that they signed up for GitHub.
See Also:
List email addresses for a user.
Example:
@client.emails
Note: Requires an authenticated client.
See Also:
Retrieve access token
Example:
Octokit.client.exchange_code_for_token("aaaa", "xxxx", "yyyy", {accept: "application/json"})
See Also:
Follow a user.
Example:
@client.follow("watzon")
Note: Requires an authenticated user.
See Also:
Get a user's followers
Example:
Octokit.client.followers("watzon")
See Also:
Get a list of users the user is following
Example:
Octokit.client.following("watzon")
See Also:
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:
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:
Get a list of public keys for a user.
Examples:
@client.keys
@client.keys("watzon")
Note: Requires an authenticated client.
See Also:
List public email addresses for a user.
Example:
@client.public_emails
Note: Requires an authenticated client.
See Also:
Remove email from user.
Example:
@client.remove_email("[email protected]")
Note: Requires authenticated client.
See Also:
Delete a public key.
Example:
@client.remove_key(1)
Note: Requires an authenticated client.
See Also:
Get a list of repos starred by a user.
Example:
Octokit.client.starred("watzon")
See Also:
Check if you are starring a repo.
Example:
@client.starred?("watzon/octokit")
Note: Requires an authenticated client.
See Also:
List repositories being watched by a user.
Example:
@client.subscriptions("watzon")
See Also:
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:
Unfollow a user.
Example:
@client.unfollow("watzon")
Note: Requires an authenticated user.
See Also:
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: