Documentation
¶
Overview ¶
Package groups implements MCP tools for GitLab group operations.
The package wraps client-go group APIs for listing groups, retrieving group details, listing members and subgroups, and managing group webhooks through list, get, add, edit, and delete operations. It also provides Markdown formatting for group tool outputs.
Group-adjacent domains such as labels, milestones, boards, variables, service accounts, SAML, LDAP, protected environments, protected branches, epics, group wikis, and group releases live in dedicated sibling packages and share the same catalog-first registration path.
GitLab API References ¶
The package wraps the GitLab Groups API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func Archive(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) error
- func ArchiveOutput(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) (toolutil.DeleteOutput, error)
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func DeleteHook(ctx context.Context, client *gitlabclient.Client, input DeleteHookInput) error
- func DeleteHookCustomHeader(ctx context.Context, client *gitlabclient.Client, ...) error
- func DeleteHookURLVariable(ctx context.Context, client *gitlabclient.Client, ...) 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 FormatDetailOutputMarkdown(g DetailOutput) string
- func FormatHookListMarkdown(out HookListOutput) string
- func FormatHookMarkdown(h HookOutput) string
- func FormatListMarkdown(out ListOutput) string
- func FormatListProjectsMarkdown(out ListProjectsOutput) string
- func FormatMemberListMarkdown(out MemberListOutput) string
- func FormatOutputMarkdown(g Output) string
- func FormatProvisionedUsersListMarkdown(out ProvisionedUsersListOutput) string
- func FormatPushRuleMarkdown(r PushRuleOutput) string
- func FormatShareGroupMarkdown(out ShareGroupOutput) string
- func FormatSharedProjectsListMarkdown(out SharedProjectsListOutput) string
- func FormatTransferLocationsListMarkdown(out TransferLocationsListOutput) string
- func FormatTransferSubGroupMarkdown(out TransferSubGroupOutput) string
- func ResendHookEvent(ctx context.Context, client *gitlabclient.Client, input ResendHookEventInput) error
- func ResendHookEventOutput(ctx context.Context, client *gitlabclient.Client, input ResendHookEventInput) (toolutil.VoidOutput, error)
- func SetHookCustomHeader(ctx context.Context, client *gitlabclient.Client, ...) error
- func SetHookCustomHeaderOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func SetHookURLVariable(ctx context.Context, client *gitlabclient.Client, ...) error
- func SetHookURLVariableOutput(ctx context.Context, client *gitlabclient.Client, ...) (toolutil.VoidOutput, error)
- func TestHook(ctx context.Context, client *gitlabclient.Client, input TestHookInput) error
- func TestHookOutput(ctx context.Context, client *gitlabclient.Client, input TestHookInput) (toolutil.VoidOutput, error)
- func Unarchive(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) error
- func UnarchiveOutput(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) (toolutil.DeleteOutput, error)
- func UnshareGroupFromGroup(ctx context.Context, client *gitlabclient.Client, input UnshareGroupInput) error
- type AddHookInput
- type AddPushRuleInput
- type ArchiveInput
- type AvatarInput
- type BranchProtectionDefaults
- type BranchProtectionDefaultsInput
- type CreateInput
- type CustomAttributeOutput
- type DeleteHookCustomHeaderInput
- type DeleteHookInput
- type DeleteHookURLVariableInput
- type DeleteInput
- type DeletePushRuleInput
- type DetailOutput
- func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (DetailOutput, error)
- func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (DetailOutput, error)
- func Restore(ctx context.Context, client *gitlabclient.Client, input RestoreInput) (DetailOutput, error)
- func ToDetailOutput(g *gl.Group, extra toolutil.GroupDetailExtra) DetailOutput
- func TransferProject(ctx context.Context, client *gitlabclient.Client, input TransferInput) (DetailOutput, error)
- func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (DetailOutput, error)
- func UploadAvatar(ctx context.Context, client *gitlabclient.Client, input UploadAvatarInput) (DetailOutput, error)
- type EditHookInput
- type EditPushRuleInput
- type GetHookInput
- type GetInput
- type GetPushRulesInput
- type GroupAccessLevelOutput
- type HookCustomHeaderInput
- type HookCustomHeaderOutput
- type HookInput
- type HookListOutput
- 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 InvitedListInput
- type LDAPGroupLinkOutput
- type ListHooksInput
- type ListInput
- type ListOutput
- func InvitedList(ctx context.Context, client *gitlabclient.Client, input InvitedListInput) (ListOutput, error)
- func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
- func Search(ctx context.Context, client *gitlabclient.Client, input SearchInput) (ListOutput, error)
- func SharedWithList(ctx context.Context, client *gitlabclient.Client, input SharedWithListInput) (ListOutput, error)
- func SubgroupsList(ctx context.Context, client *gitlabclient.Client, input SubgroupsListInput) (ListOutput, error)
- type ListProjectsInput
- type ListProjectsOutput
- type ListProvisionedUsersInput
- type ListSharedProjectsInput
- type MemberListOutput
- type MemberOutput
- type MemberRoleOutput
- type MemberUserOutput
- type MembersListInput
- type Output
- type ProjectItem
- type ProvisionedUserBasicUser
- type ProvisionedUserCustomAttribute
- type ProvisionedUserIdentity
- type ProvisionedUserOutput
- type ProvisionedUserSCIMIdentity
- type ProvisionedUsersListOutput
- 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 ResendHookEventInput
- type RestoreInput
- type RootStorageStatisticsOutput
- type SAMLGroupLinkOutput
- type SAMLIdentityOutput
- type SCIMIdentityOutput
- type SearchInput
- type SetHookCustomHeaderInput
- type SetHookURLVariableInput
- type ShareGroupInput
- type ShareGroupOutput
- type SharedProjectsListOutput
- type SharedWithGroupOutput
- type SharedWithListInput
- type StatisticsOutput
- type SubgroupsListInput
- type TestHookInput
- type TransferInput
- type TransferLocationOutput
- type TransferLocationsListInput
- type TransferLocationsListOutput
- type TransferSubGroupInput
- type TransferSubGroupOutput
- type UnshareGroupInput
- type UpdateInput
- type UploadAvatarInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionSpecs ¶
func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
ActionSpecs returns canonical specs for core group and group hook actions.
func Archive ¶
func Archive(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) error
Archive archives a GitLab group. Requires Owner role or administrator.
func ArchiveOutput ¶
func ArchiveOutput(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) (toolutil.DeleteOutput, error)
ArchiveOutput archives a GitLab group and returns the legacy success message shape.
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes a GitLab group.
func DeleteHook ¶
func DeleteHook(ctx context.Context, client *gitlabclient.Client, input DeleteHookInput) error
DeleteHook removes a webhook from a group.
func DeleteHookCustomHeader ¶
func DeleteHookCustomHeader(ctx context.Context, client *gitlabclient.Client, input DeleteHookCustomHeaderInput) error
DeleteHookCustomHeader removes a custom header from a group webhook.
func DeleteHookURLVariable ¶
func DeleteHookURLVariable(ctx context.Context, client *gitlabclient.Client, input DeleteHookURLVariableInput) error
DeleteHookURLVariable removes a templated URL variable from a group webhook.
func DeletePushRule ¶
func DeletePushRule(ctx context.Context, client *gitlabclient.Client, input DeletePushRuleInput) error
DeletePushRule deletes the push-rule configuration from a group.
func DeletePushRuleOutput ¶
func DeletePushRuleOutput(ctx context.Context, client *gitlabclient.Client, input DeletePushRuleInput) (toolutil.DeleteOutput, error)
DeletePushRuleOutput deletes a group's push rules and returns the legacy success message shape.
func FormatDetailOutputMarkdown ¶ added in v3.1.0
func FormatDetailOutputMarkdown(g DetailOutput) string
FormatDetailOutputMarkdown renders a group as a route that answers with one group returns it. The registry keys a formatter by its Go type, so DetailOutput needs its own even though it embeds Output: without it the group get, create, update, restore and transfer_project tools would fall through to no formatter at all.
runners_token is deliberately absent. It is a live credential, and this package renders into a conversation transcript; the JSON keeps it for a caller that needs it, which is the decision internal/tools/invites already took for invite_token and the reasoning is the same.
func FormatHookListMarkdown ¶
func FormatHookListMarkdown(out HookListOutput) string
FormatHookListMarkdown renders a paginated list of group hooks as a Markdown table.
func FormatHookMarkdown ¶
func FormatHookMarkdown(h HookOutput) string
FormatHookMarkdown renders a single group hook as its card. The URL variables and the custom headers are written as their keys with every value redacted: both are secrets GitLab masks on read, and the key is what says which ones are set.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a list of groups as a Markdown table.
func FormatListProjectsMarkdown ¶
func FormatListProjectsMarkdown(out ListProjectsOutput) string
FormatListProjectsMarkdown renders a list of group projects as a Markdown table.
func FormatMemberListMarkdown ¶
func FormatMemberListMarkdown(out MemberListOutput) string
FormatMemberListMarkdown renders a list of group members as a Markdown table.
The state column is the user account's state (active, blocked, deactivated, banned), which is not the membership's own state; the membership column is written only when GitLab sent one, since it is an Enterprise field.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single group as its card.
func FormatProvisionedUsersListMarkdown ¶
func FormatProvisionedUsersListMarkdown(out ProvisionedUsersListOutput) string
FormatProvisionedUsersListMarkdown renders a paginated list of users provisioned for a group through SAML/SCIM as a Markdown table.
func FormatPushRuleMarkdown ¶
func FormatPushRuleMarkdown(r PushRuleOutput) string
FormatPushRuleMarkdown renders a group's push-rule configuration as its card.
func FormatShareGroupMarkdown ¶
func FormatShareGroupMarkdown(out ShareGroupOutput) string
FormatShareGroupMarkdown renders the result of a group-to-group share as the card of what was created: the confirmation is the heading, and the share's own fields are the rows.
func FormatSharedProjectsListMarkdown ¶
func FormatSharedProjectsListMarkdown(out SharedProjectsListOutput) string
FormatSharedProjectsListMarkdown renders the projects shared with a group.
func FormatTransferLocationsListMarkdown ¶
func FormatTransferLocationsListMarkdown(out TransferLocationsListOutput) string
FormatTransferLocationsListMarkdown renders the candidate parent groups for a group transfer.
func FormatTransferSubGroupMarkdown ¶ added in v3.1.0
func FormatTransferSubGroupMarkdown(out TransferSubGroupOutput) string
FormatTransferSubGroupMarkdown renders what a group transfer answered. A move that landed is the group's own card, under its new parent; one the wait did not see land says so in its heading and a note, since its rows are the place the group is leaving, and its hints are the reads that settle where it ends up.
func ResendHookEvent ¶
func ResendHookEvent(ctx context.Context, client *gitlabclient.Client, input ResendHookEventInput) error
ResendHookEvent resends a specific previously-delivered group hook event.
func ResendHookEventOutput ¶
func ResendHookEventOutput(ctx context.Context, client *gitlabclient.Client, input ResendHookEventInput) (toolutil.VoidOutput, error)
ResendHookEventOutput resends a group hook event and returns the legacy success message shape.
func SetHookCustomHeader ¶
func SetHookCustomHeader(ctx context.Context, client *gitlabclient.Client, input SetHookCustomHeaderInput) error
SetHookCustomHeader creates or updates a custom header on a group webhook.
func SetHookCustomHeaderOutput ¶
func SetHookCustomHeaderOutput(ctx context.Context, client *gitlabclient.Client, input SetHookCustomHeaderInput) (toolutil.VoidOutput, error)
SetHookCustomHeaderOutput sets a group webhook custom header and returns the legacy success message shape.
func SetHookURLVariable ¶
func SetHookURLVariable(ctx context.Context, client *gitlabclient.Client, input SetHookURLVariableInput) error
SetHookURLVariable creates or updates a templated URL variable on a group webhook.
func SetHookURLVariableOutput ¶
func SetHookURLVariableOutput(ctx context.Context, client *gitlabclient.Client, input SetHookURLVariableInput) (toolutil.VoidOutput, error)
SetHookURLVariableOutput sets a group webhook URL variable and returns the legacy success message shape.
func TestHook ¶
func TestHook(ctx context.Context, client *gitlabclient.Client, input TestHookInput) error
TestHook triggers a test event for a group webhook.
func TestHookOutput ¶
func TestHookOutput(ctx context.Context, client *gitlabclient.Client, input TestHookInput) (toolutil.VoidOutput, error)
TestHookOutput triggers a test group hook event and returns the legacy success message shape.
func Unarchive ¶
func Unarchive(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) error
Unarchive unarchives a GitLab group. Requires Owner role or administrator.
func UnarchiveOutput ¶
func UnarchiveOutput(ctx context.Context, client *gitlabclient.Client, input ArchiveInput) (toolutil.DeleteOutput, error)
UnarchiveOutput unarchives a GitLab group and returns the legacy success message shape.
func UnshareGroupFromGroup ¶
func UnshareGroupFromGroup(ctx context.Context, client *gitlabclient.Client, input UnshareGroupInput) error
UnshareGroupFromGroup removes a group-to-group share.
Types ¶
type AddHookInput ¶
type AddHookInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
// URL shadows the shared field, so the schema of a new hook can say what
// GitLab says of it: POST /groups/:id/hooks requires url, and the edit
// that shares the other fields does not.
URL string `json:"url" jsonschema:"Webhook URL,required"`
HookInput
}
AddHookInput defines parameters for adding a new group hook.
type AddPushRuleInput ¶
type AddPushRuleInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group 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 group 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 group 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 group.
type ArchiveInput ¶
type ArchiveInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
ArchiveInput defines parameters for archiving or unarchiving a group.
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 group create uploads as the new group's avatar, as gl.GroupAvatar carries it: the file name GitLab reads the image type from, and the content, from a local file or as base64.
type BranchProtectionDefaults ¶
type BranchProtectionDefaults struct {
AllowedToPush []GroupAccessLevelOutput `json:"allowed_to_push,omitempty"`
AllowForcePush bool `json:"allow_force_push,omitempty"`
AllowedToMerge []GroupAccessLevelOutput `json:"allowed_to_merge,omitempty"`
DeveloperCanInitialPush bool `json:"developer_can_initial_push,omitempty"`
CodeOwnerApprovalRequired bool `json:"code_owner_approval_required,omitempty"`
}
BranchProtectionDefaults mirrors gl.BranchProtectionDefaults (the default_branch_protection_defaults object).
type BranchProtectionDefaultsInput ¶
type BranchProtectionDefaultsInput struct {
AllowedToPush []int `` /* 155-byte string literal not displayed */
AllowForcePush *bool `json:"allow_force_push,omitempty" jsonschema:"Allow force push on the default branch"`
AllowedToMerge []int `` /* 156-byte string literal not displayed */
DeveloperCanInitialPush *bool `json:"developer_can_initial_push,omitempty" jsonschema:"Allow developers to make the initial push to the default branch"`
CodeOwnerApprovalRequired *bool `json:"code_owner_approval_required,omitempty" jsonschema:"Require code owner approval before merging into the default branch"`
}
BranchProtectionDefaultsInput mirrors gl.DefaultBranchProtectionDefaultsOptions (the default_branch_protection_defaults object on create/update). Access levels in allowed_to_push / allowed_to_merge are given as a list of integer access levels; GitLab applies the highest provided level.
type CreateInput ¶
type CreateInput struct {
Name string `json:"name" jsonschema:"Group name,required"`
Path string `json:"path,omitempty" jsonschema:"Group URL path,required"`
Description string `json:"description,omitempty" jsonschema:"Group description"`
Visibility string `json:"visibility,omitempty" jsonschema:"Visibility level (private, internal, public)"`
ParentID int64 `json:"parent_id,omitempty" jsonschema:"Parent group ID (creates a subgroup)"`
OrganizationID *int64 `` /* 158-byte string literal not displayed */
RequestAccessEnabled *bool `json:"request_access_enabled,omitempty" jsonschema:"Allow users to request access"`
LFSEnabled *bool `json:"lfs_enabled,omitempty" jsonschema:"Enable Git LFS"`
DefaultBranch string `json:"default_branch,omitempty" jsonschema:"Default branch name"`
MathRenderingLimitsEnabled *bool `json:"math_rendering_limits_enabled,omitempty" jsonschema:"Enable math rendering limits"`
WebBasedCommitSigningEnabled *bool `json:"web_based_commit_signing_enabled,omitempty" jsonschema:"Enable web-based commit signing for projects in this group"`
AllowPersonalSnippets *bool `json:"allow_personal_snippets,omitempty" jsonschema:"Allow members to create personal snippets"`
CRMEnabled *bool `json:"crm_enabled,omitempty" jsonschema:"Enable Customer Relations Management (CRM) for the group"`
AutoDevopsEnabled *bool `json:"auto_devops_enabled,omitempty" jsonschema:"Enable Auto DevOps for projects in this group"`
DefaultBranchProtection *int64 `` /* 210-byte string literal not displayed */
DefaultBranchProtectionDefaults *BranchProtectionDefaultsInput `json:"default_branch_protection_defaults,omitempty" jsonschema:"Default branch protection settings object"`
DuoAvailability string `` /* 212-byte string literal not displayed */
EmailsEnabled *bool `json:"emails_enabled,omitempty" jsonschema:"Enable email notifications"`
EmailsDisabled *bool `` /* 127-byte string literal not displayed */
EnabledGitAccessProtocol string `json:"enabled_git_access_protocol,omitempty" jsonschema:"Allowed Git access protocol (ssh, http, all)"`
ExperimentFeaturesEnabled *bool `json:"experiment_features_enabled,omitempty" jsonschema:"Enable experimental features"`
MembershipLock *bool `json:"membership_lock,omitempty" jsonschema:"Prevent members from being added to projects in this group"`
MentionsDisabled *bool `json:"mentions_disabled,omitempty" jsonschema:"Disable @-mention notifications"`
ProjectCreationLevel string `json:"project_creation_level,omitempty" jsonschema:"Who can create projects (noone, maintainer, developer)"`
RequireTwoFactorAuth *bool `json:"require_two_factor_authentication,omitempty" jsonschema:"Require two-factor authentication for members"`
SubGroupCreationLevel string `json:"subgroup_creation_level,omitempty" jsonschema:"Who can create subgroups (owner, maintainer)"`
TwoFactorGracePeriod *int64 `` /* 131-byte string literal not displayed */
WikiAccessLevel string `` /* 126-byte string literal not displayed */
UniqueProjectDownloadLimit *int64 `` /* 178-byte string literal not displayed */
UniqueProjectDownloadLimitIntervalInSeconds *int64 `` /* 169-byte string literal not displayed */
UniqueProjectDownloadLimitAllowlist []string `` /* 166-byte string literal not displayed */
UniqueProjectDownloadLimitAlertlist []int64 `` /* 177-byte string literal not displayed */
AutoBanUserOnExcessiveProjectsDownload *bool `` /* 177-byte string literal not displayed */
// Avatar is uploaded with the create, which GitLab takes only as a
// multipart form.
Avatar *AvatarInput `` /* 357-byte string literal not displayed */
}
CreateInput defines parameters for creating a group.
type CustomAttributeOutput ¶
CustomAttributeOutput mirrors gl.CustomAttribute (a custom_attributes entry).
type DeleteHookCustomHeaderInput ¶
type DeleteHookCustomHeaderInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group 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"`
}
DeleteHookCustomHeaderInput defines parameters for deleting a custom header from a group webhook.
type DeleteHookInput ¶
type DeleteHookInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Hook ID to delete,required"`
}
DeleteHookInput defines parameters for deleting a group hook.
type DeleteHookURLVariableInput ¶
type DeleteHookURLVariableInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group 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"`
}
DeleteHookURLVariableInput defines parameters for deleting a URL variable from a group webhook.
type DeleteInput ¶
type DeleteInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
PermanentlyRemove bool `json:"permanently_remove,omitempty" jsonschema:"Permanently remove instead of marking for deletion"`
FullPath string `json:"full_path,omitempty" jsonschema:"Full path (required when permanently_remove=true)"`
}
DeleteInput defines parameters for deleting a group.
type DeletePushRuleInput ¶
type DeletePushRuleInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
DeletePushRuleInput defines parameters for deleting push rules from a group.
type DetailOutput ¶ added in v3.1.0
type DetailOutput struct {
Output
PreventSharingGroupsOutsideHierarchy bool `json:"prevent_sharing_groups_outside_hierarchy"`
EnabledGitAccessProtocol string `json:"enabled_git_access_protocol,omitempty"`
ExperimentFeaturesEnabled bool `json:"experiment_features_enabled" tier:"premium"`
MembershipLock bool `json:"membership_lock" tier:"premium"`
RunnersToken string `json:"runners_token,omitempty"`
PreventForkingOutsideGroup bool `json:"prevent_forking_outside_group" tier:"premium"`
IPRestrictionRanges string `json:"ip_restriction_ranges,omitempty" tier:"premium"`
AllowedEmailDomainsList string `json:"allowed_email_domains_list,omitempty" tier:"premium"`
OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds" tier:"premium"`
AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline" tier:"premium"`
OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved" tier:"premium"`
Projects []ProjectItem `json:"projects,omitempty"`
// What only lib/api/entities/group_detail.rb and its EE prepend add,
// read from the captured response (ADR-0021). The two SHA settings are
// sent on every group from 19.5, and are absent from an older instance's
// answer rather than reported off.
RequireSHAForMerge *bool `json:"require_sha_for_merge,omitempty"`
LockRequireSHAForMerge *bool `json:"lock_require_sha_for_merge,omitempty"`
StepUpAuthRequiredOAuthProvider string `json:"step_up_auth_required_oauth_provider,omitempty"`
ServiceAccessTokensExpirationEnforced *bool `json:"service_access_tokens_expiration_enforced,omitempty" tier:"premium"`
AISettings *toolutil.AISettingsOutput `json:"ai_settings,omitempty" tier:"premium"`
UniqueProjectDownloadLimit *int64 `json:"unique_project_download_limit,omitempty" tier:"ultimate"`
UniqueProjectDownloadLimitIntervalSecs *int64 `json:"unique_project_download_limit_interval_in_seconds,omitempty" tier:"ultimate"`
UniqueProjectDownloadLimitAllowlist []string `json:"unique_project_download_limit_allowlist,omitempty" tier:"ultimate"`
UniqueProjectDownloadLimitAlertlist []int64 `json:"unique_project_download_limit_alertlist,omitempty" tier:"ultimate"`
AutoBanUserOnExcessiveProjectsDownload *bool `json:"auto_ban_user_on_excessive_projects_download,omitempty" tier:"ultimate"`
}
DetailOutput is a group as every route that answers with one group renders it: API::Entities::GroupDetail, which is the Group entity above plus twenty-four keys a list row never carries.
The split is not tidiness. Sixteen of those keys used to sit on Output, so every row of every group list declared a runners_token, an ip_restriction_ranges and a shared_with_groups it could not be given. What a caller reads to decide what is possible is the output schema, and that schema was promising fields the route it belongs to does not send.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (DetailOutput, error)
Create creates a new GitLab group.
func Get ¶
func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (DetailOutput, error)
Get retrieves a single GitLab group by its ID or URL-encoded path. Returns the group details or an error if the group is not found.
func Restore ¶
func Restore(ctx context.Context, client *gitlabclient.Client, input RestoreInput) (DetailOutput, error)
Restore restores a group that was marked for deletion.
func ToDetailOutput ¶ added in v3.1.0
func ToDetailOutput(g *gl.Group, extra toolutil.GroupDetailExtra) DetailOutput
ToDetailOutput converts a group as a route that answers with one group renders it: everything ToOutput carries plus what only API::Entities::GroupDetail adds.
func TransferProject ¶
func TransferProject(ctx context.Context, client *gitlabclient.Client, input TransferInput) (DetailOutput, error)
TransferProject transfers a project into the group namespace and answers with the group. The route is for administrators (lib/api/groups.rb calls authenticated_as_admin!), and unlike a project's own transfer it moves the project before it answers, in GitLab 19.4 as before: it runs the transfer service inline rather than queueing its worker.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (DetailOutput, error)
Update modifies an existing GitLab group.
func UploadAvatar ¶
func UploadAvatar(ctx context.Context, client *gitlabclient.Client, input UploadAvatarInput) (DetailOutput, error)
UploadAvatar uploads or replaces the avatar for a group.
It accepts either file_path (a local file the MCP server reads) or content_base64 (base64-encoded bytes), exactly one of which must be set, and streams the image to the GitLab Groups UploadAvatar endpoint as a multipart upload. The updated group is returned in the full group output shape.
type EditHookInput ¶
type EditHookInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Hook ID to edit,required"`
HookInput
}
EditHookInput defines parameters for editing an existing group hook.
type EditPushRuleInput ¶
type EditPushRuleInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group 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 group 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 group 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 group.
type GetHookInput ¶
type GetHookInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Hook ID,required"`
}
GetHookInput defines parameters for retrieving a single group hook.
type GetInput ¶
type GetInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
WithCustomAttributes bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response"`
WithProjects *bool `` /* 133-byte string literal not displayed */
OrderBy string `json:"order_by,omitempty" jsonschema:"Order embedded projects by field (only applies with with_projects)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction for embedded projects (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
GetInput defines parameters for retrieving a single group.
type GetPushRulesInput ¶
type GetPushRulesInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
GetPushRulesInput defines parameters for getting a group's push rules.
type GroupAccessLevelOutput ¶
type GroupAccessLevelOutput struct {
AccessLevel int `json:"access_level,omitempty"`
}
GroupAccessLevelOutput mirrors gl.GroupAccessLevel (an access-level entry in allowed_to_push / allowed_to_merge).
type HookCustomHeaderInput ¶
type HookCustomHeaderInput struct {
Key string `json:"key" jsonschema:"Header name,required"`
Value string `json:"value,omitempty" jsonschema:"Header value (write-only. Masked on read)"`
}
HookCustomHeaderInput is a single custom HTTP header sent with webhook requests. It mirrors gl.HookCustomHeader on add/edit.
type HookCustomHeaderOutput ¶
type HookCustomHeaderOutput struct {
Key string `json:"key"`
Value string `json:"value,omitempty"`
}
HookCustomHeaderOutput mirrors gl.HookCustomHeader (a custom_headers entry). The value is write-only and masked on read.
type HookInput ¶
type HookInput struct {
URL string `json:"url,omitempty" jsonschema:"New webhook URL"`
Name string `json:"name,omitempty" jsonschema:"Hook name"`
Description *string `` /* 158-byte string literal not displayed */
Token string `json:"token,omitempty" jsonschema:"Secret token for payload validation"`
SigningToken string `json:"signing_token,omitempty" jsonschema:"Write-only signing token for webhook signature validation"`
PushEvents *bool `json:"push_events,omitempty" jsonschema:"Trigger on push events"`
TagPushEvents *bool `json:"tag_push_events,omitempty" jsonschema:"Trigger on tag push events"`
MergeRequestsEvents *bool `json:"merge_requests_events,omitempty" jsonschema:"Trigger on merge request events"`
IssuesEvents *bool `json:"issues_events,omitempty" jsonschema:"Trigger on issue events"`
NoteEvents *bool `json:"note_events,omitempty" jsonschema:"Trigger on comment events"`
JobEvents *bool `json:"job_events,omitempty" jsonschema:"Trigger on 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"`
SubGroupEvents *bool `json:"subgroup_events,omitempty" jsonschema:"Trigger on subgroup events"`
MemberEvents *bool `json:"member_events,omitempty" jsonschema:"Trigger on member events"`
VulnerabilityEvents *bool `json:"vulnerability_events,omitempty" jsonschema:"Trigger on vulnerability events"`
ConfidentialIssuesEvents *bool `json:"confidential_issues_events,omitempty" jsonschema:"Trigger on confidential issue events"`
ConfidentialNoteEvents *bool `json:"confidential_note_events,omitempty" jsonschema:"Trigger on confidential note events"`
EnableSSLVerification *bool `json:"enable_ssl_verification,omitempty" jsonschema:"Enable SSL verification for the hook endpoint"`
PushEventsBranchFilter *string `` /* 185-byte string literal not displayed */
BranchFilterStrategy string `json:"branch_filter_strategy,omitempty" jsonschema:"Branch filter strategy (wildcard, regex, all_branches)"`
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"`
ProjectEvents *bool `json:"project_events,omitempty" jsonschema:"Trigger on project events (group-level)"`
CustomWebhookTemplate *string `` /* 215-byte string literal not displayed */
CustomHeaders []HookCustomHeaderInput `json:"custom_headers,omitempty" jsonschema:"Custom HTTP headers added to webhook requests"`
}
HookInput defines common parameters for creating or editing a group hook. Its URL is the edit's, which GitLab leaves optional; AddHookInput declares the add's own, which GitLab requires.
type HookListOutput ¶
type HookListOutput struct {
toolutil.HintableOutput
Hooks []HookOutput `json:"hooks"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
HookListOutput holds a paginated list of group hooks.
func ListHooks ¶
func ListHooks(ctx context.Context, client *gitlabclient.Client, input ListHooksInput) (HookListOutput, error)
ListHooks retrieves a paginated list of webhooks for a group.
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"`
GroupID int64 `json:"group_id"`
PushEvents bool `json:"push_events"`
TagPushEvents bool `json:"tag_push_events"`
MergeRequestsEvents bool `json:"merge_requests_events"`
IssuesEvents bool `json:"issues_events"`
NoteEvents bool `json:"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"`
SubGroupEvents bool `json:"subgroup_events"`
MemberEvents bool `json:"member_events"`
ConfidentialIssuesEvents bool `json:"confidential_issues_events"`
ConfidentialNoteEvents bool `json:"confidential_note_events"`
EnableSSLVerification bool `json:"enable_ssl_verification"`
AlertStatus string `json:"alert_status,omitempty"`
DisabledUntil string `json:"disabled_until,omitempty"`
URLVariables []HookURLVariable `json:"url_variables,omitempty"`
FeatureFlagEvents bool `json:"feature_flag_events"`
MilestoneEvents bool `json:"milestone_events"`
VulnerabilityEvents bool `json:"vulnerability_events"`
EmojiEvents bool `json:"emoji_events"`
ResourceAccessTokenEvents bool `json:"resource_access_token_events"`
ProjectEvents bool `json:"project_events"`
PushEventsBranchFilter string `json:"push_events_branch_filter,omitempty"`
BranchFilterStrategy string `json:"branch_filter_strategy,omitempty"`
TokenPresent bool `json:"token_present"`
SigningTokenPresent bool `json:"signing_token_present"`
CreatedAt string `json:"created_at,omitempty"`
CustomWebhookTemplate string `json:"custom_webhook_template,omitempty"`
CustomHeaders []HookCustomHeaderOutput `json:"custom_headers,omitempty"`
// RepositoryUpdateEvents is sent on every group hook and client-go models
// it on the project hook and the system hook only, so it is read from the
// captured answer (ADR-0021).
RepositoryUpdateEvents bool `json:"repository_update_events"`
// DuoFlowCallbackEnabled says whether GitLab Duo flow events are sent to
// the hook. GitLab sends it on every group hook from 19.4 and client-go
// does not model it, so it is read from the captured answer too, and is
// absent from an older instance's answer rather than reported off.
DuoFlowCallbackEnabled *bool `json:"duo_flow_callback_enabled,omitempty"`
}
HookOutput represents a GitLab group webhook.
func AddHook ¶
func AddHook(ctx context.Context, client *gitlabclient.Client, input AddHookInput) (HookOutput, error)
AddHook adds a new webhook to a group. Requires the webhook URL.
func EditHook ¶
func EditHook(ctx context.Context, client *gitlabclient.Client, input EditHookInput) (HookOutput, error)
EditHook updates an existing group webhook configuration.
func GetHook ¶
func GetHook(ctx context.Context, client *gitlabclient.Client, input GetHookInput) (HookOutput, error)
GetHook retrieves a single group webhook by its ID.
type HookURLVariable ¶
HookURLVariable represents a templated webhook URL variable used to substitute placeholders like {var_name} in a webhook URL with secret values resolved server-side. Mirrors gl.HookURLVariable (Key + Value); the value is write-only and masked on read, so it is omitted unless GitLab returns it.
type InvitedListInput ¶
type InvitedListInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Filter invited groups by name or path"`
MinAccessLevel int `` /* 185-byte string literal not displayed */
Relation []string `json:"relation,omitempty" jsonschema:"Filter by relation (direct, inherited)"`
WithCustomAttributes bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response"`
OrderBy string `` /* 190-byte string literal not displayed */
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
InvitedListInput defines parameters for listing groups invited to a group.
type LDAPGroupLinkOutput ¶
type LDAPGroupLinkOutput struct {
CN string `json:"cn"`
Filter string `json:"filter,omitempty"`
GroupAccess int `json:"group_access"`
Provider string `json:"provider"`
MemberRoleID int64 `json:"member_role_id,omitempty"`
}
LDAPGroupLinkOutput mirrors gl.LDAPGroupLink (an ldap_group_links entry).
type ListHooksInput ¶
type ListHooksInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order hooks by field (id)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListHooksInput defines parameters for listing group hooks.
type ListInput ¶
type ListInput struct {
Search string `json:"search,omitempty" jsonschema:"Filter groups by name or path"`
Owned bool `json:"owned,omitempty" jsonschema:"Limit to groups explicitly owned by the authenticated user"`
TopLevelOnly bool `json:"top_level_only,omitempty" jsonschema:"Limit to top-level groups (exclude subgroups)"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order groups by field (name, path, id, similarity)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
Visibility string `json:"visibility,omitempty" jsonschema:"Filter by visibility (public, internal, private)"`
AllAvailable bool `json:"all_available,omitempty" jsonschema:"Show all groups accessible by the authenticated user"`
Statistics bool `json:"statistics,omitempty" jsonschema:"Include group statistics (storage, counts)"`
WithCustomAttributes bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response"`
CustomAttributes map[string]string `` /* 199-byte string literal not displayed */
SkipGroups []int64 `json:"skip_groups,omitempty" jsonschema:"Group IDs to exclude from results"`
MinAccessLevel int `` /* 168-byte string literal not displayed */
RepositoryStorage string `` /* 147-byte string literal not displayed */
Active *bool `json:"active,omitempty" jsonschema:"Filter by active (true) or inactive/archived (false) groups"`
Archived *bool `json:"archived,omitempty" jsonschema:"Limit to archived groups (true) or non-archived (false)"`
MarkedForDeletionOn string `json:"marked_for_deletion_on,omitempty" jsonschema:"Filter to groups marked for deletion on this date (YYYY-MM-DD)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListInput defines parameters for listing groups.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Groups []Output `json:"groups"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of groups.
func InvitedList ¶
func InvitedList(ctx context.Context, client *gitlabclient.Client, input InvitedListInput) (ListOutput, error)
InvitedList lists the groups invited to the given group.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves a paginated list of GitLab groups visible to the authenticated user. Supports filtering by search term, ownership, and top-level-only restriction. Returns the groups with pagination metadata.
func Search ¶
func Search(ctx context.Context, client *gitlabclient.Client, input SearchInput) (ListOutput, error)
Search searches for groups by query string.
func SharedWithList ¶
func SharedWithList(ctx context.Context, client *gitlabclient.Client, input SharedWithListInput) (ListOutput, error)
SharedWithList lists the groups that have been shared with the given group.
func SubgroupsList ¶
func SubgroupsList(ctx context.Context, client *gitlabclient.Client, input SubgroupsListInput) (ListOutput, error)
SubgroupsList retrieves a paginated list of descendant groups (subgroups) for a given parent group. Supports filtering by search term and pagination. Returns the subgroups with pagination metadata.
type ListProjectsInput ¶
type ListProjectsInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Filter projects by name"`
Archived *bool `json:"archived,omitempty" jsonschema:"Filter archived projects"`
Visibility string `json:"visibility,omitempty" jsonschema:"Filter by visibility (public, internal, private)"`
OrderBy string `` /* 131-byte string literal not displayed */
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
Simple bool `json:"simple,omitempty" jsonschema:"Return limited fields"`
Owned bool `json:"owned,omitempty" jsonschema:"Limit to projects owned by current user"`
Starred bool `json:"starred,omitempty" jsonschema:"Limit to starred projects"`
IncludeSubGroups bool `json:"include_subgroups,omitempty" jsonschema:"Include projects in subgroups"`
Active *bool `json:"active,omitempty" jsonschema:"Filter by active (true) or inactive/archived (false) projects"`
MinAccessLevel int `` /* 208-byte string literal not displayed */
Topic string `json:"topic,omitempty" jsonschema:"Filter projects by topic"`
WithCustomAttributes bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response"`
WithIssuesEnabled *bool `json:"with_issues_enabled,omitempty" jsonschema:"Limit to projects with issues enabled"`
WithMergeRequestsEnabled *bool `json:"with_merge_requests_enabled,omitempty" jsonschema:"Limit to projects with merge requests enabled"`
WithSecurityReports *bool `json:"with_security_reports,omitempty" tier:"ultimate" jsonschema:"Limit to projects with security reports (Ultimate)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListProjectsInput defines parameters for listing group projects.
type ListProjectsOutput ¶
type ListProjectsOutput struct {
toolutil.HintableOutput
Projects []ProjectItem `json:"projects"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListProjectsOutput holds a paginated list of group projects.
func ListProjects ¶
func ListProjects(ctx context.Context, client *gitlabclient.Client, input ListProjectsInput) (ListProjectsOutput, error)
ListProjects retrieves projects belonging to a group.
type ListProvisionedUsersInput ¶
type ListProvisionedUsersInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Username string `json:"username,omitempty" jsonschema:"Filter provisioned users by exact username"`
Search string `json:"search,omitempty" jsonschema:"Search provisioned users by name, username, or email"`
Active *bool `json:"active,omitempty" jsonschema:"Filter to active (true) or inactive (false) users"`
Blocked *bool `json:"blocked,omitempty" jsonschema:"Filter to blocked (true) or unblocked (false) users"`
CreatedAfter string `json:"created_after,omitempty" jsonschema:"Return users created after this RFC3339 timestamp (e.g. 2024-01-02T15:04:05Z)"`
CreatedBefore string `json:"created_before,omitempty" jsonschema:"Return users created before this RFC3339 timestamp (e.g. 2024-12-31T23:59:59Z)"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Column to order provisioned users by (e.g. id, name, username, created_at, updated_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction: asc or desc"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListProvisionedUsersInput defines parameters for listing the users provisioned for a group through SAML/SCIM. Mirrors gl.ListProvisionedUsersOptions filters plus offset and keyset pagination.
type ListSharedProjectsInput ¶
type ListSharedProjectsInput struct {
}
ListSharedProjectsInput defines parameters for listing projects shared with a group.
type MemberListOutput ¶
type MemberListOutput struct {
toolutil.HintableOutput
Members []MemberOutput `json:"members"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
MemberListOutput holds a paginated list of group members.
func MembersList ¶
func MembersList(ctx context.Context, client *gitlabclient.Client, input MembersListInput) (MemberListOutput, error)
MembersList retrieves all members of a GitLab group, including inherited members from parent groups. Supports filtering by name or username and pagination. Returns the member list with pagination metadata.
type MemberOutput ¶
type MemberOutput struct {
ID int64 `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
State string `json:"state"`
Locked bool `json:"locked"`
// AvatarURL is published and avatar_path is not, along with
// custom_attributes: lib/api/entities/user_basic.rb sends each of those
// two only when the caller asks for it, and no group-member route
// declares only_path or with_custom_attributes.
AvatarURL string `json:"avatar_url,omitempty"`
AccessLevel int `json:"access_level"`
WebURL string `json:"web_url"`
CreatedAt string `json:"created_at,omitempty"`
CreatedBy *MemberUserOutput `json:"created_by,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Email string `json:"email,omitempty"`
PublicEmail string `json:"public_email,omitempty"`
TwoFactorEnabled *bool `json:"two_factor_enabled,omitempty"`
GroupSAMLIdentity *SAMLIdentityOutput `json:"group_saml_identity,omitempty"`
GroupSCIMIdentity *SCIMIdentityOutput `json:"group_scim_identity,omitempty" tier:"premium"`
Override *bool `json:"override,omitempty" tier:"premium"`
MembershipState string `json:"membership_state,omitempty" tier:"premium"`
MemberRole *MemberRoleOutput `json:"member_role,omitempty"`
IsUsingSeat bool `json:"is_using_seat,omitempty"`
}
MemberOutput represents a GitLab group member.
Fields mirror gl.GroupMember (1:1 audit policy: full nested objects) plus what lib/api/entities/member.rb sends that the SDK does not carry, read from the captured response (ADR-0021): locked on every member, membership_state on every member of an Enterprise instance, and two_factor_enabled, group_scim_identity and override when the caller may see them. The created_by, group_saml_identity, group_scim_identity and member_role sub-objects are surfaced as full local mirrors on their canonical json keys (C-IMPORTS: replicated here rather than imported from sibling packages to preserve the zero-import-cycle constraint).
func MemberToOutput ¶
func MemberToOutput(m *gl.GroupMember, extra toolutil.MemberExtra) MemberOutput
MemberToOutput converts a GitLab API gl.GroupMember to the MCP tool output format, surfacing the full created_by, group_saml_identity, and member_role sub-objects (1:1 audit policy: full nested objects), and takes the fields the capture read beside the SDK.
type MemberRoleOutput ¶
type MemberRoleOutput = toolutil.MemberRoleOutput
MemberRoleOutput mirrors gl.MemberRole (the member_role object). Custom member roles are an Enterprise (Premium/Ultimate) feature; the object is nil on instances or members without a custom role. Canonical shape shared via toolutil.
type MemberUserOutput ¶
type MemberUserOutput = toolutil.MemberUserOutput
MemberUserOutput mirrors gl.MemberCreatedBy (the created_by object); canonical shape shared via toolutil.
type MembersListInput ¶
type MembersListInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Query string `json:"query,omitempty" jsonschema:"Filter members by name or username"`
UserIDs []int64 `json:"user_ids,omitempty" jsonschema:"Filter the result to the given user IDs"`
ShowSeatInfo *bool `json:"show_seat_info,omitempty" jsonschema:"Include seat information for each member (Premium/Ultimate)"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order members by field (id, name, username, access_level, last_activity_on)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
MembersListInput defines parameters for listing group members.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
FullPath string `json:"full_path"`
FullName string `json:"full_name,omitempty"`
Description string `json:"description,omitempty"`
Visibility string `json:"visibility"`
WebURL string `json:"web_url"`
ParentID int64 `json:"parent_id,omitempty"`
OrganizationID int64 `json:"organization_id,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
RequestAccessEnabled bool `json:"request_access_enabled"`
CreatedAt string `json:"created_at,omitempty"`
MarkedForDeletion string `json:"marked_for_deletion_on,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
ProjectCreationLevel string `json:"project_creation_level,omitempty"`
SubGroupCreationLevel string `json:"subgroup_creation_level,omitempty"`
LFSEnabled bool `json:"lfs_enabled"`
// Fields added in client-go v2.41.0.
Archived bool `json:"archived"`
MathRenderingLimitsEnabled bool `json:"math_rendering_limits_enabled"`
LockMathRenderingLimitsEnabled bool `json:"lock_math_rendering_limits_enabled"`
DuoFeaturesEnabled bool `json:"duo_features_enabled" tier:"premium"`
LockDuoFeaturesEnabled bool `json:"lock_duo_features_enabled" tier:"premium"`
// Remaining gl.Group fields (1:1 audit).
MaxArtifactsSize int64 `json:"max_artifacts_size,omitempty"`
DefaultBranchProtectionDefaults *BranchProtectionDefaults `json:"default_branch_protection_defaults,omitempty"`
RepositoryStorage string `json:"repository_storage,omitempty" tier:"premium"`
FileTemplateProjectID int64 `json:"file_template_project_id,omitempty" tier:"premium"`
Statistics *StatisticsOutput `json:"statistics,omitempty"`
RootStorageStatistics *RootStorageStatisticsOutput `json:"root_storage_statistics,omitempty"`
CustomAttributes []CustomAttributeOutput `json:"custom_attributes,omitempty"`
RequireTwoFactorAuth bool `json:"require_two_factor_authentication"`
TwoFactorGracePeriod int64 `json:"two_factor_grace_period,omitempty"`
AutoDevopsEnabled bool `json:"auto_devops_enabled"`
EmailsEnabled bool `json:"emails_enabled"`
EmailsDisabled bool `json:"emails_disabled"`
MentionsDisabled bool `json:"mentions_disabled"`
CRMEnabled bool `json:"crm_enabled" jsonschema:"Whether Customer Relations Management (CRM) is enabled for the group"`
LDAPCN string `json:"ldap_cn,omitempty" tier:"premium"`
LDAPAccess int `json:"ldap_access,omitempty" tier:"premium"`
LDAPGroupLinks []LDAPGroupLinkOutput `json:"ldap_group_links,omitempty"`
SAMLGroupLinks []SAMLGroupLinkOutput `json:"saml_group_links,omitempty"`
WikiAccessLevel string `json:"wiki_access_level,omitempty" tier:"premium"`
DefaultBranchProtection int64 `json:"default_branch_protection,omitempty"`
// What lib/api/entities/group.rb and its EE prepend send that client-go's
// Group does not model, read from the captured response (ADR-0021).
ShowDiffPreviewInEmail bool `json:"show_diff_preview_in_email"`
ResourceAccessTokenNotifyInherited *bool `json:"resource_access_token_notify_inherited"`
LockResourceAccessTokenNotifyInherited bool `json:"lock_resource_access_token_notify_inherited"`
DuoCoreFeaturesEnabled *bool `json:"duo_core_features_enabled,omitempty" tier:"premium"`
AutoDuoCodeReviewEnabled *bool `json:"auto_duo_code_review_enabled,omitempty" tier:"premium"`
// DuoCodeReviewDecisionsEnabled is sent from 19.5 behind the
// duo_code_review_decisions feature flag, to a caller who may administer
// the group. Tagged Ultimate as projects.md documents the project key
// with the same predicate; groups.md does not document this one, and the
// auto review flag beside it, gated the same way, predates that note.
DuoCodeReviewDecisionsEnabled *bool `json:"duo_code_review_decisions_enabled,omitempty" tier:"ultimate"`
BuiltInProjectTemplatesEnabled *bool `json:"built_in_project_templates_enabled,omitempty" tier:"premium"`
LockBuiltInProjectTemplatesEnabled *bool `json:"lock_built_in_project_templates_enabled,omitempty" tier:"premium"`
DuoNamespaceAccessRules []toolutil.DuoNamespaceAccessRuleOutput `json:"duo_namespace_access_rules,omitempty" tier:"premium"`
// GitLab.com only: ee/lib/gitlab/saas.rb gates both on Gitlab.com?, so a
// self-managed instance never sends either whatever its license.
WebBasedCommitSigningEnabled *bool `json:"web_based_commit_signing_enabled,omitempty" tier:"premium"`
AllowPersonalSnippets *bool `json:"allow_personal_snippets,omitempty" tier:"premium"`
}
Output represents a GitLab group.
Fields mirror gl.Group (1:1 audit policy: full nested objects). Nested sub-objects (statistics, custom_attributes, default_branch_protection_defaults, shared_with_groups, ldap_group_links, saml_group_links, projects, shared_projects) are surfaced as full local mirrors on their canonical json keys (C-IMPORTS: replicated here rather than imported from sibling packages to preserve the zero-import-cycle constraint).
type ProjectItem ¶
type ProjectItem struct {
ID int64 `json:"id"`
Name string `json:"name"`
NameWithNamespace string `json:"name_with_namespace,omitempty"`
Path string `json:"path,omitempty"`
PathWithNamespace string `json:"path_with_namespace"`
Description string `json:"description,omitempty"`
Visibility string `json:"visibility"`
WebURL string `json:"web_url"`
HTTPURLToRepo string `json:"http_url_to_repo,omitempty"`
SSHURLToRepo string `json:"ssh_url_to_repo,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
Topics []string `json:"topics,omitempty"`
StarCount int64 `json:"star_count,omitempty"`
ForksCount int64 `json:"forks_count,omitempty"`
// Archived is a pointer because the two group project lists take simple,
// which makes GitLab render BasicProjectDetails, and that entity does not
// say whether a project is archived: nil there is no answer, not false.
Archived *bool `json:"archived,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
LastActivityAt string `json:"last_activity_at,omitempty"`
}
ProjectItem is one project of a group as a compact row: what names it and where to clone and open it, its visibility, default branch and topics, how much attention it gets, and when it was created and last active. GitLab answers the two group project lists with Entities::Project, or with BasicProjectDetails under simple; the rest of the project (its settings, permissions, statistics and links) is what project.get returns.
type ProvisionedUserBasicUser ¶
type ProvisionedUserBasicUser struct {
ID int64 `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
State string `json:"state,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
WebURL string `json:"web_url,omitempty"`
}
ProvisionedUserBasicUser mirrors gl.BasicUser (the created_by object).
type ProvisionedUserCustomAttribute ¶
ProvisionedUserCustomAttribute mirrors gl.CustomAttribute (custom_attributes).
type ProvisionedUserIdentity ¶
type ProvisionedUserIdentity struct {
Provider string `json:"provider"`
ExternUID string `json:"extern_uid"`
}
ProvisionedUserIdentity mirrors gl.UserIdentity (the identities object).
type ProvisionedUserOutput ¶
type ProvisionedUserOutput struct {
ID int64 `json:"id"`
Username string `json:"username"`
Email string `json:"email,omitempty"`
Name string `json:"name"`
State string `json:"state"`
WebURL string `json:"web_url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Bio string `json:"bio,omitempty"`
Bot bool `json:"bot,omitempty"`
Location string `json:"location,omitempty"`
PublicEmail string `json:"public_email,omitempty"`
Linkedin string `json:"linkedin,omitempty"`
Twitter string `json:"twitter,omitempty"`
WebsiteURL string `json:"website_url,omitempty"`
Organization string `json:"organization,omitempty"`
JobTitle string `json:"job_title,omitempty"`
ThemeID int64 `json:"theme_id,omitempty"`
LastActivityOn string `json:"last_activity_on,omitempty"`
ColorSchemeID int64 `json:"color_scheme_id,omitempty"`
IsAdmin bool `json:"is_admin,omitempty"`
IsAuditor bool `json:"is_auditor,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
CanCreateGroup bool `json:"can_create_group,omitempty"`
CanCreateProject bool `json:"can_create_project,omitempty"`
ProjectsLimit int64 `json:"projects_limit,omitempty"`
CurrentSignInAt string `json:"current_sign_in_at,omitempty"`
LastSignInAt string `json:"last_sign_in_at,omitempty"`
ConfirmedAt string `json:"confirmed_at,omitempty"`
TwoFactorEnabled bool `json:"two_factor_enabled,omitempty"`
Note string `json:"note,omitempty"`
Identities []ProvisionedUserIdentity `json:"identities,omitempty"`
SCIMIdentities []ProvisionedUserSCIMIdentity `json:"scim_identities,omitempty"`
External bool `json:"external,omitempty"`
PrivateProfile bool `json:"private_profile,omitempty"`
UsingLicenseSeat bool `json:"using_license_seat,omitempty"`
CustomAttributes []ProvisionedUserCustomAttribute `json:"custom_attributes,omitempty"`
NamespaceID int64 `json:"namespace_id,omitempty"`
Locked bool `json:"locked,omitempty"`
CreatedBy *ProvisionedUserBasicUser `json:"created_by,omitempty"`
// The keys lib/api/entities/user_public.rb sends that client-go's User
// does not model, read from the captured response beside the SDK's own
// decode (ADR-0021) and described on toolutil.UserExtra. GitLab presents
// GET /groups/:id/provisioned_users with UserPublic, so the seven profile
// keys are on every response and the three counts on one whose caller may
// read the profile.
CommitEmail string `json:"commit_email,omitempty"`
Discord string `json:"discord,omitempty"`
GitHub string `json:"github,omitempty"`
LocalTime string `json:"local_time,omitempty"`
PreferredLanguage string `json:"preferred_language,omitempty"`
Pronouns string `json:"pronouns,omitempty"`
WorkInformation string `json:"work_information,omitempty"`
Followers *int64 `json:"followers,omitempty"`
Following *int64 `json:"following,omitempty"`
IsFollowed *bool `json:"is_followed,omitempty"`
}
ProvisionedUserOutput is a user provisioned through SAML or SCIM as GET /groups/:id/provisioned_users answers with it: ee/lib/ee/api/groups.rb presents the list with API::Entities::UserPublic, so the six keys client-go's User models and that entity never renders (skype, extern_uid and provider at the top level, can_create_organization, and the two sign-in addresses only the administrator's user entity carries) are not published. Nested identities (identities, scim_identities, custom_attributes, created_by) are surfaced as full local mirrors on their canonical json keys (C-IMPORTS: replicated here rather than imported from sibling packages to preserve the zero-import-cycle constraint).
func ProvisionedUserToOutput ¶
func ProvisionedUserToOutput(u *gl.User, extra toolutil.UserExtra) ProvisionedUserOutput
ProvisionedUserToOutput converts a gl.User to the full provisioned-user output shape (1:1 audit policy: full nested objects), filling from extra the keys client-go's User declares on no field of its own (ADR-0021).
type ProvisionedUserSCIMIdentity ¶
type ProvisionedUserSCIMIdentity struct {
ExternUID string `json:"extern_uid"`
GroupID int64 `json:"group_id"`
Active bool `json:"active"`
}
ProvisionedUserSCIMIdentity mirrors gl.SCIMIdentity (the scim_identities object).
type ProvisionedUsersListOutput ¶
type ProvisionedUsersListOutput struct {
toolutil.HintableOutput
Users []ProvisionedUserOutput `json:"users"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ProvisionedUsersListOutput holds a paginated list of provisioned users.
func ListProvisionedUsers ¶
func ListProvisionedUsers(ctx context.Context, client *gitlabclient.Client, input ListProvisionedUsersInput) (ProvisionedUsersListOutput, error)
ListProvisionedUsers lists the users provisioned for a group through SAML/SCIM (Premium/Ultimate). Supports username/search/active/blocked/created_after/ created_before filters plus offset and keyset pagination.
type PushRuleOutput ¶
type PushRuleOutput struct {
toolutil.HintableOutput
ID int64 `json:"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 group's push-rule configuration. It mirrors gl.GroupPushRules 1:1 (1:1 audit output-fidelity policy).
func AddPushRule ¶
func AddPushRule(ctx context.Context, client *gitlabclient.Client, input AddPushRuleInput) (PushRuleOutput, error)
AddPushRule adds push-rule configuration to a group.
func EditPushRule ¶
func EditPushRule(ctx context.Context, client *gitlabclient.Client, input EditPushRuleInput) (PushRuleOutput, error)
EditPushRule modifies the push-rule configuration for a group.
func GetPushRules ¶
func GetPushRules(ctx context.Context, client *gitlabclient.Client, input GetPushRulesInput) (PushRuleOutput, error)
GetPushRules retrieves the push-rule configuration for a group.
type ResendHookEventInput ¶
type ResendHookEventInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
HookEventID int64 `json:"hook_event_id" jsonschema:"ID of the hook event to resend,required"`
}
ResendHookEventInput defines parameters for resending a group hook event.
type RestoreInput ¶
type RestoreInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
RestoreInput defines parameters for restoring a group marked for deletion.
type RootStorageStatisticsOutput ¶
type RootStorageStatisticsOutput struct {
BuildArtifactsSize int64 `json:"build_artifacts_size"`
ContainerRegistrySize int64 `json:"container_registry_size"`
ContainerRegistrySizeIsEstimated bool `json:"container_registry_size_is_estimated"`
DependencyProxySize int64 `json:"dependency_proxy_size"`
LFSObjectsSize int64 `json:"lfs_objects_size"`
PackagesSize int64 `json:"packages_size"`
PipelineArtifactsSize int64 `json:"pipeline_artifacts_size"`
RepositorySize int64 `json:"repository_size"`
SnippetsSize int64 `json:"snippets_size"`
StorageSize int64 `json:"storage_size"`
UploadsSize int64 `json:"uploads_size"`
WikiSize int64 `json:"wiki_size"`
}
RootStorageStatisticsOutput mirrors gl.RootStorageStatistics (the root_storage_statistics object, aggregated over the whole hierarchy of a top-level group). It is only returned for top-level groups when statistics are requested; unlike Statistics it also reports the container registry and dependency proxy sizes.
type SAMLGroupLinkOutput ¶
type SAMLGroupLinkOutput struct {
Name string `json:"name"`
AccessLevel int `json:"access_level"`
MemberRoleID int64 `json:"member_role_id,omitempty"`
Provider string `json:"provider,omitempty"`
}
SAMLGroupLinkOutput mirrors gl.SAMLGroupLink (a saml_group_links entry).
type SAMLIdentityOutput ¶
type SAMLIdentityOutput = toolutil.SAMLIdentityOutput
SAMLIdentityOutput mirrors gl.GroupMemberSAMLIdentity (the group_saml_identity object); canonical shape shared via toolutil.
type SCIMIdentityOutput ¶
type SCIMIdentityOutput = toolutil.SCIMIdentityOutput
SCIMIdentityOutput mirrors the group_scim_identity object, which client-go does not model; canonical shape shared via toolutil.
type SearchInput ¶
type SearchInput struct {
Query string `json:"query" jsonschema:"Search query string,required"`
}
SearchInput defines parameters for searching groups.
type SetHookCustomHeaderInput ¶
type SetHookCustomHeaderInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group 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 (write-only),required"`
}
SetHookCustomHeaderInput defines parameters for setting a custom header on a group webhook.
type SetHookURLVariableInput ¶
type SetHookURLVariableInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
Key string `` /* 128-byte string literal not displayed */
Value string `json:"value" jsonschema:"URL variable value (write-only). Must be non-empty,required"`
}
SetHookURLVariableInput defines parameters for setting a URL variable on a group webhook.
type ShareGroupInput ¶
type ShareGroupInput struct {
}
ShareGroupInput defines parameters for sharing a group with another group.
group.group_member_share reaches the same route with an input of its own (groupmembers.ShareInput), which names the group shared with share_group_id. The two describe group_access and member_role_id alike, and member_role_id carries the same tier, so neither schema tells a caller something the other contradicts.
type ShareGroupOutput ¶
type ShareGroupOutput struct {
}
ShareGroupOutput holds the result of sharing a group with another group.
func ShareGroupWithGroup ¶
func ShareGroupWithGroup(ctx context.Context, client *gitlabclient.Client, input ShareGroupInput) (ShareGroupOutput, error)
ShareGroupWithGroup shares a group with another group.
type SharedProjectsListOutput ¶
type SharedProjectsListOutput struct {
}
SharedProjectsListOutput holds a paginated list of projects shared with a group.
func ListSharedProjects ¶
func ListSharedProjects(ctx context.Context, client *gitlabclient.Client, input ListSharedProjectsInput) (SharedProjectsListOutput, error)
ListSharedProjects retrieves projects shared with a group.
type SharedWithGroupOutput ¶
type SharedWithGroupOutput struct {
}
SharedWithGroupOutput mirrors gl.SharedWithGroup (a shared_with_groups entry).
type SharedWithListInput ¶
type SharedWithListInput struct {
}
SharedWithListInput defines parameters for listing groups shared with a group.
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 statistics object, returned when statistics=true is requested by an Owner).
type SubgroupsListInput ¶
type SubgroupsListInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Filter subgroups by name or path"`
AllAvailable bool `json:"all_available,omitempty" jsonschema:"Show all subgroups accessible by the authenticated user"`
Owned bool `json:"owned,omitempty" jsonschema:"Limit to subgroups explicitly owned by the authenticated user"`
MinAccessLevel int `` /* 163-byte string literal not displayed */
OrderBy string `json:"order_by,omitempty" jsonschema:"Order subgroups by field (name, path, id, similarity)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
Statistics bool `json:"statistics,omitempty" jsonschema:"Include group statistics (storage, counts)"`
Visibility string `json:"visibility,omitempty" jsonschema:"Filter by visibility (public, internal, private)"`
TopLevelOnly bool `json:"top_level_only,omitempty" jsonschema:"Limit to top-level subgroups (exclude nested descendants)"`
WithCustomAttributes bool `json:"with_custom_attributes,omitempty" jsonschema:"Include custom attributes in the response"`
CustomAttributes map[string]string `` /* 202-byte string literal not displayed */
SkipGroups []int64 `json:"skip_groups,omitempty" jsonschema:"Group IDs to exclude from results"`
RepositoryStorage string `` /* 147-byte string literal not displayed */
Active *bool `json:"active,omitempty" jsonschema:"Filter by active (true) or inactive/archived (false) subgroups"`
Archived *bool `json:"archived,omitempty" jsonschema:"Limit to archived subgroups (true) or non-archived (false)"`
MarkedForDeletionOn string `json:"marked_for_deletion_on,omitempty" jsonschema:"Filter to subgroups marked for deletion on this date (YYYY-MM-DD)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
SubgroupsListInput defines parameters for listing subgroups.
type TestHookInput ¶
type TestHookInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
HookID int64 `json:"hook_id" jsonschema:"Webhook ID,required"`
Trigger string `` /* 294-byte string literal not displayed */
}
TestHookInput defines parameters for triggering a test group hook event.
type TransferInput ¶
type TransferInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path to transfer,required"`
}
TransferInput defines parameters for transferring a project to a group.
type TransferLocationOutput ¶
type TransferLocationOutput struct {
ID int64 `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name,omitempty"`
FullPath string `json:"full_path,omitempty"`
WebURL string `json:"web_url,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
}
TransferLocationOutput represents a candidate parent group for a transfer.
type TransferLocationsListInput ¶
type TransferLocationsListInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Search string `json:"search,omitempty" jsonschema:"Filter candidate parent groups by name or path"`
OrderBy string `` /* 193-byte string literal not displayed */
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
TransferLocationsListInput defines parameters for listing possible transfer locations.
type TransferLocationsListOutput ¶
type TransferLocationsListOutput struct {
toolutil.HintableOutput
Locations []TransferLocationOutput `json:"locations"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
TransferLocationsListOutput holds a paginated list of transfer locations.
func TransferLocationsList ¶
func TransferLocationsList(ctx context.Context, client *gitlabclient.Client, input TransferLocationsListInput) (TransferLocationsListOutput, error)
TransferLocationsList lists the parent groups available for transferring the given group.
type TransferSubGroupInput ¶
type TransferSubGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path of the group to move,required"`
ParentID *int64 `json:"parent_id,omitempty" jsonschema:"ID of the new parent group. Omit to turn the subgroup into a top-level group"`
}
TransferSubGroupInput defines parameters for transferring a group under a new parent group or to the top level.
type TransferSubGroupOutput ¶ added in v3.1.0
type TransferSubGroupOutput struct {
DetailOutput
TransferQueued bool `` /* 260-byte string literal not displayed */
}
TransferSubGroupOutput is the group a transfer answers with. GitLab 19.4 and later move a group in the background, so the handler reads it back until it sits under the parent the transfer named. TransferQueued says the wait ended first, with no failure reported either, and the group 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 group, so whether a move has landed can only be told by comparing the group's parent with the one it was sent to.
func TransferSubGroup ¶
func TransferSubGroup(ctx context.Context, req *mcp.CallToolRequest, client *gitlabclient.Client, input TransferSubGroupInput) (TransferSubGroupOutput, error)
TransferSubGroup moves a group under a new parent group, or promotes a subgroup to a top-level group when parent_id is omitted, and waits for the move.
GitLab 19.4 and later accept the transfer, answer with the group where it still is and move it in a background worker, so an answer that does not yet show the new parent 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.
The worker repeats the checks the request passed and meets failures of its own while it moves the group (a Service Desk address the new path gives a project another one already uses, a path it cannot update, a record it cannot save). A failure there is reported only as a to-do item for the caller, so each read that does not find the group 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 ([subGroupTransferFailedError]). A move that has neither landed nor been reported failed when the wait ends is answered with the group 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 UnshareGroupInput ¶
type UnshareGroupInput struct {
}
UnshareGroupInput defines parameters for revoking a group-to-group share.
type UpdateInput ¶
type UpdateInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Name string `json:"name,omitempty" jsonschema:"Group name"`
Path string `json:"path,omitempty" jsonschema:"Group URL path"`
Description *string `` /* 134-byte string literal not displayed */
Visibility string `json:"visibility,omitempty" jsonschema:"Visibility level (private, internal, public)"`
RequestAccessEnabled *bool `json:"request_access_enabled,omitempty" jsonschema:"Allow users to request access"`
LFSEnabled *bool `json:"lfs_enabled,omitempty" jsonschema:"Enable Git LFS"`
DefaultBranch string `json:"default_branch,omitempty" jsonschema:"Default branch name"`
MathRenderingLimitsEnabled *bool `json:"math_rendering_limits_enabled,omitempty" jsonschema:"Enable math rendering limits"`
WebBasedCommitSigningEnabled *bool `json:"web_based_commit_signing_enabled,omitempty" jsonschema:"Enable web-based commit signing for projects in this group"`
AllowPersonalSnippets *bool `json:"allow_personal_snippets,omitempty" jsonschema:"Allow members to create personal snippets"`
CRMEnabled *bool `json:"crm_enabled,omitempty" jsonschema:"Enable Customer Relations Management (CRM) for the group"`
AutoDevopsEnabled *bool `json:"auto_devops_enabled,omitempty" jsonschema:"Enable Auto DevOps for projects in this group"`
DefaultBranchProtection *int64 `` /* 210-byte string literal not displayed */
DefaultBranchProtectionDefaults *BranchProtectionDefaultsInput `json:"default_branch_protection_defaults,omitempty" jsonschema:"Default branch protection settings object"`
DuoAvailability string `` /* 212-byte string literal not displayed */
DuoFeaturesEnabled *bool `` /* 209-byte string literal not displayed */
LockDuoFeaturesEnabled *bool `` /* 239-byte string literal not displayed */
EmailsEnabled *bool `json:"emails_enabled,omitempty" jsonschema:"Enable email notifications"`
EmailsDisabled *bool `` /* 127-byte string literal not displayed */
EnabledGitAccessProtocol string `json:"enabled_git_access_protocol,omitempty" jsonschema:"Allowed Git access protocol (ssh, http, all)"`
ExperimentFeaturesEnabled *bool `json:"experiment_features_enabled,omitempty" jsonschema:"Enable experimental features"`
FileTemplateProjectID *int64 `` /* 149-byte string literal not displayed */
IPRestrictionRanges string `` /* 187-byte string literal not displayed */
AllowedEmailDomainsList string `` /* 156-byte string literal not displayed */
LockMathRenderingLimitsEnabled *bool `` /* 130-byte string literal not displayed */
MaxArtifactsSize *int64 `json:"max_artifacts_size,omitempty" jsonschema:"Maximum job artifacts size in MB (administrators only)"`
MembershipLock *bool `json:"membership_lock,omitempty" jsonschema:"Prevent members from being added to projects in this group"`
MentionsDisabled *bool `json:"mentions_disabled,omitempty" jsonschema:"Disable @-mention notifications"`
PreventForkingOutsideGroup *bool `` /* 141-byte string literal not displayed */
PreventSharingGroupsOutside *bool `json:"prevent_sharing_groups_outside_hierarchy,omitempty" jsonschema:"Prevent inviting groups outside this group's hierarchy"`
ProjectCreationLevel string `json:"project_creation_level,omitempty" jsonschema:"Who can create projects (noone, maintainer, developer)"`
RequireTwoFactorAuth *bool `json:"require_two_factor_authentication,omitempty" jsonschema:"Require two-factor authentication for members"`
SubGroupCreationLevel string `json:"subgroup_creation_level,omitempty" jsonschema:"Who can create subgroups (owner, maintainer)"`
StepUpAuthRequiredOAuthProvider string `json:"step_up_auth_required_oauth_provider,omitempty" jsonschema:"OAuth provider required for step-up authentication"`
TwoFactorGracePeriod *int64 `` /* 131-byte string literal not displayed */
WikiAccessLevel string `` /* 126-byte string literal not displayed */
OnlyAllowMergeIfPipelineSucceeds *bool `` /* 138-byte string literal not displayed */
AllowMergeOnSkippedPipeline *bool `` /* 134-byte string literal not displayed */
OnlyAllowMergeIfAllDiscussionsAreResolved *bool `` /* 146-byte string literal not displayed */
UniqueProjectDownloadLimit *int64 `` /* 178-byte string literal not displayed */
UniqueProjectDownloadLimitIntervalInSeconds *int64 `` /* 169-byte string literal not displayed */
UniqueProjectDownloadLimitAllowlist []string `` /* 166-byte string literal not displayed */
UniqueProjectDownloadLimitAlertlist []int64 `` /* 177-byte string literal not displayed */
AutoBanUserOnExcessiveProjectsDownload *bool `` /* 177-byte string literal not displayed */
// RemoveAvatar sends avatar as an empty value, which PUT /groups/:id
// answers by removing the group's avatar (lib/api/groups.rb). A new
// image goes through group.upload_avatar.
RemoveAvatar bool `json:"remove_avatar,omitempty" jsonschema:"Remove the group's avatar. To replace it instead, use group.upload_avatar"`
}
UpdateInput defines parameters for updating a group.
type UploadAvatarInput ¶
type UploadAvatarInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group 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 group avatar.
Exactly one of FilePath or ContentBase64 must be provided to supply the image bytes. This mirrors the project avatar upload tool: file_path reads a local file from the MCP server filesystem (suitable for large images), while content_base64 carries inline base64-encoded image content.