users

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package users implements GitLab user operations including retrieving the current authenticated user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAdminActionMarkdownString

func FormatAdminActionMarkdownString(o AdminActionOutput) string

FormatAdminActionMarkdownString renders an admin action result as Markdown.

func FormatAssociationsCountMarkdown

func FormatAssociationsCountMarkdown(o AssociationsCountOutput) *mcp.CallToolResult

FormatAssociationsCountMarkdown renders user associations count as an MCP CallToolResult.

func FormatAssociationsCountMarkdownString

func FormatAssociationsCountMarkdownString(o AssociationsCountOutput) string

FormatAssociationsCountMarkdownString renders user associations count as a Markdown string.

func FormatContributionEventsMarkdown

func FormatContributionEventsMarkdown(o ContributionEventsOutput) *mcp.CallToolResult

FormatContributionEventsMarkdown renders contribution events as an MCP CallToolResult.

func FormatContributionEventsMarkdownString

func FormatContributionEventsMarkdownString(o ContributionEventsOutput) string

FormatContributionEventsMarkdownString renders contribution events as a Markdown string.

func FormatCurrentUserPATMarkdownString

func FormatCurrentUserPATMarkdownString(out CurrentUserPATOutput) string

FormatCurrentUserPATMarkdownString formats a PAT as Markdown.

func FormatDeleteUserIdentityMarkdownString

func FormatDeleteUserIdentityMarkdownString(o DeleteUserIdentityOutput) string

FormatDeleteUserIdentityMarkdownString renders a delete identity result as Markdown.

func FormatEmailListMarkdown

func FormatEmailListMarkdown(o EmailListOutput) *mcp.CallToolResult

FormatEmailListMarkdown renders an email list as an MCP CallToolResult.

func FormatEmailListMarkdownString

func FormatEmailListMarkdownString(o EmailListOutput) string

FormatEmailListMarkdownString renders an email list as a Markdown string.

func FormatListMarkdown

func FormatListMarkdown(o ListOutput) *mcp.CallToolResult

FormatListMarkdown renders a user list as an MCP CallToolResult.

func FormatListMarkdownString

func FormatListMarkdownString(o ListOutput) string

FormatListMarkdownString renders a user list as a Markdown string.

func FormatMarkdown

func FormatMarkdown(u Output) *mcp.CallToolResult

FormatMarkdown renders the user as an MCP CallToolResult.

func FormatMarkdownString

func FormatMarkdownString(u Output) string

FormatMarkdownString renders the authenticated user profile as a Markdown summary.

func FormatSSHKeyListMarkdown

func FormatSSHKeyListMarkdown(o SSHKeyListOutput) *mcp.CallToolResult

FormatSSHKeyListMarkdown renders an SSH key list as an MCP CallToolResult.

func FormatSSHKeyListMarkdownString

func FormatSSHKeyListMarkdownString(o SSHKeyListOutput) string

FormatSSHKeyListMarkdownString renders an SSH key list as a Markdown string.

func FormatSSHKeyMarkdown

func FormatSSHKeyMarkdown(o SSHKeyOutput) *mcp.CallToolResult

FormatSSHKeyMarkdown renders a single SSH key as an MCP CallToolResult.

func FormatSSHKeyMarkdownString

func FormatSSHKeyMarkdownString(o SSHKeyOutput) string

FormatSSHKeyMarkdownString renders a single SSH key as a Markdown string.

func FormatServiceAccountListMarkdownString

func FormatServiceAccountListMarkdownString(out ServiceAccountListOutput) string

FormatServiceAccountListMarkdownString formats a list of service accounts as Markdown.

func FormatStatusMarkdown

func FormatStatusMarkdown(o StatusOutput) *mcp.CallToolResult

FormatStatusMarkdown renders a user status as an MCP CallToolResult.

func FormatStatusMarkdownString

func FormatStatusMarkdownString(o StatusOutput) string

FormatStatusMarkdownString renders a user status as a Markdown string.

