enterprise

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Ok    bool   `json:"ok"`
	Error string `json:"error"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client, token, botToken, enterpriseID string) *Client

func (*Client) GetRoleAssignments

func (c *Client) GetRoleAssignments(ctx context.Context, roleID string) ([]RoleAssignment, error)

GetRoleAssignments returns the role assignments for the given role ID.

func (*Client) GetTeams

func (c *Client) GetTeams(ctx context.Context, cursor string) ([]slack.Team, string, error)

GetTeams returns the teams of the given enterprise.

func (*Client) GetUserGroupMembers

func (c *Client) GetUserGroupMembers(ctx context.Context, userGroupID, teamID string) ([]string, error)

GetUserGroupMembers returns the members of the given user group from a given team.

func (*Client) GetUserGroups

func (c *Client) GetUserGroups(ctx context.Context, teamID string) ([]slack.UserGroup, error)

GetUserGroups returns the user groups for the given team.

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(ctx context.Context, userID string) (*User, error)

GetUserInfo returns the user info for the given user ID.

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context, teamID, cursor string) ([]UserAdmin, string, error)

GetUsers returns the users of the given team.

type EnterpriseUser

type EnterpriseUser struct {
	ID             string   `json:"id"`
	EnterpriseID   string   `json:"enterprise_id"`
	EnterpriseName string   `json:"enterprise_name"`
	IsAdmin        bool     `json:"is_admin"`
	IsOwner        bool     `json:"is_owner"`
	IsPrimaryOwner bool     `json:"is_primary_owner"`
	Teams          []string `json:"teams"`
}

type Pagination

type Pagination struct {
	ResponseMetadata struct {
		NextCursor string `json:"next_cursor"`
	} `json:"response_metadata"`
}

type RateLimitError added in v0.0.8

type RateLimitError struct {
	RetryAfter time.Duration
}

func (*RateLimitError) Error added in v0.0.8

func (r *RateLimitError) Error() string

type RoleAssignment

type RoleAssignment struct {
	RoleID     string `json:"role_id"`
	EntityID   string `json:"entity_id"`
	UserID     string `json:"user_id"`
	DateCreate int64  `json:"date_create"`
}

type User

type User struct {
	ID                string            `json:"id"`
	TeamID            string            `json:"team_id"`
	Name              string            `json:"name"`
	Deleted           bool              `json:"deleted"`
	Color             string            `json:"color"`
	RealName          string            `json:"real_name"`
	TZ                string            `json:"tz,omitempty"`
	TZLabel           string            `json:"tz_label"`
	TZOffset          int               `json:"tz_offset"`
	Profile           slack.UserProfile `json:"profile"`
	IsBot             bool              `json:"is_bot"`
	IsAdmin           bool              `json:"is_admin"`
	IsOwner           bool              `json:"is_owner"`
	IsPrimaryOwner    bool              `json:"is_primary_owner"`
	IsRestricted      bool              `json:"is_restricted"`
	IsUltraRestricted bool              `json:"is_ultra_restricted"`
	IsStranger        bool              `json:"is_stranger"`
	IsAppUser         bool              `json:"is_app_user"`
	IsInvitedUser     bool              `json:"is_invited_user"`
	Has2FA            bool              `json:"has_2fa"`
	TwoFactorType     string            `json:"two_factor_type"`
	HasFiles          bool              `json:"has_files"`
	Presence          string            `json:"presence"`
	Locale            string            `json:"locale"`
	Enterprise        EnterpriseUser    `json:"enterprise_user,omitempty"`
}

type UserAdmin

type UserAdmin struct {
	ID                string   `json:"id"`
	Email             string   `json:"email"`
	IsAdmin           bool     `json:"is_admin"`
	IsOwner           bool     `json:"is_owner"`
	IsPrimaryOwner    bool     `json:"is_primary_owner"`
	IsRestricted      bool     `json:"is_restricted"`
	IsUltraRestricted bool     `json:"is_ultra_restricted"`
	IsBot             bool     `json:"is_bot"`
	Username          string   `json:"username"`
	FullName          string   `json:"full_name"`
	IsActive          bool     `json:"is_active"`
	DateCreated       int64    `json:"date_created"`
	DeactivatedTs     int64    `json:"deactivated_ts"`
	ExpirationTs      int64    `json:"expiration_ts"`
	Workspaces        []string `json:"workspaces"`
	Has2Fa            bool     `json:"has_2fa"`
	HasSso            bool     `json:"has_sso"`
}

Jump to

Keyboard shortcuts

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