Module aiogithubapi.models.rate_limit

GitHub rate limit data class.

Expand source code
"""GitHub rate limit data class."""
from __future__ import annotations

from typing import Any, Dict

from .base import GitHubDataModelBase


class GitHubRateLimitResourceModel(GitHubDataModelBase):
    """GitHub rate limit resource data class."""

    limit: int | None = None
    used: int | None = None
    remaining: int | None = None
    reset: int | None = None


class GitHubRateLimitResourcesModel(GitHubDataModelBase):
    """GitHub rate limit resources data class."""

    core: GitHubRateLimitResourceModel | None = None
    search: GitHubRateLimitResourceModel | None = None
    graphql: GitHubRateLimitResourceModel | None = None
    integration_manifest: GitHubRateLimitResourceModel | None = None
    source_import: GitHubRateLimitResourceModel | None = None
    code_scanning_upload: GitHubRateLimitResourceModel | None = None
    actions_runner_registration: GitHubRateLimitResourceModel | None = None
    scim: GitHubRateLimitResourceModel | None = None

    def _generate_core(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_search(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_graphql(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_integration_manifest(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_source_import(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_code_scanning_upload(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None


class GitHubRateLimitModel(GitHubDataModelBase):
    """GitHub rate limit data class."""

    rate: GitHubRateLimitResourceModel | None = None
    resources: GitHubRateLimitResourcesModel | None = None

    def _generate_rate(self, data: Dict[str, Any]) -> GitHubRateLimitResourceModel:
        """Generate rate limit resource model."""
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_resources(self, data: Dict[str, Any]) -> GitHubRateLimitResourcesModel:
        """Generate rate limit resources model."""
        return GitHubRateLimitResourcesModel(data) if data else None

Classes

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

GitHub rate limit data class.

Init.

Expand source code
class GitHubRateLimitModel(GitHubDataModelBase):
    """GitHub rate limit data class."""

    rate: GitHubRateLimitResourceModel | None = None
    resources: GitHubRateLimitResourcesModel | None = None

    def _generate_rate(self, data: Dict[str, Any]) -> GitHubRateLimitResourceModel:
        """Generate rate limit resource model."""
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_resources(self, data: Dict[str, Any]) -> GitHubRateLimitResourcesModel:
        """Generate rate limit resources model."""
        return GitHubRateLimitResourcesModel(data) if data else None

Ancestors

Class variables

var rateGitHubRateLimitResourceModel | None
var resourcesGitHubRateLimitResourcesModel | None

Inherited members

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

GitHub rate limit resource data class.

Init.

Expand source code
class GitHubRateLimitResourceModel(GitHubDataModelBase):
    """GitHub rate limit resource data class."""

    limit: int | None = None
    used: int | None = None
    remaining: int | None = None
    reset: int | None = None

Ancestors

Class variables

var limit : int | None
var remaining : int | None
var reset : int | None
var used : int | None

Inherited members

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

GitHub rate limit resources data class.

Init.

Expand source code
class GitHubRateLimitResourcesModel(GitHubDataModelBase):
    """GitHub rate limit resources data class."""

    core: GitHubRateLimitResourceModel | None = None
    search: GitHubRateLimitResourceModel | None = None
    graphql: GitHubRateLimitResourceModel | None = None
    integration_manifest: GitHubRateLimitResourceModel | None = None
    source_import: GitHubRateLimitResourceModel | None = None
    code_scanning_upload: GitHubRateLimitResourceModel | None = None
    actions_runner_registration: GitHubRateLimitResourceModel | None = None
    scim: GitHubRateLimitResourceModel | None = None

    def _generate_core(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_search(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_graphql(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_integration_manifest(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_source_import(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

    def _generate_code_scanning_upload(self, data: Any) -> GitHubRateLimitResourceModel:
        return GitHubRateLimitResourceModel(data) if data else None

Ancestors

Class variables

var actions_runner_registrationGitHubRateLimitResourceModel | None
var code_scanning_uploadGitHubRateLimitResourceModel | None
var coreGitHubRateLimitResourceModel | None
var graphqlGitHubRateLimitResourceModel | None
var integration_manifestGitHubRateLimitResourceModel | None
var scimGitHubRateLimitResourceModel | None
var searchGitHubRateLimitResourceModel | None
var source_importGitHubRateLimitResourceModel | None

Inherited members