func FormatUserActivitiesMarkdownString

func FormatUserActivitiesMarkdownString(o UserActivitiesOutput) string

FormatUserActivitiesMarkdownString renders user activities as a Markdown string.

func FormatUserMembershipsMarkdownString

func FormatUserMembershipsMarkdownString(o UserMembershipsOutput) string

FormatUserMembershipsMarkdownString renders user memberships as a Markdown string.

func FormatUserRunnerMarkdownString

func FormatUserRunnerMarkdownString(o UserRunnerOutput) string

FormatUserRunnerMarkdownString renders a user runner as a Markdown string.

func RegisterEnterpriseTools

func RegisterEnterpriseTools(server *mcp.Server, client *gitlabclient.Client)

RegisterEnterpriseTools registers enterprise-only user tools (service accounts).

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers tools for user-related operations.

Types

type AddSSHKeyForUserInput

type AddSSHKeyForUserInput struct {
	UserID    int64  `json:"user_id" jsonschema:"The ID of the user,required"`
	Title     string `json:"title" jsonschema:"A descriptive title for the SSH key,required"`
	Key       string `json:"key" jsonschema:"The SSH public key content,required"`
	ExpiresAt string `json:"expires_at,omitempty" jsonschema:"Expiration date in ISO 8601 format (YYYY-MM-DD)"`
	UsageType string `json:"usage_type,omitempty" jsonschema:"Usage type: auth or signing (default: auth)"`
}

AddSSHKeyForUserInput holds parameters for adding an SSH key to a specific user.

type AddSSHKeyInput

type AddSSHKeyInput struct {
	Title     string `json:"title" jsonschema:"A descriptive title for the SSH key,required"`
	Key       string `json:"key" jsonschema:"The SSH public key content,required"`
	ExpiresAt string `json:"expires_at,omitempty" jsonschema:"Expiration date in ISO 8601 format (YYYY-MM-DD)"`
	UsageType string `json:"usage_type,omitempty" jsonschema:"Usage type: auth or signing (default: auth)"`
}

AddSSHKeyInput holds parameters for adding an SSH key to the current user.

type AdminActionInput

type AdminActionInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
}

AdminActionInput holds the user_id parameter for admin state actions.

type AdminActionOutput

type AdminActionOutput struct {
	UserID  int64  `json:"user_id"`
	Action  string `json:"action"`
	Success bool   `json:"success"`
}

AdminActionOutput represents the result of an admin state action.

func ActivateUser

func ActivateUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

ActivateUser activates a deactivated GitLab user (admin only).

func ApproveUser

func ApproveUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

ApproveUser approves a pending GitLab user (admin only).

func BanUser

BanUser bans a GitLab user (admin only).

func BlockUser

func BlockUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

BlockUser blocks a GitLab user (admin only).

func DeactivateUser

func DeactivateUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

DeactivateUser deactivates an active GitLab user (admin only).

func DisableTwoFactor

