gitcode_api._models

Typed response models for the GitCode SDK.

Functions

as_model(data, model_type)

Wrap a mapping in the requested SDK model type.

as_model_list(data, model_type)

Wrap a list of mappings in the requested SDK model type.

Classes

APIObject(data)

Dictionary-backed wrapper around GitCode JSON objects.

ApiStatusResponse(data)

Simple success/error response containing a numeric code and message.

Blob(data)

Git blob payload.

Branch(data)

Repository branch payload returned by list/create endpoints.

BranchDetail(data)

Repository branch payload returned by the detail endpoint.

BranchDetailCommit(data)

Commit object returned inside branch detail responses.

BranchListCommit(data)

Nested branch summary commit payload.

Commit(data)

Commit payload returned by detail endpoints.

CommitAuthorSummary(data)

Author summary on commit/search payloads.

CommitComment(data)

Commit comment payload.

CommitComparison(data)

Commit comparison payload.

CommitFile(data)

Commit file entry.

CommitIdentity(data)

Commit author/committer identity.

CommitParent(data)

Commit parent reference.

CommitPayload(data)

Nested commit metadata.

CommitResult(data)

Commit result payload returned by content write operations.

CommitStats(data)

Commit diff stats.

CommitSummary(data)

Commit payload returned by list endpoints.

CommitTreeRef(data)

Tree reference embedded in commit summaries.

ContentLinks(data)

Repository content link bundle.

ContentObject(data)

Repository content payload for files and directories.

ContentWriteCommit(data)

Commit object returned by content write endpoints.

Contributor(data)

Contributor payload returned by repository statistics endpoints.

ContributorStatistics(data)

Contributor statistics payload returned by the repository statistics endpoint.

ContributorStatisticsEntry(data)

Per-day contributor statistics entry.

ContributorStatisticsOverview(data)

Aggregate contributor statistics summary.

Email(data)

Email payload for the authenticated user.

EmptyResponse(data)

Empty JSON object returned by some mutation endpoints.

EnterpriseMember(data)

Enterprise member payload.

EnterpriseRef(data)

Enterprise summary embedded in repository search results.

Issue(data)

Issue payload.

IssueComment(data)

Issue comment payload.

IssueCreateParams

Typed fields accepted by issue creation endpoints.

IssueOperationLog(data)

Issue operation log payload.

Label(data)

Label payload.

MergeResult(data)

Merge operation result payload.

MergeStatus(data)

Merge status payload.

Milestone(data)

Milestone payload.

Namespace(data)

Namespace payload returned by the namespace lookup endpoint.

NamespaceDetails(data)

Namespace object embedded in repository payloads.

OAuthToken(data)

OAuth token payload.

Organization(data)

Organization payload.

OrganizationMembership(data)

Organization membership payload.

OrganizationSummary(data)

Organization summary payload returned by list endpoints.

ProtectedBranch(data)

Protected branch configuration payload.

ProtectedTag(data)

Protected tag configuration payload.

PublicKey(data)

Public SSH key payload.

PullRequest(data)

Pull request payload.

PullRequestApprover(data)

Approver/tester embedded in pull request responses.

PullRequestAssigneeCount(data)

Response payload when assignees are added to a pull request.

PullRequestBranch(data)

Head/base branch payload in pull request responses.

PullRequestComment(data)

Pull request comment payload.

PullRequestCount(data)

Pull request count payload returned when only_count is enabled.

PullRequestCreateParams

Typed fields accepted by pull request creation endpoints.

PullRequestDiffRefs(data)

Diff refs embedded in pull requests.

PullRequestFile(data)

Pull request file diff payload.

PullRequestOperationLog(data)

Pull request operation log entry.

PullRequestReview(data)

Pull request review payload.

PullRequestSettingDetail(data)

Nested merge request setting payload in repository PR settings.

PullRequestSettings(data)

Repository pull request settings payload.

PullRequestTest(data)

Pull request test request payload.

PullRequestTimeStats(data)

Time tracking fields embedded in pull requests.

Release(data)

Release payload.

RepoCollaborator(data)

Repository collaborator payload returned by list operations.

RepoMember(data)

Repository member payload returned by add/update operations.

RepoMemberPermission(data)

Repository member permission payload.

RepoMemberPermissions(data)

Collaborator permissions payload.

Repository(data)

Repository payload returned by repository endpoints.

RepositoryCollaboratorCheck(data)

Repository collaborator presence check response.

RepositoryCreateParams

Typed fields accepted by repository creation endpoints.

RepositoryCustomizedRole(data)

Customized repository role definition.

RepositoryDownloadStatistics(data)

Repository download statistics payload.

RepositoryDownloadStatisticsDetail(data)

Per-day repository download statistics entry.

RepositoryPermission(data)

Repository permission summary.

RepositoryPermissionMode(data)

Repository member management mode.

RepositoryPushConfig(data)

Repository push rules configuration.

RepositoryReviewerSettingsUpdate(data)

Response returned after updating repository reviewer settings.

RepositorySettings(data)

Repository-level settings payload.

RepositorySummary(data)

Minimal repository payload embedded in issue/search responses.

RepositoryTransferResult(data)

Repository transfer result payload.

RepositoryUploadResult(data)

Uploaded repository attachment metadata.

SearchIssue(data)

Issue search result payload.

SearchRepository(data)

Repository search result payload.

SearchResult(data)

Backward-compatible generic search result payload.

SearchUser(data)

User search result payload.

Tag(data)

Tag payload.

TagCommit(data)

Commit object embedded in tag payloads.

Tagger(data)

Tagger identity.

Tree(data)

Git tree payload.

TreeEntry(data)

Git tree entry.

User(data)

User profile payload returned by user-related endpoints.

UserEvent(data)

Single activity event returned by the user events endpoint.

UserEventLinks(data)

Link bundle embedded in user event responses.

UserEventProject(data)

Project summary embedded in user event responses.

UserEventPushData(data)

Push event metadata embedded in user events.

UserEventsResponse(data)

Grouped user events response keyed by date.

UserRef(data)

Compact user payload embedded in other responses.

UserSummary(data)

Compact user payload returned by stargazer/subscriber endpoints.

Webhook(data)

Webhook payload.

WebhookCreateParams

Typed fields accepted by webhook creation endpoints.

class APIObject(data: Mapping[str, Any])

Bases: Mapping[str, Any]

Dictionary-backed wrapper around GitCode JSON objects.

get(k[, d]) D[k] if k in D, else d.  d defaults to None.
as_model(data: Mapping[str, Any], model_type: type[ModelT]) ModelT

Wrap a mapping in the requested SDK model type.

as_model_list(data: List[Mapping[str, Any]], model_type: type[ModelT]) List[ModelT]

Wrap a list of mappings in the requested SDK model type.

class RepositoryCreateParams

Bases: TypedDict

Typed fields accepted by repository creation endpoints.

class IssueCreateParams

Bases: TypedDict

Typed fields accepted by issue creation endpoints.

class PullRequestCreateParams

Bases: TypedDict

Typed fields accepted by pull request creation endpoints.

class WebhookCreateParams

Bases: TypedDict

Typed fields accepted by webhook creation endpoints.

