AuthenticatedUser
- class github.AuthenticatedUser.AuthenticatedUser
This class represents AuthenticatedUsers as returned by https://docs.github.com/en/rest/reference/users#get-the-authenticated-user
An AuthenticatedUser object can be created by calling
get_user()on a Github object.The OpenAPI schema can be found at
/components/schemas/private-user
/components/schemas/public-user
A CompletableGithubObject can be partially initialised (completed=False). Accessing attributes that are not initialized will then trigger a request to complete all attributes.
A partially initialized CompletableGithubObject (completed=False) can be completed via
complete(). This requires the url to be given via parameterurlorattributes.With a requester where
Requester.is_lazy == True, this CompletableGithubObjects is partially initialized. This requires the url to be given via parameterurlorattributes. Any CompletableGithubObject created from this lazy object will be lazy itself if created with parameterurlorattributes.- Parameters:
requester – requester
headers – response headers
attributes – attributes to initialize
completed – do not update non-initialized attributes when True
url – url of this instance, overrides attributes[‘url’]
accept – use this accept header when completing this instance
- add_to_emails(*emails: str) None
- Calls:
- add_to_starred(starred: Repository) None
- add_to_subscriptions(subscription: Repository) None
- add_to_watched(watched: Repository) None
- create_authorization(scopes: Opt[list[str]] = NotSet, note: Opt[str] = NotSet, note_url: Opt[str] = NotSet, client_id: Opt[str] = NotSet, client_secret: Opt[str] = NotSet, onetime_password: str | None = None) Authorization
- Calls:
- static create_fork(repo: Repository, name: Opt[str] = NotSet, default_branch_only: Opt[bool] = NotSet) Repository
- create_repo_from_template(name: str, repo: Repository, description: Opt[str] = NotSet, include_all_branches: Opt[bool] = NotSet, private: Opt[bool] = NotSet) Repository
- create_gist(public: bool, files: dict[str, InputFileContent], description: Opt[str] = NotSet) Gist
- Calls:
- create_key(title: str, key: str) UserKey
- Calls:
- Parameters:
title – string
key – string
- Return type:
- create_project(name: str, body: Opt[str] = NotSet) Project
- Calls:
- Parameters:
name – string
body – string
- Return type:
- create_repo(name: str, description: Opt[str] = NotSet, homepage: Opt[str] = NotSet, private: Opt[bool] = NotSet, has_issues: Opt[bool] = NotSet, has_wiki: Opt[bool] = NotSet, has_downloads: Opt[bool] = NotSet, has_projects: Opt[bool] = NotSet, has_discussions: Opt[bool] = NotSet, auto_init: Opt[bool] = NotSet, license_template: Opt[str] = NotSet, gitignore_template: Opt[str] = NotSet, allow_squash_merge: Opt[bool] = NotSet, allow_merge_commit: Opt[bool] = NotSet, allow_rebase_merge: Opt[bool] = NotSet, delete_branch_on_merge: Opt[bool] = NotSet) Repository
- Calls:
- edit(name: str | _NotSetType = NotSet, email: str | _NotSetType = NotSet, blog: str | _NotSetType = NotSet, company: str | _NotSetType = NotSet, location: str | _NotSetType = NotSet, hireable: bool | _NotSetType = NotSet, bio: str | _NotSetType = NotSet) None
- Calls:
- get_authorization(id: int) Authorization
- Calls:
- get_authorizations() PaginatedList[Authorization]
- Calls:
- get_emails() list[EmailData]
- Calls:
- get_events() PaginatedList[Event]
- Calls:
- get_followers() PaginatedList[NamedUser]
- Calls:
- get_following() PaginatedList[NamedUser]
- Calls:
- get_gists(since: Opt[datetime] = NotSet) PaginatedList[Gist]
- Calls:
- Parameters:
since – datetime format YYYY-MM-DDTHH:MM:SSZ
- Return type:
PaginatedListofgithub.Gist.Gist
- get_issues(filter: Opt[str] = NotSet, state: Opt[str] = NotSet, labels: Opt[list[Label]] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet) PaginatedList[Issue]
- Calls:
- get_user_issues(filter: Opt[str] = NotSet, state: Opt[str] = NotSet, labels: Opt[list[Label]] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet) PaginatedList[Issue]
- Calls:
- get_keys() PaginatedList[UserKey]
- Calls:
- get_notification(id: str) Notification
- get_notifications(all: Opt[bool] = NotSet, participating: Opt[bool] = NotSet, since: Opt[datetime] = NotSet, before: Opt[datetime] = NotSet) PaginatedList[Notification]
- Calls:
- get_organization_events(org: Organization) PaginatedList[Event]
- get_orgs() PaginatedList[Organization]
- Calls:
- get_repo(name: str) Repository
- Calls:
- get_repos(visibility: Opt[str] = NotSet, affiliation: Opt[str] = NotSet, type: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet) PaginatedList[Repository]
- Calls:
- get_starred() PaginatedList[Repository]
- Calls:
- get_starred_gists() PaginatedList[Gist]
- Calls:
- get_subscriptions() PaginatedList[Repository]
- Calls:
- get_teams() PaginatedList[Team]
- Calls:
- get_watched() PaginatedList[Repository]
- Calls:
- get_installations() PaginatedList[Installation]
- Calls:
- has_in_starred(starred: Repository) bool
- has_in_subscriptions(subscription: Repository) bool
- has_in_watched(watched: Repository) bool
- mark_notifications_as_read(last_read_at: datetime | None = None) None
- Calls:
- remove_from_emails(*emails: str) None
- Calls:
- remove_from_starred(starred: Repository) None
- remove_from_subscriptions(subscription: Repository) None
- remove_from_watched(watched: Repository) None
- accept_invitation(invitation: Invitation | int) None
- get_invitations() PaginatedList[Invitation]
- create_migration(repos: list[Repository] | tuple[Repository], lock_repositories: Opt[bool] = NotSet, exclude_attachments: Opt[bool] = NotSet) Migration
- Calls:
- get_migrations() PaginatedList[Migration]
- Calls:
- get_organization_memberships() PaginatedList[Membership]
- Calls:
- get_organization_membership(org: str) Membership