or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

actions.mdadditional-services.mdapps.mdchecks.mdclient.mdenterprise.mdgit.mdindex.mdissues.mdorganizations.mdrepositories.mdteams.mdusers.md
tile.json

users.mddocs/

Users

User profile management, authentication, followers, SSH keys, GPG keys, and user-related operations.

UsersService

The UsersService provides 94 methods for user management.

type UsersService struct{}

User Operations

Get Users

// Get fetches a user by username (use "" for authenticated user)
func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error)

// GetByID fetches a user by ID
func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error)

// GetAuthenticated fetches the authenticated user
func (s *UsersService) GetAuthenticated(ctx context.Context) (*User, *Response, error)

List Users

// ListAll lists all GitHub users (admin only)
func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error)

Edit User

// Edit the authenticated user's profile
func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error)

type User struct {
    Login               *string
    ID                  *int64
    NodeID              *string
    AvatarURL           *string
    HTMLURL             *string
    Name                *string
    Company             *string
    Blog                *string
    Location            *string
    Email               *string
    Hireable            *bool
    Bio                 *string
    TwitterUsername     *string
    PublicRepos         *int
    PublicGists         *int
    Followers           *int
    Following           *int
    CreatedAt           *Timestamp
    UpdatedAt           *Timestamp
    SuspendedAt         *Timestamp
    Type                *string
    SiteAdmin           *bool
    // Additional fields
    TotalPrivateRepos *int
    OwnedPrivateRepos *int
    PrivateGists      *int
    DiskUsage         *int
    Collaborators     *int
    TwoFactorAuthentication *bool
}

User Emails

// ListEmails lists all email addresses for the authenticated user
func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error)

// AddEmails adds email addresses to the authenticated user
func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error)

// DeleteEmails deletes email addresses from the authenticated user
func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error)

// SetEmailVisibility sets the visibility for the authenticated user's email addresses
func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility *UserEmailVisibility) ([]*UserEmail, *Response, error)

type UserEmail struct {
    Email      *string
    Primary    *bool
    Verified   *bool
    Visibility *string
}

Followers and Following

// ListFollowers lists followers of a user
func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error)

// ListFollowing lists users followed by another user
func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error)

// IsFollowing checks if one user follows another
func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error)

// Follow makes the authenticated user follow another user
func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error)

// Unfollow makes the authenticated user unfollow another user
func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error)

SSH Keys

// ListKeys lists public SSH keys for a user
func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error)

// GetKey fetches a single public SSH key
func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error)

// CreateKey adds a public SSH key for the authenticated user
func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error)

// DeleteKey deletes a public SSH key
func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error)

type Key struct {
    ID        *int64
    Key       *string
    URL       *string
    Title     *string
    ReadOnly  *bool
    Verified  *bool
    CreatedAt *Timestamp
}

GPG Keys

// ListGPGKeys lists GPG keys for a user
func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error)

// GetGPGKey gets a single GPG key
func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error)

// CreateGPGKey adds a GPG key for the authenticated user
func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error)

// DeleteGPGKey deletes a GPG key
func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error)

type GPGKey struct {
    ID                *int64
    PrimaryKeyID      *int64
    KeyID             *string
    RawKey            *string
    PublicKey         *string
    Emails            []*GPGEmail
    Subkeys           []*GPGKey
    CanSign           *bool
    CanEncryptComms   *bool
    CanEncryptStorage *bool
    CanCertify        *bool
    CreatedAt         *Timestamp
    ExpiresAt         *Timestamp
    Revoked           *bool
}

User Blocking

// ListBlockedUsers lists users blocked by the authenticated user
func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error)

// IsBlocked checks if a user is blocked by the authenticated user
func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error)

// BlockUser blocks a user
func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error)

// UnblockUser unblocks a user
func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error)

User Projects

// ListProjects lists projects for a user
func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error)

// CreateProject creates a user project
func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error)

User Packages

// ListPackages lists packages for a user
func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error)

// GetPackage gets a package for a user
func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error)

// DeletePackage deletes a package for a user
func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error)

User Social Accounts

// ListSocialAccounts lists social accounts for the authenticated user
func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions) ([]*SocialAccount, *Response, error)

// AddSocialAccounts adds social accounts for the authenticated user
func (s *UsersService) AddSocialAccounts(ctx context.Context, accounts []string) ([]*SocialAccount, *Response, error)

// DeleteSocialAccounts deletes social accounts for the authenticated user
func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accounts []string) (*Response, error)