Module aiogithubapi.models.user

GitHub user models data class.

Expand source code
"""GitHub user models data class."""
from __future__ import annotations

from typing import Any, Dict

from .base import GitHubDataModelBase


class GitHubBaseUserModel(GitHubDataModelBase):
    """GitHub base user data class."""

    avatar_url: str | None = None
    events_url: str | None = None
    followers_url: str | None = None
    following_url: str | None = None
    gists_url: str | None = None
    gravatar_id: str | None = None
    html_url: str | None = None
    id: int | None = None
    login: str | None = None
    organizations_url: str | None = None
    received_events_url: str | None = None
    repos_url: str | None = None
    site_admin: bool | None = None
    starred_url: str | None = None
    subscriptions_url: str | None = None
    type: str | None = None
    url: str | None = None


class GitHubUserModel(GitHubBaseUserModel):
    """GitHub user data class."""

    bio: str | None = None
    blog: str | None = None
    company: str | None = None
    created_at: str | None = None
    email: str | None = None
    followers: int | None = None
    following: int | None = None
    hireable: bool | None = None
    location: str | None = None
    name: str | None = None
    public_gists: int | None = None
    public_repos: int | None = None
    twitter_username: str | None = None
    updated_at: str | None = None


class GitHubAuthenticatedUserModel(GitHubUserModel):
    """GitHub authenticated user data class."""

    collaborators: int | None = None
    disk_usage: int | None = None
    owned_private_repos: int | None = None
    plan: GitHubUserPlanModel | None = None
    private_gists: int | None = None
    total_private_repos: int | None = None
    two_factor_authentication: bool | None = None

    def _generate_plan(self, data: Dict[str, Any] | None) -> GitHubUserPlanModel:
        """Generate GitHub user plan model."""
        return GitHubUserPlanModel(data) if data else None


class GitHubUserPlanModel(GitHubDataModelBase):
    """GitHub user plan data class."""

    collaborators: int | None = None
    name: str | None = None
    private_repos: int | None = None
    space: int | None = None

Classes

class GitHubAuthenticatedUserModel (data: Dict[str, Any])

GitHub authenticated user data class.

Init.

Expand source code
class GitHubAuthenticatedUserModel(GitHubUserModel):
    """GitHub authenticated user data class."""

    collaborators: int | None = None
    disk_usage: int | None = None
    owned_private_repos: int | None = None
    plan: GitHubUserPlanModel | None = None
    private_gists: int | None = None
    total_private_repos: int | None = None
    two_factor_authentication: bool | None = None

    def _generate_plan(self, data: Dict[str, Any] | None) -> GitHubUserPlanModel:
        """Generate GitHub user plan model."""
        return GitHubUserPlanModel(data) if data else None

Ancestors

Class variables

var collaborators : int | None
var disk_usage : int | None
var owned_private_repos : int | None
var planGitHubUserPlanModel | None
var private_gists : int | None
var total_private_repos : int | None
var two_factor_authentication : bool | None

Inherited members

class GitHubBaseUserModel (data: Dict[str, Any])

GitHub base user data class.

Init.

Expand source code
class GitHubBaseUserModel(GitHubDataModelBase):
    """GitHub base user data class."""

    avatar_url: str | None = None
    events_url: str | None = None
    followers_url: str | None = None
    following_url: str | None = None
    gists_url: str | None = None
    gravatar_id: str | None = None
    html_url: str | None = None
    id: int | None = None
    login: str | None = None
    organizations_url: str | None = None
    received_events_url: str | None = None
    repos_url: str | None = None
    site_admin: bool | None = None
    starred_url: str | None = None
    subscriptions_url: str | None = None
    type: str | None = None
    url: str | None = None

Ancestors

Subclasses

Class variables

var avatar_url : str | None
var events_url : str | None
var followers_url : str | None
var following_url : str | None
var gists_url : str | None
var gravatar_id : str | None
var html_url : str | None
var id : int | None
var login : str | None
var organizations_url : str | None
var received_events_url : str | None
var repos_url : str | None
var site_admin : bool | None
var starred_url : str | None
var subscriptions_url : str | None
var type : str | None
var url : str | None

Inherited members

class GitHubUserModel (data: Dict[str, Any])

GitHub user data class.

Init.

Expand source code
class GitHubUserModel(GitHubBaseUserModel):
    """GitHub user data class."""

    bio: str | None = None
    blog: str | None = None
    company: str | None = None
    created_at: str | None = None
    email: str | None = None
    followers: int | None = None
    following: int | None = None
    hireable: bool | None = None
    location: str | None = None
    name: str | None = None
    public_gists: int | None = None
    public_repos: int | None = None
    twitter_username: str | None = None
    updated_at: str | None = None

Ancestors

Subclasses

Class variables

var bio : str | None
var blog : str | None
var company : str | None
var created_at : str | None
var email : str | None
var followers : int | None
var following : int | None
var hireable : bool | None
var location : str | None
var name : str | None
var public_gists : int | None
var public_repos : int | None
var twitter_username : str | None
var updated_at : str | None

Inherited members

class GitHubUserPlanModel (data: Dict[str, Any])

GitHub user plan data class.

Init.

Expand source code
class GitHubUserPlanModel(GitHubDataModelBase):
    """GitHub user plan data class."""

    collaborators: int | None = None
    name: str | None = None
    private_repos: int | None = None
    space: int | None = None

Ancestors

Class variables

var collaborators : int | None
var name : str | None
var private_repos : int | None
var space : int | None

Inherited members