func DisableTwoFactor(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

DisableTwoFactor disables two-factor authentication for a GitLab user (admin only).

func RejectUser

func RejectUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

RejectUser rejects a pending GitLab user (admin only).

func UnbanUser

func UnbanUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

UnbanUser unbans a previously banned GitLab user (admin only).

func UnblockUser

func UnblockUser(ctx context.Context, client *gitlabclient.Client, input AdminActionInput) (AdminActionOutput, error)

UnblockUser unblocks a previously blocked GitLab user (admin only).

type AssociationsCountOutput

type AssociationsCountOutput struct {
	toolutil.HintableOutput
	GroupsCount        int64 `json:"groups_count"`
	ProjectsCount      int64 `json:"projects_count"`
	IssuesCount        int64 `json:"issues_count"`
	MergeRequestsCount int64 `json:"merge_requests_count"`
}

AssociationsCountOutput represents a user's association counts.

func GetAssociationsCount

func GetAssociationsCount(ctx context.Context, client *gitlabclient.Client, input GetAssociationsCountInput) (AssociationsCountOutput, error)

GetAssociationsCount retrieves the count of a user's associations.

type ContributionEventOutput

type ContributionEventOutput struct {
	ID          int64  `json:"id"`
	Title       string `json:"title,omitempty"`
	ProjectID   int64  `json:"project_id"`
	ActionName  string `json:"action_name"`
	TargetID    int64  `json:"target_id,omitempty"`
	TargetIID   int64  `json:"target_iid,omitempty"`
	TargetType  string `json:"target_type,omitempty"`
	TargetURL   string `json:"target_url,omitempty"`
	TargetTitle string `json:"target_title,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
}

ContributionEventOutput represents a user contribution event.

type ContributionEventsOutput

type ContributionEventsOutput struct {
	toolutil.HintableOutput
	Events     []ContributionEventOutput `json:"events"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ContributionEventsOutput holds a paginated list of contribution events.

func ListContributionEvents

func ListContributionEvents(ctx context.Context, client *gitlabclient.Client, input ListContributionEventsInput) (ContributionEventsOutput, error)

ListContributionEvents retrieves contribution events for a user.

type CreateCurrentUserPATInput

type CreateCurrentUserPATInput struct {
	Name        string   `json:"name" jsonschema:"Name of the personal access token,required"`
	Scopes      []string `json:"scopes" jsonschema:"Array of scopes,required"`
	Description string   `json:"description,omitempty" jsonschema:"Description for the token"`
	ExpiresAt   string   `json:"expires_at,omitempty" jsonschema:"Token expiration date (YYYY-MM-DD)"`
}

CreateCurrentUserPATInput holds parameters for creating a PAT for the current user.

type CreateInput

type CreateInput struct {
	Email               string `json:"email" jsonschema:"The user email address,required"`
	Name                string `json:"name" jsonschema:"The user display name,required"`
	Username            string `json:"username" jsonschema:"The username,required"`
	Password            string `json:"password,omitempty" jsonschema:"The user password (required unless reset_password or force_random_password is set)"`
	ResetPassword       *bool  `json:"reset_password,omitempty" jsonschema:"Send a password reset email instead of setting password"`
	ForceRandomPassword *bool  `json:"force_random_password,omitempty" jsonschema:"Set a random password instead of requiring one"`
	SkipConfirmation    *bool  `json:"skip_confirmation,omitempty" jsonschema:"Skip confirmation email and activate user immediately"`
	Admin               *bool  `json:"admin,omitempty" jsonschema:"Grant admin privileges"`
	External            *bool  `json:"external,omitempty" jsonschema:"Mark user as external"`
	Bio                 string `json:"bio,omitempty" jsonschema:"User bio text"`
	Location            string `json:"location,omitempty" jsonschema:"User location"`
	JobTitle            string `json:"job_title,omitempty" jsonschema:"User job title"`
	Organization        string `json:"organization,omitempty" jsonschema:"User organization"`
	ProjectsLimit       *int64 `json:"projects_limit,omitempty" jsonschema:"Maximum number of projects the user can create"`
	Note                string `json:"note,omitempty" jsonschema:"Admin note about the user"`
}

CreateInput holds parameters for creating a new GitLab user (admin only).

type CreateServiceAccountInput

type CreateServiceAccountInput struct {
	Name     string `json:"name,omitempty" jsonschema:"Name for the service account"`
	Username string `json:"username,omitempty" jsonschema:"Username for the service account"`
	Email    string `json:"email,omitempty" jsonschema:"Email for the service account"`
}

CreateServiceAccountInput holds parameters for creating a service account.

type CreateUserRunnerInput

type CreateUserRunnerInput struct {
	RunnerType      string   `json:"runner_type" jsonschema:"Runner type: instance_type or group_type or project_type,required"`
	GroupID         *int64   `json:"group_id,omitempty" jsonschema:"Group ID (required for group_type runners)"`
	ProjectID       *int64   `json:"project_id,omitempty" jsonschema:"Project ID (required for project_type runners)"`
	Description     string   `json:"description,omitempty" jsonschema:"Runner description"`
	Paused          *bool    `json:"paused,omitempty" jsonschema:"Whether the runner should be paused"`
	Locked          *bool    `json:"locked,omitempty" jsonschema:"Whether the runner should be locked"`
	RunUntagged     *bool    `json:"run_untagged,omitempty" jsonschema:"Whether the runner can run untagged jobs"`
	TagList         []string `json:"tag_list,omitempty" jsonschema:"List of runner tags"`
	AccessLevel     string   `json:"access_level,omitempty" jsonschema:"Access level: not_protected or ref_protected"`
	MaximumTimeout  *int64   `json:"maximum_timeout,omitempty" jsonschema:"Maximum timeout for jobs in seconds"`
	MaintenanceNote string   `json:"maintenance_note,omitempty" jsonschema:"Maintenance note for the runner"`
}

CreateUserRunnerInput holds parameters for creating a runner linked to a user.

type CurrentInput

type CurrentInput struct{}

CurrentInput is an empty struct for the current user tool (no parameters needed).

type CurrentUserPATOutput

type CurrentUserPATOutput struct {
	ID          int64    `json:"id"`
	Name        string   `json:"name"`
	Active      bool     `json:"active"`
	Token       string   `json:"token,omitempty"`
	Scopes      []string `json:"scopes"`
	Revoked     bool     `json:"revoked"`
	Description string   `json:"description,omitempty"`
	UserID      int64    `json:"user_id"`
	CreatedAt   string   `json:"created_at,omitempty"`
	ExpiresAt   string   `json:"expires_at,omitempty"`
	LastUsedAt  string   `json:"last_used_at,omitempty"`
}

CurrentUserPATOutput represents a personal access token.

func CreateCurrentUserPAT

func CreateCurrentUserPAT(ctx context.Context, client *gitlabclient.Client, input CreateCurrentUserPATInput) (CurrentUserPATOutput, error)

CreateCurrentUserPAT creates a personal access token for the currently authenticated user.

type DeleteInput

type DeleteInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user to delete,required"`
}

DeleteInput holds parameters for deleting a GitLab user (admin only).

type DeleteOutput

type DeleteOutput struct {
	UserID  int64 `json:"user_id"`
	Deleted bool  `json:"deleted"`
}

DeleteOutput represents the result of deleting a user.

func Delete

func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (DeleteOutput, error)

Delete deletes a GitLab user (admin only).

type DeleteSSHKeyForUserInput

type DeleteSSHKeyForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	KeyID  int64 `json:"key_id" jsonschema:"The ID of the SSH key to delete,required"`
}

