Gogs Entities

This page documents the classes provided by gogs_client module that represent entities (e.g. users, repositories) in a Gogs server.

GogsUser

class GogsUser

An immutable representation of a Gogs user

id

The user’s id

Type:int
user_id

The user’s id

Type:int

Deprecated since version 1.1: Use id instead

username

The user’s username

Type:str
full_name

The user’s full name

Type:str
email

The user’s email address. Can be empty as a result of invalid authentication

Type:str
avatar_url

The user’s avatar URL

Type:str

GogsRepo

class GogsRepo

An immutable representation of a Gogs repository

id

The repository’s id

Type:int
repo_id

The repository’s id

Type:int

Deprecated since version 1.1: Use id instead

owner

The owner of the repository

Type:GogsUser
name

The name of the repository

Type:str
full_name

The full name of the repository

Type:str
private

Whether the repository is private

Type:bool
fork

Whether the repository is a fork

Type:bool
default_branch

The name of the default branch

Type:str
urls

URLs of the repository

Type:Urls
permissions

Permissions for the repository

Type:Permissions
parent

Gets the repository’s parent, when a fork

Type:GogsRepo
description

The description of the repository

Type:str
empty

Whether the repository is empty

Type:bool
size

Size of the repository in kilobytes

Type:int
class GogsRepo.Urls
html_url

URL for the repository’s webpage

Type:str
clone_url

URL for cloning the repository (via HTTP)

Type:str
ssh_url

URL for cloning the repository via SSH

Type:str
class GogsRepo.Permissions
admin

Whether the user that requested this repository has admin permissions

Type:bool
push

Whether the user that requested this repository has push permissions

Type:bool
pull

Whether the user that requested this repository has pull permissions

Type:bool
class GogsRepo.Hook
id

The hook’s id number

Type:int
hook_id

The hook’s id number

Type:int

Deprecated since version 1.1: Use id instead

type

The hook’s type (gogs, slack, etc.)

Type:str
hook_type

The hook’s type (gogs, slack, etc.)

Type:str

Deprecated since version 1.1: Use type instead

events

The events that fire the hook

Type:List[str]
active

Whether the hook is active

Type:bool
config

Config of the hook. Possible keys include "content_type", "url", "secret"

Type:dict
class GogsRepo.DeployKey
id

The key’s id number

Type:int
key_id

The key’s id number

Type:int

Deprecated since version 1.1: Use id instead

key

The content of the key

Type:str
url

URL where the key can be found

Type:str
title

The name of the key

Type:str
created_at

Creation date of the key

Type:str
read_only

Whether key is read-only

Type:bool

GogsOrg

class GogsOrg

An immutable representation of a Gogs organization

id

The organization’s id

Type:int
org_id

The organization’s id

Type:int

Deprecated since version 1.1: Use id instead

username

Organization’s username

Type:str
full_name

Organization’s full name

Type:str
avatar_url

Organization’s avatar URL

Type:str
description

Organization’s description

Type:str
website

Organization’s website address

Type:str
location

Organization’s location

Type:str

GogsTeam

class GogsTeam

An immutable representation of a Gogs organization team

id

Team’s id

Type:int
team_id

Team’s id

Type:int

Deprecated since version 1.1: Use id instead

name

Team name

Type:str
description

Description of the team

Type:str
permission

Team permission, one of “read”, “write”, “admin”, “owner” or “none”

Type:str

GogsBranch

class GogsBranch

An immutable representation of a Gogs branch

name

The branch’s name

Type:str
commit

The HEAD commit of the branch

Type:GogsCommit

GogsCommit

class GogsCommit

An immutable representation of a Gogs commit

id

The commit’s id

Type:str
message

The commit’s message

Type:str
url

The commit’s url

Type:str
timestamp

The commit’s timestamp

Type:str