class UserRef(data: Mapping[str, Any])

Bases: APIObject

Compact user payload embedded in other responses.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • name (Optional[str]) – Display name.

  • username (Optional[str]) – Account username.

  • type (Optional[str]) – Type of the object.

  • html_url (Optional[str]) – Web URL for this object.

  • avatar_url (Optional[str]) – Avatar image URL.

  • email (Optional[str]) – Email address.

  • state (Optional[str]) – Current state value.

  • member_role (Optional[str]) – Role of the user within the current repository or organization context.

  • remark (Optional[str]) – Remark or note recorded for the user.

  • url (Optional[str]) – API URL for this object.

  • web_url (Optional[str]) – Web URL for this object.

  • name_cn (Optional[str]) – Chinese display name for the user.

  • avatar_path (Optional[str]) – Path to the user avatar resource.

  • tenant_name (Optional[str]) – Tenant name associated with the user.

  • is_member (Optional[bool]) – Whether the user is a member in the current context.

  • assignee (Optional[bool]) – Whether the user can be selected as an assignee.

  • code_owner (Optional[bool]) – Whether the user is configured as a code owner.

  • accept (Optional[bool]) – Whether the user has accepted the invitation or request.

class User(data: Mapping[str, Any])

Bases: UserRef

User profile payload returned by user-related endpoints.

Variables:
  • followers_url (Optional[str]) – Followers URL.

  • following_url (Optional[str]) – Following URL.

  • gists_url (Optional[str]) – Gists URL.

  • organizations_url (Optional[str]) – Organizations URL.

  • received_events_url (Optional[str]) – Received events URL.

  • repos_url (Optional[str]) – Repos URL.

  • starred_url (Optional[str]) – Starred URL.

  • subscriptions_url (Optional[str]) – Subscriptions URL.

  • bio (Optional[str]) – Bio.

  • blog (Optional[str]) – Blog.

  • company (Optional[str]) – Company.

  • followers (Optional[int]) – Followers.

  • following (Optional[int]) – Following.

  • top_languages (Optional[List[str]]) – Top languages.

class UserSummary(data: Mapping[str, Any])

Bases: APIObject

Compact user payload returned by stargazer/subscriber endpoints.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • name (Optional[str]) – Display name.

  • avatar_url (Optional[str]) – Avatar image URL.

  • html_url (Optional[str]) – Web URL for this object.

  • type (Optional[str]) – Type of the object.

class NamespaceDetails(data: Mapping[str, Any])

Bases: APIObject

Namespace object embedded in repository payloads.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • type (Optional[str]) – Type of the object.

  • name (Optional[str]) – Display name.

  • path (Optional[str]) – Repository-relative or namespace path.

  • html_url (Optional[str]) – Web URL for this object.

  • develop_mode (Optional[str]) – Development mode configured for the namespace.

  • region (Optional[str]) – Region.

  • cell (Optional[str]) – Cell identifier of the namespace.

  • kind (Optional[str]) – Kind of namespace.

  • full_path (Optional[str]) – Full path for the object.

  • full_name (Optional[str]) – Full display name for the object.

  • parent_id (Optional[Union[int, str]]) – ID of the parent namespace.

  • visibility_level (Optional[int]) – Visibility level configured for the namespace.

  • enable_file_control (Optional[bool]) – Whether file control is enabled for the namespace.

  • owner_id (Optional[Union[int, str]]) – ID of the namespace owner.

class Namespace(data: Mapping[str, Any])

Bases: APIObject

Namespace payload returned by the namespace lookup endpoint.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • path (Optional[str]) – Repository-relative or namespace path.

  • name (Optional[str]) – Display name.

  • html_url (Optional[str]) – Web URL for this object.

  • type (Optional[str]) – Type of the object.

class RepositoryPermission(data: Mapping[str, Any])

Bases: APIObject

Repository permission summary.

Variables:
  • pull (Optional[bool]) – Pull.

  • push (Optional[bool]) – Push.

  • admin (Optional[bool]) – Admin.

class EnterpriseRef(data: Mapping[str, Any])

Bases: APIObject

Enterprise summary embedded in repository search results.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • path (Optional[str]) – Repository-relative or namespace path.

  • html_url (Optional[str]) – Web URL for this object.

  • type (Optional[str]) – Type of the object.

class Repository(data: Mapping[str, Any])

Bases: APIObject

Repository payload returned by repository endpoints.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • full_name (Optional[str]) – Full display name for the object.

  • human_name (Optional[str]) – Human-readable display name.

  • path (Optional[str]) – Repository-relative or namespace path.

  • name (Optional[str]) – Display name.

  • description (Optional[str]) – Description text.

  • namespace (Optional[NamespaceDetails]) – Namespace that contains the repository.

  • owner (Optional[UserRef]) – Owner of the object.

  • private (Optional[bool]) – Whether the repository is private.

  • public (Optional[Union[bool, int]]) – Whether the repository is public.

  • internal (Optional[bool]) – Whether the repository is internal.

  • fork (Optional[bool]) – Whether the repository is a fork.

  • html_url (Optional[str]) – Web URL for this object.

  • web_url (Optional[str]) – Web URL for this object.

  • url (Optional[str]) – API URL for this object.

  • ssh_url_to_repo (Optional[str]) – Ssh url to repo.

  • http_url_to_repo (Optional[str]) – Http url to repo.

  • forks_count (Optional[int]) – Number of forks.

  • stargazers_count (Optional[int]) – Number of stargazers.

  • watchers_count (Optional[int]) – Number of watchers.

  • default_branch (Optional[str]) – Default branch name.

  • open_issues_count (Optional[int]) – Number of open issues.

  • license (Optional[APIObject]) – License.

  • project_creator (Optional[str]) – Login or identifier of the repository creator.

  • pushed_at (Optional[str]) – Timestamp of the most recent push.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • homepage (Optional[str]) – Homepage URL configured for the repository.

  • status (Optional[str]) – Status string returned by the API.

  • relation (Optional[str]) – Relationship between the current user and the repository.

  • members (Optional[List[str]]) – Members returned in the repository payload.

  • permission (Optional[RepositoryPermission]) – Permission summary for this object.

  • enterprise (Optional[Union[EnterpriseRef, str]]) – Enterprise associated with the repository.

  • issue_template_source (Optional[str]) – Source of the issue template project.

  • has_issue (Optional[bool]) – Whether issue tracking is enabled for the repository.

  • assigner (Optional[UserRef]) – User who assigned reviewers or assignees.

  • assignee (Optional[UserRef]) – Assigned user.

  • assignees_number (Optional[int]) – Number of configured assignees.

  • testers_number (Optional[int]) – Number of configured testers.

  • testers (Optional[List[UserRef]]) – Users configured as testers.

  • paas (Optional[APIObject]) – PaaS metadata attached to the repository.

class SearchRepository(data: Mapping[str, Any])

Bases: APIObject

