admins

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package admins provides services for managing Intercom admins and teams.

The Service handles admin retrieval and listing. TeamsService manages team definitions, and AwayStatusReasonsService manages away status reasons for teammates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityLog

type ActivityLog struct {
	ID                  string           `json:"id"`
	PerformedBy         ActivityLogAdmin `json:"performed_by"`
	Metadata            map[string]any   `json:"metadata,omitempty"`
	CreatedAt           int64            `json:"created_at"`
	ActivityType        string           `json:"activity_type"`
	ActivityDescription string           `json:"activity_description,omitempty"`
}

ActivityLog represents an admin activity log entry.

type ActivityLogAdmin

type ActivityLogAdmin struct {
	Type  string `json:"type"`
	ID    string `json:"id"`
	Email string `json:"email,omitempty"`
	IP    string `json:"ip,omitempty"`
}

ActivityLogAdmin represents the admin who performed an activity.

type ActivityLogList

type ActivityLogList struct {
	Type         string           `json:"type"`
	Pages        *api.CursorPages `json:"pages,omitempty"`
	ActivityLogs []ActivityLog    `json:"activity_logs"`
}

ActivityLogList represents a paginated list of activity logs.

func ParseListActivityLogsResult

func ParseListActivityLogsResult(r *api.Result) (*ActivityLogList, error)

ParseListActivityLogsResult decodes a Result into an ActivityLogList.

type ActivityLogListOptions

type ActivityLogListOptions struct {
	CreatedAtAfter  string `url:"created_at_after,omitempty"`
	CreatedAtBefore string `url:"created_at_before,omitempty"`
}

ActivityLogListOptions specifies the query parameters for ListActivityLogs.

type Admin

type Admin struct {
	Type               string         `json:"type"`
	ID                 string         `json:"id"`
	Name               string         `json:"name,omitempty"`
	Email              string         `json:"email,omitempty"`
	JobTitle           string         `json:"job_title,omitempty"`
	AwayModeEnabled    bool           `json:"away_mode_enabled,omitempty"`
	AwayModeReassign   bool           `json:"away_mode_reassign,omitempty"`
	AwayStatusReasonID *int           `json:"away_status_reason_id,omitempty"`
	HasInboxSeat       bool           `json:"has_inbox_seat,omitempty"`
	TeamIDs            []int          `json:"team_ids,omitempty"`
	Avatar             *Avatar        `json:"avatar,omitempty"`
	TeamPriorityLevel  map[string]any `json:"team_priority_level,omitempty"`
	EmailVerified      *bool          `json:"email_verified,omitempty"`
	App                *App           `json:"app,omitempty"`
}

Admin represents an Intercom admin (teammate).

func ParseGetResult

func ParseGetResult(r *api.Result) (*Admin, error)

ParseGetResult decodes a Result into an Admin.

func ParseMeResult

func ParseMeResult(r *api.Result) (*Admin, error)

ParseMeResult decodes a Result into an Admin.

func ParseSetAwayResult

func ParseSetAwayResult(r *api.Result) (*Admin, error)

ParseSetAwayResult decodes a Result into an Admin.

type App

type App struct {
	Type                 string `json:"type"`
	IDCode               string `json:"id_code,omitempty"`
	Name                 string `json:"name,omitempty"`
	Region               string `json:"region,omitempty"`
	Timezone             string `json:"timezone,omitempty"`
	CreatedAt            int64  `json:"created_at,omitempty"`
	IdentityVerification bool   `json:"identity_verification,omitempty"`
}

App represents an Intercom workspace.

type Avatar

type Avatar struct {
	Type     string `json:"type,omitempty"`
	ImageURL string `json:"image_url,omitempty"`
}

Avatar represents an admin's avatar.

type AwayStatusReason

type AwayStatusReason struct {
	Type      string `json:"type"`
	ID        string `json:"id"`
	Label     string `json:"label,omitempty"`
	Emoji     string `json:"emoji,omitempty"`
	Order     int    `json:"order,omitempty"`
	Deleted   bool   `json:"deleted,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`
	UpdatedAt int64  `json:"updated_at,omitempty"`
}

AwayStatusReason represents an Intercom away status reason.

func ParseAwayStatusReasonListResult

func ParseAwayStatusReasonListResult(r *api.Result) ([]AwayStatusReason, error)

ParseAwayStatusReasonListResult decodes a Result into a slice of AwayStatusReason.

type AwayStatusReasonsService

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

AwayStatusReasonsService handles communication with the away status reason related methods of the Intercom API.

