or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

actions.mdadditional-services.mdapps.mdchecks.mdclient.mdenterprise.mdgit.mdindex.mdissues.mdorganizations.mdrepositories.mdteams.mdusers.md
tile.json

enterprise.mddocs/

Enterprise

GitHub Enterprise management including audit logs, SCIM user provisioning, and enterprise-level settings.

EnterpriseService

The EnterpriseService provides methods for GitHub Enterprise operations.

type EnterpriseService struct{}

Enterprise Audit Log

// GetAuditLog gets the audit log for an enterprise
func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error)

type GetAuditLogOptions struct {
    Phrase  *string  // Search query
    Include *string  // "web", "git", "all"
    After   *string  // Cursor for pagination
    Before  *string  // Cursor for pagination
    Order   *string  // "asc", "desc"
    Page    *int
    PerPage *int
}

type AuditEntry struct {
    Timestamp     *int64
    Action        *string
    Active        *bool
    Actor         *string
    ActorID       *int64
    ActorLocation *ActorLocation
    Data          map[string]interface{}
    Org           *string
    OrgID         *int64
    Business      *string
    BusinessID    *int64
    User          *string
    UserID        *int64
}

SCIM User Provisioning

List and Get Users

// ListEnterpriseUsers lists all SCIM provisioned enterprise members
func (s *EnterpriseService) ListEnterpriseUsers(ctx context.Context, enterprise string, opts *ListSCIMUsersOptions) (*SCIMUserList, *Response, error)

// GetEnterpriseUserByID gets a SCIM provisioned user by ID
func (s *EnterpriseService) GetEnterpriseUserByID(ctx context.Context, enterprise string, userID string) (*EnterpriseUser, *Response, error)

type ListSCIMUsersOptions struct {
    StartIndex *int
    Count      *int
    Filter     string
}

type SCIMUserList struct {
    Schemas      []string
    TotalResults int
    ItemsPerPage int
    StartIndex   int
    Resources    []*EnterpriseUser
}

type EnterpriseUser struct {
    Schemas      []string
    ID           string
    ExternalID   string
    UserName     string
    Name         EnterpriseUserName
    Emails       []EnterpriseUserEmail
    Groups       []EnterpriseUserGroup
    Active       bool
    Meta         *SCIMUserMeta
}

type EnterpriseUserName struct {
    GivenName  string
    FamilyName string
}

type EnterpriseUserEmail struct {
    Value   string
    Primary bool
    Type    string
}

Create, Update, and Delete Users

// CreateEnterpriseUser provisions an enterprise member
func (s *EnterpriseService) CreateEnterpriseUser(ctx context.Context, enterprise string, user *EnterpriseUser) (*EnterpriseUser, *Response, error)

// UpdateEnterpriseUserByID updates a SCIM provisioned user
func (s *EnterpriseService) UpdateEnterpriseUserByID(ctx context.Context, enterprise string, userID string, user *EnterpriseUser) (*EnterpriseUser, *Response, error)

// DeleteEnterpriseUserByID deletes a SCIM provisioned user
func (s *EnterpriseService) DeleteEnterpriseUserByID(ctx context.Context, enterprise string, userID string) (*Response, error)

Usage:

// Create a SCIM user
newUser := &github.EnterpriseUser{
    Schemas:    []string{"urn:ietf:params:scim:schemas:core:2.0:User"},
    UserName:   "jdoe",
    ExternalID: "12345",
    Name: github.EnterpriseUserName{
        GivenName:  "John",
        FamilyName: "Doe",
    },
    Emails: []github.EnterpriseUserEmail{
        {
            Value:   "john.doe@example.com",
            Primary: true,
            Type:    "work",
        },
    },
    Active: true,
}

user, _, err := client.Enterprise.CreateEnterpriseUser(ctx, "enterprise-slug", newUser)

SCIM Groups

List and Get Groups

// ListEnterpriseGroups lists all SCIM provisioned enterprise groups
func (s *EnterpriseService) ListEnterpriseGroups(ctx context.Context, enterprise string, opts *ListSCIMGroupsOptions) (*SCIMGroupList, *Response, error)

// GetEnterpriseGroupByID gets a SCIM provisioned group by ID
func (s *EnterpriseService) GetEnterpriseGroupByID(ctx context.Context, enterprise string, groupID string) (*EnterpriseGroup, *Response, error)

type ListSCIMGroupsOptions struct {
    StartIndex *int
    Count      *int
    Filter     string
}

type SCIMGroupList struct {
    Schemas      []string
    TotalResults int
    ItemsPerPage int
    StartIndex   int
    Resources    []*EnterpriseGroup
}