Repository search result payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • full_name (Optional[str]) – Full display name for the object.

  • human_name (Optional[str]) – Human-readable display name.

  • url (Optional[str]) – API URL for this object.

  • namespace (Optional[Namespace]) – Namespace.

  • path (Optional[str]) – Repository-relative or namespace path.

  • name (Optional[str]) – Display name.

  • description (Optional[str]) – Description text.

  • status (Optional[str]) – Status string returned by the API.

  • ssh_url_to_repo (Optional[str]) – Ssh url to repo.

  • http_url_to_repo (Optional[str]) – Http url to repo.

  • web_url (Optional[str]) – Web URL for this object.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • homepage (Optional[str]) – Homepage URL configured for the repository.

  • members (Optional[List[str]]) – Members.

  • forks_count (Optional[int]) – Number of forks.

  • stargazers_count (Optional[int]) – Number of stargazers.

  • relation (Optional[str]) – Relationship between the current user and the repository.

  • permission (Optional[RepositoryPermission]) – Permission summary for this object.

  • internal (Optional[bool]) – Whether the repository is internal.

  • open_issues_count (Optional[int]) – Number of open issues.

  • has_issue (Optional[bool]) – Whether the object has issue.

  • watchers_count (Optional[int]) – Number of watchers.

  • enterprise (Optional[EnterpriseRef]) – Enterprise.

  • default_branch (Optional[str]) – Default branch name.

  • fork (Optional[bool]) – Whether the repository is a fork.

  • pushed_at (Optional[str]) – Timestamp of the most recent push.

  • owner (Optional[UserSummary]) – Owner of the object.

  • issue_template_source (Optional[str]) – Source of the issue template project.

  • private (Optional[bool]) – Whether the repository is private.

  • public (Optional[bool]) – Whether the repository is public.

class Contributor(data: Mapping[str, Any])

Bases: APIObject

Contributor payload returned by repository statistics endpoints.

Variables:
  • name (Optional[str]) – Display name.

  • contributions (Optional[int]) – Contributions.

  • email (Optional[str]) – Email address.

Bases: APIObject

Repository content link bundle.

Variables:
  • self (Optional[str]) – Self.

  • html (Optional[str]) – Html.

  • git (Optional[str]) – Git.

  • download (Optional[str]) – Download.

class ContentObject(data: Mapping[str, Any])

Bases: APIObject

Repository content payload for files and directories.

Variables:
  • type (Optional[str]) – Type of the object.

  • encoding (Optional[str]) – Encoding used for the content body.

  • size (Optional[int]) – Size.

  • name (Optional[str]) – Display name.

  • path (Optional[str]) – Repository-relative or namespace path.

  • content (Optional[str]) – Content returned for this object.

  • sha (Optional[str]) – Git SHA value.

  • url (Optional[str]) – API URL for this object.

  • html_url (Optional[str]) – Web URL for this object.

  • download_url (Optional[str]) – Direct download URL for the content.

  • _links (Optional[ContentLinks]) – Related content links returned by the API.

class CommitIdentity(data: Mapping[str, Any])

Bases: APIObject

Commit author/committer identity.

Variables:
  • name (Optional[str]) – Display name.

  • email (Optional[str]) – Email address.

  • date (Optional[str]) – Date.

class CommitParent(data: Mapping[str, Any])

Bases: APIObject

Commit parent reference.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • url (Optional[str]) – API URL for this object.

class CommitTreeRef(data: Mapping[str, Any])

Bases: APIObject

Tree reference embedded in commit summaries.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • url (Optional[str]) – API URL for this object.

class CommitPayload(data: Mapping[str, Any])

Bases: APIObject

Nested commit metadata.

Variables:
  • author (Optional[CommitIdentity]) – Author associated with this object.

  • committer (Optional[CommitIdentity]) – Committer associated with this object.

  • tree (Optional[CommitTreeRef]) – Tree.

  • message (Optional[str]) – Message text returned by the API.

class ContentWriteCommit(data: Mapping[str, Any])

Bases: APIObject

Commit object returned by content write endpoints.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • author (Optional[CommitIdentity]) – Author associated with this object.

  • committer (Optional[CommitIdentity]) – Committer associated with this object.

  • message (Optional[str]) – Message text returned by the API.

  • parents (Optional[List[CommitParent]]) – Parents.

class CommitResult(data: Mapping[str, Any])

Bases: APIObject

Commit result payload returned by content write operations.

Variables:
class TreeEntry(data: Mapping[str, Any])

Bases: APIObject

Git tree entry.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • name (Optional[str]) – Display name.

  • type (Optional[str]) – Type of the object.

  • path (Optional[str]) – Repository-relative or namespace path.

  • mode (Optional[str]) – Mode.

  • md5 (Optional[str]) – Md5.

class Tree(data: Mapping[str, Any])

Bases: APIObject

Git tree payload.

Variables:

tree (Optional[List[TreeEntry]]) – Tree.

class Blob(data: Mapping[str, Any])

Bases: APIObject

Git blob payload.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • size (Optional[int]) – Size.

  • encoding (Optional[str]) – Encoding.

  • content (Optional[str]) – Content returned for this object.

class BranchListCommit(data: Mapping[str, Any])

Bases: APIObject

Nested branch summary commit payload.

Variables:
  • commit (Optional[CommitPayload]) – Commit.

  • sha (Optional[str]) – Git SHA value.

  • url (Optional[str]) – API URL for this object.

class Branch(data: Mapping[str, Any])

Bases: APIObject

Repository branch payload returned by list/create endpoints.

Variables:
  • name (Optional[str]) – Display name.

  • commit (Optional[BranchListCommit]) – Commit.

  • protected (Optional[bool]) – Whether the branch is protected.

class BranchDetailCommit(data: Mapping[str, Any])

Bases: APIObject

Commit object returned inside branch detail responses.

Variables:
  • id (Optional[str]) – Unique identifier for this object.

  • message (Optional[str]) – Message text returned by the API.

  • parent_ids (Optional[List[str]]) – Parent commit IDs.

  • authored_date (Optional[str]) – Timestamp when the commit was authored.

  • author_name (Optional[str]) – Author name.

  • author_iam_id (Optional[str]) – IAM identifier of the commit author.

  • author_email (Optional[str]) – Author email.

  • author_user_name (Optional[str]) – Username of the commit author.

  • committed_date (Optional[str]) – Timestamp when the commit was committed.

  • committer_name (Optional[str]) – Committer name.

  • committer_email (Optional[str]) – Committer email.

  • committer_user_name (Optional[str]) – Username of the committer.

  • open_gpg_verified (Optional[bool]) – Whether OpenGPG verification is enabled for the commit.

  • verification_status (Optional[str]) – Signature verification status for the commit.

  • gpg_primary_key_id (Optional[str]) – Primary GPG key ID used for verification.

  • short_id (Optional[str]) – Short commit identifier.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • title (Optional[str]) – Title of the object.

  • author_avatar_url (Optional[str]) – Avatar URL of the commit author.

  • committer_avatar_url (Optional[str]) – Avatar URL of the committer.

  • relate_url (Optional[str]) – Related web URL for the commit.

class BranchDetail(data: Mapping[str, Any])

Bases: APIObject

Repository branch payload returned by the detail endpoint.