func NewAwayStatusReasonsService

func NewAwayStatusReasonsService(c api.Caller) *AwayStatusReasonsService

NewAwayStatusReasonsService creates a new AwayStatusReasonsService.

func (*AwayStatusReasonsService) List

List returns all away status reasons (including deleted ones).

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/away-status-reasons/listawaystatusreasons

func (*AwayStatusReasonsService) ListRaw

ListRaw returns all away status reasons with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/away-status-reasons/listawaystatusreasons

type List

type List struct {
	Type   string  `json:"type"`
	Admins []Admin `json:"admins"`
}

List represents a list of admins.

func ParseListResult

func ParseListResult(r *api.Result) (*List, error)

ParseListResult decodes a Result into a List.

type Service

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

Service handles communication with the admin related methods of the Intercom API.

func NewService

func NewService(c api.Caller) *Service

NewService creates a new admins Service.

func (*Service) GetRaw

func (s *Service) GetRaw(ctx context.Context, id string) (*api.Result, error)

GetRaw retrieves an admin by ID with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/retrieveadmin

func (*Service) List

func (s *Service) List(ctx context.Context) (*List, error)

List returns all admins for the workspace.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/listadmins

func (*Service) ListActivityLogs

func (s *Service) ListActivityLogs(ctx context.Context, opts *ActivityLogListOptions) (*ActivityLogList, error)

ListActivityLogs returns activity logs for the workspace.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/listactivitylogs

func (*Service) ListActivityLogsRaw

func (s *Service) ListActivityLogsRaw(ctx context.Context, opts *ActivityLogListOptions) (*api.Result, error)

ListActivityLogsRaw returns activity logs for the workspace with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/listactivitylogs

func (*Service) ListRaw

func (s *Service) ListRaw(ctx context.Context) (*api.Result, error)

ListRaw returns all admins for the workspace with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/listadmins

func (*Service) Me

func (s *Service) Me(ctx context.Context) (*Admin, error)

Me returns the currently authenticated admin along with the app.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/identifyadmin

func (*Service) MeRaw

func (s *Service) MeRaw(ctx context.Context) (*api.Result, error)

MeRaw returns the currently authenticated admin with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/identifyadmin

func (*Service) SetAway

func (s *Service) SetAway(ctx context.Context, id string, body *SetAwayRequest) (*Admin, error)

SetAway sets an admin's away status.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/setawayadmin

func (*Service) SetAwayRaw

func (s *Service) SetAwayRaw(ctx context.Context, id string, body *SetAwayRequest) (*api.Result, error)

SetAwayRaw sets an admin's away status with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/setawayadmin

type SetAwayRequest

type SetAwayRequest struct {
	AwayModeEnabled    bool `json:"away_mode_enabled"`
	AwayModeReassign   bool `json:"away_mode_reassign"`
	AwayStatusReasonID *int `json:"away_status_reason_id,omitempty"`
}

SetAwayRequest represents the request body for setting an admin's away status.

type Team

type Team struct {
	Type               string  `json:"type"`
	ID                 string  `json:"id"`
	Name               string  `json:"name,omitempty"`
	AdminIDs           []int64 `json:"admin_ids,omitempty"`
	AssignmentLimit    *int    `json:"assignment_limit,omitempty"`
	DistributionMethod *string `json:"distribution_method,omitempty"`
}

Team represents an Intercom team.

func ParseTeamGetResult

func ParseTeamGetResult(r *api.Result) (*Team, error)

ParseTeamGetResult decodes a Result into a Team.

type TeamList

type TeamList struct {
	Type  string `json:"type"`
	Teams []Team `json:"teams"`
}

TeamList represents the response from the list teams endpoint.

func ParseTeamListResult

func ParseTeamListResult(r *api.Result) (*TeamList, error)

ParseTeamListResult decodes a Result into a TeamList.

type TeamsService

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

TeamsService handles communication with the team related methods of the Intercom API.

func NewTeamsService

func NewTeamsService(c api.Caller) *TeamsService

NewTeamsService creates a new TeamsService.

func (*TeamsService) GetRaw

func (s *TeamsService) GetRaw(ctx context.Context, id string) (*api.Result, error)

GetRaw retrieves a team by ID with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/teams/retrieveteam

func (*TeamsService) ListRaw

func (s *TeamsService) ListRaw(ctx context.Context) (*api.Result, error)

ListRaw returns all teams with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/teams/listteams

Jump to

Keyboard shortcuts

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