DeleteSSHKeyForUserInput holds parameters for deleting an SSH key from a specific user.

type DeleteSSHKeyInput

type DeleteSSHKeyInput struct {
	KeyID int64 `json:"key_id" jsonschema:"The ID of the SSH key to delete,required"`
}

DeleteSSHKeyInput holds parameters for deleting an SSH key from the current user.

type DeleteSSHKeyOutput

type DeleteSSHKeyOutput struct {
	KeyID   int64 `json:"key_id"`
	Deleted bool  `json:"deleted"`
}

DeleteSSHKeyOutput represents the result of deleting an SSH key.

func DeleteSSHKey

func DeleteSSHKey(ctx context.Context, client *gitlabclient.Client, input DeleteSSHKeyInput) (DeleteSSHKeyOutput, error)

DeleteSSHKey deletes an SSH key from the current authenticated user.

func DeleteSSHKeyForUser

func DeleteSSHKeyForUser(ctx context.Context, client *gitlabclient.Client, input DeleteSSHKeyForUserInput) (DeleteSSHKeyOutput, error)

DeleteSSHKeyForUser deletes an SSH key from a specific user (admin only).

type DeleteUserIdentityInput

type DeleteUserIdentityInput struct {
	UserID   int64  `json:"user_id" jsonschema:"The ID of the user,required"`
	Provider string `json:"provider" jsonschema:"The external provider name (e.g. ldap or saml),required"`
}