Variables:
  • name (Optional[str]) – Display name.

  • commit (Optional[BranchDetailCommit]) – Commit.

  • merged (Optional[bool]) – Merged.

  • protected (Optional[bool]) – Whether the branch is protected.

  • developers_can_push (Optional[bool]) – Developers can push.

  • developers_can_merge (Optional[bool]) – Developers can merge.

  • can_push (Optional[bool]) – Whether the current user can push.

  • default (Optional[bool]) – Whether this is the default branch.

class ProtectedBranch(data: Mapping[str, Any])

Bases: APIObject

Protected branch configuration payload.

Variables:
  • name (Optional[str]) – Display name.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • push_users (Optional[Union[List[UserRef], List[Any]]]) – Users allowed to push to the protected branch.

  • merge_users (Optional[Union[List[UserRef], List[Any]]]) – Users allowed to merge into the protected branch.

  • merged (Optional[bool]) – Merged.

  • developers_can_push (Optional[bool]) – Whether developers can push to the protected branch.

  • developers_can_merge (Optional[bool]) – Whether developers can merge into the protected branch.

  • committer_can_push (Optional[bool]) – Whether committers can push to the protected branch.

  • committer_can_merge (Optional[bool]) – Whether committers can merge into the protected branch.

  • master_can_push (Optional[bool]) – Whether masters can push to the protected branch.

  • master_can_merge (Optional[bool]) – Whether masters can merge into the protected branch.

  • maintainer_can_push (Optional[bool]) – Whether maintainers can push to the protected branch.

  • maintainer_can_merge (Optional[bool]) – Whether maintainers can merge into the protected branch.

  • owner_can_push (Optional[bool]) – Whether owners can push to the protected branch.

  • owner_can_merge (Optional[bool]) – Whether owners can merge into the protected branch.

  • no_one_can_push (Optional[bool]) – Whether pushing is disabled for everyone.

  • no_one_can_merge (Optional[bool]) – Whether merging is disabled for everyone.

class CommitAuthorSummary(data: Mapping[str, Any])

Bases: APIObject

Author summary on commit/search payloads.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • name (Optional[str]) – Display name.

  • type (Optional[str]) – Type of the object.

  • email (Optional[str]) – Email address.

  • date (Optional[str]) – Date.

class CommitStats(data: Mapping[str, Any])

Bases: APIObject

Commit diff stats.

Variables:
  • additions (Optional[int]) – Additions.

  • deletions (Optional[int]) – Deletions.

  • total (Optional[int]) – Total.

class CommitFile(data: Mapping[str, Any])

Bases: APIObject

Commit file entry.

Variables:
  • filename (Optional[str]) – Filename.

  • raw_url (Optional[str]) – Raw URL.

  • content_url (Optional[str]) – Content URL.

class CommitSummary(data: Mapping[str, Any])

Bases: APIObject

Commit payload returned by list endpoints.

Variables:
  • url (Optional[str]) – API URL for this object.

  • sha (Optional[str]) – Git SHA value.

  • html_url (Optional[str]) – Web URL for this object.

  • comments_url (Optional[str]) – Comments URL.

  • commit (Optional[CommitPayload]) – Commit.

  • author (Optional[CommitAuthorSummary]) – Author associated with this object.

  • committer (Optional[CommitAuthorSummary]) – Committer associated with this object.

  • parents (Optional[List[CommitParent]]) – Parents.

class Commit(data: Mapping[str, Any])

Bases: CommitSummary

Commit payload returned by detail endpoints.

Variables:
  • stats (Optional[CommitStats]) – Stats.

  • files (Optional[List[CommitFile]]) – Files.

  • id (Optional[str]) – Unique identifier for this object.

  • message (Optional[str]) – Message text returned by the API.

  • parent_ids (Optional[List[str]]) – Parent ids.

  • authored_date (Optional[str]) – Authored date.

  • author_name (Optional[str]) – Author name.

  • author_iam_id (Optional[str]) – ID of the related author iam.

  • author_email (Optional[str]) – Author email.

  • author_user_name (Optional[str]) – Author user name.

  • committed_date (Optional[str]) – Committed date.

  • committer_name (Optional[str]) – Committer name.

  • committer_email (Optional[str]) – Committer email.

  • committer_user_name (Optional[str]) – Committer user name.

  • open_gpg_verified (Optional[bool]) – Open gpg verified.

  • verification_status (Optional[str]) – Verification status.

  • gpg_primary_key_id (Optional[str]) – ID of the related gpg primary key.

  • short_id (Optional[str]) – ID of the related short.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • title (Optional[str]) – Title of the object.

  • author_avatar_url (Optional[str]) – Author avatar URL.

  • committer_avatar_url (Optional[str]) – Committer avatar URL.

  • relate_url (Optional[str]) – Relate URL.

class CommitComparison(data: Mapping[str, Any])

Bases: APIObject

Commit comparison payload.

Variables:
  • base_commit (Optional[CommitSummary]) – Base commit.

  • merge_base_commit (Optional[CommitSummary]) – Merge base commit.

  • commits (Optional[List[CommitSummary]]) – Commits.

  • files (Optional[List[CommitFile]]) – Files.

  • status (Optional[str]) – Status string returned by the API.

  • ahead_by (Optional[int]) – Ahead by.

  • behind_by (Optional[int]) – Behind by.

  • total_commits (Optional[int]) – Total commits.

  • commits_count (Optional[int]) – Number of commits.

class CommitComment(data: Mapping[str, Any])

Bases: APIObject

Commit comment payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • body (Optional[str]) – Body text of the object.

  • user (Optional[UserRef]) – User associated with this object.

  • commit_id (Optional[str]) – ID of the related commit.

  • path (Optional[str]) – Repository-relative or namespace path.

  • position (Optional[int]) – Position.

  • line (Optional[int]) – Line.

  • noteable_id (Optional[int]) – ID of the related noteable.

  • noteable_type (Optional[str]) – Noteable type.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • html_url (Optional[str]) – Web URL for this object.

  • target (Optional[APIObject]) – Target.

class Label(data: Mapping[str, Any])

Bases: APIObject

Label payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • name (Optional[str]) – Display name.

  • title (Optional[str]) – Title of the object.

  • color (Optional[str]) – Color.

  • repository_id (Optional[int]) – Numeric ID of the related repository.

  • type (Optional[str]) – Type of the object.

  • text_color (Optional[str]) – Text color.

class RepositorySummary(data: Mapping[str, Any])

Bases: APIObject

Minimal repository payload embedded in issue/search responses.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • full_name (Optional[str]) – Full display name for the object.

  • human_name (Optional[str]) – Human-readable display name.

  • path (Optional[str]) – Repository-relative or namespace path.

  • name (Optional[str]) – Display name.

  • url (Optional[str]) – API URL for this object.

  • description (Optional[str]) – Description text.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • owner (Optional[Union[UserSummary, UserRef]]) – Owner of the object.

class Issue(data: Mapping[str, Any])

Bases: APIObject