type EnterpriseGroup struct {
    Schemas     []string
    ID          string
    ExternalID  string
    DisplayName string
    Members     []EnterpriseGroupMember
    Meta        *SCIMGroupMeta
}

Create, Update, and Delete Groups

// CreateEnterpriseGroup provisions an enterprise group
func (s *EnterpriseService) CreateEnterpriseGroup(ctx context.Context, enterprise string, group *EnterpriseGroup) (*EnterpriseGroup, *Response, error)

// UpdateEnterpriseGroupByID updates a SCIM provisioned group
func (s *EnterpriseService) UpdateEnterpriseGroupByID(ctx context.Context, enterprise string, groupID string, group *EnterpriseGroup) (*EnterpriseGroup, *Response, error)

// DeleteEnterpriseGroupByID deletes a SCIM provisioned group
func (s *EnterpriseService) DeleteEnterpriseGroupByID(ctx context.Context, enterprise string, groupID string) (*Response, error)

Enterprise Settings

// GetServerStatistics gets GitHub Enterprise Server statistics
func (s *EnterpriseService) GetServerStatistics(ctx context.Context, opts *GetServerStatisticsOptions) (*ServerStatistics, *Response, error)

type ServerStatistics struct {
    ServerID      *string
    CollectionDate *string
    SchemaVersion *string
    GHESVersion   *string
    HostName      *string
    // Additional statistics fields
}

Enterprise Code Security and Analysis

// GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise
func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error)

// UpdateCodeSecurityAndAnalysis updates code security and analysis features for an enterprise
func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error)

AdminService

The AdminService provides GitHub Enterprise Server admin operations.

type AdminService struct {
    // Service fields
}

Admin Statistics

// GetAdminStats gets admin statistics
func (s *AdminService) GetAdminStats(ctx context.Context, opts *GetAdminStatsOptions) (*AdminStats, *Response, error)

type AdminStats struct {
    Repos         *RepoStats
    Hooks         *HookStats
    Pages         *PageStats
    Orgs          *OrgStats
    Users         *UserStats
    Pulls         *PullStats
    Issues        *IssueStats
    Milestones    *MilestoneStats
    Gists         *GistStats
    Comments      *CommentStats
}

Create and Manage Organizations

// CreateOrg creates a new organization
func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error)

// RenameOrg renames an organization
func (s *AdminService) RenameOrg(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error)

// RenameOrgByID renames an organization by ID
func (s *AdminService) RenameOrgByID(ctx context.Context, orgID int64, newName string) (*RenameOrgResponse, *Response, error)

Manage Users

// CreateUser creates a new user
func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error)

// DeleteUser deletes a user
func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error)

// SuspendUser suspends a user
func (s *AdminService) SuspendUser(ctx context.Context, username string, opts *UserSuspendOptions) (*Response, error)

// UnsuspendUser unsuspends a user
func (s *AdminService) UnsuspendUser(ctx context.Context, username string) (*Response, error)

type UserSuspendOptions struct {
    Reason *string
}

Impersonate Users

// CreateUserImpersonation creates an impersonation token
func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error)

// DeleteUserImpersonation deletes an impersonation token
func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error)

type ImpersonateUserOptions struct {
    Scopes []string
}

Manage Teams

// CreateTeam creates a new team
func (s *AdminService) CreateTeam(ctx context.Context, org string, team *CreateTeamOptions) (*Team, *Response, error)

Manage Pre-receive Hooks

// ListPreReceiveHooks lists all pre-receive hooks
func (s *AdminService) ListPreReceiveHooks(ctx context.Context, opts *ListOptions) ([]*PreReceiveHook, *Response, error)

// GetPreReceiveHook gets a single pre-receive hook
func (s *AdminService) GetPreReceiveHook(ctx context.Context, id int64) (*PreReceiveHook, *Response, error)

// CreatePreReceiveHook creates a new pre-receive hook
func (s *AdminService) CreatePreReceiveHook(ctx context.Context, hook *PreReceiveHook) (*PreReceiveHook, *Response, error)

// UpdatePreReceiveHook updates a pre-receive hook
func (s *AdminService) UpdatePreReceiveHook(ctx context.Context, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error)

// DeletePreReceiveHook deletes a pre-receive hook
func (s *AdminService) DeletePreReceiveHook(ctx context.Context, id int64) (*Response, error)

type PreReceiveHook struct {
    ID                *int64
    Name              *string
    Script            *string
    ScriptRepository  *Repository
    Environment       *PreReceiveEnvironment
    Enforcement       *string
    AllowDownstreamConfiguration *bool
}

Indexing

// QueueIndexingJob queues a repository for indexing
func (s *AdminService) QueueIndexingJob(ctx context.Context, owner, repo string) (*Response, error)