DeleteUserIdentityInput holds parameters for deleting a user's identity provider.

type DeleteUserIdentityOutput

type DeleteUserIdentityOutput struct {
	UserID   int64  `json:"user_id"`
	Provider string `json:"provider"`
	Deleted  bool   `json:"deleted"`
}

DeleteUserIdentityOutput represents the result of deleting a user identity.

func DeleteUserIdentity

func DeleteUserIdentity(ctx context.Context, client *gitlabclient.Client, input DeleteUserIdentityInput) (DeleteUserIdentityOutput, error)

DeleteUserIdentity deletes a user's identity provider (admin only).

type EmailListOutput

type EmailListOutput struct {
	toolutil.HintableOutput
	Emails []EmailOutput `json:"emails"`
}

EmailListOutput holds a list of emails.

func ListEmails

ListEmails retrieves email addresses for the current authenticated user.

type EmailOutput

type EmailOutput struct {
	ID          int64  `json:"id"`
	Email       string `json:"email"`
	ConfirmedAt string `json:"confirmed_at,omitempty"`
}

EmailOutput represents an email address.

type GetAssociationsCountInput

type GetAssociationsCountInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
}

GetAssociationsCountInput holds parameters for getting user association counts.

type GetInput

type GetInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user to retrieve,required"`
}

GetInput holds parameters for retrieving a single user.

type GetSSHKeyForUserInput

type GetSSHKeyForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	KeyID  int64 `json:"key_id" jsonschema:"The ID of the SSH key,required"`
}

GetSSHKeyForUserInput holds parameters for retrieving a specific SSH key for a user.

type GetSSHKeyInput

type GetSSHKeyInput struct {
	KeyID int64 `json:"key_id" jsonschema:"The ID of the SSH key,required"`
}

GetSSHKeyInput holds parameters for retrieving a specific SSH key.

type GetStatusInput

type GetStatusInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user whose status to retrieve,required"`
}

GetStatusInput holds parameters for retrieving a user's status.

type GetUserActivitiesInput

type GetUserActivitiesInput struct {
	From    string `json:"from,omitempty" jsonschema:"Only activities after this date (YYYY-MM-DD)"`
	Page    int64  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int64  `json:"per_page,omitempty" jsonschema:"Number of items per page (max 100)"`
}

GetUserActivitiesInput holds parameters for listing user activities (admin only).

type GetUserMembershipsInput

type GetUserMembershipsInput struct {
	UserID  int64  `json:"user_id" jsonschema:"The ID of the user,required"`
	Type    string `json:"type,omitempty" jsonschema:"Filter by membership type: Project or Namespace"`
	Page    int64  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int64  `json:"per_page,omitempty" jsonschema:"Number of items per page (max 100)"`
}

GetUserMembershipsInput holds parameters for listing a user's memberships.

type ListContributionEventsInput

type ListContributionEventsInput struct {
	UserID     int64  `json:"user_id" jsonschema:"The ID of the user whose events to retrieve,required"`
	Action     string `` /* 176-byte string literal not displayed */
	TargetType string `` /* 131-byte string literal not displayed */
	Before     string `json:"before,omitempty" jsonschema:"Only events before this date (YYYY-MM-DD)"`
	After      string `json:"after,omitempty" jsonschema:"Only events after this date (YYYY-MM-DD)"`
	Sort       string `json:"sort,omitempty" jsonschema:"Sort order: asc or desc"`
	Page       int64  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage    int64  `json:"per_page,omitempty" jsonschema:"Number of items per page (max 100)"`
}

ListContributionEventsInput holds parameters for listing user contribution events.

type ListEmailsInput

type ListEmailsInput struct{}

ListEmailsInput is an empty struct for listing current user's emails.

type ListInput