Issue payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • html_url (Optional[str]) – Web URL for this object.

  • number (Optional[Union[int, str]]) – Sequence number for the object within its repository.

  • state (Optional[str]) – Current state value.

  • title (Optional[str]) – Title of the object.

  • body (Optional[str]) – Body text of the object.

  • user (Optional[Union[User, UserRef]]) – User associated with this object.

  • assignee (Optional[Union[User, UserRef]]) – Assigned user.

  • repository (Optional[RepositorySummary]) – Repository.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • finished_at (Optional[str]) – Timestamp when this issue was completed.

  • labels (Optional[List[Label]]) – Labels attached to this object.

  • priority (Optional[Union[int, str]]) – Priority value of the issue.

  • issue_type (Optional[str]) – Issue type returned by the API.

  • issue_state (Optional[str]) – Workflow state of the issue.

  • issue_state_detail (Optional[str]) – Detailed workflow state information for the issue.

  • stage (Optional[str]) – Current workflow stage of the issue.

  • severity (Optional[str]) – Severity level of the issue.

  • comments (Optional[int]) – Number of comments.

  • parent_id (Optional[int]) – ID of the parent issue.

class SearchIssue(data: Mapping[str, Any])

Bases: Issue

Issue search result payload.

Variables:

repository (Optional[RepositorySummary]) – Repository.

class IssueComment(data: Mapping[str, Any])

Bases: APIObject

Issue comment payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • body (Optional[str]) – Body text of the object.

  • user (Optional[UserRef]) – User associated with this object.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • target (Optional[APIObject]) – Target.

class IssueOperationLog(data: Mapping[str, Any])

Bases: APIObject

Issue operation log payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • action_type (Optional[str]) – Action type.

  • content (Optional[str]) – Content returned for this object.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • user (Optional[UserRef]) – User associated with this object.

class PullRequestBranch(data: Mapping[str, Any])

Bases: APIObject

Head/base branch payload in pull request responses.

Variables:
  • label (Optional[str]) – Display label for the ref.

  • ref (Optional[str]) – Git ref name.

  • sha (Optional[str]) – Git SHA value.

  • user (Optional[UserRef]) – User associated with this object.

  • repo (Optional[Repository]) – Repo.

class PullRequestApprover(data: Mapping[str, Any])

Bases: APIObject

Approver/tester embedded in pull request responses.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • username (Optional[str]) – Account username.

  • name (Optional[str]) – Display name.

  • nick_name (Optional[str]) – Nickname of the approver or tester.

  • name_cn (Optional[str]) – Chinese display name of the approver or tester.

  • email (Optional[str]) – Email address.

  • state (Optional[str]) – Current state value.

  • is_codeowner (Optional[bool]) – Whether the approver is a code owner.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • avatar_url (Optional[str]) – Avatar image URL.

class PullRequestTimeStats(data: Mapping[str, Any])

Bases: APIObject

Time tracking fields embedded in pull requests.

Variables:
  • time_estimate (Optional[int]) – Estimated time in seconds.

  • total_time_spent (Optional[int]) – Total time spent in seconds.

  • human_time_estimate (Optional[str]) – Human-readable estimated time.

  • human_total_time_spent (Optional[str]) – Human-readable total time spent.

class PullRequestDiffRefs(data: Mapping[str, Any])

Bases: APIObject

Diff refs embedded in pull requests.

Variables:
  • base_sha (Optional[str]) – Base sha.

  • head_sha (Optional[str]) – Head sha.

  • start_sha (Optional[str]) – Start sha.

class PullRequest(data: Mapping[str, Any])

Bases: APIObject

Pull request payload.

Variables:
  • number (Optional[Union[int, str]]) – Sequence number for the object within its repository.

  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • iid (Optional[int]) – Internal identifier scoped to the repository.

  • project_id (Optional[int]) – Numeric ID of the related project.

  • html_url (Optional[str]) – Web URL for this object.

  • url (Optional[str]) – API URL for this object.

  • title (Optional[str]) – Title of the object.

  • body (Optional[str]) – Body text of the object.

  • state (Optional[str]) – Current state value.

  • draft (Optional[bool]) – Whether the pull request is a draft.

  • close_related_issue (Optional[bool]) – Whether related issues are closed when the pull request is merged.

  • prune_branch (Optional[bool]) – Whether the source branch should be pruned after merge.

  • labels (Optional[List[Label]]) – Labels attached to this object.

  • user (Optional[UserRef]) – User associated with this object.

  • assignees (Optional[List[UserRef]]) – Users assigned to this object.

  • head (Optional[PullRequestBranch]) – Head.

  • base (Optional[PullRequestBranch]) – Base.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • merged_at (Optional[str]) – Timestamp when this pull request was merged.

  • closed_by (Optional[UserRef]) – Closed by.

  • closed_at (Optional[str]) – Timestamp when this object was closed.

  • target_branch (Optional[str]) – Target branch name.

  • source_branch (Optional[str]) – Source branch name.

  • squash_commit_message (Optional[str]) – Commit message to use for a squash merge.

  • user_notes_count (Optional[int]) – Number of user notes on the pull request.

  • upvotes (Optional[int]) – Number of upvotes.

  • downvotes (Optional[int]) – Number of downvotes.

  • source_project_id (Optional[int]) – ID of the source project.

  • target_project_id (Optional[int]) – ID of the target project.

  • work_in_progress (Optional[bool]) – Whether the pull request is marked as work in progress.

  • milestone (Optional[APIObject]) – Milestone associated with the pull request.

  • merge_when_pipeline_succeeds (Optional[bool]) – Whether the pull request should merge automatically after the pipeline succeeds.

  • merge_status (Optional[str]) – Merge status reported by the API.

  • sha (Optional[str]) – Git SHA value.

  • merge_commit_sha (Optional[str]) – SHA of the merge commit.

  • should_remove_source_branch (Optional[bool]) – Whether the source branch should be removed after merge.

  • force_remove_source_branch (Optional[bool]) – Whether the source branch should be force removed after merge.

  • web_url (Optional[str]) – Web URL for this object.

  • time_stats (Optional[PullRequestTimeStats]) – Time tracking information for the pull request.

  • squash (Optional[bool]) – Whether the pull request will be squashed on merge.

  • merge_request_type (Optional[str]) – Pull request type returned by the API.

  • has_pre_merge_ref (Optional[bool]) – Whether a pre-merge ref exists for the pull request.

  • review_mode (Optional[str]) – Review mode configured for the pull request.

  • is_source_branch_exist (Optional[bool]) – Whether the source branch still exists.

  • approval_merge_request_approvers (Optional[List[PullRequestApprover]]) – Approvers configured for the pull request.

  • approval_merge_request_testers (Optional[List[PullRequestApprover]]) – Testers configured for the pull request.

  • added_lines (Optional[int]) – Number of added lines in the pull request.

  • removed_lines (Optional[int]) – Number of removed lines in the pull request.

  • subscribed (Optional[bool]) – Whether the current user is subscribed.

  • changes_count (Optional[Union[int, str]]) – Number of changed files or changes reported by the API.

  • diff_refs (Optional[PullRequestDiffRefs]) – Diff references used to compute the pull request changes.

  • notes (Optional[int]) – Number of notes.

  • unresolved_discussions_count (Optional[int]) – Number of unresolved discussions.

  • gate_check (Optional[bool]) – Whether gate checks passed for the pull request.

class PullRequestCount(data: Mapping[str, Any])

