octomachinery.github.models package

Module contents

Models representing objects in GitHub API.

class octomachinery.github.models.GitHubAppInstallation(id, app_id, app_slug, created_at, updated_at, account: Dict[str, Any], events: List[str], permissions: Dict[str, Any], repository_selection, single_file_name: Optional[str], target_id, target_type: str, access_tokens_url, html_url, repositories_url, suspended_at: Optional[str], suspended_by: Optional[str])[source]

Bases: object

Represents a GitHub App installed into a user or an organization profile.

It has its own ID for installation which is a unique combo of an app and a profile (user or org).

access_tokens_url: str

API endpoint to retrieve access token from.

account: Dict[str, Any]

Target account (org or user) where this GitHub App is installed into.

app_id: int

GitHub App ID.

app_slug: str

GitHub App slug.

created_at: datetime.datetime

Date time when the installation has been installed.

events: List[str]

List of webhook events the app will be receiving from the account.

html_url: str

URL for controlling the GitHub App Installation.

id: int

Installation ID.

permissions: Dict[str, Any]

Permission levels of access to API endpoints types.

repositories_url: str

API endpoint listing repositories accissible by this Installation.

repository_selection: str

Repository selection mode.

single_file_name: Optional[str]

File path the GitHub app controls.

suspended_at: Optional[str]
suspended_by: Optional[str]
target_id: int

Target account ID where this GitHub App is installed into.

target_type: str

Target account type where this GitHub App is installed into.

updated_at: datetime.datetime

Date time when the installation was last updated.

class octomachinery.github.models.GitHubInstallationAccessToken(token, expires_at, permissions: Dict[str, str], repository_selection, repositories=[], single_file: Optional[str] = None)[source]

Bases: object

Struct for installation access token response from GitHub API.

property expired

Check whether this token has expired already.

expires_at: datetime.datetime

Token expiration time.

permissions: Dict[str, str]

Permission levels of access to API endpoints types.

repositories: List[Dict[str, Any]]

List of accessible repositories.

repository_selection: str

Repository selection mode.

single_file: Optional[str]

File path the GitHub app controls.

token: octomachinery.github.models.utils.SecretStr

Access token for GitHub App Installation.