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 ¶
- type ActivityLog
- type ActivityLogAdmin
- type ActivityLogList
- type ActivityLogListOptions
- type Admin
- type App
- type Avatar
- type AwayStatusReason
- type AwayStatusReasonsService
- type List
- type Service
- func (s *Service) Get(ctx context.Context, id string) (*Admin, error)
- func (s *Service) GetRaw(ctx context.Context, id string) (*api.Result, error)
- func (s *Service) List(ctx context.Context) (*List, error)
- func (s *Service) ListActivityLogs(ctx context.Context, opts *ActivityLogListOptions) (*ActivityLogList, error)
- func (s *Service) ListActivityLogsRaw(ctx context.Context, opts *ActivityLogListOptions) (*api.Result, error)
- func (s *Service) ListRaw(ctx context.Context) (*api.Result, error)
- func (s *Service) Me(ctx context.Context) (*Admin, error)
- func (s *Service) MeRaw(ctx context.Context) (*api.Result, error)
- func (s *Service) SetAway(ctx context.Context, id string, body *SetAwayRequest) (*Admin, error)
- func (s *Service) SetAwayRaw(ctx context.Context, id string, body *SetAwayRequest) (*api.Result, error)
- type SetAwayRequest
- type Team
- type TeamList
- type TeamsService
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 ¶
ParseGetResult decodes a Result into an Admin.
func ParseMeResult ¶
ParseMeResult 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 ¶
func (s *AwayStatusReasonsService) List(ctx context.Context) ([]AwayStatusReason, error)
List returns all away status reasons (including deleted ones).
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles communication with the admin related methods of the Intercom API.
func (*Service) Get ¶
Get retrieves an admin by ID.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/retrieveadmin
func (*Service) GetRaw ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.
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) Get ¶
Get retrieves a team by ID.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/teams/retrieveteam
func (*TeamsService) GetRaw ¶
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) List ¶
func (s *TeamsService) List(ctx context.Context) (*TeamList, error)
List returns all teams.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/teams/listteams
func (*TeamsService) ListRaw ¶
ListRaw returns all teams with the full HTTP result.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/teams/listteams