Bases: APIObject

Pull request count payload returned when only_count is enabled.

Variables:
  • all (Optional[int]) – All.

  • opened (Optional[int]) – Opened.

  • closed (Optional[int]) – Closed.

  • merged (Optional[int]) – Merged.

  • locked (Optional[int]) – Locked.

class PullRequestFile(data: Mapping[str, Any])

Bases: APIObject

Pull request file diff payload.

Variables:
  • filename (Optional[str]) – Filename.

  • status (Optional[str]) – Status string returned by the API.

  • additions (Optional[int]) – Additions.

  • deletions (Optional[int]) – Deletions.

  • changes (Optional[int]) – Changes.

  • blob_url (Optional[str]) – Blob URL.

  • raw_url (Optional[str]) – Raw URL.

  • contents_url (Optional[str]) – Contents URL.

  • patch (Optional[str]) – Patch.

class PullRequestComment(data: Mapping[str, Any])

Bases: APIObject

Pull request comment payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • body (Optional[str]) – Body text of the object.

  • user (Optional[UserRef]) – User associated with this object.

  • path (Optional[str]) – Repository-relative or namespace path.

  • position (Optional[int]) – Position.

  • commit_id (Optional[str]) – ID of the related commit.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • comment_type (Optional[str]) – Comment type.

  • target (Optional[APIObject]) – Target.

class PullRequestReview(data: Mapping[str, Any])

Bases: APIObject

Pull request review payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • state (Optional[str]) – Current state value.

  • body (Optional[str]) – Body text of the object.

class PullRequestTest(data: Mapping[str, Any])

Bases: APIObject

Pull request test request payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • state (Optional[str]) – Current state value.

  • body (Optional[str]) – Body text of the object.

class MergeResult(data: Mapping[str, Any])

Bases: APIObject

Merge operation result payload.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • merged (Optional[bool]) – Merged.

  • message (Optional[str]) – Message text returned by the API.

class MergeStatus(data: Mapping[str, Any])

Bases: APIObject

Merge status payload.

Variables:
  • message (Optional[str]) – Message text returned by the API.

  • error (Optional[str]) – Error.

class Milestone(data: Mapping[str, Any])

Bases: APIObject

Milestone payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • number (Optional[int]) – Sequence number for the object within its repository.

  • title (Optional[str]) – Title of the object.

  • description (Optional[str]) – Description text.

  • state (Optional[str]) – Current state value.

  • due_on (Optional[str]) – Due date for the milestone.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

class RepoMemberPermissions(data: Mapping[str, Any])

Bases: APIObject

Collaborator permissions payload.

Variables:
  • pull (Optional[bool]) – Pull.

  • push (Optional[bool]) – Push.

  • admin (Optional[bool]) – Admin.

class RepoMember(data: Mapping[str, Any])

Bases: APIObject

Repository member payload returned by add/update operations.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • name (Optional[str]) – Display name.

  • avatar_url (Optional[str]) – Avatar image URL.

  • html_url (Optional[str]) – Web URL for this object.

  • remark (Optional[str]) – Remark.

  • type (Optional[str]) – Type of the object.

  • permissions (Optional[RepoMemberPermissions]) – Permissions granted for this user.

class RepoCollaborator(data: Mapping[str, Any])

Bases: APIObject

Repository collaborator payload returned by list operations.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • name (Optional[str]) – Display name.

  • username (Optional[str]) – Account username.

  • nick_name (Optional[str]) – Nick name.

  • state (Optional[str]) – Current state value.

  • avatar (Optional[str]) – Avatar path or URL returned for the collaborator.

  • avatar_url (Optional[str]) – Avatar image URL.

  • email (Optional[str]) – Email address.

  • name_cn (Optional[str]) – Name cn.

  • web_url (Optional[str]) – Web URL for this object.

  • access_level (Optional[int]) – Access level granted to the collaborator.

  • expires_at (Optional[str]) – Timestamp when the collaborator access expires.

  • limited (Optional[bool]) – Whether the collaborator has limited access.

  • type (Optional[str]) – Type of the object.

  • last_owner (Optional[str]) – Previous owner recorded for the collaborator source.

  • is_current_source_member (Optional[bool]) – Whether the collaborator is still a member of the source entity.

  • last_source_owner (Optional[str]) – Previous source owner recorded for the collaborator.

  • join_way (Optional[str]) – How the collaborator joined the repository.

  • source_name (Optional[str]) – Name of the source entity that granted access.

  • member_roles (Optional[List[APIObject]]) – Custom member roles attached to the collaborator.

  • iam_id (Optional[str]) – IAM identifier of the collaborator.

  • committer_system_from (Optional[str]) – System from which committer identity is sourced.

  • permissions (Optional[RepoMemberPermissions]) – Permissions granted for this user.

class RepoMemberPermission(data: Mapping[str, Any])

Bases: APIObject

Repository member permission payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • permission (Optional[str]) – Permission summary for this object.

class Release(data: Mapping[str, Any])

Bases: APIObject

Release payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • tag_name (Optional[str]) – Tag name.

  • name (Optional[str]) – Display name.

  • body (Optional[str]) – Body text of the object.

  • author (Optional[UserRef]) – Author associated with this object.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • published_at (Optional[str]) – Timestamp when this object was published.

  • html_url (Optional[str]) – Web URL for this object.

class TagCommit(data: Mapping[str, Any])

Bases: APIObject

Commit object embedded in tag payloads.

Variables:
  • sha (Optional[str]) – Git SHA value.

  • url (Optional[str]) – API URL for this object.

class Tagger(data: Mapping[str, Any])

Bases: APIObject

Tagger identity.

Variables:
  • name (Optional[str]) – Display name.

  • email (Optional[str]) – Email address.

  • date (Optional[str]) – Date.

class Tag(data: Mapping[str, Any])

Bases: APIObject

Tag payload.

Variables:
  • name (Optional[str]) – Display name.

  • message (Optional[str]) – Message text returned by the API.

  • commit (Optional[TagCommit]) – Commit.

  • tagger (Optional[Tagger]) – Tagger.

class ProtectedTag(data: Mapping[str, Any])

Bases: APIObject

Protected tag configuration payload.

Variables:
  • name (Optional[str]) – Display name.

  • create_access_level (Optional[int]) – Access level required to create the protected tag.

  • create_access_level_desc (Optional[str]) – Description of the access levels allowed to create the protected tag.

class Webhook(data: Mapping[str, Any])

Bases: APIObject

Webhook payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • url (Optional[str]) – API URL for this object.

  • password (Optional[str]) – Password.

  • result (Optional[str]) – Result text returned by the webhook.

  • project_id (Optional[int]) – Numeric ID of the related project.

  • result_code (Optional[int]) – Result code returned by the webhook.

  • push_events (Optional[bool]) – Push events.

  • tag_push_events (Optional[bool]) – Tag push events.

  • issues_events (Optional[bool]) – Issues events.

  • note_events (Optional[bool]) – Note events.

  • merge_requests_events (Optional[bool]) – Merge requests events.

  • created_at (Optional[str]) – Timestamp when this object was created.

class OrganizationSummary(data: Mapping[str, Any])