type ListInput struct {
	Search   string `json:"search,omitempty" jsonschema:"Search users by name or username or email"`
	Username string `json:"username,omitempty" jsonschema:"Filter by exact username"`
	Active   *bool  `json:"active,omitempty" jsonschema:"Filter for active users only"`
	Blocked  *bool  `json:"blocked,omitempty" jsonschema:"Filter for blocked users only"`
	External *bool  `json:"external,omitempty" jsonschema:"Filter for external users only"`
	OrderBy  string `json:"order_by,omitempty" jsonschema:"Order by: id | name | username | created_at | updated_at"`
	Sort     string `json:"sort,omitempty" jsonschema:"Sort order: asc or desc"`
	Page     int64  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage  int64  `json:"per_page,omitempty" jsonschema:"Number of items per page (max 100)"`
}

ListInput holds parameters for listing GitLab users.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Users      []Output                  `json:"users"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput holds a paginated list of users.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List retrieves a paginated list of GitLab users.

type ListSSHKeysForUserInput

type ListSSHKeysForUserInput struct {
	UserID  int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	Page    int64 `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int64 `json:"per_page,omitempty" jsonschema:"Number of items per page (max 100)"`
}

ListSSHKeysForUserInput holds parameters for listing SSH keys for a specific user.

type ListSSHKeysInput

type ListSSHKeysInput struct {
	Page    int64 `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int64 `json:"per_page,omitempty" jsonschema:"Number of items per page (max 100)"`
}

ListSSHKeysInput holds parameters for listing SSH keys.

type ListServiceAccountsInput

type ListServiceAccountsInput struct {
	OrderBy string `json:"order_by,omitempty" jsonschema:"Field to order by (id/username/name)"`
	Sort    string `json:"sort,omitempty" jsonschema:"Sort direction (asc/desc)"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Items per page (max 100)"`
}

ListServiceAccountsInput holds parameters for listing service accounts.

type ModifyInput

type ModifyInput struct {
	UserID             int64  `json:"user_id" jsonschema:"The ID of the user to modify,required"`
	Email              string `json:"email,omitempty" jsonschema:"New email address"`
	Name               string `json:"name,omitempty" jsonschema:"New display name"`
	Username           string `json:"username,omitempty" jsonschema:"New username"`
	Password           string `json:"password,omitempty" jsonschema:"New password"`
	Admin              *bool  `json:"admin,omitempty" jsonschema:"Grant or revoke admin privileges"`
	External           *bool  `json:"external,omitempty" jsonschema:"Mark or unmark as external"`
	SkipReconfirmation *bool  `json:"skip_reconfirmation,omitempty" jsonschema:"Skip reconfirmation on email change"`
	Bio                string `json:"bio,omitempty" jsonschema:"New bio text"`
	Location           string `json:"location,omitempty" jsonschema:"New location"`
	JobTitle           string `json:"job_title,omitempty" jsonschema:"New job title"`
	Organization       string `json:"organization,omitempty" jsonschema:"New organization"`
	ProjectsLimit      *int64 `json:"projects_limit,omitempty" jsonschema:"New maximum projects limit"`
	Note               string `json:"note,omitempty" jsonschema:"New admin note"`
	PrivateProfile     *bool  `json:"private_profile,omitempty" jsonschema:"Set profile as private"`
	CanCreateGroup     *bool  `json:"can_create_group,omitempty" jsonschema:"Allow user to create groups"`
	Locked             *bool  `json:"locked,omitempty" jsonschema:"Lock or unlock the user account"`
}

ModifyInput holds parameters for modifying an existing GitLab user (admin only).

type Output

