Documentation
¶
Overview ¶
Package projects implements MCP tools for GitLab project operations.
The package covers project create, get, list, update, delete, restore, fork, star, archive, transfer, sharing, invited groups, forks, languages, members, starrers, hooks, push rules, pull mirroring, approval configuration, approval rules, and user contributed or starred project listings.
Catalog Surface ¶
Project actions are one of the broadest catalog domains. Their ActionSpecs feed individual tools, the gitlab_project meta-tool, and unified dynamic action IDs such as project.get, project.hook_add, and project.approval_rule_list.
GitLab API References ¶
The package wraps these GitLab APIs:
Index ¶
- func ActionSpecs(client *gitlabclient.Client, enterprise bool) []toolutil.ActionSpec
- func DeleteApprovalRule(ctx context.Context, client *gitlabclient.Client, ...) error
- func DeleteApprovalRuleOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func DeleteCustomHeader(ctx context.Context, client *gitlabclient.Client, ...) error
- func DeleteCustomHeaderOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func DeleteForkRelation(ctx context.Context, client *gitlabclient.Client, ...) error
- func DeleteForkRelationOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func DeleteHook(ctx context.Context, client *gitlabclient.Client, input DeleteHookInput) error
- func DeleteHookOutput(ctx context.Context, client *gitlabclient.Client, input DeleteHookInput) (toolutil.DeleteOutput, error)
- func DeletePushRule(ctx context.Context, client *gitlabclient.Client, input DeletePushRuleInput) error
- func DeletePushRuleOutput(ctx context.Context, client *gitlabclient.Client, input DeletePushRuleInput) (toolutil.DeleteOutput, error)
- func DeleteSharedGroupOutput(ctx context.Context, client *gitlabclient.Client, input DeleteSharedGroupInput) (toolutil.DeleteOutput, error)
- func DeleteSharedProjectFromGroup(ctx context.Context, client *gitlabclient.Client, input DeleteSharedGroupInput) error
- func DeleteTargetBranchRule(ctx context.Context, client *gitlabclient.Client, ...) error
- func DeleteTargetBranchRuleOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.DeleteOutput, error)
- func DeleteWebhookURLVariable(ctx context.Context, client *gitlabclient.Client, ...) error
- func DeleteWebhookURLVariableOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func FormatApprovalConfigMarkdown(out ApprovalConfigOutput) string
- func FormatApprovalRuleMarkdown(out ApprovalRuleOutput) string
- func FormatDeleteMarkdown(out DeleteOutput) string
- func FormatDownloadAvatarMarkdown(out DownloadAvatarOutput) string
- func FormatHookMarkdown(out HookOutput) string
- func FormatLanguagesMarkdown(out LanguagesOutput) string
- func FormatListApprovalRulesMarkdown(out ListApprovalRulesOutput) string
- func FormatListForksMarkdown(out ListForksOutput) string
- func FormatListHooksMarkdown(out ListHooksOutput) string
- func FormatListMarkdown(out ListOutput) string
- func FormatListProjectGroupsMarkdown(out ListProjectGroupsOutput) string
- func FormatListProjectUsersMarkdown(out ListProjectUsersOutput) string
- func FormatListStarrersMarkdown(out ListProjectStarrersOutput) string
- func FormatListTargetBranchRulesMarkdown(out ListTargetBranchRulesOutput) string
- func FormatMarkdown(p Output) string
- func FormatPullMirrorMarkdown(out PullMirrorOutput) string
- func FormatPushRuleMarkdown(out PushRuleOutput) string
- func FormatRepositoryStorageMarkdown(out RepositoryStorageOutput) string
- func FormatShareProjectMarkdown(out ShareProjectOutput) string
- func FormatTargetBranchRuleMarkdown(out TargetBranchRuleOutput) string
- func FormatTransferMarkdown(out TransferOutput) string
- func FormatTriggerTestHookMarkdown(out TriggerTestHookOutput) string
- func SetCustomHeader(ctx context.Context, client *gitlabclient.Client, input SetCustomHeaderInput) error
- func SetCustomHeaderOutput(ctx context.Context, client *gitlabclient.Client, input SetCustomHeaderInput) (toolutil.VoidOutput, error)
- func SetWebhookURLVariable(ctx context.Context, client *gitlabclient.Client, ...) error
- func SetWebhookURLVariableOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func StartHousekeeping(ctx context.Context, client *gitlabclient.Client, input StartHousekeepingInput) error
- func StartHousekeepingOutput(ctx context.Context, client *gitlabclient.Client, input StartHousekeepingInput) (toolutil.VoidOutput, error)
- func StartMirroring(ctx context.Context, client *gitlabclient.Client, input StartMirroringInput) error
- func StartMirroringOutput(ctx context.Context, client *gitlabclient.Client, input StartMirroringInput) (toolutil.VoidOutput, error)
- type AccessOutput
- type AddHookInput
- type AddPushRuleInput
- type ApprovalConfigOutput
- type ApprovalGroupOutput
- type ApprovalRuleOutput
- func CreateApprovalRule(ctx context.Context, client *gitlabclient.Client, ...) (ApprovalRuleOutput, error)
- func GetApprovalRule(ctx context.Context, client *gitlabclient.Client, input GetApprovalRuleInput) (ApprovalRuleOutput, error)
- func UpdateApprovalRule(ctx context.Context, client *gitlabclient.Client, ...) (ApprovalRuleOutput, error)
- type ApproverGroupOutput
- type ApproverNestedGroupOutput
- type ApproverUserOutput
- type ArchiveInput
- type AvatarInput
- type BasicOutput
- type ChangeApprovalConfigInput
- type ConfigurePullMirrorInput
- type ContainerExpirationPolicyInput
- type ContainerExpirationPolicyOutput
- type CreateApprovalRuleInput
- type CreateForUserInput
- type CreateForkRelationInput
- type CreateInput
- type CreateTargetBranchRuleInput
- type CustomAttributeOutput
- type DeleteApprovalRuleInput
- type DeleteCustomHeaderInput
- type DeleteForkRelationInput
- type DeleteHookInput
- type DeleteInput
- type DeleteOutput
- type DeletePushRuleInput
- type DeleteSharedGroupInput
- type DeleteTargetBranchRuleInput
- type DeleteWebhookURLVariableInput
- type DownloadAvatarInput
- type DownloadAvatarOutput
- type EditHookInput
- type EditPushRuleInput
- type ForkInput
- type ForkParentOutput
- type GetApprovalConfigInput
- type GetApprovalRuleInput
- type GetHookInput
- type GetInput
- type GetLanguagesInput
- type GetPullMirrorInput
- type GetPushRulesInput
- type GetRepositoryStorageInput
- type HookCustomHeader
- type HookCustomHeaderInput
- type HookOptionsInput
- type HookOutput
- func AddHook(ctx context.Context, client *gitlabclient.Client, input AddHookInput) (HookOutput, error)
- func EditHook(ctx context.Context, client *gitlabclient.Client, input EditHookInput) (HookOutput, error)
- func GetHook(ctx context.Context, client *gitlabclient.Client, input GetHookInput) (HookOutput, error)
- type HookURLVariable
- type LanguageEntry
- type LanguagesOutput
- type LicenseOutput
- type LinksOutput
- type ListApprovalRulesInput
- type ListApprovalRulesOutput
- type ListForksInput
- type ListForksOutput
- type ListHooksInput
- type ListHooksOutput
- type ListInput
- type ListInvitedGroupsInput
- type ListOutput
- func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
- func ListUserContributedProjects(ctx context.Context, client *gitlabclient.Client, ...) (ListOutput, error)
- func ListUserProjects(ctx context.Context, client *gitlabclient.Client, input ListUserProjectsInput) (ListOutput, error)
- func ListUserStarredProjects(ctx context.Context, client *gitlabclient.Client, ...) (ListOutput, error)
- type ListProjectGroupsInput
- type ListProjectGroupsOutput
- type ListProjectStarrersInput
- type ListProjectStarrersOutput
- type ListProjectUsersInput
- type ListProjectUsersOutput
- type ListTargetBranchRulesInput
- type ListTargetBranchRulesOutput
- type ListUserContributedProjectsInput
- type ListUserProjectsInput
- type ListUserStarredProjectsInput
- type NamespaceOutput
- type Output
- func Archive(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) (Output, error)
- func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
- func CreateForUser(ctx context.Context, client *gitlabclient.Client, input CreateForUserInput) (Output, error)
- func CreateForkRelation(ctx context.Context, client *gitlabclient.Client, ...) (Output, error)
- func Fork(ctx context.Context, client *gitlabclient.Client, input ForkInput) (Output, error)
- func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)
- func Restore(ctx context.Context, client *gitlabclient.Client, input RestoreInput) (Output, error)
- func Star(ctx context.Context, client *gitlabclient.Client, input StarInput) (Output, error)
- func ToOutput(p *gl.Project, extra toolutil.ProjectExtra) Output
- func Unarchive(ctx context.Context, client *gitlabclient.Client, input UnarchiveInput) (Output, error)
- func Unstar(ctx context.Context, client *gitlabclient.Client, input UnstarInput) (Output, error)
- func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
- func UploadAvatar(ctx context.Context, client *gitlabclient.Client, input UploadAvatarInput) (Output, error)
- type OwnerOutput
- type PermissionsOutput
- type ProjectGroupOutput
- type ProjectUserOutput
- type ProtectedBranchRefOutput
- type PullMirrorOutput
- type PushRuleOutput
- func AddPushRule(ctx context.Context, client *gitlabclient.Client, input AddPushRuleInput) (PushRuleOutput, error)
- func EditPushRule(ctx context.Context, client *gitlabclient.Client, input EditPushRuleInput) (PushRuleOutput, error)
- func GetPushRules(ctx context.Context, client *gitlabclient.Client, input GetPushRulesInput) (PushRuleOutput, error)
- type RepositoryStorageOutput
- type RestoreInput
- type SetCustomHeaderInput
- type SetWebhookURLVariableInput
- type ShareProjectInput
- type ShareProjectOutput
- type SharedWithGroupOutput
- type StarInput
- type StarrerOutput
- type StartHousekeepingInput
- type StartMirroringInput
- type StatisticsOutput
- type TargetBranchRuleOutput
- type TransferInput
- type TransferOutput
- type TriggerTestHookInput
- type TriggerTestHookOutput
- type UnarchiveInput
- type UnstarInput
- type UpdateApprovalRuleInput
- type UpdateInput
- type UploadAvatarInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionSpecs ¶
func ActionSpecs(client *gitlabclient.Client, enterprise bool) []toolutil.ActionSpec
ActionSpecs returns canonical specs for project lifecycle and settings actions.
func DeleteApprovalRule ¶
func DeleteApprovalRule(ctx context.Context, client *gitlabclient.Client, input DeleteApprovalRuleInput) error
DeleteApprovalRule deletes a project-level approval rule.
func DeleteApprovalRuleOutput ¶
func DeleteApprovalRuleOutput(ctx context.Context, client *gitlabclient.Client, input DeleteApprovalRuleInput) (toolutil.VoidOutput, error)
DeleteApprovalRuleOutput deletes a project approval rule and returns the legacy success message shape.
func DeleteCustomHeader ¶
func DeleteCustomHeader(ctx context.Context, client *gitlabclient.Client, input DeleteCustomHeaderInput) error
DeleteCustomHeader deletes a custom header from a project webhook.
func DeleteCustomHeaderOutput ¶
func DeleteCustomHeaderOutput(ctx context.Context, client *gitlabclient.Client, input DeleteCustomHeaderInput) (toolutil.VoidOutput, error)
DeleteCustomHeaderOutput deletes a webhook custom header and returns the legacy success message shape.
func DeleteForkRelation ¶
func DeleteForkRelation(ctx context.Context, client *gitlabclient.Client, input DeleteForkRelationInput) error
DeleteForkRelation removes the fork relationship from a project.
func DeleteForkRelationOutput ¶
func DeleteForkRelationOutput(ctx context.Context, client *gitlabclient.Client, input DeleteForkRelationInput) (toolutil.VoidOutput, error)
DeleteForkRelationOutput removes a fork relation and returns the legacy success message shape.
func DeleteHook ¶
func DeleteHook(ctx context.Context, client *gitlabclient.Client, input DeleteHookInput) error
DeleteHook deletes a project webhook.
func DeleteHookOutput ¶
func DeleteHookOutput(ctx context.Context, client *gitlabclient.Client, input DeleteHookInput) (toolutil.DeleteOutput, error)
DeleteHookOutput deletes a project webhook and returns the legacy success message shape.
func DeletePushRule ¶
func DeletePushRule(ctx context.Context, client *gitlabclient.Client, input DeletePushRuleInput) error
DeletePushRule deletes the push rule configuration from a project.
func DeletePushRuleOutput ¶
func DeletePushRuleOutput(ctx context.Context, client *gitlabclient.Client, input DeletePushRuleInput) (toolutil.DeleteOutput, error)
DeletePushRuleOutput deletes project push rules and returns the legacy success message shape.
func DeleteSharedGroupOutput ¶
func DeleteSharedGroupOutput(ctx context.Context, client *gitlabclient.Client, input DeleteSharedGroupInput) (toolutil.DeleteOutput, error)
DeleteSharedGroupOutput removes a shared group and returns the legacy success message shape.
func DeleteSharedProjectFromGroup ¶
func DeleteSharedProjectFromGroup(ctx context.Context, client *gitlabclient.Client, input DeleteSharedGroupInput) error
DeleteSharedProjectFromGroup removes a shared group link from a project.
func DeleteTargetBranchRule ¶
func DeleteTargetBranchRule(ctx context.Context, client *gitlabclient.Client, input DeleteTargetBranchRuleInput) error
DeleteTargetBranchRule deletes a target branch rule by its ID. Premium/Ultimate. Destructive.
func DeleteTargetBranchRuleOutput ¶
func DeleteTargetBranchRuleOutput(ctx context.Context, client *gitlabclient.Client, input DeleteTargetBranchRuleInput) (toolutil.DeleteOutput, error)
DeleteTargetBranchRuleOutput deletes a target branch rule and returns the legacy success-message shape used by other destructive project actions.
func DeleteWebhookURLVariable ¶
func DeleteWebhookURLVariable(ctx context.Context, client *gitlabclient.Client, input DeleteWebhookURLVariableInput) error
DeleteWebhookURLVariable deletes a URL variable from a project webhook.
func DeleteWebhookURLVariableOutput ¶
func DeleteWebhookURLVariableOutput(ctx context.Context, client *gitlabclient.Client, input DeleteWebhookURLVariableInput) (toolutil.VoidOutput, error)
DeleteWebhookURLVariableOutput deletes a webhook URL variable and returns the legacy success message shape.
func FormatApprovalConfigMarkdown ¶
func FormatApprovalConfigMarkdown(out ApprovalConfigOutput) string
FormatApprovalConfigMarkdown renders approval configuration as a card.
func FormatApprovalRuleMarkdown ¶
func FormatApprovalRuleMarkdown(out ApprovalRuleOutput) string
FormatApprovalRuleMarkdown renders a single approval rule as a card.
func FormatDeleteMarkdown ¶
func FormatDeleteMarkdown(out DeleteOutput) string
FormatDeleteMarkdown renders a project deletion result as a card: GitLab schedules the deletion and answers with when it will happen, so the result is an object rather than a one-line confirmation.
func FormatDownloadAvatarMarkdown ¶
func FormatDownloadAvatarMarkdown(out DownloadAvatarOutput) string
FormatDownloadAvatarMarkdown renders an avatar download result as a card.
func FormatHookMarkdown ¶
func FormatHookMarkdown(out HookOutput) string
FormatHookMarkdown renders a single project webhook as a card, with the events it subscribes to as the nested collection they are and the URL variable and custom header keys through the one writer of a redacted key table. The name and the URL used to be written as bullet-less label lines, which render as one run-on paragraph, and neither was escaped.
func FormatLanguagesMarkdown ¶
func FormatLanguagesMarkdown(out LanguagesOutput) string
FormatLanguagesMarkdown renders project languages as Markdown.
func FormatListApprovalRulesMarkdown ¶
func FormatListApprovalRulesMarkdown(out ListApprovalRulesOutput) string
FormatListApprovalRulesMarkdown renders a list of approval rules as Markdown.
func FormatListForksMarkdown ¶
func FormatListForksMarkdown(out ListForksOutput) string
FormatListForksMarkdown renders a list of project forks as Markdown.
func FormatListHooksMarkdown ¶
func FormatListHooksMarkdown(out ListHooksOutput) string
FormatListHooksMarkdown renders a list of project webhooks as Markdown.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a list of projects as a Markdown table.
func FormatListProjectGroupsMarkdown ¶
func FormatListProjectGroupsMarkdown(out ListProjectGroupsOutput) string
FormatListProjectGroupsMarkdown renders a project groups list as markdown.
func FormatListProjectUsersMarkdown ¶
func FormatListProjectUsersMarkdown(out ListProjectUsersOutput) string
FormatListProjectUsersMarkdown renders a users list as markdown.
func FormatListStarrersMarkdown ¶
func FormatListStarrersMarkdown(out ListProjectStarrersOutput) string
FormatListStarrersMarkdown renders a starrers list as markdown.
func FormatListTargetBranchRulesMarkdown ¶
func FormatListTargetBranchRulesMarkdown(out ListTargetBranchRulesOutput) string
FormatListTargetBranchRulesMarkdown renders a project's target branch rules as a Markdown table.
func FormatMarkdown ¶
FormatMarkdown renders a single project as a card: one row per field GitLab sent, the description as prose under its label, and the hints last.
func FormatPullMirrorMarkdown ¶
func FormatPullMirrorMarkdown(out PullMirrorOutput) string
FormatPullMirrorMarkdown renders pull mirror details as a card.
func FormatPushRuleMarkdown ¶
func FormatPushRuleMarkdown(out PushRuleOutput) string
FormatPushRuleMarkdown renders a push rule as a card. Every regex is a code span: a rule holding an alternation used to reach the model as `^(feat|fix):`, which is not the pattern GitLab enforces.
func FormatRepositoryStorageMarkdown ¶
func FormatRepositoryStorageMarkdown(out RepositoryStorageOutput) string
FormatRepositoryStorageMarkdown renders repository storage info as a card.
func FormatShareProjectMarkdown ¶
func FormatShareProjectMarkdown(out ShareProjectOutput) string
FormatShareProjectMarkdown renders a share-project result as a card: the share GitLab created is the object the action returns.
func FormatTargetBranchRuleMarkdown ¶
func FormatTargetBranchRuleMarkdown(out TargetBranchRuleOutput) string
FormatTargetBranchRuleMarkdown renders a single target branch rule as a card.
func FormatTransferMarkdown ¶ added in v3.1.0
func FormatTransferMarkdown(out TransferOutput) string
FormatTransferMarkdown renders what a project transfer answered. A move that landed is the project's own card, in its new namespace; one the wait did not see land says so in its heading and a note, since its rows are the namespace the project is leaving, and its hints are the reads that settle where it ends up.
func FormatTriggerTestHookMarkdown ¶
func FormatTriggerTestHookMarkdown(out TriggerTestHookOutput) string
FormatTriggerTestHookMarkdown renders a webhook test trigger result as markdown. The message names the event the caller asked for, so it is escaped rather than written as it arrived.
func SetCustomHeader ¶
func SetCustomHeader(ctx context.Context, client *gitlabclient.Client, input SetCustomHeaderInput) error
SetCustomHeader sets a custom header on a project webhook.
func SetCustomHeaderOutput ¶
func SetCustomHeaderOutput(ctx context.Context, client *gitlabclient.Client, input SetCustomHeaderInput) (toolutil.VoidOutput, error)
SetCustomHeaderOutput sets a webhook custom header and returns the legacy success message shape.
func SetWebhookURLVariable ¶
func SetWebhookURLVariable(ctx context.Context, client *gitlabclient.Client, input SetWebhookURLVariableInput) error
SetWebhookURLVariable sets a URL variable on a project webhook.
func SetWebhookURLVariableOutput ¶
func SetWebhookURLVariableOutput(ctx context.Context, client *gitlabclient.Client, input SetWebhookURLVariableInput) (toolutil.VoidOutput, error)
SetWebhookURLVariableOutput sets a webhook URL variable and returns the legacy success message shape.
func StartHousekeeping ¶
func StartHousekeeping(ctx context.Context, client *gitlabclient.Client, input StartHousekeepingInput) error
StartHousekeeping triggers housekeeping (git gc/repack) for a project.
func StartHousekeepingOutput ¶
func StartHousekeepingOutput(ctx context.Context, client *gitlabclient.Client, input StartHousekeepingInput) (toolutil.VoidOutput, error)
StartHousekeepingOutput starts housekeeping and returns the legacy success message shape.
func StartMirroring ¶
func StartMirroring(ctx context.Context, client *gitlabclient.Client, input StartMirroringInput) error
StartMirroring triggers an immediate pull mirror update for a project.
func StartMirroringOutput ¶
func StartMirroringOutput(ctx context.Context, client *gitlabclient.Client, input StartMirroringInput) (toolutil.VoidOutput, error)
StartMirroringOutput starts pull mirroring and returns the legacy success message shape.
Types ¶
type AccessOutput ¶
type AccessOutput struct {
AccessLevel int64 `json:"access_level"`
NotificationLevel int64 `json:"notification_level"`
}
AccessOutput mirrors gl.ProjectAccess / gl.GroupAccess, the access-level pair embedded in the permissions object.
type AddHookInput ¶
type AddHookInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
URL string `json:"url" jsonschema:"Webhook URL,required"`
HookOptionsInput
}
AddHookInput defines parameters for adding a webhook to a project.
type AddPushRuleInput ¶
type AddPushRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
AuthorEmailRegex string `json:"author_email_regex,omitempty" jsonschema:"Regex to validate author email addresses"`
BranchNameRegex string `json:"branch_name_regex,omitempty" jsonschema:"Regex to validate branch names"`
CommitCommitterCheck *bool `json:"commit_committer_check,omitempty" jsonschema:"Reject commits where committer is not a project member"`
CommitCommitterNameCheck *bool `json:"commit_committer_name_check,omitempty" jsonschema:"Reject commits where committer name does not match user name"`
CommitMessageNegativeRegex string `json:"commit_message_negative_regex,omitempty" jsonschema:"Regex that commit messages must NOT match"`
CommitMessageRegex string `json:"commit_message_regex,omitempty" jsonschema:"Regex that commit messages must match"`
DenyDeleteTag *bool `json:"deny_delete_tag,omitempty" jsonschema:"Deny tag deletion"`
FileNameRegex string `json:"file_name_regex,omitempty" jsonschema:"Regex for disallowed file names"`
MaxFileSize *int64 `json:"max_file_size,omitempty" jsonschema:"Maximum file size (MB). 0 means unlimited"`
MemberCheck *bool `json:"member_check,omitempty" jsonschema:"Only allow commits from project members"`
PreventSecrets *bool `json:"prevent_secrets,omitempty" jsonschema:"Reject files that are likely to contain secrets"`
RejectUnsignedCommits *bool `json:"reject_unsigned_commits,omitempty" jsonschema:"Reject commits that are not GPG signed"`
RejectNonDCOCommits *bool `json:"reject_non_dco_commits,omitempty" jsonschema:"Reject commits without DCO certification"`
}
AddPushRuleInput defines parameters for adding push rules to a project.
type ApprovalConfigOutput ¶
type ApprovalConfigOutput struct {
toolutil.HintableOutput
Approvers []*ApproverUserOutput `json:"approvers,omitempty"`
ApproverGroups []*ApproverGroupOutput `json:"approver_groups,omitempty"`
ApprovalsBeforeMerge int64 `json:"approvals_before_merge"`
ResetApprovalsOnPush bool `json:"reset_approvals_on_push"`
DisableOverridingApproversPerMergeRequest bool `json:"disable_overriding_approvers_per_merge_request"`
MergeRequestsAuthorApproval bool `json:"merge_requests_author_approval"`
MergeRequestsDisableCommittersApproval bool `json:"merge_requests_disable_committers_approval"`
RequireReauthenticationToApprove bool `json:"require_reauthentication_to_approve"`
SelectiveCodeOwnerRemovals bool `json:"selective_code_owner_removals"`
RequirePasswordToApprove bool `json:"require_password_to_approve"`
}
ApprovalConfigOutput holds project-level approval configuration. It mirrors gl.ProjectApprovals 1:1, including the approvers / approver_groups object arrays and the deprecated require_password_to_approve scalar.
func ChangeApprovalConfig ¶
func ChangeApprovalConfig(ctx context.Context, client *gitlabclient.Client, input ChangeApprovalConfigInput) (ApprovalConfigOutput, error)
ChangeApprovalConfig updates the project-level approval configuration.
func GetApprovalConfig ¶
func GetApprovalConfig(ctx context.Context, client *gitlabclient.Client, input GetApprovalConfigInput) (ApprovalConfigOutput, error)
GetApprovalConfig retrieves the project-level approval configuration.
type ApprovalGroupOutput ¶
type ApprovalGroupOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
FullName string `json:"full_name"`
FullPath string `json:"full_path"`
Visibility string `json:"visibility"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
}
ApprovalGroupOutput mirrors the compact identity subset of gl.Group surfaced in an approval rule's groups array. The full gl.Group struct carries dozens of administrative fields not present in the approval-rule projection; this curated mirror surfaces the group identity fields that the API returns there.
type ApprovalRuleOutput ¶
type ApprovalRuleOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
RuleType string `json:"rule_type,omitempty"`
ReportType string `json:"report_type,omitempty"`
ApprovalsRequired int64 `json:"approvals_required"`
EligibleApprovers []*toolutil.BasicUserOutput `json:"eligible_approvers,omitempty"`
Users []*toolutil.BasicUserOutput `json:"users,omitempty"`
Groups []*ApprovalGroupOutput `json:"groups,omitempty"`
ProtectedBranches []*ProtectedBranchRefOutput `json:"protected_branches,omitempty"`
ContainsHiddenGroups bool `json:"contains_hidden_groups"`
AppliesToAllProtectedBranches bool `json:"applies_to_all_protected_branches"`
// CoverageMinimumThreshold is exposed only on a rule whose report_type is
// code_coverage, and client-go does not model it, so it is read from the
// captured answer (ADR-0021) and stays nil on every other rule.
CoverageMinimumThreshold *int64 `json:"coverage_minimum_threshold,omitempty" tier:"premium"`
}
ApprovalRuleOutput holds a single project approval rule. It mirrors gl.ProjectApprovalRule 1:1: eligible_approvers and users are full user objects, groups are group objects, and protected_branches surfaces the branch identity objects.
func CreateApprovalRule ¶
func CreateApprovalRule(ctx context.Context, client *gitlabclient.Client, input CreateApprovalRuleInput) (ApprovalRuleOutput, error)
CreateApprovalRule creates a new project-level approval rule.
func GetApprovalRule ¶
func GetApprovalRule(ctx context.Context, client *gitlabclient.Client, input GetApprovalRuleInput) (ApprovalRuleOutput, error)
GetApprovalRule retrieves a single project-level approval rule.
func UpdateApprovalRule ¶
func UpdateApprovalRule(ctx context.Context, client *gitlabclient.Client, input UpdateApprovalRuleInput) (ApprovalRuleOutput, error)
UpdateApprovalRule updates an existing project-level approval rule.
type ApproverGroupOutput ¶
type ApproverGroupOutput struct {
Group ApproverNestedGroupOutput `json:"group"`
}
ApproverGroupOutput mirrors gl.MergeRequestApproverGroup, an element of the project approvals approver_groups array. The SDK nests the group identity under a group key (gl.MergeRequestApproverNestedGroup).
type ApproverNestedGroupOutput ¶
type ApproverNestedGroupOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Description string `json:"description"`
Visibility string `json:"visibility"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
FullName string `json:"full_name"`
FullPath string `json:"full_path"`
LFSEnabled bool `json:"lfs_enabled"`
RequestAccessEnabled bool `json:"request_access_enabled"`
}
ApproverNestedGroupOutput mirrors gl.MergeRequestApproverNestedGroup.
type ApproverUserOutput ¶
type ApproverUserOutput struct {
User *toolutil.BasicUserOutput `json:"user"`
}
ApproverUserOutput mirrors gl.MergeRequestApproverUser, an element of the project approvals approvers array.
It does not carry the SDK type's ApprovedAt. client-go writes one struct for two responses: merge_request_approvals.md shows approved_at on the merge request's approved_by elements, and the project-level approvers array it spells `"approvers": [] // Deprecated in GitLab 12.3, always returns empty`. GitLab's own record agrees, giving that element the single property `user` (GitLab's generated OpenAPI document, GET and POST /projects/{id}/approvals).
type ArchiveInput ¶
type ArchiveInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
ArchiveInput defines parameters for archiving a project.
type AvatarInput ¶ added in v3.4.0
type AvatarInput struct {
Filename string `json:"filename" jsonschema:"Avatar file name such as avatar.png, whose extension GitLab reads the image type from,required"`
FilePath string `` /* 233-byte string literal not displayed */
ContentBase64 string `` /* 134-byte string literal not displayed */
}
AvatarInput is an image a project create uploads as the new project's avatar, as gl.ProjectAvatar carries it: the file name GitLab reads the image type from, and the content, from a local file or as base64.
type BasicOutput ¶ added in v3.1.0
type BasicOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
NameWithNamespace string `json:"name_with_namespace,omitempty"`
Description string `json:"description"`
Visibility string `json:"visibility"`
DefaultBranch string `json:"default_branch"`
WebURL string `json:"web_url"`
HTTPURLToRepo string `json:"http_url_to_repo,omitempty"`
SSHURLToRepo string `json:"ssh_url_to_repo,omitempty"`
ReadmeURL string `json:"readme_url,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
LicenseURL string `json:"license_url,omitempty"`
Topics []string `json:"topics"`
TagList []string `json:"tag_list,omitempty"`
ForksCount int64 `json:"forks_count,omitempty"`
StarCount int64 `json:"star_count,omitempty"`
CreatedAt string `json:"created_at"`
LastActivityAt string `json:"last_activity_at,omitempty"`
RepositoryStorage string `json:"repository_storage,omitempty"`
Namespace *NamespaceOutput `json:"namespace,omitempty"`
License *LicenseOutput `json:"license,omitempty"`
CustomAttributes []CustomAttributeOutput `json:"custom_attributes,omitempty"`
}
BasicOutput is a project as API::Entities::BasicProjectDetails renders it: the twenty-four keys GitLab sends wherever the full project is not the answer. Two routes ask for exactly this shape, the project search scope (lib/api/search.rb) and the job token allowlist, and every route that takes `simple=true` narrows to it. Output embeds it, mirroring GitLab's own entity inheritance.
func ToBasicOutput ¶ added in v3.1.0
func ToBasicOutput(p *gl.Project) BasicOutput
ToBasicOutput converts a project the way API::Entities::BasicProjectDetails renders it. A route that sends the basic entity calls this directly, and ToOutput fills the embedded half of the full project with it.
type ChangeApprovalConfigInput ¶
type ChangeApprovalConfigInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
ApprovalsBeforeMerge *int64 `json:"approvals_before_merge,omitempty" jsonschema:"Number of approvals required before merge"`
ResetApprovalsOnPush *bool `json:"reset_approvals_on_push,omitempty" jsonschema:"Reset approvals when new commits are pushed"`
DisableOverridingApproversPerMergeRequest *bool `json:"disable_overriding_approvers_per_merge_request,omitempty" jsonschema:"Prevent overriding approvers per MR"`
MergeRequestsAuthorApproval *bool `json:"merge_requests_author_approval,omitempty" jsonschema:"Allow MR author to approve their own MR"`
MergeRequestsDisableCommittersApproval *bool `json:"merge_requests_disable_committers_approval,omitempty" jsonschema:"Prevent MR committers from approving"`
RequireReauthenticationToApprove *bool `json:"require_reauthentication_to_approve,omitempty" jsonschema:"Require reauthentication to approve"`
SelectiveCodeOwnerRemovals *bool `json:"selective_code_owner_removals,omitempty" jsonschema:"Only remove code owner approvals when relevant files change"`
RequirePasswordToApprove *bool `` /* 154-byte string literal not displayed */
}
ChangeApprovalConfigInput defines parameters for changing approval configuration.
type ConfigurePullMirrorInput ¶
type ConfigurePullMirrorInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Enabled *bool `json:"enabled,omitempty" jsonschema:"Enable or disable pull mirroring"`
URL string `` /* 197-byte string literal not displayed */
AuthUser string `` /* 145-byte string literal not displayed */
AuthPassword string `` /* 171-byte string literal not displayed */
MirrorBranchRegex string `json:"mirror_branch_regex,omitempty" jsonschema:"Regex to filter branches to mirror"`
MirrorTriggerBuilds *bool `json:"mirror_trigger_builds,omitempty" jsonschema:"Trigger CI builds when mirror updates"`
OnlyMirrorProtectedBranches *bool `json:"only_mirror_protected_branches,omitempty" jsonschema:"Only mirror protected branches"`
MirrorOverwritesDivergedBranches *bool `` /* 260-byte string literal not displayed */
// Confirm is declared so the input schema advertises the reserved confirm
// key and strict validation accepts it. Its value is never populated:
// toolutil strips reserved keys before unmarshalling, so the guard reads
// the caller's confirmation from the raw request instead.
Confirm bool `` /* 204-byte string literal not displayed */
}
ConfigurePullMirrorInput defines parameters for configuring pull mirroring.
type ContainerExpirationPolicyInput ¶
type ContainerExpirationPolicyInput struct {
Cadence string `json:"cadence,omitempty" jsonschema:"Cleanup cadence (1d, 7d, 14d, 1month, 3month)"`
KeepN *int64 `json:"keep_n,omitempty" jsonschema:"Number of most recent tags to always keep per image name"`
OlderThan string `json:"older_than,omitempty" jsonschema:"Only tags older than this duration are eligible for deletion (7d, 14d, 30d, 90d)"`
NameRegex *string `` /* 162-byte string literal not displayed */
NameRegexKeep *string `` /* 172-byte string literal not displayed */
Enabled *bool `json:"enabled,omitempty" jsonschema:"Enable the container expiration policy"`
// NameRegexDelete is the name this input gave name_regex before the field
// took GitLab's name, kept so that a call written against it still sets
// the regex. It is
// sent as name_regex, and only when name_regex is left out, which is the
// rule client-go applied while it copied the one into the other. It goes
// at the next major version, with the other compatibility fields.
NameRegexDelete *string `` /* 144-byte string literal not displayed */
}
ContainerExpirationPolicyInput mirrors the GitLab gl.ContainerExpirationPolicyAttributes options for configuring the container registry cleanup policy when creating or updating a project.
type ContainerExpirationPolicyOutput ¶
type ContainerExpirationPolicyOutput struct {
Cadence string `json:"cadence"`
KeepN int64 `json:"keep_n"`
OlderThan string `json:"older_than"`
NameRegex string `json:"name_regex"`
NameRegexKeep string `json:"name_regex_keep"`
Enabled bool `json:"enabled"`
NextRunAt string `json:"next_run_at,omitempty"`
}
ContainerExpirationPolicyOutput mirrors the container_expiration_policy object lib/api/entities/container_expiration_policy.rb renders: the seven keys it exposes, name_regex among them. It no longer publishes name_regex_delete, which client-go's ContainerExpirationPolicy still carries and v3.16.2 deprecated, since no entity sends it and it was always empty.
type CreateApprovalRuleInput ¶
type CreateApprovalRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Name string `json:"name" jsonschema:"Rule name,required"`
ApprovalsRequired int64 `json:"approvals_required" jsonschema:"Number of approvals required,required"`
RuleType string `` /* 269-byte string literal not displayed */
ReportType string `json:"report_type,omitempty" jsonschema:"Report type for report-approver rules (e.g. code_coverage, license_scanning)"`
UserIDs []int64 `json:"user_ids,omitempty" jsonschema:"User IDs to assign as approvers"`
GroupIDs []int64 `json:"group_ids,omitempty" jsonschema:"Group IDs to assign as approvers"`
ProtectedBranchIDs []int64 `json:"protected_branch_ids,omitempty" jsonschema:"Protected branch IDs to scope the rule to"`
Usernames []string `json:"usernames,omitempty" jsonschema:"Usernames to assign as approvers"`
AppliesToAllProtectedBranches *bool `json:"applies_to_all_protected_branches,omitempty" jsonschema:"Apply this rule to all protected branches"`
}
CreateApprovalRuleInput defines parameters for creating an approval rule.
type CreateForUserInput ¶
type CreateForUserInput struct {
UserID int64 `json:"user_id" jsonschema:"Target user ID who will own the project,required"`
// Name shadows the embedded one, because POST /projects/user/:user_id
// requires the name where POST /projects takes a name or a path.
Name string `json:"name" jsonschema:"Project name,required"`
CreateInput
}
CreateForUserInput defines parameters for creating a project on behalf of a user. Besides UserID, it carries the full GitLab gl.CreateProjectForUserOptions (an alias of gl.CreateProjectOptions) settings via an embedded CreateInput.
type CreateForkRelationInput ¶
type CreateForkRelationInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path of the forked project,required"`
ForkedFromID int64 `json:"forked_from_id" jsonschema:"ID of the project to set as the fork source,required"`
}
CreateForkRelationInput defines parameters for creating a fork relation.
type CreateInput ¶
type CreateInput struct {
// Basic metadata
Name string `json:"name,omitempty" jsonschema:"Project name, derived from the path when left out. Provide name, path or both"`
Path string `json:"path,omitempty" jsonschema:"Project path slug, derived from the name when left out. Provide name, path or both"`
NamespaceID int `json:"namespace_id,omitempty" jsonschema:"Namespace ID (defaults to personal namespace)"`
Description string `json:"description,omitempty" jsonschema:"Project description"`
Visibility string `json:"visibility,omitempty" jsonschema:"Visibility level (private, internal, public)"`
InitializeWithReadme bool `json:"initialize_with_readme,omitempty" jsonschema:"Initialize with a README"`
DefaultBranch string `` /* 237-byte string literal not displayed */
Topics []string `json:"topics,omitempty" jsonschema:"Topic tags for the project"`
ImportURL string `json:"import_url,omitempty" jsonschema:"URL to import repository from"`
RepositoryStorage string `json:"repository_storage,omitempty" jsonschema:"Repository storage shard name (admin only)"`
// Template provisioning
TemplateName string `json:"template_name,omitempty" jsonschema:"Built-in project template name to use"`
TemplateProjectID int64 `json:"template_project_id,omitempty" tier:"premium" jsonschema:"Custom project template ID to use"`
UseCustomTemplate *bool `json:"use_custom_template,omitempty" tier:"premium" jsonschema:"Use a custom group/instance project template"`
GroupWithProjectTemplatesID int64 `` /* 128-byte string literal not displayed */
// Merge settings
MergeMethod string `json:"merge_method,omitempty" jsonschema:"Merge method (merge, rebase_merge, ff)"`
SquashOption string `json:"squash_option,omitempty" jsonschema:"Squash option (never, always, default_on, default_off)"`
OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds,omitempty" jsonschema:"Only allow merge when pipeline succeeds"`
OnlyAllowMergeIfAllDiscussionsAreResolved bool `` /* 129-byte string literal not displayed */
OnlyAllowMergeIfAllStatusChecksPassed *bool `` /* 144-byte string literal not displayed */
AllowMergeOnSkippedPipeline *bool `json:"allow_merge_on_skipped_pipeline,omitempty" jsonschema:"Allow merge when pipeline is skipped"`
RemoveSourceBranchAfterMerge *bool `json:"remove_source_branch_after_merge,omitempty" jsonschema:"Remove source branch after merge by default"`
AutocloseReferencedIssues *bool `json:"autoclose_referenced_issues,omitempty" jsonschema:"Auto-close referenced issues on merge"`
ResolveOutdatedDiffDiscussions *bool `json:"resolve_outdated_diff_discussions,omitempty" jsonschema:"Auto-resolve outdated diff discussions"`
PrintingMergeRequestLinkEnabled *bool `json:"printing_merge_request_link_enabled,omitempty" jsonschema:"Show the create-merge-request link after pushing"`
MergeCommitTemplate string `json:"merge_commit_template,omitempty" jsonschema:"Template for merge commit messages"`
SquashCommitTemplate string `json:"squash_commit_template,omitempty" jsonschema:"Template for squash commit messages"`
MRDefaultTitleTemplate string `json:"mr_default_title_template,omitempty" jsonschema:"Template for default merge request titles"`
SuggestionCommitMessage string `json:"suggestion_commit_message,omitempty" jsonschema:"Default commit message for suggestions"`
IssueBranchTemplate string `json:"issue_branch_template,omitempty" jsonschema:"Template for branch names created from issues"`
ApprovalsBeforeMerge int64 `` /* 155-byte string literal not displayed */
MergeRequestTitleRegex string `json:"merge_request_title_regex,omitempty" jsonschema:"Regex that MR titles must match"`
MergeRequestTitleRegexDescription string `json:"merge_request_title_regex_description,omitempty" jsonschema:"Human-readable description for the MR title regex"`
// Feature toggles
IssuesEnabled *bool `json:"issues_enabled,omitempty" jsonschema:"Enable issues feature (deprecated: use issues_access_level)"`
MergeRequestsEnabled *bool `` /* 128-byte string literal not displayed */
WikiEnabled *bool `json:"wiki_enabled,omitempty" jsonschema:"Enable wiki feature (deprecated: use wiki_access_level)"`
JobsEnabled *bool `json:"jobs_enabled,omitempty" jsonschema:"Enable CI/CD jobs (deprecated: use builds_access_level)"`
SnippetsEnabled *bool `json:"snippets_enabled,omitempty" jsonschema:"Enable snippets feature (deprecated: use snippets_access_level)"`
ContainerRegistryEnabled *bool `` /* 132-byte string literal not displayed */
LFSEnabled *bool `json:"lfs_enabled,omitempty" jsonschema:"Enable Git LFS"`
ServiceDeskEnabled *bool `json:"service_desk_enabled,omitempty" jsonschema:"Enable Service Desk"`
EmailsEnabled *bool `json:"emails_enabled,omitempty" jsonschema:"Enable email notifications"`
EmailsDisabled *bool `json:"emails_disabled,omitempty" jsonschema:"Disable email notifications (deprecated: use emails_enabled)"`
ShowDefaultAwardEmojis *bool `json:"show_default_award_emojis,omitempty" jsonschema:"Show default award emojis on issues/MRs"`
PackagesEnabled *bool `json:"packages_enabled,omitempty" jsonschema:"Enable packages feature (deprecated: use package_registry_access_level)"`
PackageRegistryAccessLevel string `json:"package_registry_access_level,omitempty" jsonschema:"Package registry access level (disabled, private, enabled)"`
// Auto DevOps
AutoDevopsEnabled *bool `json:"auto_devops_enabled,omitempty" jsonschema:"Enable Auto DevOps for the project"`
AutoDevopsDeployStrategy string `json:"auto_devops_deploy_strategy,omitempty" jsonschema:"Auto DevOps deploy strategy (continuous, manual, timed_incremental)"`
// CI/CD settings
CIConfigPath string `json:"ci_config_path,omitempty" jsonschema:"Custom CI/CD configuration file path"`
CICDCatalogEnabled *bool `json:"cicd_catalog_enabled,omitempty" jsonschema:"Publish the project as a CI/CD catalog resource"`
BuildTimeout int64 `json:"build_timeout,omitempty" jsonschema:"Build timeout in seconds"`
BuildGitStrategy string `json:"build_git_strategy,omitempty" jsonschema:"Git strategy for builds (fetch, clone)"`
AutoCancelPendingPipelines string `json:"auto_cancel_pending_pipelines,omitempty" jsonschema:"Auto-cancel pending pipelines (enabled, disabled)"`
ResourceGroupDefaultProcessMode string `` /* 141-byte string literal not displayed */
GroupRunnersEnabled *bool `json:"group_runners_enabled,omitempty" jsonschema:"Enable group runners"`
PublicBuilds *bool `json:"public_builds,omitempty" jsonschema:"Enable public access to pipelines (deprecated: use public_jobs)"`
PublicJobs *bool `json:"public_jobs,omitempty" jsonschema:"Enable public access to pipelines"`
// Mirroring
Mirror *bool `json:"mirror,omitempty" tier:"premium" jsonschema:"Enable pull mirroring from import_url"`
MirrorTriggerBuilds *bool `json:"mirror_trigger_builds,omitempty" tier:"premium" jsonschema:"Trigger pipelines for mirror updates"`
// Container registry cleanup
ContainerExpirationPolicyAttributes *ContainerExpirationPolicyInput `json:"container_expiration_policy_attributes,omitempty" jsonschema:"Container registry cleanup policy attributes"`
// Compliance and security
EnforceAuthChecksOnUploads *bool `json:"enforce_auth_checks_on_uploads,omitempty" jsonschema:"Enforce authorization checks on uploads"`
ExternalAuthorizationClassificationLabel string `` /* 132-byte string literal not displayed */
// Access control
RequestAccessEnabled *bool `json:"request_access_enabled,omitempty" jsonschema:"Allow users to request access"`
PagesAccessLevel string `json:"pages_access_level,omitempty" jsonschema:"Pages access level (disabled, private, enabled, public)"`
ContainerRegistryAccessLevel string `json:"container_registry_access_level,omitempty" jsonschema:"Container registry access level (disabled, private, enabled)"`
SnippetsAccessLevel string `json:"snippets_access_level,omitempty" jsonschema:"Snippets access level (disabled, private, enabled)"`
IssuesAccessLevel string `json:"issues_access_level,omitempty" jsonschema:"Issues access level (disabled, private, enabled)"`
MergeRequestsAccessLevel string `json:"merge_requests_access_level,omitempty" jsonschema:"Merge requests access level (disabled, private, enabled)"`
WikiAccessLevel string `json:"wiki_access_level,omitempty" jsonschema:"Wiki access level (disabled, private, enabled)"`
BuildsAccessLevel string `json:"builds_access_level,omitempty" jsonschema:"CI/CD builds access level (disabled, private, enabled)"`
RepositoryAccessLevel string `json:"repository_access_level,omitempty" jsonschema:"Repository access level (disabled, private, enabled)"`
ForkingAccessLevel string `json:"forking_access_level,omitempty" jsonschema:"Forking access level (disabled, private, enabled)"`
AnalyticsAccessLevel string `json:"analytics_access_level,omitempty" jsonschema:"Analytics access level (disabled, private, enabled)"`
ReleasesAccessLevel string `json:"releases_access_level,omitempty" jsonschema:"Releases access level (disabled, private, enabled)"`
EnvironmentsAccessLevel string `json:"environments_access_level,omitempty" jsonschema:"Environments access level (disabled, private, enabled)"`
FeatureFlagsAccessLevel string `json:"feature_flags_access_level,omitempty" jsonschema:"Feature flags access level (disabled, private, enabled)"`
InfrastructureAccessLevel string `json:"infrastructure_access_level,omitempty" jsonschema:"Infrastructure access level (disabled, private, enabled)"`
MonitorAccessLevel string `json:"monitor_access_level,omitempty" jsonschema:"Monitor access level (disabled, private, enabled)"`
RequirementsAccessLevel string `json:"requirements_access_level,omitempty" jsonschema:"Requirements access level (disabled, private, enabled)"`
SecurityAndComplianceAccessLevel string `` /* 132-byte string literal not displayed */
ModelExperimentsAccessLevel string `json:"model_experiments_access_level,omitempty" jsonschema:"Model experiments access level (disabled, private, enabled)"`
ModelRegistryAccessLevel string `json:"model_registry_access_level,omitempty" jsonschema:"Model registry access level (disabled, private, enabled)"`
// Deprecated fields surfaced for 1:1 SDK parity
TagList []string `json:"tag_list,omitempty" jsonschema:"Project tags (deprecated: use topics)"`
// Avatar is uploaded with the create, which GitLab takes only as a
// multipart form.
Avatar *AvatarInput `json:"avatar,omitempty" jsonschema:"Avatar image to upload with the project, from a local file or base64 content"`
}
CreateInput defines parameters for creating a GitLab project. Fields mirror the GitLab gl.CreateProjectOptions options 1:1, except the nine that struct carries and POST /projects does not declare, which GitLab's update route alone takes and Grape drops from a create: ci_forward_deployment_enabled and protect_merge_request_pipelines (lib/api/helpers/projects_helpers.rb, optional_update_params_ce), and issues_template, merge_requests_template, merge_pipelines_enabled, merge_trains_enabled, merge_trains_skip_train_allowed, merge_train_enforcement and reviewer_assignment_strategy (ee/lib/ee/api/helpers/projects_helpers.rb, optional_update_params_ee). project.update offers each of them.
type CreateTargetBranchRuleInput ¶
type CreateTargetBranchRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Numeric project ID that owns the rule. The create mutation requires a numeric ID,required"`
Name string `json:"name" jsonschema:"Source branch name or wildcard pattern that triggers the rule (e.g. release/*),required"`
TargetBranch string `` /* 128-byte string literal not displayed */
}
CreateTargetBranchRuleInput defines parameters for creating a target branch rule. The create mutation takes a numeric project ID, so project_id must be numeric here (unlike the list query which requires the full path).
type CustomAttributeOutput ¶
CustomAttributeOutput mirrors gl.CustomAttribute, an element of the custom_attributes array.
type DeleteApprovalRuleInput ¶
type DeleteApprovalRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
RuleID int64 `json:"rule_id" jsonschema:"Approval rule ID to delete,required"`
}
DeleteApprovalRuleInput defines parameters for deleting an approval rule.
type DeleteCustomHeaderInput ¶
type DeleteCustomHeaderInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
Key string `json:"key" jsonschema:"Custom header key name to delete,required"`
}
DeleteCustomHeaderInput defines parameters for deleting a custom header from a webhook.
type DeleteForkRelationInput ¶
type DeleteForkRelationInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
DeleteForkRelationInput defines parameters for deleting a fork relation.
type DeleteHookInput ¶
type DeleteHookInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID to delete,required"`
}
DeleteHookInput defines parameters for deleting a project webhook.
type DeleteInput ¶
type DeleteInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
PermanentlyRemove bool `` /* 185-byte string literal not displayed */
FullPath string `` /* 136-byte string literal not displayed */
}
DeleteInput defines parameters for deleting a project.
type DeleteOutput ¶
type DeleteOutput struct {
toolutil.HintableOutput
Status string `json:"status"`
Message string `json:"message"`
MarkedForDeletionOn string `json:"marked_for_deletion_on,omitempty"`
PermanentlyRemoved bool `json:"permanently_removed"`
}
DeleteOutput holds the result of a project deletion request.
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (DeleteOutput, error)
Delete deletes a GitLab project by its ID or URL-encoded path. When the GitLab instance has delayed deletion enabled, the project is marked for deletion rather than removed immediately. When permanently_remove is true and the instance requires a two-step process (mark-then-remove), the handler performs both steps automatically.
type DeletePushRuleInput ¶
type DeletePushRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
DeletePushRuleInput defines parameters for deleting push rules from a project.
type DeleteSharedGroupInput ¶
type DeleteSharedGroupInput struct {
}
DeleteSharedGroupInput defines parameters for removing a group share from a project.
type DeleteTargetBranchRuleInput ¶
type DeleteTargetBranchRuleInput struct {
RuleID int64 `json:"rule_id" jsonschema:"Target branch rule ID to delete (from the list action),required"`
}
DeleteTargetBranchRuleInput defines parameters for deleting a target branch rule. The destroy mutation identifies the rule solely by its own ID.
type DeleteWebhookURLVariableInput ¶
type DeleteWebhookURLVariableInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
Key string `json:"key" jsonschema:"URL variable key name to delete,required"`
}
DeleteWebhookURLVariableInput defines parameters for deleting a URL variable from a webhook.
type DownloadAvatarInput ¶
type DownloadAvatarInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
DownloadAvatarInput defines parameters for downloading a project avatar.
type DownloadAvatarOutput ¶
type DownloadAvatarOutput struct {
toolutil.HintableOutput
ContentBase64 string `json:"content_base64"`
SizeBytes int `json:"size_bytes"`
}
DownloadAvatarOutput holds the result of downloading a project avatar.
func DownloadAvatar ¶
func DownloadAvatar(ctx context.Context, client *gitlabclient.Client, input DownloadAvatarInput) (DownloadAvatarOutput, error)
DownloadAvatar downloads the avatar image for a project as base64-encoded data.
type EditHookInput ¶
type EditHookInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID to edit,required"`
URL string `json:"url,omitempty" jsonschema:"Updated webhook URL"`
HookOptionsInput
}
EditHookInput defines parameters for editing a project webhook.
type EditPushRuleInput ¶
type EditPushRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
AuthorEmailRegex *string `json:"author_email_regex,omitempty" jsonschema:"Regex to validate author email addresses"`
BranchNameRegex *string `json:"branch_name_regex,omitempty" jsonschema:"Regex to validate branch names"`
CommitCommitterCheck *bool `json:"commit_committer_check,omitempty" jsonschema:"Reject commits where committer is not a project member"`
CommitCommitterNameCheck *bool `json:"commit_committer_name_check,omitempty" jsonschema:"Reject commits where committer name does not match user name"`
CommitMessageNegativeRegex *string `json:"commit_message_negative_regex,omitempty" jsonschema:"Regex that commit messages must NOT match"`
CommitMessageRegex *string `json:"commit_message_regex,omitempty" jsonschema:"Regex that commit messages must match"`
DenyDeleteTag *bool `json:"deny_delete_tag,omitempty" jsonschema:"Deny tag deletion"`
FileNameRegex *string `json:"file_name_regex,omitempty" jsonschema:"Regex for disallowed file names"`
MaxFileSize *int64 `json:"max_file_size,omitempty" jsonschema:"Maximum file size (MB). 0 means unlimited"`
MemberCheck *bool `json:"member_check,omitempty" jsonschema:"Only allow commits from project members"`
PreventSecrets *bool `json:"prevent_secrets,omitempty" jsonschema:"Reject files that are likely to contain secrets"`
RejectUnsignedCommits *bool `json:"reject_unsigned_commits,omitempty" jsonschema:"Reject commits that are not GPG signed"`
RejectNonDCOCommits *bool `json:"reject_non_dco_commits,omitempty" jsonschema:"Reject commits without DCO certification"`
}
EditPushRuleInput defines parameters for editing push rules on a project.
type ForkInput ¶
type ForkInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Source project ID or URL-encoded path,required"`
Name string `json:"name,omitempty" jsonschema:"Name for the forked project"`
Path string `json:"path,omitempty" jsonschema:"Path slug for the forked project"`
NamespaceID int64 `json:"namespace_id,omitempty" jsonschema:"Namespace ID to fork into"`
NamespacePath string `json:"namespace_path,omitempty" jsonschema:"Namespace path to fork into"`
Namespace string `json:"namespace,omitempty" jsonschema:"Namespace ID or path to fork into (deprecated: use namespace_id or namespace_path)"`
Description string `json:"description,omitempty" jsonschema:"Description for the forked project"`
Visibility string `json:"visibility,omitempty" jsonschema:"Visibility level (private, internal, public)"`
Branches string `json:"branches,omitempty" jsonschema:"Branches to fork (empty=all)"`
MergeRequestDefaultTargetSelf *bool `json:"mr_default_target_self,omitempty" jsonschema:"MR default target is the fork itself instead of upstream"`
}
ForkInput defines parameters for forking a project.
type ForkParentOutput ¶
type ForkParentOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
NameWithNamespace string `json:"name_with_namespace"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
HTTPURLToRepo string `json:"http_url_to_repo"`
WebURL string `json:"web_url"`
RepositoryStorage string `json:"repository_storage"`
}
ForkParentOutput mirrors gl.ForkParent, the forked_from_project object.
type GetApprovalConfigInput ¶
type GetApprovalConfigInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetApprovalConfigInput defines parameters for getting approval configuration.
type GetApprovalRuleInput ¶
type GetApprovalRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
RuleID int64 `json:"rule_id" jsonschema:"Approval rule ID,required"`
}
GetApprovalRuleInput defines parameters for getting a specific approval rule.
type GetHookInput ¶
type GetHookInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
}
GetHookInput defines parameters for getting a single project webhook.
type GetInput ¶
type GetInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path (e.g. 'user/repo' or 42),required"`
Statistics *bool `json:"statistics,omitempty" jsonschema:"Include project statistics (commit count, storage sizes)"`
License *bool `json:"license,omitempty" jsonschema:"Include license information in response"`
WithCustomAttributes *bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in response"`
}
GetInput defines parameters for retrieving a project.
type GetLanguagesInput ¶
type GetLanguagesInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetLanguagesInput defines parameters for retrieving project languages.
type GetPullMirrorInput ¶
type GetPullMirrorInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetPullMirrorInput defines parameters for getting pull mirror details.
type GetPushRulesInput ¶
type GetPushRulesInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetPushRulesInput defines parameters for getting project push rules.
type GetRepositoryStorageInput ¶
type GetRepositoryStorageInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetRepositoryStorageInput defines parameters for getting repository storage info.
type HookCustomHeader ¶
HookCustomHeader mirrors gl.HookCustomHeader, a webhook custom header. The value is masked by the API on read (returned empty) and surfaced for 1:1 parity.
type HookCustomHeaderInput ¶
type HookCustomHeaderInput struct {
Key string `json:"key" jsonschema:"Header name,required"`
Value string `json:"value" jsonschema:"Header value (write-only. Not returned by the API),required"`
}
HookCustomHeaderInput represents a single custom HTTP header for a webhook.
type HookOptionsInput ¶
type HookOptionsInput struct {
Name string `json:"name,omitempty" jsonschema:"Webhook name"`
Description *string `` /* 146-byte string literal not displayed */
Token string `json:"token,omitempty" jsonschema:"Secret token for validation"`
SigningToken string `json:"signing_token,omitempty" jsonschema:"Write-only signing token for webhook signature validation"`
PushEventsBranchFilter *string `` /* 170-byte string literal not displayed */
CustomWebhookTemplate *string `` /* 170-byte string literal not displayed */
BranchFilterStrategy string `json:"branch_filter_strategy,omitempty" jsonschema:"Branch filter strategy (wildcard, regex, all_branches)"`
PushEvents *bool `json:"push_events,omitempty" jsonschema:"Trigger on push events"`
IssuesEvents *bool `json:"issues_events,omitempty" jsonschema:"Trigger on issue events"`
ConfidentialIssuesEvents *bool `json:"confidential_issues_events,omitempty" jsonschema:"Trigger on confidential issue events"`
MergeRequestsEvents *bool `json:"merge_requests_events,omitempty" jsonschema:"Trigger on merge request events"`
TagPushEvents *bool `json:"tag_push_events,omitempty" jsonschema:"Trigger on tag push events"`
NoteEvents *bool `json:"note_events,omitempty" jsonschema:"Trigger on note/comment events"`
ConfidentialNoteEvents *bool `json:"confidential_note_events,omitempty" jsonschema:"Trigger on confidential note events"`
JobEvents *bool `json:"job_events,omitempty" jsonschema:"Trigger on CI job events"`
PipelineEvents *bool `json:"pipeline_events,omitempty" jsonschema:"Trigger on pipeline events"`
WikiPageEvents *bool `json:"wiki_page_events,omitempty" jsonschema:"Trigger on wiki page events"`
DeploymentEvents *bool `json:"deployment_events,omitempty" jsonschema:"Trigger on deployment events"`
ReleasesEvents *bool `json:"releases_events,omitempty" jsonschema:"Trigger on release events"`
MilestoneEvents *bool `json:"milestone_events,omitempty" jsonschema:"Trigger on milestone events"`
FeatureFlagEvents *bool `json:"feature_flag_events,omitempty" jsonschema:"Trigger on feature flag events"`
EmojiEvents *bool `json:"emoji_events,omitempty" jsonschema:"Trigger on emoji events"`
ResourceAccessTokenEvents *bool `json:"resource_access_token_events,omitempty" jsonschema:"Trigger on resource access token events"`
ResourceDeployTokenEvents *bool `json:"resource_deploy_token_events,omitempty" jsonschema:"Trigger on resource deploy token events"`
VulnerabilityEvents *bool `json:"vulnerability_events,omitempty" jsonschema:"Trigger on vulnerability events"`
EnableSSLVerification *bool `json:"enable_ssl_verification,omitempty" jsonschema:"Enable SSL verification for webhook"`
CustomHeaders []HookCustomHeaderInput `json:"custom_headers,omitempty" jsonschema:"Custom HTTP headers sent with each webhook request (key/value pairs)"`
}
HookOptionsInput defines common project webhook settings shared by add and edit operations.
type HookOutput ¶
type HookOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
URL string `json:"url"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
ProjectID int64 `json:"project_id"`
PushEvents bool `json:"push_events"`
PushEventsBranchFilter string `json:"push_events_branch_filter,omitempty"`
IssuesEvents bool `json:"issues_events"`
ConfidentialIssuesEvents bool `json:"confidential_issues_events"`
MergeRequestsEvents bool `json:"merge_requests_events"`
TagPushEvents bool `json:"tag_push_events"`
NoteEvents bool `json:"note_events"`
ConfidentialNoteEvents bool `json:"confidential_note_events"`
JobEvents bool `json:"job_events"`
PipelineEvents bool `json:"pipeline_events"`
WikiPageEvents bool `json:"wiki_page_events"`
DeploymentEvents bool `json:"deployment_events"`
ReleasesEvents bool `json:"releases_events"`
MilestoneEvents bool `json:"milestone_events"`
FeatureFlagEvents bool `json:"feature_flag_events"`
EmojiEvents bool `json:"emoji_events"`
EnableSSLVerification bool `json:"enable_ssl_verification"`
RepositoryUpdateEvents bool `json:"repository_update_events"`
ResourceAccessTokenEvents bool `json:"resource_access_token_events"`
ResourceDeployTokenEvents bool `json:"resource_deploy_token_events"`
AlertStatus string `json:"alert_status,omitempty"`
DisabledUntil string `json:"disabled_until,omitempty"`
URLVariables []HookURLVariable `json:"url_variables,omitempty"`
BranchFilterStrategy string `json:"branch_filter_strategy,omitempty"`
CustomWebhookTemplate string `json:"custom_webhook_template,omitempty"`
CustomHeaders []HookCustomHeader `json:"custom_headers,omitempty"`
VulnerabilityEvents bool `json:"vulnerability_events"`
TokenPresent bool `json:"token_present"`
SigningTokenPresent bool `json:"signing_token_present"`
CreatedAt time.Time `json:"created_at"`
// DuoFlowCallbackEnabled says whether GitLab Duo flow events are sent to
// the hook. lib/api/entities/project_hook.rb sends it on every hook from
// GitLab 19.4 and client-go does not model it, so it is read beside the
// SDK's fields and is absent from an older instance's answer rather than
// reported off.
DuoFlowCallbackEnabled *bool `json:"duo_flow_callback_enabled,omitempty"`
}
HookOutput represents a project webhook.
func AddHook ¶
func AddHook(ctx context.Context, client *gitlabclient.Client, input AddHookInput) (HookOutput, error)
AddHook adds a webhook to a project.
func EditHook ¶
func EditHook(ctx context.Context, client *gitlabclient.Client, input EditHookInput) (HookOutput, error)
EditHook edits an existing project webhook.
func GetHook ¶
func GetHook(ctx context.Context, client *gitlabclient.Client, input GetHookInput) (HookOutput, error)
GetHook retrieves a single project webhook by ID.
type HookURLVariable ¶
HookURLVariable mirrors gl.HookURLVariable, a webhook URL variable. The value is masked by the API on read (returned empty) and surfaced for 1:1 parity.
type LanguageEntry ¶
LanguageEntry represents a single programming language and its percentage.
type LanguagesOutput ¶
type LanguagesOutput struct {
toolutil.HintableOutput
Languages []LanguageEntry `json:"languages"`
}
LanguagesOutput holds the programming languages detected in a project.
func GetLanguages ¶
func GetLanguages(ctx context.Context, client *gitlabclient.Client, input GetLanguagesInput) (LanguagesOutput, error)
GetLanguages retrieves the programming languages used in a project with percentages.
type LicenseOutput ¶
type LicenseOutput struct {
Key string `json:"key"`
Name string `json:"name"`
Nickname string `json:"nickname"`
HTMLURL string `json:"html_url"`
SourceURL string `json:"source_url"`
}
LicenseOutput mirrors gl.ProjectLicense, the license object.
type LinksOutput ¶
type LinksOutput struct {
Self string `json:"self"`
Issues string `json:"issues"`
MergeRequests string `json:"merge_requests"`
RepoBranches string `json:"repo_branches"`
Labels string `json:"labels"`
Events string `json:"events"`
Members string `json:"members"`
ClusterAgents string `json:"cluster_agents"`
}
LinksOutput mirrors gl.Links, the project _links object.
type ListApprovalRulesInput ¶
type ListApprovalRulesInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Keyset ordering column (for keyset pagination)"`
Sort string `json:"sort,omitempty" jsonschema:"Keyset sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListApprovalRulesInput defines parameters for listing project approval rules.
type ListApprovalRulesOutput ¶
type ListApprovalRulesOutput struct {
toolutil.HintableOutput
Rules []ApprovalRuleOutput `json:"rules"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListApprovalRulesOutput holds a paginated list of project approval rules.
func ListApprovalRules ¶
func ListApprovalRules(ctx context.Context, client *gitlabclient.Client, input ListApprovalRulesInput) (ListApprovalRulesOutput, error)
ListApprovalRules retrieves all project-level approval rules.
type ListForksInput ¶
type ListForksInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Owned bool `json:"owned,omitempty" jsonschema:"Limit to forks owned by the current user"`
Search string `json:"search,omitempty" jsonschema:"Search query for fork name"`
Visibility string `json:"visibility,omitempty" jsonschema:"Filter by visibility (private, internal, public)"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order by field (id, name, path, created_at, updated_at, last_activity_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
// Additional filters (additive 1:1 SDK parity with ListProjectsOptions)
Archived *bool `json:"archived,omitempty" jsonschema:"Filter by archived status (true=only archived, false=only active)"`
Topic string `json:"topic,omitempty" jsonschema:"Filter by topic name"`
Simple bool `json:"simple,omitempty" jsonschema:"Return only limited fields (faster for large result sets)"`
MinAccessLevel int `` /* 184-byte string literal not displayed */
LastActivityAfter string `json:"last_activity_after,omitempty" jsonschema:"Return forks with last activity after date (ISO 8601 format)"`
LastActivityBefore string `json:"last_activity_before,omitempty" jsonschema:"Return forks with last activity before date (ISO 8601 format)"`
Starred *bool `json:"starred,omitempty" jsonschema:"Limit to forks starred by the current user"`
Membership *bool `json:"membership,omitempty" jsonschema:"Limit to forks where the current user is a member"`
WithIssuesEnabled *bool `json:"with_issues_enabled,omitempty" jsonschema:"Filter by forks with issues feature enabled"`
WithMergeRequestsEnabled *bool `json:"with_merge_requests_enabled,omitempty" jsonschema:"Filter by forks with merge requests enabled"`
SearchNamespaces *bool `json:"search_namespaces,omitempty" jsonschema:"Include namespace in search"`
Statistics *bool `json:"statistics,omitempty" jsonschema:"Include project statistics in response"`
WithProgrammingLanguage string `json:"with_programming_language,omitempty" jsonschema:"Filter by programming language name"`
IncludePendingDelete *bool `json:"include_pending_delete,omitempty" jsonschema:"Include forks marked/scheduled for deletion. Default false."`
IncludeHidden *bool `json:"include_hidden,omitempty" jsonschema:"Include hidden forks in results"`
IDAfter int64 `json:"id_after,omitempty" jsonschema:"Return forks with ID greater than this value (keyset pagination)"`
IDBefore int64 `json:"id_before,omitempty" jsonschema:"Return forks with ID less than this value (keyset pagination)"`
Active *bool `json:"active,omitempty" jsonschema:"Limit to active (non-archived, non-pending-deletion) forks"`
Imported *bool `json:"imported,omitempty" jsonschema:"Limit to forks imported from an external source by the current user"`
RepositoryStorage string `json:"repository_storage,omitempty" jsonschema:"Limit to forks on the given repository storage shard (admin only)"`
WithCustomAttributes *bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response (admin only)"`
CustomAttributes map[string]string `` /* 209-byte string literal not displayed */
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListForksInput defines parameters for listing project forks. The forks endpoint accepts the same filter set as the project list endpoint (ListProjectsOptions), so every filter is surfaced here for 1:1 SDK parity.
type ListForksOutput ¶
type ListForksOutput struct {
toolutil.HintableOutput
// Forks and SimpleForks split for the reason [ListOutput] splits: simple
// switches the entity GitLab renders, and exactly one is present.
Forks []Output `json:"forks,omitzero"`
SimpleForks []BasicOutput `json:"simple_forks,omitzero"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListForksOutput holds a paginated list of project forks.
func ListForks ¶
func ListForks(ctx context.Context, client *gitlabclient.Client, input ListForksInput) (ListForksOutput, error)
ListForks retrieves a paginated list of forks for a project.
type ListHooksInput ¶
type ListHooksInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Keyset ordering column (for keyset pagination)"`
Sort string `json:"sort,omitempty" jsonschema:"Keyset sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListHooksInput defines parameters for listing project webhooks.
type ListHooksOutput ¶
type ListHooksOutput struct {
toolutil.HintableOutput
Hooks []HookOutput `json:"hooks"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListHooksOutput holds a paginated list of project webhooks.
func ListHooks ¶
func ListHooks(ctx context.Context, client *gitlabclient.Client, input ListHooksInput) (ListHooksOutput, error)
ListHooks retrieves all webhooks for a project.
type ListInput ¶
type ListInput struct {
Owned bool `json:"owned,omitempty" jsonschema:"Limit to projects explicitly owned by the current user"`
Search string `json:"search,omitempty" jsonschema:"Search query for project name"`
Visibility string `json:"visibility,omitempty" jsonschema:"Filter by visibility (private, internal, public)"`
Archived *bool `json:"archived,omitempty" jsonschema:"Filter by archived status (true=only archived, false=only active)"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order by field (id, name, path, created_at, updated_at, last_activity_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
Topic string `json:"topic,omitempty" jsonschema:"Filter by topic name"`
Simple bool `json:"simple,omitempty" jsonschema:"Return only limited fields (faster for large result sets)"`
MinAccessLevel int `` /* 173-byte string literal not displayed */
LastActivityAfter string `json:"last_activity_after,omitempty" jsonschema:"Return projects with last activity after date (ISO 8601 format)"`
LastActivityBefore string `json:"last_activity_before,omitempty" jsonschema:"Return projects with last activity before date (ISO 8601 format)"`
Starred *bool `json:"starred,omitempty" jsonschema:"Limit to projects starred by the current user"`
Membership *bool `json:"membership,omitempty" jsonschema:"Limit to projects where current user is a member"`
WithIssuesEnabled *bool `json:"with_issues_enabled,omitempty" jsonschema:"Filter by projects with issues feature enabled"`
WithMergeRequestsEnabled *bool `json:"with_merge_requests_enabled,omitempty" jsonschema:"Filter by projects with merge requests enabled"`
SearchNamespaces *bool `json:"search_namespaces,omitempty" jsonschema:"Include namespace in search"`
Statistics *bool `json:"statistics,omitempty" jsonschema:"Include project statistics in response"`
WithProgrammingLanguage string `json:"with_programming_language,omitempty" jsonschema:"Filter by programming language name"`
IncludePendingDelete *bool `` /* 127-byte string literal not displayed */
IncludeHidden *bool `json:"include_hidden,omitempty" jsonschema:"Include hidden projects in results (administrators only)"`
IDAfter int64 `json:"id_after,omitempty" jsonschema:"Return projects with ID greater than this value (keyset pagination)"`
IDBefore int64 `json:"id_before,omitempty" jsonschema:"Return projects with ID less than this value (keyset pagination)"`
// Additional filters (additive 1:1 SDK parity with ListProjectsOptions)
Active *bool `json:"active,omitempty" jsonschema:"Limit to active (non-archived, non-pending-deletion) projects"`
Imported *bool `` /* 126-byte string literal not displayed */
RepositoryStorage string `json:"repository_storage,omitempty" jsonschema:"Limit to projects on the given repository storage shard (admin only)"`
WithCustomAttributes *bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response (admin only)"`
CustomAttributes map[string]string `` /* 208-byte string literal not displayed */
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListInput defines filters for listing projects.
type ListInvitedGroupsInput ¶
type ListInvitedGroupsInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Search by group name"`
MinAccessLevel int `` /* 173-byte string literal not displayed */
Relation []string `json:"relation,omitempty" jsonschema:"Filter by group relation to the project (e.g. direct, inherited)"`
WithCustomAttributes *bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response (admin only)"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Keyset ordering column (for keyset pagination)"`
Sort string `json:"sort,omitempty" jsonschema:"Keyset sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListInvitedGroupsInput defines parameters for listing groups invited to a project.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Projects []Output `json:"projects,omitzero"`
SimpleProjects []BasicOutput `json:"simple_projects,omitzero"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of projects.
GitLab answers a project list with one of two entities and the caller chooses which: the full project by default, BasicProjectDetails when simple is true. Each has a field of its own here, so that a basic row never reads as a full one with every key the basic entity lacks set to false or zero; exactly one of the two is present in a response.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves a paginated list of GitLab projects.
func ListUserContributedProjects ¶
func ListUserContributedProjects(ctx context.Context, client *gitlabclient.Client, input ListUserContributedProjectsInput) (ListOutput, error)
ListUserContributedProjects lists projects a specific user has contributed to, by offset pages only, since GitLab cannot follow this list by keyset (see [contributedKeysetRefusal]).
func ListUserProjects ¶
func ListUserProjects(ctx context.Context, client *gitlabclient.Client, input ListUserProjectsInput) (ListOutput, error)
ListUserProjects lists projects owned by the given user.
func ListUserStarredProjects ¶
func ListUserStarredProjects(ctx context.Context, client *gitlabclient.Client, input ListUserStarredProjectsInput) (ListOutput, error)
ListUserStarredProjects lists projects starred by a specific user.
type ListProjectGroupsInput ¶
type ListProjectGroupsInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Search by group name"`
SkipGroups []int64 `json:"skip_groups,omitempty" jsonschema:"Array of group IDs to exclude"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Keyset ordering column (for keyset pagination)"`
Sort string `json:"sort,omitempty" jsonschema:"Keyset sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListProjectGroupsInput defines parameters for listing a project's ancestor groups.
type ListProjectGroupsOutput ¶
type ListProjectGroupsOutput struct {
toolutil.HintableOutput
Groups []ProjectGroupOutput `json:"groups"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListProjectGroupsOutput holds a paginated list of project groups.
func ListInvitedGroups ¶
func ListInvitedGroups(ctx context.Context, client *gitlabclient.Client, input ListInvitedGroupsInput) (ListProjectGroupsOutput, error)
ListInvitedGroups lists groups that have been invited to the given project.
func ListProjectGroups ¶
func ListProjectGroups(ctx context.Context, client *gitlabclient.Client, input ListProjectGroupsInput) (ListProjectGroupsOutput, error)
ListProjectGroups lists the ancestor groups of the given project.
type ListProjectStarrersInput ¶
type ListProjectStarrersInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Search by name or username"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Keyset ordering column (for keyset pagination)"`
Sort string `json:"sort,omitempty" jsonschema:"Keyset sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListProjectStarrersInput defines parameters for listing project starrers.
type ListProjectStarrersOutput ¶
type ListProjectStarrersOutput struct {
toolutil.HintableOutput
Starrers []StarrerOutput `json:"starrers"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListProjectStarrersOutput holds a paginated list of project starrers.
func ListProjectStarrers ¶
func ListProjectStarrers(ctx context.Context, client *gitlabclient.Client, input ListProjectStarrersInput) (ListProjectStarrersOutput, error)
ListProjectStarrers lists users who have starred the given project.
type ListProjectUsersInput ¶
type ListProjectUsersInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Search by name or username"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Keyset ordering column (for keyset pagination)"`
Sort string `json:"sort,omitempty" jsonschema:"Keyset sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListProjectUsersInput defines parameters for listing users of a project.
type ListProjectUsersOutput ¶
type ListProjectUsersOutput struct {
toolutil.HintableOutput
Users []ProjectUserOutput `json:"users"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListProjectUsersOutput holds a paginated list of project users.
func ListProjectUsers ¶
func ListProjectUsers(ctx context.Context, client *gitlabclient.Client, input ListProjectUsersInput) (ListProjectUsersOutput, error)
ListProjectUsers lists users who are members of the given project.
type ListTargetBranchRulesInput ¶
type ListTargetBranchRulesInput struct {
ProjectID toolutil.StringOrInt `` /* 180-byte string literal not displayed */
}
ListTargetBranchRulesInput defines parameters for listing a project's target branch rules. The GitLab GraphQL project(fullPath:) field does not accept numeric IDs, so project_id must be the full namespace/project path.
type ListTargetBranchRulesOutput ¶
type ListTargetBranchRulesOutput struct {
toolutil.HintableOutput
TargetBranchRules []TargetBranchRuleOutput `json:"target_branch_rules"`
}
ListTargetBranchRulesOutput holds a project's target branch rules. The underlying GraphQL connection returns every rule in one response, so there is no pagination envelope to mirror.
func ListTargetBranchRules ¶
func ListTargetBranchRules(ctx context.Context, client *gitlabclient.Client, input ListTargetBranchRulesInput) (ListTargetBranchRulesOutput, error)
ListTargetBranchRules returns the target branch rules configured for a project. Premium/Ultimate.
type ListUserContributedProjectsInput ¶
type ListUserContributedProjectsInput struct {
UserID toolutil.StringOrInt `json:"user_id" jsonschema:"User ID or username,required"`
// contains filtered or unexported fields
}
ListUserContributedProjectsInput defines parameters for listing contributed projects.
type ListUserProjectsInput ¶
type ListUserProjectsInput struct {
UserID toolutil.StringOrInt `json:"user_id" jsonschema:"User ID or username,required"`
// contains filtered or unexported fields
}
ListUserProjectsInput defines parameters for listing projects owned by a specific user.
type ListUserStarredProjectsInput ¶
type ListUserStarredProjectsInput struct {
UserID toolutil.StringOrInt `json:"user_id" jsonschema:"User ID or username,required"`
// contains filtered or unexported fields
}
ListUserStarredProjectsInput defines parameters for listing starred projects.
type NamespaceOutput ¶
type NamespaceOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Kind string `json:"kind"`
FullPath string `json:"full_path"`
ParentID int64 `json:"parent_id"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
}
NamespaceOutput mirrors gl.ProjectNamespace, the namespace object embedded in project payloads on the namespace key.
type Output ¶
type Output struct {
BasicOutput
Archived bool `json:"archived"`
EmptyRepo bool `json:"empty_repo,omitempty"`
OpenIssuesCount int64 `json:"open_issues_count,omitempty"`
MergeMethod string `json:"merge_method,omitempty"`
SquashOption string `json:"squash_option,omitempty"`
AutomaticRebaseEnabled bool `json:"automatic_rebase_enabled"`
OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds"`
OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved"`
RemoveSourceBranchAfterMerge bool `json:"remove_source_branch_after_merge"`
MarkedForDeletionOn string `json:"marked_for_deletion_on,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
CreatorID int64 `json:"creator_id,omitempty"`
RequestAccessEnabled bool `json:"request_access_enabled"`
LFSEnabled bool `json:"lfs_enabled"`
CIConfigPath string `json:"ci_config_path,omitempty"`
AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline"`
MergePipelinesEnabled bool `json:"merge_pipelines_enabled" tier:"premium"`
MergeTrainsEnabled bool `json:"merge_trains_enabled" tier:"premium"`
ProtectMergeRequestPipelines *bool `json:"protect_merge_request_pipelines,omitempty"`
MergeCommitTemplate string `json:"merge_commit_template,omitempty"`
SquashCommitTemplate string `json:"squash_commit_template,omitempty"`
MRDefaultTitleTemplate string `json:"mr_default_title_template,omitempty"`
AutocloseReferencedIssues bool `json:"autoclose_referenced_issues"`
ResolveOutdatedDiffDiscussions bool `json:"resolve_outdated_diff_discussions"`
PackageRegistryAccessLevel string `json:"package_registry_access_level,omitempty"`
BuildTimeout int64 `json:"build_timeout,omitempty"`
SuggestionCommitMessage string `json:"suggestion_commit_message,omitempty"`
ComplianceFrameworks []string `json:"compliance_frameworks,omitempty" tier:"premium"`
ImportURL string `json:"import_url,omitempty"`
MergeRequestTitleRegex string `json:"merge_request_title_regex,omitempty" tier:"premium"`
MergeRequestTitleRegexDescription string `json:"merge_request_title_regex_description,omitempty" tier:"premium"`
ReviewerAssignmentStrategy string `json:"reviewer_assignment_strategy,omitempty" tier:"premium"`
// Access-level enums (1:1 SDK parity).
ContainerRegistryAccessLevel string `json:"container_registry_access_level,omitempty"`
IssuesAccessLevel string `json:"issues_access_level,omitempty"`
ReleasesAccessLevel string `json:"releases_access_level,omitempty"`
RepositoryAccessLevel string `json:"repository_access_level,omitempty"`
MergeRequestsAccessLevel string `json:"merge_requests_access_level,omitempty"`
ForkingAccessLevel string `json:"forking_access_level,omitempty"`
WikiAccessLevel string `json:"wiki_access_level,omitempty"`
BuildsAccessLevel string `json:"builds_access_level,omitempty"`
SnippetsAccessLevel string `json:"snippets_access_level,omitempty"`
PagesAccessLevel string `json:"pages_access_level,omitempty"`
AnalyticsAccessLevel string `json:"analytics_access_level,omitempty"`
EnvironmentsAccessLevel string `json:"environments_access_level,omitempty"`
FeatureFlagsAccessLevel string `json:"feature_flags_access_level,omitempty"`
InfrastructureAccessLevel string `json:"infrastructure_access_level,omitempty"`
MonitorAccessLevel string `json:"monitor_access_level,omitempty"`
RequirementsAccessLevel string `json:"requirements_access_level,omitempty" tier:"ultimate"`
SecurityAndComplianceAccessLevel string `json:"security_and_compliance_access_level,omitempty"`
ModelExperimentsAccessLevel string `json:"model_experiments_access_level,omitempty"`
ModelRegistryAccessLevel string `json:"model_registry_access_level,omitempty"`
// CI/CD settings (1:1 SDK parity).
CIDisplayPipelineVariables bool `json:"ci_display_pipeline_variables"`
AllowPipelineTriggerApproveDeployment bool `json:"allow_pipeline_trigger_approve_deployment" tier:"premium"`
PreventMergeWithoutJiraIssue bool `json:"prevent_merge_without_jira_issue" tier:"ultimate"`
PrintingMergeRequestLinkEnabled bool `json:"printing_merge_request_link_enabled"`
CICDCatalogEnabled bool `json:"cicd_catalog_enabled"`
CIDefaultGitDepth int64 `json:"ci_default_git_depth,omitempty"`
CIDeletePipelinesInSeconds int64 `json:"ci_delete_pipelines_in_seconds,omitempty"`
CIForwardDeploymentEnabled bool `json:"ci_forward_deployment_enabled"`
CIForwardDeploymentRollbackAllowed bool `json:"ci_forward_deployment_rollback_allowed"`
CIPushRepositoryForJobTokenAllowed bool `json:"ci_push_repository_for_job_token_allowed"`
CIIDTokenSubClaimComponents []string `json:"ci_id_token_sub_claim_components,omitempty"`
CISeparatedCaches bool `json:"ci_separated_caches"`
CIJobTokenScopeEnabled bool `json:"ci_job_token_scope_enabled"`
CIAllowForkPipelinesToRunInParentProject bool `json:"ci_allow_fork_pipelines_to_run_in_parent_project"`
CIRestrictPipelineCancellationRole string `json:"ci_restrict_pipeline_cancellation_role,omitempty" tier:"premium"`
CIPipelineVariablesMinimumOverrideRole string `json:"ci_pipeline_variables_minimum_override_role,omitempty"`
BuildGitStrategy string `json:"build_git_strategy,omitempty"`
AutoCancelPendingPipelines string `json:"auto_cancel_pending_pipelines,omitempty"`
AutoDevopsDeployStrategy string `json:"auto_devops_deploy_strategy,omitempty"`
AutoDevopsEnabled bool `json:"auto_devops_enabled"`
KeepLatestArtifact bool `json:"keep_latest_artifact"`
MergeTrainsSkipTrainAllowed bool `json:"merge_trains_skip_train_allowed" tier:"premium"`
PublicJobs bool `json:"public_jobs"`
MaxArtifactsSize int64 `json:"max_artifacts_size,omitempty"`
// Mirror settings (1:1 SDK parity).
Mirror bool `json:"mirror" tier:"premium"`
MirrorUserID int64 `json:"mirror_user_id,omitempty" tier:"premium"`
MirrorTriggerBuilds bool `json:"mirror_trigger_builds" tier:"premium"`
OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches" tier:"premium"`
MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches" tier:"premium"`
// Import status (1:1 SDK parity).
ImportType string `json:"import_type,omitempty"`
ImportStatus string `json:"import_status,omitempty"`
ImportError string `json:"import_error,omitempty"`
// Container registry (1:1 SDK parity).
ContainerRegistryImagePrefix string `json:"container_registry_image_prefix,omitempty"`
// Security and compliance (1:1 SDK parity).
SecurityAndComplianceEnabled bool `json:"security_and_compliance_enabled" tier:"ultimate"`
EnforceAuthChecksOnUploads bool `json:"enforce_auth_checks_on_uploads,omitempty"`
PreReceiveSecretDetectionEnabled bool `json:"pre_receive_secret_detection_enabled" tier:"ultimate"`
AutoDuoCodeReviewEnabled bool `json:"auto_duo_code_review_enabled"`
// Service desk (1:1 SDK parity).
ServiceDeskEnabled bool `json:"service_desk_enabled"`
ServiceDeskAddress string `json:"service_desk_address,omitempty"`
// Templates and misc (1:1 SDK parity).
IssuesTemplate string `json:"issues_template,omitempty" tier:"premium"`
MergeRequestsTemplate string `json:"merge_requests_template,omitempty" tier:"premium"`
IssueBranchTemplate string `json:"issue_branch_template,omitempty"`
ExternalAuthorizationClassificationLabel string `json:"external_authorization_classification_label,omitempty" tier:"premium"`
RequirementsEnabled bool `json:"requirements_enabled" tier:"ultimate"`
EmailsEnabled bool `json:"emails_enabled"`
GroupRunnersEnabled bool `json:"group_runners_enabled"`
ResourceGroupDefaultProcessMode string `json:"resource_group_default_process_mode,omitempty"`
RunnerTokenExpirationInterval int64 `json:"runner_token_expiration_interval,omitempty"`
RunnersToken string `json:"runners_token,omitempty"`
CanCreateMergeRequestIn bool `json:"can_create_merge_request_in"`
MergeRequestDefaultTargetSelf bool `json:"mr_default_target_self"`
// Nested objects (1:1 SDK parity, full mirrors).
Owner *OwnerOutput `json:"owner,omitempty"`
Permissions *PermissionsOutput `json:"permissions,omitempty"`
ForkedFromProject *ForkParentOutput `json:"forked_from_project,omitempty"`
Links *LinksOutput `json:"_links,omitempty"`
Statistics *StatisticsOutput `json:"statistics,omitempty"`
ContainerExpirationPolicy *ContainerExpirationPolicyOutput `json:"container_expiration_policy,omitempty"`
// Deprecated SDK fields, surfaced additively for 1:1 parity.
IssuesEnabled bool `json:"issues_enabled"`
MergeRequestsEnabled bool `json:"merge_requests_enabled"`
WikiEnabled bool `json:"wiki_enabled"`
JobsEnabled bool `json:"jobs_enabled"`
SnippetsEnabled bool `json:"snippets_enabled,omitempty"`
ContainerRegistryEnabled bool `json:"container_registry_enabled,omitempty"`
PackagesEnabled bool `json:"packages_enabled,omitempty"`
ApprovalsBeforeMerge int64 `json:"approvals_before_merge,omitempty" tier:"premium"`
MarkedForDeletionAt string `json:"marked_for_deletion_at,omitempty"`
RestrictUserDefinedVariables bool `json:"restrict_user_defined_variables"`
EmailsDisabled bool `json:"emails_disabled"`
// Fields API::Entities::Project sends that client-go's Project does not
// model, read from the captured response (ADR-0021). Each is a pointer
// because none of them is unconditional in practice: the four without a
// gate below are still absent whenever the caller asked for the simple
// form, and the rest are gated on a licensed feature, an ability or
// GitLab.com.
DescriptionHTML *string `json:"description_html,omitempty"`
RepositoryObjectFormat *string `json:"repository_object_format,omitempty"`
ShowDiffPreviewInEmail *bool `json:"show_diff_preview_in_email,omitempty"`
WarnAboutPotentiallyUnwantedCharacters *bool `json:"warn_about_potentially_unwanted_characters,omitempty"`
// SecretPushProtectionEnabled is gated on the read_secret_push_protection_info
// ability rather than on a license, and carries the same value as the older
// spelling PreReceiveSecretDetectionEnabled.
SecretPushProtectionEnabled *bool `json:"secret_push_protection_enabled,omitempty"`
// WebBasedCommitSigningEnabled is a GitLab.com feature (Gitlab::Saas), so a
// self-managed instance never sends it whatever its license.
WebBasedCommitSigningEnabled *bool `json:"web_based_commit_signing_enabled,omitempty"`
// MergeTrainEnforcement is one of allow_bypass, enforce_for_all_users and
// enforce_with_owner_override, as GitLab spells the setting: a string, not
// the flag it was first declared as, which no licensed answer decoded into.
MergeTrainEnforcement *string `json:"merge_train_enforcement,omitempty" tier:"premium"`
MaxPipelinesPerMergeTrain *int64 `json:"max_pipelines_per_merge_train,omitempty" tier:"premium"`
DuoRemoteFlowsEnabled *bool `json:"duo_remote_flows_enabled,omitempty" tier:"premium"`
DuoFoundationalFlowsEnabled *bool `json:"duo_foundational_flows_enabled,omitempty" tier:"premium"`
OnlyAllowMergeIfAllStatusChecksPassed *bool `json:"only_allow_merge_if_all_status_checks_passed,omitempty" tier:"ultimate"`
DuoSastFPDetectionEnabled *bool `json:"duo_sast_fp_detection_enabled,omitempty" tier:"ultimate"`
DuoSastVRWorkflowEnabled *bool `json:"duo_sast_vr_workflow_enabled,omitempty" tier:"ultimate"`
DuoSecretDetectionFPEnabled *bool `json:"duo_secret_detection_fp_enabled,omitempty" tier:"ultimate"`
DuoDependencyBumpBreakingChanges *bool `json:"duo_dependency_bump_breaking_changes_enabled,omitempty" tier:"ultimate"`
SecurityPolicyPipelineMustSucceed *bool `json:"security_policy_pipeline_must_succeed,omitempty" tier:"ultimate"`
SPPRepositoryPipelineAccess *bool `json:"spp_repository_pipeline_access,omitempty" tier:"ultimate"`
// CISkipBranchPipelinesForMRs is one of the CI/CD settings GitLab sends
// only to a caller holding admin_project on the project, from 19.4.
CISkipBranchPipelinesForMRs *bool `json:"ci_skip_branch_pipelines_for_mrs,omitempty"`
// DuoCodeReviewDecisionsEnabled is whether GitLab Duo may approve a merge
// request or ask for changes after reviewing it, sent from 19.5 while the
// duo_code_review_decisions feature flag is on for the project.
DuoCodeReviewDecisionsEnabled *bool `json:"duo_code_review_decisions_enabled,omitempty" tier:"ultimate"`
}
Output is a project as API::Entities::Project renders it: everything BasicOutput carries plus what only the full entity adds. It mirrors gl.Project field-for-field (1:1 audit policy), surfacing every scalar plus full nested objects on their canonical keys (owner, permissions, forked_from_project, _links, statistics, shared_with_groups, container_expiration_policy).
func Archive ¶
func Archive(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) (Output, error)
Archive sets a project to archived (read-only) state.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create creates a new GitLab project with the specified settings.
func CreateForUser ¶
func CreateForUser(ctx context.Context, client *gitlabclient.Client, input CreateForUserInput) (Output, error)
CreateForUser creates a new project owned by the specified user (admin operation).
func CreateForkRelation ¶
func CreateForkRelation(ctx context.Context, client *gitlabclient.Client, input CreateForkRelationInput) (Output, error)
CreateForkRelation creates a fork relation between two projects and answers with the downstream project GitLab returns.
GitLab answers POST /projects/:id/fork/:forked_from_id with the forked project, which GitLab's own generated OpenAPI document records and the end-to-end suite observed on a live 19.3 instance. client-go declares the response as ProjectForkRelation, a synthetic {id, forked_to_project_id, forked_from_project_id, created_at, updated_at} pair that no field of the real body fills, so the wrapper decoded five zero values out of a project and this action published them. The request is therefore issued directly, into gl.Project, and the action returns the project the endpoint answers with, the same Output every other project action returns. Recorded in docs/development/upstream-bugs.md.
func Restore ¶
func Restore(ctx context.Context, client *gitlabclient.Client, input RestoreInput) (Output, error)
Restore restores a GitLab project that has been marked for deletion.
func ToOutput ¶
func ToOutput(p *gl.Project, extra toolutil.ProjectExtra) Output
ToOutput converts a GitLab API gl.Project the way API::Entities::Project renders it: everything ToBasicOutput carries, every other SDK field with full nested objects on their canonical keys (owner, permissions, forked_from_project, _links, statistics, shared_with_groups, container_expiration_policy), and the eighteen keys client-go does not model, read from the captured response.
func Unarchive ¶
func Unarchive(ctx context.Context, client *gitlabclient.Client, input UnarchiveInput) (Output, error)
Unarchive removes the archived (read-only) state from a project.
func Unstar ¶
func Unstar(ctx context.Context, client *gitlabclient.Client, input UnstarInput) (Output, error)
Unstar removes the star from a project for the authenticated user.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update modifies settings on an existing GitLab project.
func UploadAvatar ¶
func UploadAvatar(ctx context.Context, client *gitlabclient.Client, input UploadAvatarInput) (Output, error)
UploadAvatar uploads or replaces the avatar for a project. Accepts either file_path (local file) or content_base64 (base64-encoded string).
type OwnerOutput ¶
type OwnerOutput struct {
ID int64 `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
State string `json:"state"`
Locked bool `json:"locked"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
PublicEmail string `json:"public_email,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
OwnerOutput is a documented reference subset of the project owner object.
Documented reference subset per doc/api/projects.md (`owner.*` attribute table): id, username, public_email, name, state, locked, avatar_url, web_url, created_at. The owner key is a *gl.User in the SDK, but the project payload surfaces only this identity subset rather than the full user record, so the remaining administrative gl.User fields (bio, projects_limit, identities, is_admin, etc.) are intentionally not mirrored here.
type PermissionsOutput ¶
type PermissionsOutput struct {
ProjectAccess *AccessOutput `json:"project_access"`
GroupAccess *AccessOutput `json:"group_access"`
}
PermissionsOutput mirrors gl.Permissions, the permissions object.
type ProjectGroupOutput ¶
type ProjectGroupOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
AvatarURL string `json:"avatar_url,omitempty"`
WebURL string `json:"web_url,omitempty"`
FullName string `json:"full_name"`
FullPath string `json:"full_path"`
}
ProjectGroupOutput represents a group associated with a project.
type ProjectUserOutput ¶
type ProjectUserOutput = toolutil.UserBasicOutput
ProjectUserOutput represents a project user. It is an alias rather than a copy because the route presents API::Entities::UserBasic, which toolutil.UserBasicOutput already declares key for key, and a second declaration of one entity is how locked and public_email went missing here in the first place.
type ProtectedBranchRefOutput ¶
ProtectedBranchRefOutput mirrors the compact identity subset of gl.ProtectedBranch surfaced in an approval rule's protected_branches array.
type PullMirrorOutput ¶
type PullMirrorOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Enabled bool `json:"enabled"`
URL string `json:"url,omitempty"`
UpdateStatus string `json:"update_status,omitempty"`
LastError string `json:"last_error,omitempty"`
LastSuccessfulUpdateAt string `json:"last_successful_update_at,omitempty"`
LastUpdateAt string `json:"last_update_at,omitempty"`
LastUpdateStartedAt string `json:"last_update_started_at,omitempty"`
MirrorTriggerBuilds bool `json:"mirror_trigger_builds"`
OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"`
MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"`
MirrorBranchRegex string `json:"mirror_branch_regex,omitempty"`
}
PullMirrorOutput holds pull mirror configuration details.
func ConfigurePullMirror ¶
func ConfigurePullMirror(ctx context.Context, client *gitlabclient.Client, input ConfigurePullMirrorInput) (PullMirrorOutput, error)
ConfigurePullMirror sets up or updates pull mirroring for a project.
A configuration that arms mirror_overwrites_diverged_branches is confirmed first: see [confirmDivergedOverwrite] for which calls that covers and why the rest are not destructive.
func GetPullMirror ¶
func GetPullMirror(ctx context.Context, client *gitlabclient.Client, input GetPullMirrorInput) (PullMirrorOutput, error)
GetPullMirror retrieves pull mirror configuration for a project.
type PushRuleOutput ¶
type PushRuleOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
ProjectID int64 `json:"project_id"`
CommitMessageRegex string `json:"commit_message_regex,omitempty"`
CommitMessageNegativeRegex string `json:"commit_message_negative_regex,omitempty"`
BranchNameRegex string `json:"branch_name_regex,omitempty"`
DenyDeleteTag bool `json:"deny_delete_tag"`
MemberCheck bool `json:"member_check"`
PreventSecrets bool `json:"prevent_secrets"`
AuthorEmailRegex string `json:"author_email_regex,omitempty"`
FileNameRegex string `json:"file_name_regex,omitempty"`
MaxFileSize int64 `json:"max_file_size"`
CommitCommitterCheck bool `json:"commit_committer_check"`
CommitCommitterNameCheck bool `json:"commit_committer_name_check"`
RejectUnsignedCommits bool `json:"reject_unsigned_commits"`
RejectNonDCOCommits bool `json:"reject_non_dco_commits"`
CreatedAt string `json:"created_at,omitempty"`
}
PushRuleOutput represents a project's push rule configuration.
func AddPushRule ¶
func AddPushRule(ctx context.Context, client *gitlabclient.Client, input AddPushRuleInput) (PushRuleOutput, error)
AddPushRule adds push rule configuration to a project.
func EditPushRule ¶
func EditPushRule(ctx context.Context, client *gitlabclient.Client, input EditPushRuleInput) (PushRuleOutput, error)
EditPushRule modifies the push rule configuration for a project.
func GetPushRules ¶
func GetPushRules(ctx context.Context, client *gitlabclient.Client, input GetPushRulesInput) (PushRuleOutput, error)
GetPushRules retrieves the push rule configuration for a project.
type RepositoryStorageOutput ¶
type RepositoryStorageOutput struct {
toolutil.HintableOutput
ProjectID int64 `json:"project_id"`
DiskPath string `json:"disk_path"`
RepositoryStorage string `json:"repository_storage"`
CreatedAt string `json:"created_at,omitempty"`
}
RepositoryStorageOutput holds repository storage information.
func GetRepositoryStorage ¶
func GetRepositoryStorage(ctx context.Context, client *gitlabclient.Client, input GetRepositoryStorageInput) (RepositoryStorageOutput, error)
GetRepositoryStorage retrieves repository storage information for a project.
type RestoreInput ¶
type RestoreInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path of the project marked for deletion,required"`
}
RestoreInput defines parameters for restoring a project marked for deletion.
type SetCustomHeaderInput ¶
type SetCustomHeaderInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
Key string `json:"key" jsonschema:"Custom header key name,required"`
Value string `json:"value" jsonschema:"Custom header value,required"`
}
SetCustomHeaderInput defines parameters for setting a custom header on a webhook.
type SetWebhookURLVariableInput ¶
type SetWebhookURLVariableInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
Key string `json:"key" jsonschema:"URL variable key name. Letters and underscores only. GitLab rejects keys containing digits,required"`
Value string `json:"value" jsonschema:"URL variable value. Must be non-empty,required"`
}
SetWebhookURLVariableInput defines parameters for setting a URL variable on a webhook.
type ShareProjectInput ¶
type ShareProjectInput struct {
}
ShareProjectInput defines parameters for sharing a project with a group.
type ShareProjectOutput ¶
type ShareProjectOutput struct {
}
ShareProjectOutput holds the result of sharing a project: the sentence this server composes, and the link GitLab created (Entities::ProjectGroupLink), which client-go's ShareProjectWithGroup does not decode and is read from the captured response (ADR-0021); the gap is recorded in docs/development/upstream-bugs.md. member_role_id is sent when the project can carry a custom role on the link, which is an Ultimate feature.
func ShareProjectWithGroup ¶
func ShareProjectWithGroup(ctx context.Context, client *gitlabclient.Client, input ShareProjectInput) (ShareProjectOutput, error)
ShareProjectWithGroup shares a project with the given group.
type SharedWithGroupOutput ¶
type SharedWithGroupOutput struct {
}
SharedWithGroupOutput mirrors gl.ProjectSharedWithGroup, an element of the shared_with_groups array.
type StarInput ¶
type StarInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
StarInput defines parameters for starring a project.
type StarrerOutput ¶
type StarrerOutput struct {
StarredSince string `json:"starred_since"`
User ProjectUserOutput `json:"user"`
}
StarrerOutput represents a user who starred a project.
type StartHousekeepingInput ¶
type StartHousekeepingInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
StartHousekeepingInput defines parameters for triggering project housekeeping.
type StartMirroringInput ¶
type StartMirroringInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
StartMirroringInput defines parameters for triggering a mirror pull.
type StatisticsOutput ¶
type StatisticsOutput struct {
CommitCount int64 `json:"commit_count"`
StorageSize int64 `json:"storage_size"`
RepositorySize int64 `json:"repository_size"`
WikiSize int64 `json:"wiki_size"`
LFSObjectsSize int64 `json:"lfs_objects_size"`
JobArtifactsSize int64 `json:"job_artifacts_size"`
PipelineArtifactsSize int64 `json:"pipeline_artifacts_size"`
PackagesSize int64 `json:"packages_size"`
SnippetsSize int64 `json:"snippets_size"`
UploadsSize int64 `json:"uploads_size"`
ContainerRegistrySize int64 `json:"container_registry_size"`
}
StatisticsOutput mirrors gl.Statistics, the project statistics object.
type TargetBranchRuleOutput ¶
type TargetBranchRuleOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
TargetBranch string `json:"target_branch"`
CreatedAt string `json:"created_at,omitempty"`
}
TargetBranchRuleOutput mirrors gl.TargetBranchRule 1:1. A target branch rule maps a source-branch name pattern to a default target branch for merge requests (the "merge request target branch workflow", a Premium/Ultimate feature exposed via GitLab GraphQL).
func CreateTargetBranchRule ¶
func CreateTargetBranchRule(ctx context.Context, client *gitlabclient.Client, input CreateTargetBranchRuleInput) (TargetBranchRuleOutput, error)
CreateTargetBranchRule creates a target branch rule for a project. Premium/Ultimate. Not destructive.
type TransferInput ¶
type TransferInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Namespace string `json:"namespace" jsonschema:"Target namespace ID or path,required"`
}
TransferInput defines parameters for transferring a project to another namespace.
type TransferOutput ¶ added in v3.1.0
type TransferOutput struct {
Output
TransferQueued bool `` /* 264-byte string literal not displayed */
}
TransferOutput is the project a transfer answers with. GitLab 19.4 and later move a project in the background, so the handler reads it back until it sits in the namespace the transfer named. TransferQueued says the wait ended first, with no failure reported either, and the project is then described where it still was.
The flag is this server's own and GitLab sends nothing like it: no entity exposes the transfer state of a namespace, so whether a move has landed can only be told by comparing where the project is with where it was sent.
func Transfer ¶
func Transfer(ctx context.Context, req *mcp.CallToolRequest, client *gitlabclient.Client, input TransferInput) (TransferOutput, error)
Transfer moves a project to a different namespace and waits for the move.
GitLab 19.4 and later accept the transfer, answer with the project where it still is and move it in a background worker, so an answer that does not yet show the destination is read back until it does, for up to waitpoll.TransferBound. An older GitLab answers after the move, and its answer is returned as it is, with no read at all; so does one from 19.0 to 19.3 unless the groups_and_projects_async_transfer flag is on, and the handler tells the two apart by the answer rather than by the version.
Some checks run only in that worker (a project pending deletion with the same name or path, container registry images, npm packages scoped to the old top-level namespace, and on 19.4 the name and path collision, which 19.5 refuses with the request too), and a failure is reported only as a to-do item for the caller, so each read that does not find the project moved also looks for that item, and one dated after the transfer ends the wait with an error. From 19.5 the item carries GitLab's reason, which the error quotes ([transferFailedError]). A move that has neither landed nor been reported failed when the wait ends is answered with the project from the transfer's own answer and TransferQueued set, never as an error: GitLab accepted it, and a model told the transfer failed would send it again, which GitLab runs a second time while the first is queued and refuses while it runs.
type TriggerTestHookInput ¶
type TriggerTestHookInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID to test,required"`
Event string `` /* 324-byte string literal not displayed */
}
TriggerTestHookInput defines parameters for triggering a test webhook event.
type TriggerTestHookOutput ¶
type TriggerTestHookOutput struct {
toolutil.HintableOutput
Message string `json:"message"`
}
TriggerTestHookOutput holds the result of triggering a test webhook.
func TriggerTestHook ¶
func TriggerTestHook(ctx context.Context, client *gitlabclient.Client, input TriggerTestHookInput) (TriggerTestHookOutput, error)
TriggerTestHook triggers a test event for a project webhook.
type UnarchiveInput ¶
type UnarchiveInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
UnarchiveInput defines parameters for unarchiving a project.
type UnstarInput ¶
type UnstarInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
UnstarInput defines parameters for unstarring a project.
type UpdateApprovalRuleInput ¶
type UpdateApprovalRuleInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
RuleID int64 `json:"rule_id" jsonschema:"Approval rule ID,required"`
Name string `json:"name,omitempty" jsonschema:"Updated rule name"`
ApprovalsRequired *int64 `json:"approvals_required,omitempty" jsonschema:"Updated number of approvals required"`
UserIDs []int64 `json:"user_ids,omitempty" jsonschema:"Updated user IDs to assign as approvers"`
GroupIDs []int64 `json:"group_ids,omitempty" jsonschema:"Updated group IDs to assign as approvers"`
ProtectedBranchIDs []int64 `json:"protected_branch_ids,omitempty" jsonschema:"Updated protected branch IDs"`
Usernames []string `json:"usernames,omitempty" jsonschema:"Updated usernames to assign as approvers"`
AppliesToAllProtectedBranches *bool `json:"applies_to_all_protected_branches,omitempty" jsonschema:"Apply this rule to all protected branches"`
}
UpdateApprovalRuleInput defines parameters for updating an approval rule.
type UpdateInput ¶
type UpdateInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Name string `json:"name,omitempty" jsonschema:"New project name"`
Description *string `` /* 132-byte string literal not displayed */
Visibility string `json:"visibility,omitempty" jsonschema:"Visibility level (private, internal, public)"`
DefaultBranch string `json:"default_branch,omitempty" jsonschema:"New default branch"`
MergeMethod string `json:"merge_method,omitempty" jsonschema:"Merge method (merge, rebase_merge, ff)"`
Topics []string `` /* 141-byte string literal not displayed */
SquashOption string `json:"squash_option,omitempty" jsonschema:"Squash option (never, always, default_on, default_off)"`
AutomaticRebaseEnabled *bool `json:"automatic_rebase_enabled,omitempty" jsonschema:"Rebase the source branch automatically before merge"`
OnlyAllowMergeIfPipelineSucceeds *bool `json:"only_allow_merge_if_pipeline_succeeds,omitempty" jsonschema:"Only allow merge when pipeline succeeds"`
OnlyAllowMergeIfAllDiscussionsAreResolved *bool `` /* 129-byte string literal not displayed */
IssuesEnabled *bool `` /* 133-byte string literal not displayed */
MergeRequestsEnabled *bool `json:"merge_requests_enabled,omitempty" jsonschema:"Enable merge requests feature"`
WikiEnabled *bool `json:"wiki_enabled,omitempty" jsonschema:"Enable wiki feature"`
JobsEnabled *bool `json:"jobs_enabled,omitempty" jsonschema:"Enable CI/CD jobs"`
LFSEnabled *bool `json:"lfs_enabled,omitempty" jsonschema:"Enable Git LFS"`
RequestAccessEnabled *bool `json:"request_access_enabled,omitempty" jsonschema:"Allow users to request access"`
PublicBuilds *bool `json:"public_builds,omitempty" jsonschema:"Enable public access to pipelines"`
PackagesEnabled *bool `` /* 126-byte string literal not displayed */
PackageRegistryAccessLevel string `json:"package_registry_access_level,omitempty" jsonschema:"Package registry access level (disabled, private, enabled)"`
PagesAccessLevel string `json:"pages_access_level,omitempty" jsonschema:"Pages access level (disabled, private, enabled, public)"`
ContainerRegistryAccessLevel string `json:"container_registry_access_level,omitempty" jsonschema:"Container registry access level (disabled, private, enabled)"`
SnippetsAccessLevel string `json:"snippets_access_level,omitempty" jsonschema:"Snippets access level (disabled, private, enabled)"`
CIConfigPath *string `` /* 192-byte string literal not displayed */
AllowMergeOnSkippedPipeline *bool `json:"allow_merge_on_skipped_pipeline,omitempty" jsonschema:"Allow merge when pipeline is skipped"`
RemoveSourceBranchAfterMerge *bool `json:"remove_source_branch_after_merge,omitempty" jsonschema:"Remove source branch after merge by default"`
AutocloseReferencedIssues *bool `json:"autoclose_referenced_issues,omitempty" jsonschema:"Auto-close referenced issues on merge"`
MergeCommitTemplate *string `` /* 184-byte string literal not displayed */
SquashCommitTemplate *string `` /* 185-byte string literal not displayed */
MRDefaultTitleTemplate *string `` /* 192-byte string literal not displayed */
MergePipelinesEnabled *bool `json:"merge_pipelines_enabled,omitempty" jsonschema:"Enable merged results pipelines"`
MergeTrainsEnabled *bool `json:"merge_trains_enabled,omitempty" jsonschema:"Enable merge trains"`
ProtectMergeRequestPipelines *bool `` /* 153-byte string literal not displayed */
ResolveOutdatedDiffDiscussions *bool `json:"resolve_outdated_diff_discussions,omitempty" jsonschema:"Auto-resolve outdated diff discussions"`
ApprovalsBeforeMerge *int64 `` /* 173-byte string literal not displayed */
MergeRequestTitleRegex *string `` /* 160-byte string literal not displayed */
MergeRequestTitleRegexDescription *string `` /* 190-byte string literal not displayed */
ReviewerAssignmentStrategy string `` /* 286-byte string literal not displayed */
// Basic metadata (additive 1:1 SDK parity)
Path string `json:"path,omitempty" jsonschema:"New project path slug"`
ImportURL string `json:"import_url,omitempty" tier:"premium" jsonschema:"URL to import/mirror repository from"`
RepositoryStorage string `json:"repository_storage,omitempty" jsonschema:"Repository storage shard name (admin only)"`
TagList []string `` /* 145-byte string literal not displayed */
// Merge settings (additive)
OnlyAllowMergeIfAllStatusChecksPassed *bool `` /* 144-byte string literal not displayed */
AllowPipelineTriggerApproveDeployment *bool `` /* 133-byte string literal not displayed */
PreventMergeWithoutJiraIssue *bool `json:"prevent_merge_without_jira_issue,omitempty" tier:"ultimate" jsonschema:"Require an associated Jira issue before merge"`
MergeRequestDefaultTargetSelf *bool `json:"mr_default_target_self,omitempty" jsonschema:"Default merge request target to the project itself (for forks)"`
MergeTrainsSkipTrainAllowed *bool `json:"merge_trains_skip_train_allowed,omitempty" jsonschema:"Allow skipping the merge train"`
MergeTrainEnforcement string `` /* 239-byte string literal not displayed */
PrintingMergeRequestLinkEnabled *bool `json:"printing_merge_request_link_enabled,omitempty" jsonschema:"Show the create-merge-request link after pushing"`
SuggestionCommitMessage *string `` /* 188-byte string literal not displayed */
IssueBranchTemplate *string `` /* 192-byte string literal not displayed */
IssuesTemplate string `json:"issues_template,omitempty" tier:"premium" jsonschema:"Default issue description template"`
MergeRequestsTemplate string `json:"merge_requests_template,omitempty" tier:"premium" jsonschema:"Default merge request description template"`
// Feature toggles (additive)
SnippetsEnabled *bool `json:"snippets_enabled,omitempty" jsonschema:"Enable snippets feature (deprecated: use snippets_access_level)"`
ContainerRegistryEnabled *bool `` /* 132-byte string literal not displayed */
ServiceDeskEnabled *bool `json:"service_desk_enabled,omitempty" jsonschema:"Enable Service Desk"`
EmailsEnabled *bool `json:"emails_enabled,omitempty" jsonschema:"Enable email notifications"`
EmailsDisabled *bool `json:"emails_disabled,omitempty" jsonschema:"Disable email notifications (deprecated: use emails_enabled)"`
ShowDefaultAwardEmojis *bool `json:"show_default_award_emojis,omitempty" jsonschema:"Show default award emojis on issues/MRs"`
GroupRunnersEnabled *bool `json:"group_runners_enabled,omitempty" jsonschema:"Enable group runners"`
KeepLatestArtifact *bool `json:"keep_latest_artifact,omitempty" jsonschema:"Keep the latest artifact for each pipeline"`
BuildTimeout *int64 `json:"build_timeout,omitempty" jsonschema:"Build timeout in seconds. GitLab accepts 10 minutes to one month"`
MaxArtifactsSize *int64 `` /* 158-byte string literal not displayed */
// Auto DevOps (additive)
AutoDevopsEnabled *bool `json:"auto_devops_enabled,omitempty" jsonschema:"Enable Auto DevOps for the project"`
AutoDevopsDeployStrategy string `json:"auto_devops_deploy_strategy,omitempty" jsonschema:"Auto DevOps deploy strategy (continuous, manual, timed_incremental)"`
AutoDuoCodeReviewEnabled *bool `` /* 290-byte string literal not displayed */
// CI/CD settings (additive)
BuildGitStrategy string `json:"build_git_strategy,omitempty" jsonschema:"Git strategy for builds (fetch, clone)"`
AutoCancelPendingPipelines string `json:"auto_cancel_pending_pipelines,omitempty" jsonschema:"Auto-cancel pending pipelines (enabled, disabled)"`
CICDCatalogEnabled *bool `json:"cicd_catalog_enabled,omitempty" jsonschema:"Publish the project as a CI/CD catalog resource"`
CIDefaultGitDepth *int64 `` /* 168-byte string literal not displayed */
CIDeletePipelinesInSeconds *int64 `` /* 195-byte string literal not displayed */
CIDisplayPipelineVariables *bool `json:"ci_display_pipeline_variables,omitempty" jsonschema:"Display pipeline variables in the UI"`
CIForwardDeploymentEnabled *bool `json:"ci_forward_deployment_enabled,omitempty" jsonschema:"Enable CI/CD forward deployment (skip outdated jobs)"`
CIForwardDeploymentRollbackAllowed *bool `json:"ci_forward_deployment_rollback_allowed,omitempty" jsonschema:"Allow job retries even for outdated deployment jobs"`
CIPushRepositoryForJobTokenAllowed *bool `json:"ci_push_repository_for_job_token_allowed,omitempty" jsonschema:"Allow CI job tokens to push to the repository"`
CIIDTokenSubClaimComponents []string `json:"ci_id_token_sub_claim_components,omitempty" jsonschema:"Components used to build the CI ID token sub claim"`
CISeparatedCaches *bool `json:"ci_separated_caches,omitempty" jsonschema:"Use separate caches for protected branches"`
CIRestrictPipelineCancellationRole string `` /* 154-byte string literal not displayed */
CIPipelineVariablesMinimumOverrideRole string `` /* 172-byte string literal not displayed */
RestrictUserDefinedVariables *bool `` /* 164-byte string literal not displayed */
ResourceGroupDefaultProcessMode string `` /* 141-byte string literal not displayed */
PublicJobs *bool `json:"public_jobs,omitempty" jsonschema:"Enable public access to pipelines"`
// Mirroring (additive)
Mirror *bool `json:"mirror,omitempty" tier:"premium" jsonschema:"Enable pull mirroring from import_url"`
MirrorTriggerBuilds *bool `json:"mirror_trigger_builds,omitempty" tier:"premium" jsonschema:"Trigger pipelines for mirror updates"`
MirrorBranchRegex string `json:"mirror_branch_regex,omitempty" tier:"premium" jsonschema:"Only mirror branches matching this regex"`
MirrorOverwritesDivergedBranches *bool `json:"mirror_overwrites_diverged_branches,omitempty" tier:"premium" jsonschema:"Overwrite diverged branches when mirroring"`
MirrorUserID *int64 `json:"mirror_user_id,omitempty" tier:"premium" jsonschema:"User ID used to run mirror updates (admin only)"`
OnlyMirrorProtectedBranches *bool `json:"only_mirror_protected_branches,omitempty" tier:"premium" jsonschema:"Only mirror protected branches"`
// Container registry cleanup (additive)
ContainerExpirationPolicyAttributes *ContainerExpirationPolicyInput `json:"container_expiration_policy_attributes,omitempty" jsonschema:"Container registry cleanup policy attributes"`
// Compliance and security (additive)
EnforceAuthChecksOnUploads *bool `json:"enforce_auth_checks_on_uploads,omitempty" jsonschema:"Enforce authorization checks on uploads"`
ExternalAuthorizationClassificationLabel *string `` /* 205-byte string literal not displayed */
// Access control (additive)
IssuesAccessLevel string `json:"issues_access_level,omitempty" jsonschema:"Issues access level (disabled, private, enabled)"`
MergeRequestsAccessLevel string `json:"merge_requests_access_level,omitempty" jsonschema:"Merge requests access level (disabled, private, enabled)"`
WikiAccessLevel string `json:"wiki_access_level,omitempty" jsonschema:"Wiki access level (disabled, private, enabled)"`
BuildsAccessLevel string `json:"builds_access_level,omitempty" jsonschema:"CI/CD builds access level (disabled, private, enabled)"`
RepositoryAccessLevel string `json:"repository_access_level,omitempty" jsonschema:"Repository access level (disabled, private, enabled)"`
ForkingAccessLevel string `json:"forking_access_level,omitempty" jsonschema:"Forking access level (disabled, private, enabled)"`
AnalyticsAccessLevel string `json:"analytics_access_level,omitempty" jsonschema:"Analytics access level (disabled, private, enabled)"`
ReleasesAccessLevel string `json:"releases_access_level,omitempty" jsonschema:"Releases access level (disabled, private, enabled)"`
EnvironmentsAccessLevel string `json:"environments_access_level,omitempty" jsonschema:"Environments access level (disabled, private, enabled)"`
FeatureFlagsAccessLevel string `json:"feature_flags_access_level,omitempty" jsonschema:"Feature flags access level (disabled, private, enabled)"`
InfrastructureAccessLevel string `json:"infrastructure_access_level,omitempty" jsonschema:"Infrastructure access level (disabled, private, enabled)"`
MonitorAccessLevel string `json:"monitor_access_level,omitempty" jsonschema:"Monitor access level (disabled, private, enabled)"`
RequirementsAccessLevel string `json:"requirements_access_level,omitempty" jsonschema:"Requirements access level (disabled, private, enabled)"`
SecurityAndComplianceAccessLevel string `` /* 132-byte string literal not displayed */
ModelExperimentsAccessLevel string `json:"model_experiments_access_level,omitempty" jsonschema:"Model experiments access level (disabled, private, enabled)"`
ModelRegistryAccessLevel string `json:"model_registry_access_level,omitempty" jsonschema:"Model registry access level (disabled, private, enabled)"`
// RemoveAvatar sends avatar as an empty value, which PUT /projects/:id
// maps to CarrierWave's remove_avatar (lib/api/projects.rb). A new
// image goes through project.upload_avatar.
RemoveAvatar bool `json:"remove_avatar,omitempty" jsonschema:"Remove the project's avatar. To replace it instead, use project.upload_avatar"`
}
UpdateInput defines parameters for updating project settings.
type UploadAvatarInput ¶
type UploadAvatarInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Filename string `json:"filename" jsonschema:"Avatar filename (e.g. avatar.png),required"`
FilePath string `` /* 233-byte string literal not displayed */
ContentBase64 string `` /* 134-byte string literal not displayed */
}
UploadAvatarInput defines parameters for uploading a project avatar. Exactly one of FilePath or ContentBase64 must be provided.