Bases: APIObject

Organization summary payload returned by list endpoints.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • path (Optional[str]) – Repository-relative or namespace path.

  • name (Optional[str]) – Display name.

  • avatar_url (Optional[str]) – Avatar image URL.

  • repos_url (Optional[str]) – Repos URL.

  • events_url (Optional[str]) – Events URL.

  • members_url (Optional[str]) – Members URL.

  • description (Optional[str]) – Description text.

  • follow_count (Optional[int]) – Number of follow.

class Organization(data: Mapping[str, Any])

Bases: OrganizationSummary

Organization payload.

Variables:
  • enterprise (Optional[str]) – Enterprise identifier associated with the organization.

  • gitee (Optional[APIObject]) – Additional mirrored-platform metadata.

class OrganizationMembership(data: Mapping[str, Any])

Bases: APIObject

Organization membership payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • path (Optional[str]) – Repository-relative or namespace path.

  • name (Optional[str]) – Display name.

  • url (Optional[str]) – API URL for this object.

  • avatar_url (Optional[str]) – Avatar image URL.

  • user (Optional[UserRef]) – User associated with this object.

  • role (Optional[str]) – Role.

  • organization (Optional[OrganizationSummary]) – Organization.

class EnterpriseMember(data: Mapping[str, Any])

Bases: APIObject

Enterprise member payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • role (Optional[str]) – Role.

  • url (Optional[str]) – API URL for this object.

  • user (Optional[UserRef]) – User associated with this object.

  • login (Optional[str]) – Account login name.

  • name (Optional[str]) – Display name.

  • avatar_url (Optional[str]) – Avatar image URL.

  • html_url (Optional[str]) – Web URL for this object.

class Email(data: Mapping[str, Any])

Bases: APIObject

Email payload for the authenticated user.

Variables:
  • email (Optional[str]) – Email address.

  • state (Optional[str]) – Current state value.

class OAuthToken(data: Mapping[str, Any])

Bases: APIObject

OAuth token payload.

Variables:
  • access_token (Optional[str]) – OAuth access token.

  • expires_in (Optional[int]) – Lifetime of the token in seconds.

  • refresh_token (Optional[str]) – OAuth refresh token.

  • scope (Optional[str]) – OAuth scopes granted to the token.

  • created_at (Optional[str]) – Timestamp when this object was created.

class EmptyResponse(data: Mapping[str, Any])

Bases: APIObject

Empty JSON object returned by some mutation endpoints.

class ApiStatusResponse(data: Mapping[str, Any])

Bases: APIObject

Simple success/error response containing a numeric code and message.

Variables:
  • code (Optional[int]) – Numeric status code returned by the API.

  • msg (Optional[str]) – Message returned by the API.

class PublicKey(data: Mapping[str, Any])

Bases: APIObject

Public SSH key payload.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • title (Optional[str]) – Title of the object.

  • key (Optional[str]) – Public key material.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • url (Optional[str]) – API URL for this object.

class UserEventProject(data: Mapping[str, Any])

Bases: APIObject

Project summary embedded in user event responses.

Variables:
  • main_repository_language (Optional[List[Any]]) – Primary languages reported for the repository.

  • star_count (Optional[int]) – Number of stars on the repository.

  • forks_count (Optional[int]) – Number of forks.

  • develop_mode (Optional[str]) – Development mode of the repository.

  • stared (Optional[bool]) – Whether the current user has starred the repository.

class UserEventPushData(data: Mapping[str, Any])

Bases: APIObject

Push event metadata embedded in user events.

Variables:
  • commit_count (Optional[int]) – Number of commits included in the push event.

  • action (Optional[str]) – Action.

  • ref_type (Optional[str]) – Type of Git ref involved in the push event.

  • commit_from (Optional[str]) – Starting commit SHA for the push event.

  • commit_to (Optional[str]) – Ending commit SHA for the push event.

  • ref (Optional[str]) – Git ref name.

  • commit_title (Optional[str]) – Title of the primary commit in the push event.

Bases: APIObject

Link bundle embedded in user event responses.

Variables:
  • project (Optional[str]) – Link to the related project.

  • action_type (Optional[str]) – Link to the action type resource.

class UserEvent(data: Mapping[str, Any])

Bases: APIObject

Single activity event returned by the user events endpoint.

Variables:
  • action (Optional[Union[int, str]]) – Action code reported for the event.

  • action_name (Optional[str]) – Human-readable action name.

  • author (Optional[UserRef]) – Author associated with this object.

  • author_id (Optional[Union[int, str]]) – ID of the event author.

  • author_username (Optional[str]) – Username of the event author.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • project (Optional[UserEventProject]) – Project associated with the event.

  • project_id (Optional[Union[int, str]]) – ID of the related project.

  • project_name (Optional[str]) – Name of the related project.

  • push_data (Optional[UserEventPushData]) – Push metadata for push events.

  • _links (Optional[UserEventLinks]) – Related links for the event.

class UserEventsResponse(data: Mapping[str, Any])

Bases: APIObject

Grouped user events response keyed by date.

Variables:
  • events (Optional[Dict[str, List[UserEvent]]]) – Events grouped by date.

  • next (Optional[str]) – URL or token used to fetch the next page.

class RepositoryReviewerSettingsUpdate(data: Mapping[str, Any])

Bases: APIObject

Response returned after updating repository reviewer settings.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

class RepositoryPermissionMode(data: Mapping[str, Any])

Bases: APIObject

Repository member management mode.

Variables:

memberMgntMode (Optional[int]) – Repository member management mode.

class RepositoryPushConfig(data: Mapping[str, Any])

Bases: APIObject

Repository push rules configuration.

Variables:
  • reject_not_signed_by_gpg (Optional[bool]) – Whether unsigned commits are rejected.

  • commit_message_regex (Optional[str]) – Regular expression required for commit messages.

  • max_file_size (Optional[int]) – Maximum allowed file size for pushes.

  • skip_rule_for_owner (Optional[bool]) – Whether push rules are skipped for owners.

  • deny_force_push (Optional[bool]) – Whether force pushes are denied.

class RepositoryUploadResult(data: Mapping[str, Any])

Bases: APIObject

Uploaded repository attachment metadata.

Variables:
  • success (Optional[bool]) – Success.

  • path (Optional[str]) – Repository-relative or namespace path.

  • full_path (Optional[str]) – Full path for the object.

class RepositorySettings(data: Mapping[str, Any])

Bases: APIObject

Repository-level settings payload.

Variables:
  • disable_fork (Optional[bool]) – Whether repository forking is disabled.

  • forbidden_developer_create_branch (Optional[bool]) – Whether developers are forbidden from creating branches.

  • forbidden_developer_create_tag (Optional[bool]) – Whether developers are forbidden from creating tags.

  • forbidden_committer_create_branch (Optional[bool]) – Whether committers are forbidden from creating branches.

  • forbidden_developer_create_branch_user_ids (Optional[str]) – User IDs exempted from the developer branch-creation restriction.

  • branch_name_regex (Optional[str]) – Regular expression required for branch names.

  • tag_name_regex (Optional[str]) – Regular expression required for tag names.

  • generate_pre_merge_ref (Optional[bool]) – Whether pre-merge refs are generated.

  • rebase_disable_trigger_webhook (Optional[bool]) – Whether rebases avoid triggering webhooks.

  • open_gpg_verified (Optional[bool]) – Whether OpenGPG verification is enabled.

  • include_lfs_objects (Optional[bool]) – Whether LFS objects are included.

  • forbidden_gitlab_access (Optional[bool]) – Whether GitLab access is forbidden.