type Output struct {
	toolutil.HintableOutput
	ID               int64  `json:"id"`
	Username         string `json:"username"`
	Email            string `json:"email"`
	Name             string `json:"name"`
	State            string `json:"state"`
	WebURL           string `json:"web_url"`
	AvatarURL        string `json:"avatar_url"`
	IsAdmin          bool   `json:"is_admin"`
	Bot              bool   `json:"bot"`
	Bio              string `json:"bio,omitempty"`
	Location         string `json:"location,omitempty"`
	JobTitle         string `json:"job_title,omitempty"`
	Organization     string `json:"organization,omitempty"`
	CreatedAt        string `json:"created_at,omitempty"`
	PublicEmail      string `json:"public_email,omitempty"`
	WebsiteURL       string `json:"website_url,omitempty"`
	LastActivityOn   string `json:"last_activity_on,omitempty"`
	TwoFactorEnabled bool   `json:"two_factor_enabled"`
	External         bool   `json:"external"`
	Locked           bool   `json:"locked"`
	PrivateProfile   bool   `json:"private_profile"`
	CurrentSignInAt  string `json:"current_sign_in_at,omitempty"`
	ProjectsLimit    int64  `json:"projects_limit"`
	CanCreateProject bool   `json:"can_create_project"`
	CanCreateGroup   bool   `json:"can_create_group"`
	Note             string `json:"note,omitempty"`
	UsingLicenseSeat bool   `json:"using_license_seat"`
	ThemeID          int64  `json:"theme_id,omitempty"`
	ColorSchemeID    int64  `json:"color_scheme_id,omitempty"`
}

Output represents the current authenticated GitLab user.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)

Create creates a new GitLab user (admin only).

func CreateServiceAccount

func CreateServiceAccount(ctx context.Context, client *gitlabclient.Client, input CreateServiceAccountInput) (Output, error)

CreateServiceAccount creates a new service account user.

func Current

func Current(ctx context.Context, client *gitlabclient.Client, _ CurrentInput) (Output, error)

Current retrieves the currently authenticated GitLab user.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

Get retrieves a single GitLab user by ID.

func Modify

func Modify(ctx context.Context, client *gitlabclient.Client, input ModifyInput) (Output, error)

Modify modifies an existing GitLab user (admin only).

type SSHKeyListOutput

