feat: generate all 229 Forgejo API types from swagger spec
Co-Authored-By: Virgil <virgil@lethean.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
eb3d63e5c1
commit
9e3b2c0181
36 changed files with 2394 additions and 0 deletions
61
types/action.go
Normal file
61
types/action.go
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// ActionTask — ActionTask represents a ActionTask
|
||||
type ActionTask struct {
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
DisplayTitle string `json:"display_title,omitempty"`
|
||||
Event string `json:"event,omitempty"`
|
||||
HeadBranch string `json:"head_branch,omitempty"`
|
||||
HeadSHA string `json:"head_sha,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RunNumber int64 `json:"run_number,omitempty"`
|
||||
RunStartedAt time.Time `json:"run_started_at,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
WorkflowID string `json:"workflow_id,omitempty"`
|
||||
}
|
||||
|
||||
// ActionTaskResponse — ActionTaskResponse returns a ActionTask
|
||||
type ActionTaskResponse struct {
|
||||
Entries []*ActionTask `json:"workflow_runs,omitempty"`
|
||||
TotalCount int64 `json:"total_count,omitempty"`
|
||||
}
|
||||
|
||||
// ActionVariable — ActionVariable return value of the query API
|
||||
type ActionVariable struct {
|
||||
Data string `json:"data,omitempty"` // the value of the variable
|
||||
Name string `json:"name,omitempty"` // the name of the variable
|
||||
OwnerID int64 `json:"owner_id,omitempty"` // the owner to which the variable belongs
|
||||
RepoID int64 `json:"repo_id,omitempty"` // the repository to which the variable belongs
|
||||
}
|
||||
|
||||
// CreateVariableOption — CreateVariableOption the option when creating variable
|
||||
type CreateVariableOption struct {
|
||||
Value string `json:"value"` // Value of the variable to create
|
||||
}
|
||||
|
||||
// DispatchWorkflowOption — DispatchWorkflowOption options when dispatching a workflow
|
||||
type DispatchWorkflowOption struct {
|
||||
Inputs map[string]any `json:"inputs,omitempty"` // Input keys and values configured in the workflow file.
|
||||
Ref string `json:"ref"` // Git reference for the workflow
|
||||
}
|
||||
|
||||
// Secret — Secret represents a secret
|
||||
type Secret struct {
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Name string `json:"name,omitempty"` // the secret's name
|
||||
}
|
||||
|
||||
// UpdateVariableOption — UpdateVariableOption the option when updating variable
|
||||
type UpdateVariableOption struct {
|
||||
Name string `json:"name,omitempty"` // New name for the variable. If the field is empty, the variable name won't be updated.
|
||||
Value string `json:"value"` // Value of the variable to update
|
||||
}
|
||||
|
||||
28
types/activity.go
Normal file
28
types/activity.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
type Activity struct {
|
||||
ActUser *User `json:"act_user,omitempty"`
|
||||
ActUserID int64 `json:"act_user_id,omitempty"`
|
||||
Comment *Comment `json:"comment,omitempty"`
|
||||
CommentID int64 `json:"comment_id,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IsPrivate bool `json:"is_private,omitempty"`
|
||||
OpType string `json:"op_type,omitempty"` // the type of action
|
||||
RefName string `json:"ref_name,omitempty"`
|
||||
Repo *Repository `json:"repo,omitempty"`
|
||||
RepoID int64 `json:"repo_id,omitempty"`
|
||||
UserID int64 `json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
// ActivityPub — ActivityPub type
|
||||
type ActivityPub struct {
|
||||
Context string `json:"@context,omitempty"`
|
||||
}
|
||||
|
||||
21
types/admin.go
Normal file
21
types/admin.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// Cron — Cron represents a Cron task
|
||||
type Cron struct {
|
||||
ExecTimes int64 `json:"exec_times,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Next time.Time `json:"next,omitempty"`
|
||||
Prev time.Time `json:"prev,omitempty"`
|
||||
Schedule string `json:"schedule,omitempty"`
|
||||
}
|
||||
|
||||
// RenameUserOption — RenameUserOption options when renaming a user
|
||||
type RenameUserOption struct {
|
||||
NewName string `json:"new_username"` // New username for this user. This name cannot be in use yet by any other user.
|
||||
}
|
||||
|
||||
119
types/branch.go
Normal file
119
types/branch.go
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// Branch — Branch represents a repository branch
|
||||
type Branch struct {
|
||||
Commit *PayloadCommit `json:"commit,omitempty"`
|
||||
EffectiveBranchProtectionName string `json:"effective_branch_protection_name,omitempty"`
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Protected bool `json:"protected,omitempty"`
|
||||
RequiredApprovals int64 `json:"required_approvals,omitempty"`
|
||||
StatusCheckContexts []string `json:"status_check_contexts,omitempty"`
|
||||
UserCanMerge bool `json:"user_can_merge,omitempty"`
|
||||
UserCanPush bool `json:"user_can_push,omitempty"`
|
||||
}
|
||||
|
||||
// BranchProtection — BranchProtection represents a branch protection for a repository
|
||||
type BranchProtection struct {
|
||||
ApplyToAdmins bool `json:"apply_to_admins,omitempty"`
|
||||
ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams,omitempty"`
|
||||
ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username,omitempty"`
|
||||
BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests,omitempty"`
|
||||
BlockOnOutdatedBranch bool `json:"block_on_outdated_branch,omitempty"`
|
||||
BlockOnRejectedReviews bool `json:"block_on_rejected_reviews,omitempty"`
|
||||
BranchName string `json:"branch_name,omitempty"` // Deprecated: true
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
DismissStaleApprovals bool `json:"dismiss_stale_approvals,omitempty"`
|
||||
EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist,omitempty"`
|
||||
EnableMergeWhitelist bool `json:"enable_merge_whitelist,omitempty"`
|
||||
EnablePush bool `json:"enable_push,omitempty"`
|
||||
EnablePushWhitelist bool `json:"enable_push_whitelist,omitempty"`
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
IgnoreStaleApprovals bool `json:"ignore_stale_approvals,omitempty"`
|
||||
MergeWhitelistTeams []string `json:"merge_whitelist_teams,omitempty"`
|
||||
MergeWhitelistUsernames []string `json:"merge_whitelist_usernames,omitempty"`
|
||||
ProtectedFilePatterns string `json:"protected_file_patterns,omitempty"`
|
||||
PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys,omitempty"`
|
||||
PushWhitelistTeams []string `json:"push_whitelist_teams,omitempty"`
|
||||
PushWhitelistUsernames []string `json:"push_whitelist_usernames,omitempty"`
|
||||
RequireSignedCommits bool `json:"require_signed_commits,omitempty"`
|
||||
RequiredApprovals int64 `json:"required_approvals,omitempty"`
|
||||
RuleName string `json:"rule_name,omitempty"`
|
||||
StatusCheckContexts []string `json:"status_check_contexts,omitempty"`
|
||||
UnprotectedFilePatterns string `json:"unprotected_file_patterns,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// CreateBranchProtectionOption — CreateBranchProtectionOption options for creating a branch protection
|
||||
type CreateBranchProtectionOption struct {
|
||||
ApplyToAdmins bool `json:"apply_to_admins,omitempty"`
|
||||
ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams,omitempty"`
|
||||
ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username,omitempty"`
|
||||
BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests,omitempty"`
|
||||
BlockOnOutdatedBranch bool `json:"block_on_outdated_branch,omitempty"`
|
||||
BlockOnRejectedReviews bool `json:"block_on_rejected_reviews,omitempty"`
|
||||
BranchName string `json:"branch_name,omitempty"` // Deprecated: true
|
||||
DismissStaleApprovals bool `json:"dismiss_stale_approvals,omitempty"`
|
||||
EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist,omitempty"`
|
||||
EnableMergeWhitelist bool `json:"enable_merge_whitelist,omitempty"`
|
||||
EnablePush bool `json:"enable_push,omitempty"`
|
||||
EnablePushWhitelist bool `json:"enable_push_whitelist,omitempty"`
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
IgnoreStaleApprovals bool `json:"ignore_stale_approvals,omitempty"`
|
||||
MergeWhitelistTeams []string `json:"merge_whitelist_teams,omitempty"`
|
||||
MergeWhitelistUsernames []string `json:"merge_whitelist_usernames,omitempty"`
|
||||
ProtectedFilePatterns string `json:"protected_file_patterns,omitempty"`
|
||||
PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys,omitempty"`
|
||||
PushWhitelistTeams []string `json:"push_whitelist_teams,omitempty"`
|
||||
PushWhitelistUsernames []string `json:"push_whitelist_usernames,omitempty"`
|
||||
RequireSignedCommits bool `json:"require_signed_commits,omitempty"`
|
||||
RequiredApprovals int64 `json:"required_approvals,omitempty"`
|
||||
RuleName string `json:"rule_name,omitempty"`
|
||||
StatusCheckContexts []string `json:"status_check_contexts,omitempty"`
|
||||
UnprotectedFilePatterns string `json:"unprotected_file_patterns,omitempty"`
|
||||
}
|
||||
|
||||
// CreateBranchRepoOption — CreateBranchRepoOption options when creating a branch in a repository
|
||||
type CreateBranchRepoOption struct {
|
||||
BranchName string `json:"new_branch_name"` // Name of the branch to create
|
||||
OldBranchName string `json:"old_branch_name,omitempty"` // Deprecated: true Name of the old branch to create from
|
||||
OldRefName string `json:"old_ref_name,omitempty"` // Name of the old branch/tag/commit to create from
|
||||
}
|
||||
|
||||
// EditBranchProtectionOption — EditBranchProtectionOption options for editing a branch protection
|
||||
type EditBranchProtectionOption struct {
|
||||
ApplyToAdmins bool `json:"apply_to_admins,omitempty"`
|
||||
ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams,omitempty"`
|
||||
ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username,omitempty"`
|
||||
BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests,omitempty"`
|
||||
BlockOnOutdatedBranch bool `json:"block_on_outdated_branch,omitempty"`
|
||||
BlockOnRejectedReviews bool `json:"block_on_rejected_reviews,omitempty"`
|
||||
DismissStaleApprovals bool `json:"dismiss_stale_approvals,omitempty"`
|
||||
EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist,omitempty"`
|
||||
EnableMergeWhitelist bool `json:"enable_merge_whitelist,omitempty"`
|
||||
EnablePush bool `json:"enable_push,omitempty"`
|
||||
EnablePushWhitelist bool `json:"enable_push_whitelist,omitempty"`
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
IgnoreStaleApprovals bool `json:"ignore_stale_approvals,omitempty"`
|
||||
MergeWhitelistTeams []string `json:"merge_whitelist_teams,omitempty"`
|
||||
MergeWhitelistUsernames []string `json:"merge_whitelist_usernames,omitempty"`
|
||||
ProtectedFilePatterns string `json:"protected_file_patterns,omitempty"`
|
||||
PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys,omitempty"`
|
||||
PushWhitelistTeams []string `json:"push_whitelist_teams,omitempty"`
|
||||
PushWhitelistUsernames []string `json:"push_whitelist_usernames,omitempty"`
|
||||
RequireSignedCommits bool `json:"require_signed_commits,omitempty"`
|
||||
RequiredApprovals int64 `json:"required_approvals,omitempty"`
|
||||
StatusCheckContexts []string `json:"status_check_contexts,omitempty"`
|
||||
UnprotectedFilePatterns string `json:"unprotected_file_patterns,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateBranchRepoOption — UpdateBranchRepoOption options when updating a branch in a repository
|
||||
type UpdateBranchRepoOption struct {
|
||||
Name string `json:"name"` // New branch name
|
||||
}
|
||||
|
||||
22
types/comment.go
Normal file
22
types/comment.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// Comment — Comment represents a comment on a commit or issue
|
||||
type Comment struct {
|
||||
Attachments []*Attachment `json:"assets,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IssueURL string `json:"issue_url,omitempty"`
|
||||
OriginalAuthor string `json:"original_author,omitempty"`
|
||||
OriginalAuthorID int64 `json:"original_author_id,omitempty"`
|
||||
PRURL string `json:"pull_request_url,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
68
types/commit.go
Normal file
68
types/commit.go
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
type Commit struct {
|
||||
Author *User `json:"author,omitempty"`
|
||||
Commit *RepoCommit `json:"commit,omitempty"`
|
||||
Committer *User `json:"committer,omitempty"`
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
Files []*CommitAffectedFiles `json:"files,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
Parents []*CommitMeta `json:"parents,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Stats *CommitStats `json:"stats,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// CommitAffectedFiles — CommitAffectedFiles store information about files affected by the commit
|
||||
type CommitAffectedFiles struct {
|
||||
Filename string `json:"filename,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// CommitDateOptions — CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
|
||||
type CommitDateOptions struct {
|
||||
Author time.Time `json:"author,omitempty"`
|
||||
Committer time.Time `json:"committer,omitempty"`
|
||||
}
|
||||
|
||||
type CommitMeta struct {
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// CommitStats — CommitStats is statistics for a RepoCommit
|
||||
type CommitStats struct {
|
||||
Additions int64 `json:"additions,omitempty"`
|
||||
Deletions int64 `json:"deletions,omitempty"`
|
||||
Total int64 `json:"total,omitempty"`
|
||||
}
|
||||
|
||||
// CommitStatus — CommitStatus holds a single status of a single Commit
|
||||
type CommitStatus struct {
|
||||
Context string `json:"context,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Creator *User `json:"creator,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Status *CommitStatusState `json:"status,omitempty"`
|
||||
TargetURL string `json:"target_url,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// CommitStatusState — CommitStatusState holds the state of a CommitStatus It can be "pending", "success", "error" and "failure"
|
||||
// CommitStatusState has no fields in the swagger spec.
|
||||
type CommitStatusState struct{}
|
||||
|
||||
type CommitUser struct {
|
||||
Date string `json:"date,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
40
types/common.go
Normal file
40
types/common.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// Attachment — Attachment a generic attachment
|
||||
type Attachment struct {
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
DownloadCount int64 `json:"download_count,omitempty"`
|
||||
DownloadURL string `json:"browser_download_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
UUID string `json:"uuid,omitempty"`
|
||||
}
|
||||
|
||||
// EditAttachmentOptions — EditAttachmentOptions options for editing attachments
|
||||
type EditAttachmentOptions struct {
|
||||
DownloadURL string `json:"browser_download_url,omitempty"` // (Can only be set if existing attachment is of external type)
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Permission — Permission represents a set of permissions
|
||||
type Permission struct {
|
||||
Admin bool `json:"admin,omitempty"`
|
||||
Pull bool `json:"pull,omitempty"`
|
||||
Push bool `json:"push,omitempty"`
|
||||
}
|
||||
|
||||
// StateType — StateType issue state type
|
||||
// StateType has no fields in the swagger spec.
|
||||
type StateType struct{}
|
||||
|
||||
// TimeStamp — TimeStamp defines a timestamp
|
||||
// TimeStamp has no fields in the swagger spec.
|
||||
type TimeStamp struct{}
|
||||
|
||||
104
types/content.go
Normal file
104
types/content.go
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// ContentsResponse — ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
|
||||
type ContentsResponse struct {
|
||||
Content string `json:"content,omitempty"` // `content` is populated when `type` is `file`, otherwise null
|
||||
DownloadURL string `json:"download_url,omitempty"`
|
||||
Encoding string `json:"encoding,omitempty"` // `encoding` is populated when `type` is `file`, otherwise null
|
||||
GitURL string `json:"git_url,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
LastCommitSHA string `json:"last_commit_sha,omitempty"`
|
||||
Links *FileLinksResponse `json:"_links,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
SubmoduleGitURL string `json:"submodule_git_url,omitempty"` // `submodule_git_url` is populated when `type` is `submodule`, otherwise null
|
||||
Target string `json:"target,omitempty"` // `target` is populated when `type` is `symlink`, otherwise null
|
||||
Type string `json:"type,omitempty"` // `type` will be `file`, `dir`, `symlink`, or `submodule`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// CreateFileOptions — CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
|
||||
type CreateFileOptions struct {
|
||||
Author *Identity `json:"author,omitempty"`
|
||||
BranchName string `json:"branch,omitempty"` // branch (optional) to base this file from. if not given, the default branch is used
|
||||
Committer *Identity `json:"committer,omitempty"`
|
||||
ContentBase64 string `json:"content"` // content must be base64 encoded
|
||||
Dates *CommitDateOptions `json:"dates,omitempty"`
|
||||
Message string `json:"message,omitempty"` // message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
NewBranchName string `json:"new_branch,omitempty"` // new_branch (optional) will make a new branch from `branch` before creating the file
|
||||
Signoff bool `json:"signoff,omitempty"` // Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
}
|
||||
|
||||
// DeleteFileOptions — DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
|
||||
type DeleteFileOptions struct {
|
||||
Author *Identity `json:"author,omitempty"`
|
||||
BranchName string `json:"branch,omitempty"` // branch (optional) to base this file from. if not given, the default branch is used
|
||||
Committer *Identity `json:"committer,omitempty"`
|
||||
Dates *CommitDateOptions `json:"dates,omitempty"`
|
||||
Message string `json:"message,omitempty"` // message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
NewBranchName string `json:"new_branch,omitempty"` // new_branch (optional) will make a new branch from `branch` before creating the file
|
||||
SHA string `json:"sha"` // sha is the SHA for the file that already exists
|
||||
Signoff bool `json:"signoff,omitempty"` // Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
}
|
||||
|
||||
type FileCommitResponse struct {
|
||||
Author *CommitUser `json:"author,omitempty"`
|
||||
Committer *CommitUser `json:"committer,omitempty"`
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Parents []*CommitMeta `json:"parents,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Tree *CommitMeta `json:"tree,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// FileDeleteResponse — FileDeleteResponse contains information about a repo's file that was deleted
|
||||
type FileDeleteResponse struct {
|
||||
Commit *FileCommitResponse `json:"commit,omitempty"`
|
||||
Content any `json:"content,omitempty"`
|
||||
Verification *PayloadCommitVerification `json:"verification,omitempty"`
|
||||
}
|
||||
|
||||
// FileLinksResponse — FileLinksResponse contains the links for a repo's file
|
||||
type FileLinksResponse struct {
|
||||
GitURL string `json:"git,omitempty"`
|
||||
HTMLURL string `json:"html,omitempty"`
|
||||
Self string `json:"self,omitempty"`
|
||||
}
|
||||
|
||||
// FileResponse — FileResponse contains information about a repo's file
|
||||
type FileResponse struct {
|
||||
Commit *FileCommitResponse `json:"commit,omitempty"`
|
||||
Content *ContentsResponse `json:"content,omitempty"`
|
||||
Verification *PayloadCommitVerification `json:"verification,omitempty"`
|
||||
}
|
||||
|
||||
// FilesResponse — FilesResponse contains information about multiple files from a repo
|
||||
type FilesResponse struct {
|
||||
Commit *FileCommitResponse `json:"commit,omitempty"`
|
||||
Files []*ContentsResponse `json:"files,omitempty"`
|
||||
Verification *PayloadCommitVerification `json:"verification,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateFileOptions — UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
|
||||
type UpdateFileOptions struct {
|
||||
Author *Identity `json:"author,omitempty"`
|
||||
BranchName string `json:"branch,omitempty"` // branch (optional) to base this file from. if not given, the default branch is used
|
||||
Committer *Identity `json:"committer,omitempty"`
|
||||
ContentBase64 string `json:"content"` // content must be base64 encoded
|
||||
Dates *CommitDateOptions `json:"dates,omitempty"`
|
||||
FromPath string `json:"from_path,omitempty"` // from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL
|
||||
Message string `json:"message,omitempty"` // message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
NewBranchName string `json:"new_branch,omitempty"` // new_branch (optional) will make a new branch from `branch` before creating the file
|
||||
SHA string `json:"sha"` // sha is the SHA for the file that already exists
|
||||
Signoff bool `json:"signoff,omitempty"` // Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
}
|
||||
|
||||
42
types/error.go
Normal file
42
types/error.go
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// APIError — APIError is an api error with a message
|
||||
type APIError struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
type APIForbiddenError struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
type APIInvalidTopicsError struct {
|
||||
InvalidTopics []string `json:"invalidTopics,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
type APINotFound struct {
|
||||
Errors []string `json:"errors,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
type APIRepoArchivedError struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
type APIUnauthorizedError struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
type APIValidationError struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
44
types/federation.go
Normal file
44
types/federation.go
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// NodeInfo — NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks
|
||||
type NodeInfo struct {
|
||||
Metadata map[string]any `json:"metadata,omitempty"`
|
||||
OpenRegistrations bool `json:"openRegistrations,omitempty"`
|
||||
Protocols []string `json:"protocols,omitempty"`
|
||||
Services *NodeInfoServices `json:"services,omitempty"`
|
||||
Software *NodeInfoSoftware `json:"software,omitempty"`
|
||||
Usage *NodeInfoUsage `json:"usage,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// NodeInfoServices — NodeInfoServices contains the third party sites this server can connect to via their application API
|
||||
type NodeInfoServices struct {
|
||||
Inbound []string `json:"inbound,omitempty"`
|
||||
Outbound []string `json:"outbound,omitempty"`
|
||||
}
|
||||
|
||||
// NodeInfoSoftware — NodeInfoSoftware contains Metadata about server software in use
|
||||
type NodeInfoSoftware struct {
|
||||
Homepage string `json:"homepage,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Repository string `json:"repository,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// NodeInfoUsage — NodeInfoUsage contains usage statistics for this server
|
||||
type NodeInfoUsage struct {
|
||||
LocalComments int64 `json:"localComments,omitempty"`
|
||||
LocalPosts int64 `json:"localPosts,omitempty"`
|
||||
Users *NodeInfoUsageUsers `json:"users,omitempty"`
|
||||
}
|
||||
|
||||
// NodeInfoUsageUsers — NodeInfoUsageUsers contains statistics about the users of this server
|
||||
type NodeInfoUsageUsers struct {
|
||||
ActiveHalfyear int64 `json:"activeHalfyear,omitempty"`
|
||||
ActiveMonth int64 `json:"activeMonth,omitempty"`
|
||||
Total int64 `json:"total,omitempty"`
|
||||
}
|
||||
|
||||
3
types/generate.go
Normal file
3
types/generate.go
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
package types
|
||||
|
||||
//go:generate go run ../cmd/forgegen/ -spec ../testdata/swagger.v1.json -out .
|
||||
94
types/git.go
Normal file
94
types/git.go
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// AnnotatedTag — AnnotatedTag represents an annotated tag
|
||||
type AnnotatedTag struct {
|
||||
ArchiveDownloadCount *TagArchiveDownloadCount `json:"archive_download_count,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Object *AnnotatedTagObject `json:"object,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Tagger *CommitUser `json:"tagger,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Verification *PayloadCommitVerification `json:"verification,omitempty"`
|
||||
}
|
||||
|
||||
// AnnotatedTagObject — AnnotatedTagObject contains meta information of the tag object
|
||||
type AnnotatedTagObject struct {
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// ChangedFile — ChangedFile store information about files affected by the pull request
|
||||
type ChangedFile struct {
|
||||
Additions int64 `json:"additions,omitempty"`
|
||||
Changes int64 `json:"changes,omitempty"`
|
||||
ContentsURL string `json:"contents_url,omitempty"`
|
||||
Deletions int64 `json:"deletions,omitempty"`
|
||||
Filename string `json:"filename,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
PreviousFilename string `json:"previous_filename,omitempty"`
|
||||
RawURL string `json:"raw_url,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// EditGitHookOption — EditGitHookOption options when modifying one Git hook
|
||||
type EditGitHookOption struct {
|
||||
Content string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
// GitBlobResponse — GitBlobResponse represents a git blob
|
||||
type GitBlobResponse struct {
|
||||
Content string `json:"content,omitempty"`
|
||||
Encoding string `json:"encoding,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// GitEntry — GitEntry represents a git tree
|
||||
type GitEntry struct {
|
||||
Mode string `json:"mode,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// GitHook — GitHook represents a Git repository hook
|
||||
type GitHook struct {
|
||||
Content string `json:"content,omitempty"`
|
||||
IsActive bool `json:"is_active,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
type GitObject struct {
|
||||
SHA string `json:"sha,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// GitTreeResponse — GitTreeResponse returns a git tree
|
||||
type GitTreeResponse struct {
|
||||
Entries []*GitEntry `json:"tree,omitempty"`
|
||||
Page int64 `json:"page,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
TotalCount int64 `json:"total_count,omitempty"`
|
||||
Truncated bool `json:"truncated,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// Note — Note contains information related to a git note
|
||||
type Note struct {
|
||||
Commit *Commit `json:"commit,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
type NoteOptions struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
69
types/hook.go
Normal file
69
types/hook.go
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateHookOption — CreateHookOption options when create a hook
|
||||
type CreateHookOption struct {
|
||||
Active bool `json:"active,omitempty"`
|
||||
AuthorizationHeader string `json:"authorization_header,omitempty"`
|
||||
BranchFilter string `json:"branch_filter,omitempty"`
|
||||
Config *CreateHookOptionConfig `json:"config"`
|
||||
Events []string `json:"events,omitempty"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
// CreateHookOptionConfig — CreateHookOptionConfig has all config options in it required are "content_type" and "url" Required
|
||||
// CreateHookOptionConfig has no fields in the swagger spec.
|
||||
type CreateHookOptionConfig struct{}
|
||||
|
||||
// EditHookOption — EditHookOption options when modify one hook
|
||||
type EditHookOption struct {
|
||||
Active bool `json:"active,omitempty"`
|
||||
AuthorizationHeader string `json:"authorization_header,omitempty"`
|
||||
BranchFilter string `json:"branch_filter,omitempty"`
|
||||
Config map[string]any `json:"config,omitempty"`
|
||||
Events []string `json:"events,omitempty"`
|
||||
}
|
||||
|
||||
// Hook — Hook a hook is a web hook when one repository changed
|
||||
type Hook struct {
|
||||
Active bool `json:"active,omitempty"`
|
||||
AuthorizationHeader string `json:"authorization_header,omitempty"`
|
||||
BranchFilter string `json:"branch_filter,omitempty"`
|
||||
Config map[string]any `json:"config,omitempty"` // Deprecated: use Metadata instead
|
||||
ContentType string `json:"content_type,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Events []string `json:"events,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Metadata any `json:"metadata,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// PayloadCommit — PayloadCommit represents a commit
|
||||
type PayloadCommit struct {
|
||||
Added []string `json:"added,omitempty"`
|
||||
Author *PayloadUser `json:"author,omitempty"`
|
||||
Committer *PayloadUser `json:"committer,omitempty"`
|
||||
ID string `json:"id,omitempty"` // sha1 hash of the commit
|
||||
Message string `json:"message,omitempty"`
|
||||
Modified []string `json:"modified,omitempty"`
|
||||
Removed []string `json:"removed,omitempty"`
|
||||
Timestamp time.Time `json:"timestamp,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Verification *PayloadCommitVerification `json:"verification,omitempty"`
|
||||
}
|
||||
|
||||
// PayloadCommitVerification — PayloadCommitVerification represents the GPG verification of a commit
|
||||
type PayloadCommitVerification struct {
|
||||
Payload string `json:"payload,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Signature string `json:"signature,omitempty"`
|
||||
Signer *PayloadUser `json:"signer,omitempty"`
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
}
|
||||
|
||||
145
types/issue.go
Normal file
145
types/issue.go
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateIssueCommentOption — CreateIssueCommentOption options for creating a comment on an issue
|
||||
type CreateIssueCommentOption struct {
|
||||
Body string `json:"body"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// CreateIssueOption — CreateIssueOption options to create one issue
|
||||
type CreateIssueOption struct {
|
||||
Assignee string `json:"assignee,omitempty"` // deprecated
|
||||
Assignees []string `json:"assignees,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Closed bool `json:"closed,omitempty"`
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
Labels []int64 `json:"labels,omitempty"` // list of label ids
|
||||
Milestone int64 `json:"milestone,omitempty"` // milestone id
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// EditDeadlineOption — EditDeadlineOption options for creating a deadline
|
||||
type EditDeadlineOption struct {
|
||||
Deadline time.Time `json:"due_date"`
|
||||
}
|
||||
|
||||
// EditIssueCommentOption — EditIssueCommentOption options for editing a comment
|
||||
type EditIssueCommentOption struct {
|
||||
Body string `json:"body"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// EditIssueOption — EditIssueOption options for editing an issue
|
||||
type EditIssueOption struct {
|
||||
Assignee string `json:"assignee,omitempty"` // deprecated
|
||||
Assignees []string `json:"assignees,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
Milestone int64 `json:"milestone,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
RemoveDeadline bool `json:"unset_due_date,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// Issue — Issue represents an issue in a repository
|
||||
type Issue struct {
|
||||
Assignee *User `json:"assignee,omitempty"`
|
||||
Assignees []*User `json:"assignees,omitempty"`
|
||||
Attachments []*Attachment `json:"assets,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Closed time.Time `json:"closed_at,omitempty"`
|
||||
Comments int64 `json:"comments,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Index int64 `json:"number,omitempty"`
|
||||
IsLocked bool `json:"is_locked,omitempty"`
|
||||
Labels []*Label `json:"labels,omitempty"`
|
||||
Milestone *Milestone `json:"milestone,omitempty"`
|
||||
OriginalAuthor string `json:"original_author,omitempty"`
|
||||
OriginalAuthorID int64 `json:"original_author_id,omitempty"`
|
||||
PinOrder int64 `json:"pin_order,omitempty"`
|
||||
PullRequest *PullRequestMeta `json:"pull_request,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Repository *RepositoryMeta `json:"repository,omitempty"`
|
||||
State *StateType `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
type IssueConfig struct {
|
||||
BlankIssuesEnabled bool `json:"blank_issues_enabled,omitempty"`
|
||||
ContactLinks []*IssueConfigContactLink `json:"contact_links,omitempty"`
|
||||
}
|
||||
|
||||
type IssueConfigContactLink struct {
|
||||
About string `json:"about,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
type IssueConfigValidation struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
Valid bool `json:"valid,omitempty"`
|
||||
}
|
||||
|
||||
// IssueDeadline — IssueDeadline represents an issue deadline
|
||||
type IssueDeadline struct {
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
}
|
||||
|
||||
// IssueFormField — IssueFormField represents a form field
|
||||
type IssueFormField struct {
|
||||
Attributes map[string]any `json:"attributes,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Type *IssueFormFieldType `json:"type,omitempty"`
|
||||
Validations map[string]any `json:"validations,omitempty"`
|
||||
Visible []*IssueFormFieldVisible `json:"visible,omitempty"`
|
||||
}
|
||||
|
||||
// IssueFormFieldType has no fields in the swagger spec.
|
||||
type IssueFormFieldType struct{}
|
||||
|
||||
// IssueFormFieldVisible — IssueFormFieldVisible defines issue form field visible
|
||||
// IssueFormFieldVisible has no fields in the swagger spec.
|
||||
type IssueFormFieldVisible struct{}
|
||||
|
||||
// IssueLabelsOption — IssueLabelsOption a collection of labels
|
||||
type IssueLabelsOption struct {
|
||||
Labels []any `json:"labels,omitempty"` // Labels can be a list of integers representing label IDs or a list of strings representing label names
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// IssueMeta — IssueMeta basic issue information
|
||||
type IssueMeta struct {
|
||||
Index int64 `json:"index,omitempty"`
|
||||
Name string `json:"repo,omitempty"`
|
||||
Owner string `json:"owner,omitempty"`
|
||||
}
|
||||
|
||||
// IssueTemplate — IssueTemplate represents an issue template for a repository
|
||||
type IssueTemplate struct {
|
||||
About string `json:"about,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Fields []*IssueFormField `json:"body,omitempty"`
|
||||
FileName string `json:"file_name,omitempty"`
|
||||
Labels *IssueTemplateLabels `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
// IssueTemplateLabels has no fields in the swagger spec.
|
||||
type IssueTemplateLabels struct{}
|
||||
|
||||
69
types/key.go
Normal file
69
types/key.go
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateGPGKeyOption — CreateGPGKeyOption options create user GPG key
|
||||
type CreateGPGKeyOption struct {
|
||||
ArmoredKey string `json:"armored_public_key"` // An armored GPG key to add
|
||||
Signature string `json:"armored_signature,omitempty"`
|
||||
}
|
||||
|
||||
// CreateKeyOption — CreateKeyOption options when creating a key
|
||||
type CreateKeyOption struct {
|
||||
Key string `json:"key"` // An armored SSH key to add
|
||||
ReadOnly bool `json:"read_only,omitempty"` // Describe if the key has only read access or read/write
|
||||
Title string `json:"title"` // Title of the key to add
|
||||
}
|
||||
|
||||
// DeployKey — DeployKey a deploy key
|
||||
type DeployKey struct {
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
KeyID int64 `json:"key_id,omitempty"`
|
||||
ReadOnly bool `json:"read_only,omitempty"`
|
||||
Repository *Repository `json:"repository,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// GPGKey — GPGKey a user GPG key to sign commit and tag in repository
|
||||
type GPGKey struct {
|
||||
CanCertify bool `json:"can_certify,omitempty"`
|
||||
CanEncryptComms bool `json:"can_encrypt_comms,omitempty"`
|
||||
CanEncryptStorage bool `json:"can_encrypt_storage,omitempty"`
|
||||
CanSign bool `json:"can_sign,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Emails []*GPGKeyEmail `json:"emails,omitempty"`
|
||||
Expires time.Time `json:"expires_at,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
KeyID string `json:"key_id,omitempty"`
|
||||
PrimaryKeyID string `json:"primary_key_id,omitempty"`
|
||||
PublicKey string `json:"public_key,omitempty"`
|
||||
SubsKey []*GPGKey `json:"subkeys,omitempty"`
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
}
|
||||
|
||||
// GPGKeyEmail — GPGKeyEmail an email attached to a GPGKey
|
||||
type GPGKeyEmail struct {
|
||||
Email string `json:"email,omitempty"`
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
}
|
||||
|
||||
// PublicKey — PublicKey publickey is a user key to push code to repository
|
||||
type PublicKey struct {
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
KeyType string `json:"key_type,omitempty"`
|
||||
ReadOnly bool `json:"read_only,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
49
types/label.go
Normal file
49
types/label.go
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateLabelOption — CreateLabelOption options for creating a label
|
||||
type CreateLabelOption struct {
|
||||
Color string `json:"color"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Exclusive bool `json:"exclusive,omitempty"`
|
||||
IsArchived bool `json:"is_archived,omitempty"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// DeleteLabelsOption — DeleteLabelOption options for deleting a label
|
||||
type DeleteLabelsOption struct {
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// EditLabelOption — EditLabelOption options for editing a label
|
||||
type EditLabelOption struct {
|
||||
Color string `json:"color,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Exclusive bool `json:"exclusive,omitempty"`
|
||||
IsArchived bool `json:"is_archived,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Label — Label a label to an issue or a pr
|
||||
type Label struct {
|
||||
Color string `json:"color,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Exclusive bool `json:"exclusive,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IsArchived bool `json:"is_archived,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// LabelTemplate — LabelTemplate info of a Label template
|
||||
type LabelTemplate struct {
|
||||
Color string `json:"color,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Exclusive bool `json:"exclusive,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
37
types/milestone.go
Normal file
37
types/milestone.go
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateMilestoneOption — CreateMilestoneOption options for creating a milestone
|
||||
type CreateMilestoneOption struct {
|
||||
Deadline time.Time `json:"due_on,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
// EditMilestoneOption — EditMilestoneOption options for editing a milestone
|
||||
type EditMilestoneOption struct {
|
||||
Deadline time.Time `json:"due_on,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
// Milestone — Milestone milestone is a collection of issues on one repository
|
||||
type Milestone struct {
|
||||
Closed time.Time `json:"closed_at,omitempty"`
|
||||
ClosedIssues int64 `json:"closed_issues,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Deadline time.Time `json:"due_on,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
OpenIssues int64 `json:"open_issues,omitempty"`
|
||||
State *StateType `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
255
types/misc.go
Normal file
255
types/misc.go
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// AddCollaboratorOption — AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||
type AddCollaboratorOption struct {
|
||||
Permission string `json:"permission,omitempty"`
|
||||
}
|
||||
|
||||
// AddTimeOption — AddTimeOption options for adding time to an issue
|
||||
type AddTimeOption struct {
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
Time int64 `json:"time"` // time in seconds
|
||||
User string `json:"user_name,omitempty"` // User who spent the time (optional)
|
||||
}
|
||||
|
||||
// ChangeFileOperation — ChangeFileOperation for creating, updating or deleting a file
|
||||
type ChangeFileOperation struct {
|
||||
ContentBase64 string `json:"content,omitempty"` // new or updated file content, must be base64 encoded
|
||||
FromPath string `json:"from_path,omitempty"` // old path of the file to move
|
||||
Operation string `json:"operation"` // indicates what to do with the file
|
||||
Path string `json:"path"` // path to the existing or new file
|
||||
SHA string `json:"sha,omitempty"` // sha is the SHA for the file that already exists, required for update or delete
|
||||
}
|
||||
|
||||
// ChangeFilesOptions — ChangeFilesOptions options for creating, updating or deleting multiple files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
|
||||
type ChangeFilesOptions struct {
|
||||
Author *Identity `json:"author,omitempty"`
|
||||
BranchName string `json:"branch,omitempty"` // branch (optional) to base this file from. if not given, the default branch is used
|
||||
Committer *Identity `json:"committer,omitempty"`
|
||||
Dates *CommitDateOptions `json:"dates,omitempty"`
|
||||
Files []*ChangeFileOperation `json:"files"` // list of file operations
|
||||
Message string `json:"message,omitempty"` // message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
NewBranchName string `json:"new_branch,omitempty"` // new_branch (optional) will make a new branch from `branch` before creating the file
|
||||
Signoff bool `json:"signoff,omitempty"` // Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
}
|
||||
|
||||
type Compare struct {
|
||||
Commits []*Commit `json:"commits,omitempty"`
|
||||
TotalCommits int64 `json:"total_commits,omitempty"`
|
||||
}
|
||||
|
||||
// CreateForkOption — CreateForkOption options for creating a fork
|
||||
type CreateForkOption struct {
|
||||
Name string `json:"name,omitempty"` // name of the forked repository
|
||||
Organization string `json:"organization,omitempty"` // organization name, if forking into an organization
|
||||
}
|
||||
|
||||
// CreateOrUpdateSecretOption — CreateOrUpdateSecretOption options when creating or updating secret
|
||||
type CreateOrUpdateSecretOption struct {
|
||||
Data string `json:"data"` // Data of the secret to update
|
||||
}
|
||||
|
||||
// DismissPullReviewOptions — DismissPullReviewOptions are options to dismiss a pull review
|
||||
type DismissPullReviewOptions struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
Priors bool `json:"priors,omitempty"`
|
||||
}
|
||||
|
||||
// ForgeLike — ForgeLike activity data type
|
||||
// ForgeLike has no fields in the swagger spec.
|
||||
type ForgeLike struct{}
|
||||
|
||||
// GenerateRepoOption — GenerateRepoOption options when creating repository using a template
|
||||
type GenerateRepoOption struct {
|
||||
Avatar bool `json:"avatar,omitempty"` // include avatar of the template repo
|
||||
DefaultBranch string `json:"default_branch,omitempty"` // Default branch of the new repository
|
||||
Description string `json:"description,omitempty"` // Description of the repository to create
|
||||
GitContent bool `json:"git_content,omitempty"` // include git content of default branch in template repo
|
||||
GitHooks bool `json:"git_hooks,omitempty"` // include git hooks in template repo
|
||||
Labels bool `json:"labels,omitempty"` // include labels in template repo
|
||||
Name string `json:"name"` // Name of the repository to create
|
||||
Owner string `json:"owner"` // The organization or person who will own the new repository
|
||||
Private bool `json:"private,omitempty"` // Whether the repository is private
|
||||
ProtectedBranch bool `json:"protected_branch,omitempty"` // include protected branches in template repo
|
||||
Topics bool `json:"topics,omitempty"` // include topics in template repo
|
||||
Webhooks bool `json:"webhooks,omitempty"` // include webhooks in template repo
|
||||
}
|
||||
|
||||
// GitignoreTemplateInfo — GitignoreTemplateInfo name and text of a gitignore template
|
||||
type GitignoreTemplateInfo struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
}
|
||||
|
||||
// Identity — Identity for a person's identity like an author or committer
|
||||
type Identity struct {
|
||||
Email string `json:"email,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// LicenseTemplateInfo — LicensesInfo contains information about a License
|
||||
type LicenseTemplateInfo struct {
|
||||
Body string `json:"body,omitempty"`
|
||||
Implementation string `json:"implementation,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// LicensesTemplateListEntry — LicensesListEntry is used for the API
|
||||
type LicensesTemplateListEntry struct {
|
||||
Key string `json:"key,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// MarkdownOption — MarkdownOption markdown options
|
||||
type MarkdownOption struct {
|
||||
Context string `json:"Context,omitempty"` // Context to render in: body
|
||||
Mode string `json:"Mode,omitempty"` // Mode to render (comment, gfm, markdown) in: body
|
||||
Text string `json:"Text,omitempty"` // Text markdown to render in: body
|
||||
Wiki bool `json:"Wiki,omitempty"` // Is it a wiki page ? in: body
|
||||
}
|
||||
|
||||
// MarkupOption — MarkupOption markup options
|
||||
type MarkupOption struct {
|
||||
BranchPath string `json:"BranchPath,omitempty"` // The current branch path where the form gets posted in: body
|
||||
Context string `json:"Context,omitempty"` // Context to render in: body
|
||||
FilePath string `json:"FilePath,omitempty"` // File path for detecting extension in file mode in: body
|
||||
Mode string `json:"Mode,omitempty"` // Mode to render (comment, gfm, markdown, file) in: body
|
||||
Text string `json:"Text,omitempty"` // Text markup to render in: body
|
||||
Wiki bool `json:"Wiki,omitempty"` // Is it a wiki page ? in: body
|
||||
}
|
||||
|
||||
// MergePullRequestOption — MergePullRequestForm form for merging Pull Request
|
||||
type MergePullRequestOption struct {
|
||||
DeleteBranchAfterMerge bool `json:"delete_branch_after_merge,omitempty"`
|
||||
Do string `json:"Do"`
|
||||
ForceMerge bool `json:"force_merge,omitempty"`
|
||||
HeadCommitID string `json:"head_commit_id,omitempty"`
|
||||
MergeCommitID string `json:"MergeCommitID,omitempty"`
|
||||
MergeMessageField string `json:"MergeMessageField,omitempty"`
|
||||
MergeTitleField string `json:"MergeTitleField,omitempty"`
|
||||
MergeWhenChecksSucceed bool `json:"merge_when_checks_succeed,omitempty"`
|
||||
}
|
||||
|
||||
// MigrateRepoOptions — MigrateRepoOptions options for migrating repository's this is used to interact with api v1
|
||||
type MigrateRepoOptions struct {
|
||||
AuthPassword string `json:"auth_password,omitempty"`
|
||||
AuthToken string `json:"auth_token,omitempty"`
|
||||
AuthUsername string `json:"auth_username,omitempty"`
|
||||
CloneAddr string `json:"clone_addr"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Issues bool `json:"issues,omitempty"`
|
||||
LFS bool `json:"lfs,omitempty"`
|
||||
LFSEndpoint string `json:"lfs_endpoint,omitempty"`
|
||||
Labels bool `json:"labels,omitempty"`
|
||||
Milestones bool `json:"milestones,omitempty"`
|
||||
Mirror bool `json:"mirror,omitempty"`
|
||||
MirrorInterval string `json:"mirror_interval,omitempty"`
|
||||
Private bool `json:"private,omitempty"`
|
||||
PullRequests bool `json:"pull_requests,omitempty"`
|
||||
Releases bool `json:"releases,omitempty"`
|
||||
RepoName string `json:"repo_name"`
|
||||
RepoOwner string `json:"repo_owner,omitempty"` // Name of User or Organisation who will own Repo after migration
|
||||
RepoOwnerID int64 `json:"uid,omitempty"` // deprecated (only for backwards compatibility)
|
||||
Service string `json:"service,omitempty"`
|
||||
Wiki bool `json:"wiki,omitempty"`
|
||||
}
|
||||
|
||||
// NewIssuePinsAllowed — NewIssuePinsAllowed represents an API response that says if new Issue Pins are allowed
|
||||
type NewIssuePinsAllowed struct {
|
||||
Issues bool `json:"issues,omitempty"`
|
||||
PullRequests bool `json:"pull_requests,omitempty"`
|
||||
}
|
||||
|
||||
// NotifySubjectType — NotifySubjectType represent type of notification subject
|
||||
// NotifySubjectType has no fields in the swagger spec.
|
||||
type NotifySubjectType struct{}
|
||||
|
||||
// PRBranchInfo — PRBranchInfo information about a branch
|
||||
type PRBranchInfo struct {
|
||||
Name string `json:"label,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Repo *Repository `json:"repo,omitempty"`
|
||||
RepoID int64 `json:"repo_id,omitempty"`
|
||||
Sha string `json:"sha,omitempty"`
|
||||
}
|
||||
|
||||
// PayloadUser — PayloadUser represents the author or committer of a commit
|
||||
type PayloadUser struct {
|
||||
Email string `json:"email,omitempty"`
|
||||
Name string `json:"name,omitempty"` // Full name of the commit author
|
||||
UserName string `json:"username,omitempty"`
|
||||
}
|
||||
|
||||
type Reference struct {
|
||||
Object *GitObject `json:"object,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// ReplaceFlagsOption — ReplaceFlagsOption options when replacing the flags of a repository
|
||||
type ReplaceFlagsOption struct {
|
||||
Flags []string `json:"flags,omitempty"`
|
||||
}
|
||||
|
||||
// SearchResults — SearchResults results of a successful search
|
||||
type SearchResults struct {
|
||||
Data []*Repository `json:"data,omitempty"`
|
||||
OK bool `json:"ok,omitempty"`
|
||||
}
|
||||
|
||||
// ServerVersion — ServerVersion wraps the version of the server
|
||||
type ServerVersion struct {
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// TimelineComment — TimelineComment represents a timeline comment (comment of any type) on a commit or issue
|
||||
type TimelineComment struct {
|
||||
Assignee *User `json:"assignee,omitempty"`
|
||||
AssigneeTeam *Team `json:"assignee_team,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
DependentIssue *Issue `json:"dependent_issue,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IssueURL string `json:"issue_url,omitempty"`
|
||||
Label *Label `json:"label,omitempty"`
|
||||
Milestone *Milestone `json:"milestone,omitempty"`
|
||||
NewRef string `json:"new_ref,omitempty"`
|
||||
NewTitle string `json:"new_title,omitempty"`
|
||||
OldMilestone *Milestone `json:"old_milestone,omitempty"`
|
||||
OldProjectID int64 `json:"old_project_id,omitempty"`
|
||||
OldRef string `json:"old_ref,omitempty"`
|
||||
OldTitle string `json:"old_title,omitempty"`
|
||||
PRURL string `json:"pull_request_url,omitempty"`
|
||||
ProjectID int64 `json:"project_id,omitempty"`
|
||||
RefAction string `json:"ref_action,omitempty"`
|
||||
RefComment *Comment `json:"ref_comment,omitempty"`
|
||||
RefCommitSHA string `json:"ref_commit_sha,omitempty"` // commit SHA where issue/PR was referenced
|
||||
RefIssue *Issue `json:"ref_issue,omitempty"`
|
||||
RemovedAssignee bool `json:"removed_assignee,omitempty"` // whether the assignees were removed or added
|
||||
ResolveDoer *User `json:"resolve_doer,omitempty"`
|
||||
ReviewID int64 `json:"review_id,omitempty"`
|
||||
TrackedTime *TrackedTime `json:"tracked_time,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
// WatchInfo — WatchInfo represents an API watch status of one repository
|
||||
type WatchInfo struct {
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
Ignored bool `json:"ignored,omitempty"`
|
||||
Reason any `json:"reason,omitempty"`
|
||||
RepositoryURL string `json:"repository_url,omitempty"`
|
||||
Subscribed bool `json:"subscribed,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
34
types/notification.go
Normal file
34
types/notification.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// NotificationCount — NotificationCount number of unread notifications
|
||||
type NotificationCount struct {
|
||||
New int64 `json:"new,omitempty"`
|
||||
}
|
||||
|
||||
// NotificationSubject — NotificationSubject contains the notification subject (Issue/Pull/Commit)
|
||||
type NotificationSubject struct {
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
LatestCommentHTMLURL string `json:"latest_comment_html_url,omitempty"`
|
||||
LatestCommentURL string `json:"latest_comment_url,omitempty"`
|
||||
State *StateType `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Type *NotifySubjectType `json:"type,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// NotificationThread — NotificationThread expose Notification on API
|
||||
type NotificationThread struct {
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Pinned bool `json:"pinned,omitempty"`
|
||||
Repository *Repository `json:"repository,omitempty"`
|
||||
Subject *NotificationSubject `json:"subject,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Unread bool `json:"unread,omitempty"`
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
38
types/oauth.go
Normal file
38
types/oauth.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
type AccessToken struct {
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Scopes []string `json:"scopes,omitempty"`
|
||||
Token string `json:"sha1,omitempty"`
|
||||
TokenLastEight string `json:"token_last_eight,omitempty"`
|
||||
}
|
||||
|
||||
// CreateAccessTokenOption — CreateAccessTokenOption options when create access token
|
||||
type CreateAccessTokenOption struct {
|
||||
Name string `json:"name"`
|
||||
Scopes []string `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// CreateOAuth2ApplicationOptions — CreateOAuth2ApplicationOptions holds options to create an oauth2 application
|
||||
type CreateOAuth2ApplicationOptions struct {
|
||||
ConfidentialClient bool `json:"confidential_client,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RedirectURIs []string `json:"redirect_uris,omitempty"`
|
||||
}
|
||||
|
||||
type OAuth2Application struct {
|
||||
ClientID string `json:"client_id,omitempty"`
|
||||
ClientSecret string `json:"client_secret,omitempty"`
|
||||
ConfidentialClient bool `json:"confidential_client,omitempty"`
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RedirectURIs []string `json:"redirect_uris,omitempty"`
|
||||
}
|
||||
|
||||
52
types/org.go
Normal file
52
types/org.go
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// CreateOrgOption — CreateOrgOption options for creating an organization
|
||||
type CreateOrgOption struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access,omitempty"`
|
||||
UserName string `json:"username"`
|
||||
Visibility string `json:"visibility,omitempty"` // possible values are `public` (default), `limited` or `private`
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
// EditOrgOption — EditOrgOption options for editing an organization
|
||||
type EditOrgOption struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access,omitempty"`
|
||||
Visibility string `json:"visibility,omitempty"` // possible values are `public`, `limited` or `private`
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
// Organization — Organization represents an organization
|
||||
type Organization struct {
|
||||
AvatarURL string `json:"avatar_url,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access,omitempty"`
|
||||
UserName string `json:"username,omitempty"` // deprecated
|
||||
Visibility string `json:"visibility,omitempty"`
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
// OrganizationPermissions — OrganizationPermissions list different users permissions on an organization
|
||||
type OrganizationPermissions struct {
|
||||
CanCreateRepository bool `json:"can_create_repository,omitempty"`
|
||||
CanRead bool `json:"can_read,omitempty"`
|
||||
CanWrite bool `json:"can_write,omitempty"`
|
||||
IsAdmin bool `json:"is_admin,omitempty"`
|
||||
IsOwner bool `json:"is_owner,omitempty"`
|
||||
}
|
||||
|
||||
31
types/package.go
Normal file
31
types/package.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// Package — Package represents a package
|
||||
type Package struct {
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
Creator *User `json:"creator,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Owner *User `json:"owner,omitempty"`
|
||||
Repository *Repository `json:"repository,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// PackageFile — PackageFile represents a package file
|
||||
type PackageFile struct {
|
||||
HashMD5 string `json:"md5,omitempty"`
|
||||
HashSHA1 string `json:"sha1,omitempty"`
|
||||
HashSHA256 string `json:"sha256,omitempty"`
|
||||
HashSHA512 string `json:"sha512,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Size int64 `json:"Size,omitempty"`
|
||||
}
|
||||
|
||||
153
types/pr.go
Normal file
153
types/pr.go
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreatePullRequestOption — CreatePullRequestOption options when creating a pull request
|
||||
type CreatePullRequestOption struct {
|
||||
Assignee string `json:"assignee,omitempty"`
|
||||
Assignees []string `json:"assignees,omitempty"`
|
||||
Base string `json:"base,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
Head string `json:"head,omitempty"`
|
||||
Labels []int64 `json:"labels,omitempty"`
|
||||
Milestone int64 `json:"milestone,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
// CreatePullReviewComment — CreatePullReviewComment represent a review comment for creation api
|
||||
type CreatePullReviewComment struct {
|
||||
Body string `json:"body,omitempty"`
|
||||
NewLineNum int64 `json:"new_position,omitempty"` // if comment to new file line or 0
|
||||
OldLineNum int64 `json:"old_position,omitempty"` // if comment to old file line or 0
|
||||
Path string `json:"path,omitempty"` // the tree path
|
||||
}
|
||||
|
||||
// CreatePullReviewCommentOptions — CreatePullReviewCommentOptions are options to create a pull review comment
|
||||
// CreatePullReviewCommentOptions has no fields in the swagger spec.
|
||||
type CreatePullReviewCommentOptions struct{}
|
||||
|
||||
// CreatePullReviewOptions — CreatePullReviewOptions are options to create a pull review
|
||||
type CreatePullReviewOptions struct {
|
||||
Body string `json:"body,omitempty"`
|
||||
Comments []*CreatePullReviewComment `json:"comments,omitempty"`
|
||||
CommitID string `json:"commit_id,omitempty"`
|
||||
Event *ReviewStateType `json:"event,omitempty"`
|
||||
}
|
||||
|
||||
// EditPullRequestOption — EditPullRequestOption options when modify pull request
|
||||
type EditPullRequestOption struct {
|
||||
AllowMaintainerEdit bool `json:"allow_maintainer_edit,omitempty"`
|
||||
Assignee string `json:"assignee,omitempty"`
|
||||
Assignees []string `json:"assignees,omitempty"`
|
||||
Base string `json:"base,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
Labels []int64 `json:"labels,omitempty"`
|
||||
Milestone int64 `json:"milestone,omitempty"`
|
||||
RemoveDeadline bool `json:"unset_due_date,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
// PullRequest — PullRequest represents a pull request
|
||||
type PullRequest struct {
|
||||
Additions int64 `json:"additions,omitempty"`
|
||||
AllowMaintainerEdit bool `json:"allow_maintainer_edit,omitempty"`
|
||||
Assignee *User `json:"assignee,omitempty"`
|
||||
Assignees []*User `json:"assignees,omitempty"`
|
||||
Base *PRBranchInfo `json:"base,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
ChangedFiles int64 `json:"changed_files,omitempty"`
|
||||
Closed time.Time `json:"closed_at,omitempty"`
|
||||
Comments int64 `json:"comments,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Deadline time.Time `json:"due_date,omitempty"`
|
||||
Deletions int64 `json:"deletions,omitempty"`
|
||||
DiffURL string `json:"diff_url,omitempty"`
|
||||
Draft bool `json:"draft,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
HasMerged bool `json:"merged,omitempty"`
|
||||
Head *PRBranchInfo `json:"head,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Index int64 `json:"number,omitempty"`
|
||||
IsLocked bool `json:"is_locked,omitempty"`
|
||||
Labels []*Label `json:"labels,omitempty"`
|
||||
MergeBase string `json:"merge_base,omitempty"`
|
||||
Mergeable bool `json:"mergeable,omitempty"`
|
||||
Merged time.Time `json:"merged_at,omitempty"`
|
||||
MergedBy *User `json:"merged_by,omitempty"`
|
||||
MergedCommitID string `json:"merge_commit_sha,omitempty"`
|
||||
Milestone *Milestone `json:"milestone,omitempty"`
|
||||
PatchURL string `json:"patch_url,omitempty"`
|
||||
PinOrder int64 `json:"pin_order,omitempty"`
|
||||
RequestedReviewers []*User `json:"requested_reviewers,omitempty"`
|
||||
RequestedReviewersTeams []*Team `json:"requested_reviewers_teams,omitempty"`
|
||||
ReviewComments int64 `json:"review_comments,omitempty"` // number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)
|
||||
State *StateType `json:"state,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
// PullRequestMeta — PullRequestMeta PR info if an issue is a PR
|
||||
type PullRequestMeta struct {
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
HasMerged bool `json:"merged,omitempty"`
|
||||
IsWorkInProgress bool `json:"draft,omitempty"`
|
||||
Merged time.Time `json:"merged_at,omitempty"`
|
||||
}
|
||||
|
||||
// PullReview — PullReview represents a pull request review
|
||||
type PullReview struct {
|
||||
Body string `json:"body,omitempty"`
|
||||
CodeCommentsCount int64 `json:"comments_count,omitempty"`
|
||||
CommitID string `json:"commit_id,omitempty"`
|
||||
Dismissed bool `json:"dismissed,omitempty"`
|
||||
HTMLPullURL string `json:"pull_request_url,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Official bool `json:"official,omitempty"`
|
||||
Stale bool `json:"stale,omitempty"`
|
||||
State *ReviewStateType `json:"state,omitempty"`
|
||||
Submitted time.Time `json:"submitted_at,omitempty"`
|
||||
Team *Team `json:"team,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
// PullReviewComment — PullReviewComment represents a comment on a pull request review
|
||||
type PullReviewComment struct {
|
||||
Body string `json:"body,omitempty"`
|
||||
CommitID string `json:"commit_id,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
DiffHunk string `json:"diff_hunk,omitempty"`
|
||||
HTMLPullURL string `json:"pull_request_url,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
LineNum int `json:"position,omitempty"`
|
||||
OldLineNum int `json:"original_position,omitempty"`
|
||||
OrigCommitID string `json:"original_commit_id,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
Resolver *User `json:"resolver,omitempty"`
|
||||
ReviewID int64 `json:"pull_request_review_id,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
// PullReviewRequestOptions — PullReviewRequestOptions are options to add or remove pull review requests
|
||||
type PullReviewRequestOptions struct {
|
||||
Reviewers []string `json:"reviewers,omitempty"`
|
||||
TeamReviewers []string `json:"team_reviewers,omitempty"`
|
||||
}
|
||||
|
||||
// SubmitPullReviewOptions — SubmitPullReviewOptions are options to submit a pending pull review
|
||||
type SubmitPullReviewOptions struct {
|
||||
Body string `json:"body,omitempty"`
|
||||
Event *ReviewStateType `json:"event,omitempty"`
|
||||
}
|
||||
|
||||
124
types/quota.go
Normal file
124
types/quota.go
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// CreateQuotaGroupOptions — CreateQutaGroupOptions represents the options for creating a quota group
|
||||
type CreateQuotaGroupOptions struct {
|
||||
Name string `json:"name,omitempty"` // Name of the quota group to create
|
||||
Rules []*CreateQuotaRuleOptions `json:"rules,omitempty"` // Rules to add to the newly created group. If a rule does not exist, it will be created.
|
||||
}
|
||||
|
||||
// CreateQuotaRuleOptions — CreateQuotaRuleOptions represents the options for creating a quota rule
|
||||
type CreateQuotaRuleOptions struct {
|
||||
Limit int64 `json:"limit,omitempty"` // The limit set by the rule
|
||||
Name string `json:"name,omitempty"` // Name of the rule to create
|
||||
Subjects []string `json:"subjects,omitempty"` // The subjects affected by the rule
|
||||
}
|
||||
|
||||
// EditQuotaRuleOptions — EditQuotaRuleOptions represents the options for editing a quota rule
|
||||
type EditQuotaRuleOptions struct {
|
||||
Limit int64 `json:"limit,omitempty"` // The limit set by the rule
|
||||
Subjects []string `json:"subjects,omitempty"` // The subjects affected by the rule
|
||||
}
|
||||
|
||||
// QuotaGroup — QuotaGroup represents a quota group
|
||||
type QuotaGroup struct {
|
||||
Name string `json:"name,omitempty"` // Name of the group
|
||||
Rules []*QuotaRuleInfo `json:"rules,omitempty"` // Rules associated with the group
|
||||
}
|
||||
|
||||
// QuotaGroupList — QuotaGroupList represents a list of quota groups
|
||||
// QuotaGroupList has no fields in the swagger spec.
|
||||
type QuotaGroupList struct{}
|
||||
|
||||
// QuotaInfo — QuotaInfo represents information about a user's quota
|
||||
type QuotaInfo struct {
|
||||
Groups *QuotaGroupList `json:"groups,omitempty"`
|
||||
Used *QuotaUsed `json:"used,omitempty"`
|
||||
}
|
||||
|
||||
// QuotaRuleInfo — QuotaRuleInfo contains information about a quota rule
|
||||
type QuotaRuleInfo struct {
|
||||
Limit int64 `json:"limit,omitempty"` // The limit set by the rule
|
||||
Name string `json:"name,omitempty"` // Name of the rule (only shown to admins)
|
||||
Subjects []string `json:"subjects,omitempty"` // Subjects the rule affects
|
||||
}
|
||||
|
||||
// QuotaUsed — QuotaUsed represents the quota usage of a user
|
||||
type QuotaUsed struct {
|
||||
Size *QuotaUsedSize `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// QuotaUsedArtifact — QuotaUsedArtifact represents an artifact counting towards a user's quota
|
||||
type QuotaUsedArtifact struct {
|
||||
HTMLURL string `json:"html_url,omitempty"` // HTML URL to the action run containing the artifact
|
||||
Name string `json:"name,omitempty"` // Name of the artifact
|
||||
Size int64 `json:"size,omitempty"` // Size of the artifact (compressed)
|
||||
}
|
||||
|
||||
// QuotaUsedArtifactList — QuotaUsedArtifactList represents a list of artifacts counting towards a user's quota
|
||||
// QuotaUsedArtifactList has no fields in the swagger spec.
|
||||
type QuotaUsedArtifactList struct{}
|
||||
|
||||
// QuotaUsedAttachment — QuotaUsedAttachment represents an attachment counting towards a user's quota
|
||||
type QuotaUsedAttachment struct {
|
||||
APIURL string `json:"api_url,omitempty"` // API URL for the attachment
|
||||
ContainedIn map[string]any `json:"contained_in,omitempty"` // Context for the attachment: URLs to the containing object
|
||||
Name string `json:"name,omitempty"` // Filename of the attachment
|
||||
Size int64 `json:"size,omitempty"` // Size of the attachment (in bytes)
|
||||
}
|
||||
|
||||
// QuotaUsedAttachmentList — QuotaUsedAttachmentList represents a list of attachment counting towards a user's quota
|
||||
// QuotaUsedAttachmentList has no fields in the swagger spec.
|
||||
type QuotaUsedAttachmentList struct{}
|
||||
|
||||
// QuotaUsedPackage — QuotaUsedPackage represents a package counting towards a user's quota
|
||||
type QuotaUsedPackage struct {
|
||||
HTMLURL string `json:"html_url,omitempty"` // HTML URL to the package version
|
||||
Name string `json:"name,omitempty"` // Name of the package
|
||||
Size int64 `json:"size,omitempty"` // Size of the package version
|
||||
Type string `json:"type,omitempty"` // Type of the package
|
||||
Version string `json:"version,omitempty"` // Version of the package
|
||||
}
|
||||
|
||||
// QuotaUsedPackageList — QuotaUsedPackageList represents a list of packages counting towards a user's quota
|
||||
// QuotaUsedPackageList has no fields in the swagger spec.
|
||||
type QuotaUsedPackageList struct{}
|
||||
|
||||
// QuotaUsedSize — QuotaUsedSize represents the size-based quota usage of a user
|
||||
type QuotaUsedSize struct {
|
||||
Assets *QuotaUsedSizeAssets `json:"assets,omitempty"`
|
||||
Git *QuotaUsedSizeGit `json:"git,omitempty"`
|
||||
Repos *QuotaUsedSizeRepos `json:"repos,omitempty"`
|
||||
}
|
||||
|
||||
// QuotaUsedSizeAssets — QuotaUsedSizeAssets represents the size-based asset usage of a user
|
||||
type QuotaUsedSizeAssets struct {
|
||||
Artifacts int64 `json:"artifacts,omitempty"` // Storage size used for the user's artifacts
|
||||
Attachments *QuotaUsedSizeAssetsAttachments `json:"attachments,omitempty"`
|
||||
Packages *QuotaUsedSizeAssetsPackages `json:"packages,omitempty"`
|
||||
}
|
||||
|
||||
// QuotaUsedSizeAssetsAttachments — QuotaUsedSizeAssetsAttachments represents the size-based attachment quota usage of a user
|
||||
type QuotaUsedSizeAssetsAttachments struct {
|
||||
Issues int64 `json:"issues,omitempty"` // Storage size used for the user's issue & comment attachments
|
||||
Releases int64 `json:"releases,omitempty"` // Storage size used for the user's release attachments
|
||||
}
|
||||
|
||||
// QuotaUsedSizeAssetsPackages — QuotaUsedSizeAssetsPackages represents the size-based package quota usage of a user
|
||||
type QuotaUsedSizeAssetsPackages struct {
|
||||
All int64 `json:"all,omitempty"` // Storage suze used for the user's packages
|
||||
}
|
||||
|
||||
// QuotaUsedSizeGit — QuotaUsedSizeGit represents the size-based git (lfs) quota usage of a user
|
||||
type QuotaUsedSizeGit struct {
|
||||
LFS int64 `json:"LFS,omitempty"` // Storage size of the user's Git LFS objects
|
||||
}
|
||||
|
||||
// QuotaUsedSizeRepos — QuotaUsedSizeRepos represents the size-based repository quota usage of a user
|
||||
type QuotaUsedSizeRepos struct {
|
||||
Private int64 `json:"private,omitempty"` // Storage size of the user's private repositories
|
||||
Public int64 `json:"public,omitempty"` // Storage size of the user's public repositories
|
||||
}
|
||||
|
||||
19
types/reaction.go
Normal file
19
types/reaction.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// EditReactionOption — EditReactionOption contain the reaction type
|
||||
type EditReactionOption struct {
|
||||
Reaction string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
// Reaction — Reaction contain one reaction
|
||||
type Reaction struct {
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
Reaction string `json:"content,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
51
types/release.go
Normal file
51
types/release.go
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateReleaseOption — CreateReleaseOption options when creating a release
|
||||
type CreateReleaseOption struct {
|
||||
HideArchiveLinks bool `json:"hide_archive_links,omitempty"`
|
||||
IsDraft bool `json:"draft,omitempty"`
|
||||
IsPrerelease bool `json:"prerelease,omitempty"`
|
||||
Note string `json:"body,omitempty"`
|
||||
TagName string `json:"tag_name"`
|
||||
Target string `json:"target_commitish,omitempty"`
|
||||
Title string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// EditReleaseOption — EditReleaseOption options when editing a release
|
||||
type EditReleaseOption struct {
|
||||
HideArchiveLinks bool `json:"hide_archive_links,omitempty"`
|
||||
IsDraft bool `json:"draft,omitempty"`
|
||||
IsPrerelease bool `json:"prerelease,omitempty"`
|
||||
Note string `json:"body,omitempty"`
|
||||
TagName string `json:"tag_name,omitempty"`
|
||||
Target string `json:"target_commitish,omitempty"`
|
||||
Title string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Release — Release represents a repository release
|
||||
type Release struct {
|
||||
ArchiveDownloadCount *TagArchiveDownloadCount `json:"archive_download_count,omitempty"`
|
||||
Attachments []*Attachment `json:"assets,omitempty"`
|
||||
Author *User `json:"author,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
HideArchiveLinks bool `json:"hide_archive_links,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IsDraft bool `json:"draft,omitempty"`
|
||||
IsPrerelease bool `json:"prerelease,omitempty"`
|
||||
Note string `json:"body,omitempty"`
|
||||
PublishedAt time.Time `json:"published_at,omitempty"`
|
||||
TagName string `json:"tag_name,omitempty"`
|
||||
TarURL string `json:"tarball_url,omitempty"`
|
||||
Target string `json:"target_commitish,omitempty"`
|
||||
Title string `json:"name,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
UploadURL string `json:"upload_url,omitempty"`
|
||||
ZipURL string `json:"zipball_url,omitempty"`
|
||||
}
|
||||
|
||||
217
types/repo.go
Normal file
217
types/repo.go
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
type CreatePushMirrorOption struct {
|
||||
Interval string `json:"interval,omitempty"`
|
||||
RemoteAddress string `json:"remote_address,omitempty"`
|
||||
RemotePassword string `json:"remote_password,omitempty"`
|
||||
RemoteUsername string `json:"remote_username,omitempty"`
|
||||
SyncOnCommit bool `json:"sync_on_commit,omitempty"`
|
||||
UseSSH bool `json:"use_ssh,omitempty"`
|
||||
}
|
||||
|
||||
// CreateRepoOption — CreateRepoOption options when creating repository
|
||||
type CreateRepoOption struct {
|
||||
AutoInit bool `json:"auto_init,omitempty"` // Whether the repository should be auto-initialized?
|
||||
DefaultBranch string `json:"default_branch,omitempty"` // DefaultBranch of the repository (used when initializes and in template)
|
||||
Description string `json:"description,omitempty"` // Description of the repository to create
|
||||
Gitignores string `json:"gitignores,omitempty"` // Gitignores to use
|
||||
IssueLabels string `json:"issue_labels,omitempty"` // Label-Set to use
|
||||
License string `json:"license,omitempty"` // License to use
|
||||
Name string `json:"name"` // Name of the repository to create
|
||||
ObjectFormatName string `json:"object_format_name,omitempty"` // ObjectFormatName of the underlying git repository
|
||||
Private bool `json:"private,omitempty"` // Whether the repository is private
|
||||
Readme string `json:"readme,omitempty"` // Readme of the repository to create
|
||||
Template bool `json:"template,omitempty"` // Whether the repository is template
|
||||
TrustModel string `json:"trust_model,omitempty"` // TrustModel of the repository
|
||||
}
|
||||
|
||||
// EditRepoOption — EditRepoOption options when editing a repository's properties
|
||||
type EditRepoOption struct {
|
||||
AllowFastForwardOnly bool `json:"allow_fast_forward_only_merge,omitempty"` // either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging.
|
||||
AllowManualMerge bool `json:"allow_manual_merge,omitempty"` // either `true` to allow mark pr as merged manually, or `false` to prevent it.
|
||||
AllowMerge bool `json:"allow_merge_commits,omitempty"` // either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.
|
||||
AllowRebase bool `json:"allow_rebase,omitempty"` // either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.
|
||||
AllowRebaseMerge bool `json:"allow_rebase_explicit,omitempty"` // either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits.
|
||||
AllowRebaseUpdate bool `json:"allow_rebase_update,omitempty"` // either `true` to allow updating pull request branch by rebase, or `false` to prevent it.
|
||||
AllowSquash bool `json:"allow_squash_merge,omitempty"` // either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.
|
||||
Archived bool `json:"archived,omitempty"` // set to `true` to archive this repository.
|
||||
AutodetectManualMerge bool `json:"autodetect_manual_merge,omitempty"` // either `true` to enable AutodetectManualMerge, or `false` to prevent it. Note: In some special cases, misjudgments can occur.
|
||||
DefaultAllowMaintainerEdit bool `json:"default_allow_maintainer_edit,omitempty"` // set to `true` to allow edits from maintainers by default
|
||||
DefaultBranch string `json:"default_branch,omitempty"` // sets the default branch for this repository.
|
||||
DefaultDeleteBranchAfterMerge bool `json:"default_delete_branch_after_merge,omitempty"` // set to `true` to delete pr branch after merge by default
|
||||
DefaultMergeStyle string `json:"default_merge_style,omitempty"` // set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", "squash", or "fast-forward-only".
|
||||
DefaultUpdateStyle string `json:"default_update_style,omitempty"` // set to a update style to be used by this repository: "rebase" or "merge"
|
||||
Description string `json:"description,omitempty"` // a short description of the repository.
|
||||
EnablePrune bool `json:"enable_prune,omitempty"` // enable prune - remove obsolete remote-tracking references when mirroring
|
||||
ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"`
|
||||
ExternalWiki *ExternalWiki `json:"external_wiki,omitempty"`
|
||||
GloballyEditableWiki bool `json:"globally_editable_wiki,omitempty"` // set the globally editable state of the wiki
|
||||
HasActions bool `json:"has_actions,omitempty"` // either `true` to enable actions unit, or `false` to disable them.
|
||||
HasIssues bool `json:"has_issues,omitempty"` // either `true` to enable issues for this repository or `false` to disable them.
|
||||
HasPackages bool `json:"has_packages,omitempty"` // either `true` to enable packages unit, or `false` to disable them.
|
||||
HasProjects bool `json:"has_projects,omitempty"` // either `true` to enable project unit, or `false` to disable them.
|
||||
HasPullRequests bool `json:"has_pull_requests,omitempty"` // either `true` to allow pull requests, or `false` to prevent pull request.
|
||||
HasReleases bool `json:"has_releases,omitempty"` // either `true` to enable releases unit, or `false` to disable them.
|
||||
HasWiki bool `json:"has_wiki,omitempty"` // either `true` to enable the wiki for this repository or `false` to disable it.
|
||||
IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts,omitempty"` // either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace.
|
||||
InternalTracker *InternalTracker `json:"internal_tracker,omitempty"`
|
||||
MirrorInterval string `json:"mirror_interval,omitempty"` // set to a string like `8h30m0s` to set the mirror interval time
|
||||
Name string `json:"name,omitempty"` // name of the repository
|
||||
Private bool `json:"private,omitempty"` // either `true` to make the repository private or `false` to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private.
|
||||
Template bool `json:"template,omitempty"` // either `true` to make this repository a template or `false` to make it a normal repository
|
||||
Website string `json:"website,omitempty"` // a URL with more information about the repository.
|
||||
WikiBranch string `json:"wiki_branch,omitempty"` // sets the branch used for this repository's wiki.
|
||||
}
|
||||
|
||||
// ExternalTracker — ExternalTracker represents settings for external tracker
|
||||
type ExternalTracker struct {
|
||||
ExternalTrackerFormat string `json:"external_tracker_format,omitempty"` // External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.
|
||||
ExternalTrackerRegexpPattern string `json:"external_tracker_regexp_pattern,omitempty"` // External Issue Tracker issue regular expression
|
||||
ExternalTrackerStyle string `json:"external_tracker_style,omitempty"` // External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp`
|
||||
ExternalTrackerURL string `json:"external_tracker_url,omitempty"` // URL of external issue tracker.
|
||||
}
|
||||
|
||||
// ExternalWiki — ExternalWiki represents setting for external wiki
|
||||
type ExternalWiki struct {
|
||||
ExternalWikiURL string `json:"external_wiki_url,omitempty"` // URL of external wiki.
|
||||
}
|
||||
|
||||
// InternalTracker — InternalTracker represents settings for internal tracker
|
||||
type InternalTracker struct {
|
||||
AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time,omitempty"` // Let only contributors track time (Built-in issue tracker)
|
||||
EnableIssueDependencies bool `json:"enable_issue_dependencies,omitempty"` // Enable dependencies for issues and pull requests (Built-in issue tracker)
|
||||
EnableTimeTracker bool `json:"enable_time_tracker,omitempty"` // Enable time tracking (Built-in issue tracker)
|
||||
}
|
||||
|
||||
// PushMirror — PushMirror represents information of a push mirror
|
||||
type PushMirror struct {
|
||||
CreatedUnix time.Time `json:"created,omitempty"`
|
||||
Interval string `json:"interval,omitempty"`
|
||||
LastError string `json:"last_error,omitempty"`
|
||||
LastUpdateUnix time.Time `json:"last_update,omitempty"`
|
||||
PublicKey string `json:"public_key,omitempty"`
|
||||
RemoteAddress string `json:"remote_address,omitempty"`
|
||||
RemoteName string `json:"remote_name,omitempty"`
|
||||
RepoName string `json:"repo_name,omitempty"`
|
||||
SyncOnCommit bool `json:"sync_on_commit,omitempty"`
|
||||
}
|
||||
|
||||
// RepoCollaboratorPermission — RepoCollaboratorPermission to get repository permission for a collaborator
|
||||
type RepoCollaboratorPermission struct {
|
||||
Permission string `json:"permission,omitempty"`
|
||||
RoleName string `json:"role_name,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
type RepoCommit struct {
|
||||
Author *CommitUser `json:"author,omitempty"`
|
||||
Committer *CommitUser `json:"committer,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Tree *CommitMeta `json:"tree,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Verification *PayloadCommitVerification `json:"verification,omitempty"`
|
||||
}
|
||||
|
||||
// RepoTopicOptions — RepoTopicOptions a collection of repo topic names
|
||||
type RepoTopicOptions struct {
|
||||
Topics []string `json:"topics,omitempty"` // list of topic names
|
||||
}
|
||||
|
||||
// RepoTransfer — RepoTransfer represents a pending repo transfer
|
||||
type RepoTransfer struct {
|
||||
Doer *User `json:"doer,omitempty"`
|
||||
Recipient *User `json:"recipient,omitempty"`
|
||||
Teams []*Team `json:"teams,omitempty"`
|
||||
}
|
||||
|
||||
// Repository — Repository represents a repository
|
||||
type Repository struct {
|
||||
AllowFastForwardOnly bool `json:"allow_fast_forward_only_merge,omitempty"`
|
||||
AllowMerge bool `json:"allow_merge_commits,omitempty"`
|
||||
AllowRebase bool `json:"allow_rebase,omitempty"`
|
||||
AllowRebaseMerge bool `json:"allow_rebase_explicit,omitempty"`
|
||||
AllowRebaseUpdate bool `json:"allow_rebase_update,omitempty"`
|
||||
AllowSquash bool `json:"allow_squash_merge,omitempty"`
|
||||
Archived bool `json:"archived,omitempty"`
|
||||
ArchivedAt time.Time `json:"archived_at,omitempty"`
|
||||
AvatarURL string `json:"avatar_url,omitempty"`
|
||||
CloneURL string `json:"clone_url,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
DefaultAllowMaintainerEdit bool `json:"default_allow_maintainer_edit,omitempty"`
|
||||
DefaultBranch string `json:"default_branch,omitempty"`
|
||||
DefaultDeleteBranchAfterMerge bool `json:"default_delete_branch_after_merge,omitempty"`
|
||||
DefaultMergeStyle string `json:"default_merge_style,omitempty"`
|
||||
DefaultUpdateStyle string `json:"default_update_style,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Empty bool `json:"empty,omitempty"`
|
||||
ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"`
|
||||
ExternalWiki *ExternalWiki `json:"external_wiki,omitempty"`
|
||||
Fork bool `json:"fork,omitempty"`
|
||||
Forks int64 `json:"forks_count,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
GloballyEditableWiki bool `json:"globally_editable_wiki,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
HasActions bool `json:"has_actions,omitempty"`
|
||||
HasIssues bool `json:"has_issues,omitempty"`
|
||||
HasPackages bool `json:"has_packages,omitempty"`
|
||||
HasProjects bool `json:"has_projects,omitempty"`
|
||||
HasPullRequests bool `json:"has_pull_requests,omitempty"`
|
||||
HasReleases bool `json:"has_releases,omitempty"`
|
||||
HasWiki bool `json:"has_wiki,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts,omitempty"`
|
||||
Internal bool `json:"internal,omitempty"`
|
||||
InternalTracker *InternalTracker `json:"internal_tracker,omitempty"`
|
||||
Language string `json:"language,omitempty"`
|
||||
LanguagesURL string `json:"languages_url,omitempty"`
|
||||
Link string `json:"link,omitempty"`
|
||||
Mirror bool `json:"mirror,omitempty"`
|
||||
MirrorInterval string `json:"mirror_interval,omitempty"`
|
||||
MirrorUpdated time.Time `json:"mirror_updated,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
ObjectFormatName string `json:"object_format_name,omitempty"` // ObjectFormatName of the underlying git repository
|
||||
OpenIssues int64 `json:"open_issues_count,omitempty"`
|
||||
OpenPulls int64 `json:"open_pr_counter,omitempty"`
|
||||
OriginalURL string `json:"original_url,omitempty"`
|
||||
Owner *User `json:"owner,omitempty"`
|
||||
Parent *Repository `json:"parent,omitempty"`
|
||||
Permissions *Permission `json:"permissions,omitempty"`
|
||||
Private bool `json:"private,omitempty"`
|
||||
Releases int64 `json:"release_counter,omitempty"`
|
||||
RepoTransfer *RepoTransfer `json:"repo_transfer,omitempty"`
|
||||
SSHURL string `json:"ssh_url,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
Stars int64 `json:"stars_count,omitempty"`
|
||||
Template bool `json:"template,omitempty"`
|
||||
Topics []string `json:"topics,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
Watchers int64 `json:"watchers_count,omitempty"`
|
||||
Website string `json:"website,omitempty"`
|
||||
WikiBranch string `json:"wiki_branch,omitempty"`
|
||||
}
|
||||
|
||||
// RepositoryMeta — RepositoryMeta basic repository information
|
||||
type RepositoryMeta struct {
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Owner string `json:"owner,omitempty"`
|
||||
}
|
||||
|
||||
// TransferRepoOption — TransferRepoOption options when transfer a repository's ownership
|
||||
type TransferRepoOption struct {
|
||||
NewOwner string `json:"new_owner"`
|
||||
TeamIDs []int64 `json:"team_ids,omitempty"` // ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.
|
||||
}
|
||||
|
||||
// UpdateRepoAvatarOption — UpdateRepoAvatarUserOption options when updating the repo avatar
|
||||
type UpdateRepoAvatarOption struct {
|
||||
Image string `json:"image,omitempty"` // image must be base64 encoded
|
||||
}
|
||||
|
||||
9
types/review.go
Normal file
9
types/review.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// ReviewStateType — ReviewStateType review state type
|
||||
// ReviewStateType has no fields in the swagger spec.
|
||||
type ReviewStateType struct{}
|
||||
|
||||
39
types/settings.go
Normal file
39
types/settings.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// GeneralAPISettings — GeneralAPISettings contains global api settings exposed by it
|
||||
type GeneralAPISettings struct {
|
||||
DefaultGitTreesPerPage int64 `json:"default_git_trees_per_page,omitempty"`
|
||||
DefaultMaxBlobSize int64 `json:"default_max_blob_size,omitempty"`
|
||||
DefaultPagingNum int64 `json:"default_paging_num,omitempty"`
|
||||
MaxResponseItems int64 `json:"max_response_items,omitempty"`
|
||||
}
|
||||
|
||||
// GeneralAttachmentSettings — GeneralAttachmentSettings contains global Attachment settings exposed by API
|
||||
type GeneralAttachmentSettings struct {
|
||||
AllowedTypes string `json:"allowed_types,omitempty"`
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
MaxFiles int64 `json:"max_files,omitempty"`
|
||||
MaxSize int64 `json:"max_size,omitempty"`
|
||||
}
|
||||
|
||||
// GeneralRepoSettings — GeneralRepoSettings contains global repository settings exposed by API
|
||||
type GeneralRepoSettings struct {
|
||||
ForksDisabled bool `json:"forks_disabled,omitempty"`
|
||||
HTTPGitDisabled bool `json:"http_git_disabled,omitempty"`
|
||||
LFSDisabled bool `json:"lfs_disabled,omitempty"`
|
||||
MigrationsDisabled bool `json:"migrations_disabled,omitempty"`
|
||||
MirrorsDisabled bool `json:"mirrors_disabled,omitempty"`
|
||||
StarsDisabled bool `json:"stars_disabled,omitempty"`
|
||||
TimeTrackingDisabled bool `json:"time_tracking_disabled,omitempty"`
|
||||
}
|
||||
|
||||
// GeneralUISettings — GeneralUISettings contains global ui settings exposed by API
|
||||
type GeneralUISettings struct {
|
||||
AllowedReactions []string `json:"allowed_reactions,omitempty"`
|
||||
CustomEmojis []string `json:"custom_emojis,omitempty"`
|
||||
DefaultTheme string `json:"default_theme,omitempty"`
|
||||
}
|
||||
|
||||
24
types/status.go
Normal file
24
types/status.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// CombinedStatus — CombinedStatus holds the combined state of several statuses for a single commit
|
||||
type CombinedStatus struct {
|
||||
CommitURL string `json:"commit_url,omitempty"`
|
||||
Repository *Repository `json:"repository,omitempty"`
|
||||
SHA string `json:"sha,omitempty"`
|
||||
State *CommitStatusState `json:"state,omitempty"`
|
||||
Statuses []*CommitStatus `json:"statuses,omitempty"`
|
||||
TotalCount int64 `json:"total_count,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// CreateStatusOption — CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
|
||||
type CreateStatusOption struct {
|
||||
Context string `json:"context,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
State *CommitStatusState `json:"state,omitempty"`
|
||||
TargetURL string `json:"target_url,omitempty"`
|
||||
}
|
||||
|
||||
55
types/tag.go
Normal file
55
types/tag.go
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// CreateTagOption — CreateTagOption options when creating a tag
|
||||
type CreateTagOption struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
TagName string `json:"tag_name"`
|
||||
Target string `json:"target,omitempty"`
|
||||
}
|
||||
|
||||
// CreateTagProtectionOption — CreateTagProtectionOption options for creating a tag protection
|
||||
type CreateTagProtectionOption struct {
|
||||
NamePattern string `json:"name_pattern,omitempty"`
|
||||
WhitelistTeams []string `json:"whitelist_teams,omitempty"`
|
||||
WhitelistUsernames []string `json:"whitelist_usernames,omitempty"`
|
||||
}
|
||||
|
||||
// EditTagProtectionOption — EditTagProtectionOption options for editing a tag protection
|
||||
type EditTagProtectionOption struct {
|
||||
NamePattern string `json:"name_pattern,omitempty"`
|
||||
WhitelistTeams []string `json:"whitelist_teams,omitempty"`
|
||||
WhitelistUsernames []string `json:"whitelist_usernames,omitempty"`
|
||||
}
|
||||
|
||||
// Tag — Tag represents a repository tag
|
||||
type Tag struct {
|
||||
ArchiveDownloadCount *TagArchiveDownloadCount `json:"archive_download_count,omitempty"`
|
||||
Commit *CommitMeta `json:"commit,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
TarballURL string `json:"tarball_url,omitempty"`
|
||||
ZipballURL string `json:"zipball_url,omitempty"`
|
||||
}
|
||||
|
||||
// TagArchiveDownloadCount — TagArchiveDownloadCount counts how many times a archive was downloaded
|
||||
type TagArchiveDownloadCount struct {
|
||||
TarGz int64 `json:"tar_gz,omitempty"`
|
||||
Zip int64 `json:"zip,omitempty"`
|
||||
}
|
||||
|
||||
// TagProtection — TagProtection represents a tag protection
|
||||
type TagProtection struct {
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
NamePattern string `json:"name_pattern,omitempty"`
|
||||
Updated time.Time `json:"updated_at,omitempty"`
|
||||
WhitelistTeams []string `json:"whitelist_teams,omitempty"`
|
||||
WhitelistUsernames []string `json:"whitelist_usernames,omitempty"`
|
||||
}
|
||||
|
||||
40
types/team.go
Normal file
40
types/team.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// CreateTeamOption — CreateTeamOption options for creating a team
|
||||
type CreateTeamOption struct {
|
||||
CanCreateOrgRepo bool `json:"can_create_org_repo,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
IncludesAllRepositories bool `json:"includes_all_repositories,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Permission string `json:"permission,omitempty"`
|
||||
Units []string `json:"units,omitempty"`
|
||||
UnitsMap map[string]any `json:"units_map,omitempty"`
|
||||
}
|
||||
|
||||
// EditTeamOption — EditTeamOption options for editing a team
|
||||
type EditTeamOption struct {
|
||||
CanCreateOrgRepo bool `json:"can_create_org_repo,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
IncludesAllRepositories bool `json:"includes_all_repositories,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Permission string `json:"permission,omitempty"`
|
||||
Units []string `json:"units,omitempty"`
|
||||
UnitsMap map[string]any `json:"units_map,omitempty"`
|
||||
}
|
||||
|
||||
// Team — Team represents a team in an organization
|
||||
type Team struct {
|
||||
CanCreateOrgRepo bool `json:"can_create_org_repo,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
IncludesAllRepositories bool `json:"includes_all_repositories,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Permission string `json:"permission,omitempty"`
|
||||
Units []string `json:"units,omitempty"`
|
||||
UnitsMap map[string]any `json:"units_map,omitempty"`
|
||||
}
|
||||
|
||||
29
types/time_tracking.go
Normal file
29
types/time_tracking.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// StopWatch — StopWatch represent a running stopwatch
|
||||
type StopWatch struct {
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
Duration string `json:"duration,omitempty"`
|
||||
IssueIndex int64 `json:"issue_index,omitempty"`
|
||||
IssueTitle string `json:"issue_title,omitempty"`
|
||||
RepoName string `json:"repo_name,omitempty"`
|
||||
RepoOwnerName string `json:"repo_owner_name,omitempty"`
|
||||
Seconds int64 `json:"seconds,omitempty"`
|
||||
}
|
||||
|
||||
// TrackedTime — TrackedTime worked time for an issue / pr
|
||||
type TrackedTime struct {
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Issue *Issue `json:"issue,omitempty"`
|
||||
IssueID int64 `json:"issue_id,omitempty"` // deprecated (only for backwards compatibility)
|
||||
Time int64 `json:"time,omitempty"` // Time in seconds
|
||||
UserID int64 `json:"user_id,omitempty"` // deprecated (only for backwards compatibility)
|
||||
UserName string `json:"user_name,omitempty"`
|
||||
}
|
||||
|
||||
21
types/topic.go
Normal file
21
types/topic.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
// TopicName — TopicName a list of repo topic names
|
||||
type TopicName struct {
|
||||
TopicNames []string `json:"topics,omitempty"`
|
||||
}
|
||||
|
||||
// TopicResponse — TopicResponse for returning topics
|
||||
type TopicResponse struct {
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"topic_name,omitempty"`
|
||||
RepoCount int64 `json:"repo_count,omitempty"`
|
||||
Updated time.Time `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
142
types/user.go
Normal file
142
types/user.go
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
|
||||
type BlockedUser struct {
|
||||
BlockID int64 `json:"block_id,omitempty"`
|
||||
Created time.Time `json:"created_at,omitempty"`
|
||||
}
|
||||
|
||||
// CreateEmailOption — CreateEmailOption options when creating email addresses
|
||||
type CreateEmailOption struct {
|
||||
Emails []string `json:"emails,omitempty"` // email addresses to add
|
||||
}
|
||||
|
||||
// CreateUserOption — CreateUserOption create user options
|
||||
type CreateUserOption struct {
|
||||
Created time.Time `json:"created_at,omitempty"` // For explicitly setting the user creation timestamp. Useful when users are migrated from other systems. When omitted, the user's creation timestamp will be set to "now".
|
||||
Email string `json:"email"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
LoginName string `json:"login_name,omitempty"`
|
||||
MustChangePassword bool `json:"must_change_password,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Restricted bool `json:"restricted,omitempty"`
|
||||
SendNotify bool `json:"send_notify,omitempty"`
|
||||
SourceID int64 `json:"source_id,omitempty"`
|
||||
Username string `json:"username"`
|
||||
Visibility string `json:"visibility,omitempty"`
|
||||
}
|
||||
|
||||
// DeleteEmailOption — DeleteEmailOption options when deleting email addresses
|
||||
type DeleteEmailOption struct {
|
||||
Emails []string `json:"emails,omitempty"` // email addresses to delete
|
||||
}
|
||||
|
||||
// EditUserOption — EditUserOption edit user options
|
||||
type EditUserOption struct {
|
||||
Active bool `json:"active,omitempty"`
|
||||
Admin bool `json:"admin,omitempty"`
|
||||
AllowCreateOrganization bool `json:"allow_create_organization,omitempty"`
|
||||
AllowGitHook bool `json:"allow_git_hook,omitempty"`
|
||||
AllowImportLocal bool `json:"allow_import_local,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
LoginName string `json:"login_name,omitempty"`
|
||||
MaxRepoCreation int64 `json:"max_repo_creation,omitempty"`
|
||||
MustChangePassword bool `json:"must_change_password,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
ProhibitLogin bool `json:"prohibit_login,omitempty"`
|
||||
Pronouns string `json:"pronouns,omitempty"`
|
||||
Restricted bool `json:"restricted,omitempty"`
|
||||
SourceID int64 `json:"source_id,omitempty"`
|
||||
Visibility string `json:"visibility,omitempty"`
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
// Email — Email an email address belonging to a user
|
||||
type Email struct {
|
||||
Email string `json:"email,omitempty"`
|
||||
Primary bool `json:"primary,omitempty"`
|
||||
UserID int64 `json:"user_id,omitempty"`
|
||||
UserName string `json:"username,omitempty"`
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
}
|
||||
|
||||
// SetUserQuotaGroupsOptions — SetUserQuotaGroupsOptions represents the quota groups of a user
|
||||
type SetUserQuotaGroupsOptions struct {
|
||||
Groups []string `json:"groups"` // Quota groups the user shall have
|
||||
}
|
||||
|
||||
// UpdateUserAvatarOption — UpdateUserAvatarUserOption options when updating the user avatar
|
||||
type UpdateUserAvatarOption struct {
|
||||
Image string `json:"image,omitempty"` // image must be base64 encoded
|
||||
}
|
||||
|
||||
// User — User represents a user
|
||||
type User struct {
|
||||
AvatarURL string `json:"avatar_url,omitempty"` // URL to the user's avatar
|
||||
Created time.Time `json:"created,omitempty"`
|
||||
Description string `json:"description,omitempty"` // the user's description
|
||||
Email string `json:"email,omitempty"`
|
||||
Followers int64 `json:"followers_count,omitempty"` // user counts
|
||||
Following int64 `json:"following_count,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"` // the user's full name
|
||||
HTMLURL string `json:"html_url,omitempty"` // URL to the user's gitea page
|
||||
ID int64 `json:"id,omitempty"` // the user's id
|
||||
IsActive bool `json:"active,omitempty"` // Is user active
|
||||
IsAdmin bool `json:"is_admin,omitempty"` // Is the user an administrator
|
||||
Language string `json:"language,omitempty"` // User locale
|
||||
LastLogin time.Time `json:"last_login,omitempty"`
|
||||
Location string `json:"location,omitempty"` // the user's location
|
||||
LoginName string `json:"login_name,omitempty"` // the user's authentication sign-in name.
|
||||
ProhibitLogin bool `json:"prohibit_login,omitempty"` // Is user login prohibited
|
||||
Pronouns string `json:"pronouns,omitempty"` // the user's pronouns
|
||||
Restricted bool `json:"restricted,omitempty"` // Is user restricted
|
||||
SourceID int64 `json:"source_id,omitempty"` // The ID of the user's Authentication Source
|
||||
StarredRepos int64 `json:"starred_repos_count,omitempty"`
|
||||
UserName string `json:"login,omitempty"` // the user's username
|
||||
Visibility string `json:"visibility,omitempty"` // User visibility level option: public, limited, private
|
||||
Website string `json:"website,omitempty"` // the user's website
|
||||
}
|
||||
|
||||
// UserHeatmapData — UserHeatmapData represents the data needed to create a heatmap
|
||||
type UserHeatmapData struct {
|
||||
Contributions int64 `json:"contributions,omitempty"`
|
||||
Timestamp *TimeStamp `json:"timestamp,omitempty"`
|
||||
}
|
||||
|
||||
// UserSettings — UserSettings represents user settings
|
||||
type UserSettings struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
DiffViewStyle string `json:"diff_view_style,omitempty"`
|
||||
EnableRepoUnitHints bool `json:"enable_repo_unit_hints,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
HideActivity bool `json:"hide_activity,omitempty"`
|
||||
HideEmail bool `json:"hide_email,omitempty"` // Privacy
|
||||
Language string `json:"language,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Pronouns string `json:"pronouns,omitempty"`
|
||||
Theme string `json:"theme,omitempty"`
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
// UserSettingsOptions — UserSettingsOptions represents options to change user settings
|
||||
type UserSettingsOptions struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
DiffViewStyle string `json:"diff_view_style,omitempty"`
|
||||
EnableRepoUnitHints bool `json:"enable_repo_unit_hints,omitempty"`
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
HideActivity bool `json:"hide_activity,omitempty"`
|
||||
HideEmail bool `json:"hide_email,omitempty"` // Privacy
|
||||
Language string `json:"language,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Pronouns string `json:"pronouns,omitempty"`
|
||||
Theme string `json:"theme,omitempty"`
|
||||
Website string `json:"website,omitempty"`
|
||||
}
|
||||
|
||||
46
types/wiki.go
Normal file
46
types/wiki.go
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Code generated by forgegen from swagger.v1.json — DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
|
||||
// CreateWikiPageOptions — CreateWikiPageOptions form for creating wiki
|
||||
type CreateWikiPageOptions struct {
|
||||
ContentBase64 string `json:"content_base64,omitempty"` // content must be base64 encoded
|
||||
Message string `json:"message,omitempty"` // optional commit message summarizing the change
|
||||
Title string `json:"title,omitempty"` // page title. leave empty to keep unchanged
|
||||
}
|
||||
|
||||
// WikiCommit — WikiCommit page commit/revision
|
||||
type WikiCommit struct {
|
||||
Author *CommitUser `json:"author,omitempty"`
|
||||
Commiter *CommitUser `json:"commiter,omitempty"`
|
||||
ID string `json:"sha,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// WikiCommitList — WikiCommitList commit/revision list
|
||||
type WikiCommitList struct {
|
||||
Count int64 `json:"count,omitempty"`
|
||||
WikiCommits []*WikiCommit `json:"commits,omitempty"`
|
||||
}
|
||||
|
||||
// WikiPage — WikiPage a wiki page
|
||||
type WikiPage struct {
|
||||
CommitCount int64 `json:"commit_count,omitempty"`
|
||||
ContentBase64 string `json:"content_base64,omitempty"` // Page content, base64 encoded
|
||||
Footer string `json:"footer,omitempty"`
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
LastCommit *WikiCommit `json:"last_commit,omitempty"`
|
||||
Sidebar string `json:"sidebar,omitempty"`
|
||||
SubURL string `json:"sub_url,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
// WikiPageMetaData — WikiPageMetaData wiki page meta information
|
||||
type WikiPageMetaData struct {
|
||||
HTMLURL string `json:"html_url,omitempty"`
|
||||
LastCommit *WikiCommit `json:"last_commit,omitempty"`
|
||||
SubURL string `json:"sub_url,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
Loading…
Add table
Reference in a new issue