class PullRequestSettingDetail(data: Mapping[str, Any])

Bases: APIObject

Nested merge request setting payload in repository PR settings.

Variables:
  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • project_id (Optional[Union[int, str]]) – Numeric ID of the related project.

  • disable_merge_by_self (Optional[bool]) – Whether users are prevented from merging pull requests they created.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • can_force_merge (Optional[bool]) – Whether administrators can force merge.

  • disable_squash_merge (Optional[bool]) – Whether squash merge is disabled.

  • approval_required_reviewers (Optional[int]) – Number of reviewers required before merge.

  • approval_required_approvers (Optional[int]) – Number of approvers required before merge.

  • add_notes_after_merged (Optional[bool]) – Whether notes are added after merge.

  • merged_commit_author (Optional[str]) – Author name used for merged commits.

  • mark_auto_merged_mr_as_closed (Optional[bool]) – Whether auto-merged pull requests are marked as closed.

  • delete_source_branch_when_merged (Optional[bool]) – Whether source branches are deleted after merge.

  • auto_squash_merge (Optional[bool]) – Whether squash merge is enabled by default.

  • squash_merge_with_no_merge_commit (Optional[bool]) – Whether squash merges omit a merge commit.

  • close_issue_when_mr_merged (Optional[bool]) – Whether related issues are closed when a pull request is merged.

  • can_reopen (Optional[bool]) – Whether merged or closed pull requests can be reopened.

  • is_check_cla (Optional[bool]) – Whether CLA checks are enabled.

  • approval_approvers (Optional[List[APIObject]]) – Available approver rules for the repository.

  • approval_testers (Optional[List[APIObject]]) – Available tester rules for the repository.

  • approval_required_testers (Optional[int]) – Number of testers required before merge.

  • is_allow_lite_merge_request (Optional[bool]) – Whether lightweight pull requests are allowed.

  • lite_merge_request_prefix_title (Optional[str]) – Title prefix used for lightweight pull requests.

class PullRequestSettings(data: Mapping[str, Any])

Bases: APIObject

Repository pull request settings payload.

Variables:
  • merge_request_setting (Optional[PullRequestSettingDetail]) – Detailed pull request merge settings.

  • only_allow_merge_if_all_discussions_are_resolved (Optional[bool]) – Whether all discussions must be resolved before merge.

  • only_allow_merge_if_pipeline_succeeds (Optional[bool]) – Whether merges require a successful pipeline.

  • merge_method (Optional[str]) – Merge strategy configured for pull requests.

class RepositoryTransferResult(data: Mapping[str, Any])

Bases: APIObject

Repository transfer result payload.

Variables:
  • new_owner (Optional[str]) – New owner.

  • new_name (Optional[str]) – New name.

class RepositoryCustomizedRole(data: Mapping[str, Any])

Bases: APIObject

Customized repository role definition.

Variables:
  • role_id (Optional[str]) – Identifier of the custom role.

  • access_level (Optional[int]) – Access level granted by the custom role.

  • role_name (Optional[str]) – Name of the custom role.

  • role_chinese_name (Optional[str]) – Chinese name of the custom role.

  • role_description (Optional[str]) – Description of the custom role.

  • role_type (Optional[str]) – Type of the custom role.

  • member_count (Optional[int]) – Number of members assigned to the custom role.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

class RepositoryDownloadStatisticsDetail(data: Mapping[str, Any])

Bases: APIObject

Per-day repository download statistics entry.

Variables:
  • pdate (Optional[str]) – Date for this statistics entry.

  • repo_id (Optional[str]) – Repository ID.

  • total_dl_cnt (Optional[int]) – Total download count up to this date.

  • today_dl_cnt (Optional[int]) – Download count for this date.

class RepositoryDownloadStatistics(data: Mapping[str, Any])

Bases: APIObject

Repository download statistics payload.

Variables:
  • download_statistics_detail (Optional[List[RepositoryDownloadStatisticsDetail]]) – Per-day download statistics entries.

  • download_statistics_total (Optional[int]) – Total downloads within the requested time range.

  • download_statistics_history_total (Optional[int]) – Historical total downloads for the repository.

class ContributorStatisticsOverview(data: Mapping[str, Any])

Bases: APIObject

Aggregate contributor statistics summary.

Variables:
  • additions (Optional[int]) – Additions.

  • deletions (Optional[int]) – Deletions.

  • total_changes (Optional[int]) – Total lines changed.

  • commit_count (Optional[int]) – Number of commits.

class ContributorStatisticsEntry(data: Mapping[str, Any])

Bases: APIObject

Per-day contributor statistics entry.

Variables:
  • date (Optional[str]) – Date for this contribution statistics entry.

  • additions (Optional[int]) – Additions.

  • deletions (Optional[int]) – Deletions.

  • total_changes (Optional[int]) – Total lines changed on this date.

  • commit_count (Optional[int]) – Number of commits on this date.

class ContributorStatistics(data: Mapping[str, Any])

Bases: APIObject

Contributor statistics payload returned by the repository statistics endpoint.

Variables:
class PullRequestOperationLog(data: Mapping[str, Any])

Bases: APIObject

Pull request operation log entry.

Variables:
  • content (Optional[str]) – Content returned for this object.

  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • action (Optional[str]) – Action recorded in the operation log.

  • merge_request_id (Optional[Union[int, str]]) – ID of the related pull request.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • updated_at (Optional[str]) – Timestamp when this object was last updated.

  • discussion_id (Optional[str]) – ID of the related discussion.

  • project (Optional[str]) – Project identifier recorded in the log entry.

  • assignee (Optional[APIObject]) – Assignee metadata captured in the log entry.

  • proposer (Optional[APIObject]) – Proposer metadata captured in the log entry.

  • user (Optional[UserRef]) – User associated with this object.

class PullRequestAssigneeCount(data: Mapping[str, Any])

Bases: APIObject

Response payload when assignees are added to a pull request.

Variables:

assignees_number (Optional[int]) – Assignees number.

class RepositoryCollaboratorCheck(data: Mapping[str, Any])

Bases: APIObject

Repository collaborator presence check response.

Variables:

message (Optional[str]) – Message text returned by the API.

class SearchUser(data: Mapping[str, Any])

Bases: APIObject

User search result payload.

Variables:
  • avatar_url (Optional[str]) – Avatar image URL.

  • created_at (Optional[str]) – Timestamp when this object was created.

  • html_url (Optional[str]) – Web URL for this object.

  • id (Optional[Union[int, str]]) – Unique identifier for this object.

  • login (Optional[str]) – Account login name.

  • name (Optional[str]) – Display name.

class SearchResult(data: Mapping[str, Any])

Bases: APIObject

Backward-compatible generic search result payload.