type SSHKeyListOutput struct {
	toolutil.HintableOutput
	Keys       []SSHKeyOutput            `json:"keys"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

SSHKeyListOutput holds a paginated list of SSH keys.

func ListSSHKeys

func ListSSHKeys(ctx context.Context, client *gitlabclient.Client, input ListSSHKeysInput) (SSHKeyListOutput, error)

ListSSHKeys retrieves SSH keys for the current authenticated user.

func ListSSHKeysForUser

func ListSSHKeysForUser(ctx context.Context, client *gitlabclient.Client, input ListSSHKeysForUserInput) (SSHKeyListOutput, error)

ListSSHKeysForUser retrieves SSH keys for a specific user.

type SSHKeyOutput

type SSHKeyOutput struct {
	ID        int64  `json:"id"`
	Title     string `json:"title"`
	Key       string `json:"key"`
	CreatedAt string `json:"created_at,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty"`
	UsageType string `json:"usage_type,omitempty"`
}

SSHKeyOutput represents an SSH key.

func AddSSHKey

func AddSSHKey(ctx context.Context, client *gitlabclient.Client, input AddSSHKeyInput) (SSHKeyOutput, error)

AddSSHKey adds an SSH key to the current authenticated user.

func AddSSHKeyForUser

func AddSSHKeyForUser(ctx context.Context, client *gitlabclient.Client, input AddSSHKeyForUserInput) (SSHKeyOutput, error)

AddSSHKeyForUser adds an SSH key to a specific user (admin only).

func GetSSHKey

func GetSSHKey(ctx context.Context, client *gitlabclient.Client, input GetSSHKeyInput) (SSHKeyOutput, error)

GetSSHKey retrieves a specific SSH key for the current user.

func GetSSHKeyForUser

func GetSSHKeyForUser(ctx context.Context, client *gitlabclient.Client, input GetSSHKeyForUserInput) (SSHKeyOutput, error)

GetSSHKeyForUser retrieves a specific SSH key for a user.

type ServiceAccountListOutput

type ServiceAccountListOutput struct {
	Accounts []ServiceAccountOutput `json:"accounts"`
}

ServiceAccountListOutput holds a list of service accounts.

func ListServiceAccounts

func ListServiceAccounts(ctx context.Context, client *gitlabclient.Client, input ListServiceAccountsInput) (ServiceAccountListOutput, error)

ListServiceAccounts lists all service accounts.

type ServiceAccountOutput

type ServiceAccountOutput struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Name     string `json:"name"`
}

ServiceAccountOutput represents a service account.

type SetStatusInput

type SetStatusInput struct {
	Emoji            string `json:"emoji,omitempty" jsonschema:"The emoji to set for the status (e.g. coffee or speech_balloon)"`
	Message          string `json:"message,omitempty" jsonschema:"The status message text"`
	Availability     string `json:"availability,omitempty" jsonschema:"The availability: not_set or busy"`
	ClearStatusAfter string `` /* 153-byte string literal not displayed */
}

SetStatusInput holds parameters for setting the current user's status.

type StatusOutput

type StatusOutput struct {
	toolutil.HintableOutput
	Emoji         string `json:"emoji,omitempty"`
	Availability  string `json:"availability,omitempty"`
	Message       string `json:"message,omitempty"`
	MessageHTML   string `json:"message_html,omitempty"`
	ClearStatusAt string `json:"clear_status_at,omitempty"`
}

StatusOutput represents a user's status.

func CurrentUserStatus

func CurrentUserStatus(ctx context.Context, client *gitlabclient.Client, _ CurrentInput) (StatusOutput, error)

CurrentUserStatus retrieves the status of the current authenticated user.

func GetStatus

func GetStatus(ctx context.Context, client *gitlabclient.Client, input GetStatusInput) (StatusOutput, error)

GetStatus retrieves the status of a specific user.

func SetStatus

func SetStatus(ctx context.Context, client *gitlabclient.Client, input SetStatusInput) (StatusOutput, error)

SetStatus sets the current user's status.

type UserActivitiesOutput

type UserActivitiesOutput struct {
	Activities []UserActivityOutput      `json:"activities"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

UserActivitiesOutput holds a paginated list of user activities.

func GetUserActivities

func GetUserActivities(ctx context.Context, client *gitlabclient.Client, input GetUserActivitiesInput) (UserActivitiesOutput, error)

GetUserActivities retrieves user activity entries (admin only).

type UserActivityOutput

type UserActivityOutput struct {
	Username       string `json:"username"`
	LastActivityOn string `json:"last_activity_on,omitempty"`
}

UserActivityOutput represents a user activity entry.

type UserMembershipOutput

type UserMembershipOutput struct {
	SourceID    int64  `json:"source_id"`
	SourceName  string `json:"source_name"`
	SourceType  string `json:"source_type"`
	AccessLevel int64  `json:"access_level"`
}

UserMembershipOutput represents a user's membership in a project or group.

type UserMembershipsOutput

type UserMembershipsOutput struct {
	Memberships []UserMembershipOutput    `json:"memberships"`
	Pagination  toolutil.PaginationOutput `json:"pagination"`
}

UserMembershipsOutput holds a paginated list of user memberships.

func GetUserMemberships

func GetUserMemberships(ctx context.Context, client *gitlabclient.Client, input GetUserMembershipsInput) (UserMembershipsOutput, error)

GetUserMemberships retrieves a user's project and group memberships.

type UserRunnerOutput

type UserRunnerOutput struct {
	ID             int64  `json:"id"`
	Token          string `json:"token"`
	TokenExpiresAt string `json:"token_expires_at,omitempty"`
}

UserRunnerOutput represents a GitLab runner linked to the current user.

func CreateUserRunner

func CreateUserRunner(ctx context.Context, client *gitlabclient.Client, input CreateUserRunnerInput) (UserRunnerOutput, error)

CreateUserRunner creates a runner linked to the current user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL