zendesk

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Zendesk API client library for Go (golang).

Index

Constants

View Source
const (
	PriorityUrgent = "urgent"
	PriorityHigh   = "high"
	PriorityNormal = "normal"
	PriorityLow    = "low"
)
View Source
const (
	StatusNew     = "new"
	StatusOpen    = "open"
	StatusPending = "pending"
	StatusHold    = "hold"
	StatusSolved  = "solved"
	StatusClosed  = "closed"
	StatusDeleted = "deleted"
)

Variables

This section is empty.

Functions

func SetTimeout added in v0.0.29

func SetTimeout(timeout time.Duration) configOption

func WithFilterForAction added in v0.0.21

func WithFilterForAction(action AuditLogAction) listAccountConfigurationAuditLogModifier

func WithFilterForActorID added in v0.0.21

func WithFilterForActorID(actorID ActorID) listAccountConfigurationAuditLogModifier

func WithFilterForCreatedAt added in v0.0.21

func WithFilterForCreatedAt(startTime time.Time, endTime time.Time) listAccountConfigurationAuditLogModifier

func WithFilterForIPAddress added in v0.0.26

func WithFilterForIPAddress(ipAddress string) listAccountConfigurationAuditLogModifier

func WithFilterForSourceID added in v0.0.21

func WithFilterForSourceID(sourceType string, sourceID uint64) listAccountConfigurationAuditLogModifier

Filter audit logs by the source id. Requires filter[source_type] to also be set.

func WithFilterForSourceType added in v0.0.21

func WithFilterForSourceType(sourceType string) listAccountConfigurationAuditLogModifier

func WithLogger

func WithLogger(logger *log.Logger) configOption

func WithPageSize added in v0.0.24

func WithPageSize(pageSize uint8) listAccountConfigurationAuditLogModifier

func WithRequestPreProcessor

func WithRequestPreProcessor(requestPreProcessor RequestPreProcessor) configOption

func WithRoundTripper

func WithRoundTripper(roundTripper http.RoundTripper) configOption

func WithSort added in v0.0.24

func WithSort(field string, direction CursorPaginationSortDirection) listAccountConfigurationAuditLogModifier

func WithUserAgent added in v0.0.17

func WithUserAgent(userAgent string) configOption

Types

type AccountConfigurationService added in v0.0.21

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

https://developer.zendesk.com/api-reference/ticketing/account-configuration/account_settings/

type ActorID added in v0.0.21

type ActorID int64

type AgentEvent added in v0.0.4

type AgentEvent struct {
	StartTime     time.Time       `json:"timestamp"`
	AccountID     ChatAccountID   `json:"account_id"`
	AgentID       UserID          `json:"agent_id"`
	FieldName     string          `json:"field_name"`
	ID            string          `json:"id"`
	PreviousValue AgentEventValue `json:"previous_value"`
	Value         AgentEventValue `json:"value"`
}

type AgentEventExportResponse added in v0.0.4

type AgentEventExportResponse struct {
	AgentEvents []AgentEvent `json:"agent_events"`
	EndTimeUnix float64      `json:"end_time"`
	NextPage    string       `json:"next_page"`
	Count       int64        `json:"count"`
}

func (AgentEventExportResponse) EndTime added in v0.0.4

func (response AgentEventExportResponse) EndTime() time.Time

type AgentEventService added in v0.0.4

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

https://developer.zendesk.com/api-reference/live-chat/chat-api/incremental_agent_events_api/

func (*AgentEventService) GetAgentStates added in v0.0.4

func (s *AgentEventService) GetAgentStates(
	ctx context.Context,
) AgentStates

func (*AgentEventService) UpdateAgentStates added in v0.0.4

func (s *AgentEventService) UpdateAgentStates(
	ctx context.Context,
	defaultStateTime time.Time,
) error

type AgentEventValue added in v0.0.4

type AgentEventValue string

func (*AgentEventValue) UnmarshalJSON added in v0.0.4

func (a *AgentEventValue) UnmarshalJSON(data []byte) error

type AgentState added in v0.0.4

type AgentState struct {
	AgentID         UserID
	EngagementCount uint64
	Status          string
	StatusSince     time.Time
	Timestamp       time.Time
}

type AgentStates added in v0.0.4

type AgentStates map[UserID]AgentState

type Article

type Article struct {
	AuthorID          UserID            `json:"author_id"`
	Body              string            `json:"body"`
	CommentsDisabled  bool              `json:"comments_disabled"`
	ContentTagIds     []any             `json:"content_tag_ids"`
	CreatedAt         time.Time         `json:"created_at"`
	Draft             bool              `json:"draft"`
	EditedAt          time.Time         `json:"edited_at"`
	HTMLURL           string            `json:"html_url"`
	ID                ArticleID         `json:"id"`
	LabelNames        []any             `json:"label_names"`
	Locale            string            `json:"locale"`
	Name              string            `json:"name"`
	Outdated          bool              `json:"outdated"`
	PermissionGroupID PermissionGroupID `json:"permission_group_id"`
	Position          int64             `json:"position"`
	Promoted          bool              `json:"promoted"`
	SectionID         SectionID         `json:"section_id"`
	SourceLocale      string            `json:"source_locale"`
	Title             string            `json:"title"`
	UpdatedAt         time.Time         `json:"updated_at"`
	URL               string            `json:"url"`
	UserSegmentID     UserSegmentID     `json:"user_segment_id"`
	VoteCount         uint64            `json:"vote_count"`
	VoteSum           int64             `json:"vote_sum"`
}

type ArticleID

type ArticleID uint64

type ArticleResponse

type ArticleResponse struct {
	Article Article `json:"article"`
}

type ArticleService added in v0.0.12

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

https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/

type ArticlesResponse

type ArticlesResponse struct {
	Articles []Article `json:"articles"`
	CursorPaginationResponse
}

type AuditLog added in v0.0.21

type AuditLog struct {
	Action            AuditLogAction `json:"action"`
	ActionLabel       string         `json:"action_label"`
	ActorID           ActorID        `json:"actor_id"`
	ActorName         string         `json:"actor_name"`
	ChangeDescription string         `json:"change_description"`
	CreatedAt         time.Time      `json:"created_at"`
	ID                AuditLogID     `json:"id"`
	IPAddress         *string        `json:"ip_address"`
	SourceID          SourceID       `json:"source_id"`
	SourceLabel       string         `json:"source_label"`
	SourceType        string         `json:"source_type"`
	URL               string         `json:"url"`
}

https://developer.zendesk.com/api-reference/ticketing/account-configuration/audit_logs/#json-format

type AuditLogAction added in v0.0.21

type AuditLogAction string
const (
	Create   AuditLogAction = "create"
	Destroy  AuditLogAction = "destroy"
	Exported AuditLogAction = "exported"
	Login    AuditLogAction = "login"
	Update   AuditLogAction = "update"
)

type AuditLogID added in v0.0.21

type AuditLogID uint64

type AuditLogService added in v0.0.21

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

https://developer.zendesk.com/api-reference/ticketing/account-configuration/audit_logs/

type AuditLogsResponse added in v0.0.21

type AuditLogsResponse struct {
	AuditLogs []AuditLog `json:"audit_logs"`
	CursorPaginationResponse
}

type AuthenticationPassword

type AuthenticationPassword struct {
	Email    string
	Password string
}

func (AuthenticationPassword) AddZendeskAuthentication

func (auth AuthenticationPassword) AddZendeskAuthentication(r *http.Request)

type AuthenticationToken

type AuthenticationToken struct {
	Email string
	Token string
}

func (AuthenticationToken) AddZendeskAuthentication

func (auth AuthenticationToken) AddZendeskAuthentication(r *http.Request)

type CategoriesResponse

type CategoriesResponse struct {
	Categories []Category `json:"categories"`
	CursorPaginationResponse
}

type Category

type Category struct {
	CreatedAt    time.Time  `json:"created_at"`
	Description  string     `json:"description"`
	HTMLURL      string     `json:"html_url"`
	ID           CategoryID `json:"id"`
	Locale       string     `json:"locale"`
	Name         string     `json:"name"`
	Outdated     bool       `json:"outdated"`
	Position     int64      `json:"position"`
	SourceLocale string     `json:"source_locale"`
	UpdatedAt    time.Time  `json:"updated_at"`
	URL          string     `json:"url"`
}

type CategoryID

type CategoryID uint64

type CategoryResponse

type CategoryResponse struct {
	Category Category `json:"category"`
}

type CategoryService added in v0.0.12

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

https://developer.zendesk.com/api-reference/help_center/help-center-api/categories/

func (CategoryService) List added in v0.0.26

func (s CategoryService) List(ctx context.Context, pageHandler func(response CategoriesResponse) error) error

type Chat

type Chat struct {
	ID              ChatID           `json:"id"`
	Visitor         ChatVisitor      `json:"visitor"`
	StartedBy       string           `json:"started_by"`
	Session         ChatSession      `json:"session"`
	WebPath         []ChatWebPath    `json:"webpath"`
	Timestamp       time.Time        `json:"timestamp"`
	Count           ChatCount        `json:"count"`
	Duration        uint64           `json:"duration"`
	ResponseTime    ChatResponseTime `json:"response_time"`
	AgentIds        []UserID         `json:"agent_ids"`
	Triggered       bool             `json:"triggered"`
	Unread          bool             `json:"unread"`
	Missed          bool             `json:"missed"`
	Tags            []Tag            `json:"tags"`
	Type            string           `json:"type"`
	History         []ChatHistory    `json:"history"`
	DepartmentID    *GroupID         `json:"department_id"`
	EndTimestamp    time.Time        `json:"end_timestamp"`
	ZendeskTicketID TicketID         `json:"zendesk_ticket_id"`
}

type ChatAccountID added in v0.0.12

type ChatAccountID uint64

type ChatCount

type ChatCount struct {
	Visitor uint64 `json:"visitor"`
	Agent   uint64 `json:"agent"`
	Total   uint64 `json:"total"`
}

type ChatCredentials

type ChatCredentials struct {
	ClientID     string
	ClientSecret string
}

type ChatEngagement added in v0.0.2

type ChatEngagement struct {
	ID           ChatEngagementID `json:"id"`
	AgentID      UserID           `json:"agent_id"`
	DepartmentID *GroupID         `json:"department_id"`
	Assigned     bool             `json:"assigned"`
	Accepted     bool             `json:"accepted"`
	StartedBy    string           `json:"started_by"`
	Timestamp    time.Time        `json:"timestamp"`
	Duration     float64          `json:"duration"`
	Count        ChatCount        `json:"count"`
	ResponseTime ChatResponseTime `json:"response_time"`
}

type ChatEngagementID added in v0.0.2

type ChatEngagementID string

type ChatHistory

type ChatHistory struct {
	DepartmentID   GroupID   `json:"department_id"`
	DepartmentName string    `json:"department_name"`
	Name           string    `json:"name"`
	Channel        string    `json:"channel"`
	Index          int       `json:"index"`
	Timestamp      time.Time `json:"timestamp"`
	Type           string    `json:"type"`
	Msg            string    `json:"msg"`
	Options        string    `json:"options"`
	MsgID          string    `json:"msg_id"`
	SenderType     string    `json:"sender_type"`
	Source         string    `json:"source"`
	AgentID        UserID    `json:"agent_id,string"`
	Reason         string    `json:"reason"`
}

type ChatID

type ChatID string

type ChatResponseTime

type ChatResponseTime struct {
	First uint64  `json:"first"`
	Avg   float64 `json:"avg"`
	Max   uint64  `json:"max"`
}

type ChatSearchResult added in v0.0.3

type ChatSearchResult struct {
	ID        ChatID    `json:"id"`
	Timestamp time.Time `json:"timestamp"`
	Preview   string    `json:"preview"`
	Type      string    `json:"type"`
}

type ChatService

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

https://developer.zendesk.com/api-reference/live-chat/chat-api/chats/

func (*ChatService) List added in v0.0.12

func (s *ChatService) List(ctx context.Context, pageHandler func(page ChatsResponse) error) error

https://developer.zendesk.com/api-reference/live-chat/chat-api/chats/#list-chats

func (*ChatService) Search added in v0.0.12

func (s *ChatService) Search(ctx context.Context, query string, pageHandler func(page ChatsSearchResponse) error) error

https://developer.zendesk.com/api-reference/live-chat/chat-api/chats/#search-chats

type ChatSession

type ChatSession struct {
	EndDate     time.Time `json:"end_date"`
	CountryCode string    `json:"country_code"`
	City        string    `json:"city"`
	Browser     string    `json:"browser"`
	IP          string    `json:"ip"`
	CountryName string    `json:"country_name"`
	ID          string    `json:"id"`
	Region      string    `json:"region"`
	Platform    string    `json:"platform"`
	UserAgent   string    `json:"user_agent"`
	StartDate   time.Time `json:"start_date"`
}

type ChatVisitor

type ChatVisitor struct {
	Name  string `json:"name"`
	Notes string `json:"notes"`
	ID    string `json:"id"`
	Phone string `json:"phone"`
	Email string `json:"email"`
}

type ChatWebPath

type ChatWebPath struct {
	Timestamp time.Time `json:"timestamp"`
	To        string    `json:"to"`
	From      string    `json:"from"`
	Title     string    `json:"title"`
}

type ChatsIncrementalExportResponse

type ChatsIncrementalExportResponse struct {
	Chats       []IncrementalExportChat `json:"chats"`
	Count       uint64                  `json:"count"`
	EndID       ChatID                  `json:"end_id"`
	EndTimeUnix int64                   `json:"end_time"`
	NextPage    string                  `json:"next_page"`
}

func (ChatsIncrementalExportResponse) EndTime

func (response ChatsIncrementalExportResponse) EndTime() time.Time

type ChatsResponse

type ChatsResponse struct {
	Chats   []Chat  `json:"chats"`
	NextURL *string `json:"next_url"`
}

type ChatsSearchResponse added in v0.0.3

type ChatsSearchResponse struct {
	Results []ChatSearchResult `json:"results"`
	NextURL *string            `json:"next_url"`
}
type CursorPaginationLinks struct {
	First string `json:"first"`
	Last  string `json:"last"`
	Next  string `json:"next"`
}

type CursorPaginationMeta

type CursorPaginationMeta struct {
	HasMore      bool   `json:"has_more"`
	AfterCursor  string `json:"after_cursor"`
	BeforeCursor string `json:"before_cursor"`
}

type CursorPaginationResponse

type CursorPaginationResponse struct {
	Meta  CursorPaginationMeta  `json:"meta"`
	Links CursorPaginationLinks `json:"links"`
}

type CursorPaginationSortDirection added in v0.0.24

type CursorPaginationSortDirection string

type CustomFieldOption added in v0.0.12

type CustomFieldOption struct {
	ID       CustomFieldOptionID `json:"id"`
	Name     string              `json:"name"`
	Position uint64              `json:"position"`
	RawName  string              `json:"raw_name"`
	URL      string              `json:"url"`
	Value    string              `json:"value"`
}

type CustomFieldOptionID added in v0.0.12

type CustomFieldOptionID uint64

type CustomRoleID added in v0.0.12

type CustomRoleID uint64

type Error

type Error struct {
	StatusCode  int    `json:"status_code"`
	Body        []byte `json:"body"`
	Message     string `json:"message"`
	Description string `json:"description"`
}

func (*Error) Error

func (err *Error) Error() string

func (*Error) ImmutableRecord added in v0.0.12

func (err *Error) ImmutableRecord() bool

func (*Error) UnmarshalJSON

func (err *Error) UnmarshalJSON(b []byte) error

type Group added in v0.0.12

type Group struct {
	ID        GroupID   `json:"id"`
	IsPublic  bool      `json:"is_public"`
	Name      string    `json:"name"`
	Deleted   bool      `json:"deleted"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type GroupID

type GroupID uint64

type GroupMembership added in v0.0.12

type GroupMembership struct {
	ID        GroupMembershipID `json:"id"`
	CreatedAt time.Time         `json:"created_at"`
	Default   bool              `json:"default"`
	GroupID   GroupID           `json:"group_id"`
	UpdatedAt time.Time         `json:"updated_at"`
	UserID    UserID            `json:"user_id"`
}

type GroupMembershipID added in v0.0.12

type GroupMembershipID uint64

type GroupMembershipPayload added in v0.0.12

type GroupMembershipPayload struct {
	GroupMembership any `json:"group_membership"`
}

type GroupMembershipResponse added in v0.0.12

type GroupMembershipResponse struct {
	GroupMembership GroupMembership `json:"group_membership"`
}

type GroupMembershipService added in v0.0.12

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

https://developer.zendesk.com/api-reference/ticketing/groups/group_memberships/

func (GroupMembershipService) ListByGroup added in v0.0.12

func (s GroupMembershipService) ListByGroup(
	ctx context.Context,
	groupID GroupID,
	pageHandler func(response GroupMembershipsResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/groups/group_memberships/#list-memberships

type GroupMembershipsResponse added in v0.0.12

type GroupMembershipsResponse struct {
	GroupMemberships []GroupMembership `json:"group_memberships"`
	CursorPaginationResponse
}

type GroupsResponse added in v0.0.12

type GroupsResponse struct {
	Groups []Group
	CursorPaginationResponse
}

type GroupsService added in v0.0.12

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

https://developer.zendesk.com/api-reference/ticketing/groups/groups/

func (GroupsService) List added in v0.0.12

func (s GroupsService) List(
	ctx context.Context,
	pageHandler func(response GroupsResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/groups/groups/#list-groups

type IncrementalExportChat added in v0.0.2

type IncrementalExportChat struct {
	Chat
	ChatEngagements []ChatEngagement `json:"engagements"`
}

type IncrementalExportResponse

type IncrementalExportResponse struct {
	EndTimeUnix int64 `json:"end_time"`
	EndOfStream bool  `json:"end_of_stream"`
}

func (IncrementalExportResponse) EndTime

func (response IncrementalExportResponse) EndTime() time.Time

type JobStatus added in v0.0.22

type JobStatus struct {
	ID       string `json:"id"`
	URL      string `json:"url"`
	Total    uint64 `json:"total"`
	Progress uint64 `json:"progress"`
	Status   string `json:"status"`
	Message  string `json:"message"`
	Results  any    `json:"results"`
}

type JobStatusResponse added in v0.0.22

type JobStatusResponse struct {
	JobStatus JobStatus `json:"job_status"`
}

type ListAccountConfigurationAuditLogModifier added in v0.0.21

type ListAccountConfigurationAuditLogModifier interface {
	ModifyListAccountConfigurationAuditLogRequest(queryParameters *url.Values)
}

https://developer.zendesk.com/api-reference/ticketing/account-configuration/audit_logs/#parameters

type LiveChatService added in v0.0.12

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

https://developer.zendesk.com/api-reference/live-chat/introduction/

type MergeRequestPayload added in v0.0.22

type MergeRequestPayload struct {
	IDs                   []TicketID `json:"ids"`
	SourceComment         string     `json:"source_comment"`
	SourceCommentIsPublic bool       `json:"source_comment_is_public"`
	TargetComment         string     `json:"target_comment"`
	TargetCommentIsPublic bool       `json:"target_comment_is_public"`
}

type Organization

type Organization struct {
	ID                 OrganizationID     `json:"id"`
	CreatedAt          time.Time          `json:"created_at"`
	DeletedAt          *time.Time         `json:"deleted_at"`
	Details            string             `json:"details"`
	DomainNames        []string           `json:"domain_names"`
	ExternalID         *string            `json:"external_id"`
	GroupID            *GroupID           `json:"group_id"`
	Name               string             `json:"name"`
	Notes              string             `json:"notes"`
	SharedComments     bool               `json:"shared_comments"`
	SharedTickets      bool               `json:"shared_tickets"`
	Tags               []Tag              `json:"tags"`
	UpdatedAt          time.Time          `json:"updated_at"`
	OrganizationFields OrganizationFields `json:"organization_fields"`
}

type OrganizationCustomField

type OrganizationCustomField struct {
	ID    int `json:"id"`
	Value any `json:"value"`
}

type OrganizationFields added in v0.0.12

type OrganizationFields map[string]any

func (OrganizationFields) GetBool added in v0.0.12

func (fields OrganizationFields) GetBool(key string) bool

func (OrganizationFields) GetString added in v0.0.12

func (fields OrganizationFields) GetString(key string) *string

type OrganizationID

type OrganizationID uint64

type OrganizationPayload added in v0.0.12

type OrganizationPayload struct {
	Organization any `json:"organization"`
}

type OrganizationResponse

type OrganizationResponse struct {
	Organization Organization `json:"organization"`
}

type OrganizationSatisfactionRating

type OrganizationSatisfactionRating struct {
	Score string `json:"score"`
}

type OrganizationVia

type OrganizationVia struct {
	Channel string `json:"channel"`
}

type OrganizationsIncrementalExportResponse

type OrganizationsIncrementalExportResponse struct {
	OrganizationsResponse
	IncrementalExportResponse
}

type OrganizationsResponse

type OrganizationsResponse struct {
	Organizations []Organization `json:"organizations"`
}

type PermissionGroupID added in v0.0.12

type PermissionGroupID uint64

type RequestPreProcessor

type RequestPreProcessor interface {
	ProcessRequest(r *http.Request) error
}

type RequestPreProcessorFunc

type RequestPreProcessorFunc func(*http.Request) error

func (RequestPreProcessorFunc) ProcessRequest

func (p RequestPreProcessorFunc) ProcessRequest(r *http.Request) error

type Schedule added in v0.0.12

type Schedule struct {
	ID        ScheduleID         `json:"id"`
	Name      string             `json:"name"`
	TimeZone  string             `json:"time_zone"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
	Intervals []ScheduleInterval `json:"intervals"`
}

func (Schedule) Active added in v0.0.12

func (schedule Schedule) Active(now time.Time) (bool, error)

func (Schedule) Location added in v0.0.12

func (schedule Schedule) Location() (*time.Location, error)

type ScheduleID added in v0.0.12

type ScheduleID uint64

type ScheduleInterval added in v0.0.12

type ScheduleInterval struct {
	StartTime int `json:"start_time"`
	EndTime   int `json:"end_time"`
}

type ScheduleService added in v0.0.12

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

https://developer.zendesk.com/api-reference/ticketing/ticket-management/schedules/

type SchedulesResponse added in v0.0.12

type SchedulesResponse struct {
	Schedules []Schedule `json:"schedules"`
}

type Section

type Section struct {
	CategoryID      CategoryID `json:"category_id"`
	CreatedAt       time.Time  `json:"created_at"`
	Description     string     `json:"description"`
	HTMLURL         string     `json:"html_url"`
	ID              SectionID  `json:"id"`
	Locale          string     `json:"locale"`
	Name            string     `json:"name"`
	Outdated        bool       `json:"outdated"`
	ParentSectionID any        `json:"parent_section_id"`
	Position        uint       `json:"position"`
	Sorting         string     `json:"sorting"`
	SourceLocale    string     `json:"source_locale"`
	ThemeTemplate   string     `json:"theme_template"`
	UpdatedAt       time.Time  `json:"updated_at"`
	URL             string     `json:"url"`
}

type SectionID

type SectionID uint64

type SectionService added in v0.0.12

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

https://developer.zendesk.com/api-reference/help_center/help-center-api/sections/

func (SectionService) List added in v0.0.26

func (s SectionService) List(ctx context.Context, pageHandler func(response SectionsResponse) error) error

type SectionsResponse

type SectionsResponse struct {
	Sections     []Section `json:"sections"`
	Page         int       `json:"page"`
	PreviousPage any       `json:"previous_page"`
	NextPage     string    `json:"next_page"`
	PerPage      int       `json:"per_page"`
	PageCount    int       `json:"page_count"`
	Count        int       `json:"count"`
	SortBy       string    `json:"sort_by"`
	SortOrder    string    `json:"sort_order"`
	CursorPaginationResponse
}

type Service

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

func NewService

func NewService(
	subDomain string,
	zendeskAuth authentication,
	chatCredentials ChatCredentials,
	opts ...configOption,
) *Service

func (*Service) SubDomain added in v0.0.12

func (s *Service) SubDomain() string

type SideConversationCreatePayload added in v0.0.30

type SideConversationCreatePayload struct {
	Message SideConversationMessage `json:"message"`
}

type SideConversationMessage added in v0.0.30

type SideConversationMessage struct {
	Subject string                   `json:"subject"`
	Body    string                   `json:"body"`
	To      []SideConversationTarget `json:"to"`
}

type SideConversationTarget added in v0.0.30

type SideConversationTarget interface {
	SideConversationTarget()
}

type SideConversationTargetChildTicket added in v0.0.30

type SideConversationTargetChildTicket struct {
	SupportGroupID GroupID `json:"support_group_id"`
	SupportAgentID UserID  `json:"support_agent_id,omitempty"`
}

func (SideConversationTargetChildTicket) SideConversationTarget added in v0.0.30

func (s SideConversationTargetChildTicket) SideConversationTarget()

type SourceID added in v0.0.23

type SourceID int64

type SupportService

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

https://developer.zendesk.com/api-reference/ticketing/introduction/

type SuspendedTicket added in v0.0.12

type SuspendedTicket struct {
	ID        SuspendedTicketID `json:"id"`
	Subject   string            `json:"subject"`
	Cause     string            `json:"cause"`
	CauseID   int               `json:"cause_id"`
	TicketID  *TicketID         `json:"ticket_id"`
	CreatedAt time.Time         `json:"created_at"`
	UpdatedAt time.Time         `json:"updated_at"`
	Recipient string            `json:"recipient"`
}

type SuspendedTicketID added in v0.0.12

type SuspendedTicketID uint64

type SuspendedTicketsResponse added in v0.0.12

type SuspendedTicketsResponse struct {
	SuspendedTickets []SuspendedTicket `json:"suspended_tickets"`
	CursorPaginationResponse
}

type Tag added in v0.0.19

type Tag string

func (Tag) Validate added in v0.0.19

func (tag Tag) Validate() error

type Tags

type Tags []Tag

func (Tags) HasTag added in v0.0.12

func (tags Tags) HasTag(targetTag Tag) bool

type TagsPayload

type TagsPayload struct {
	Tags Tags `json:"tags"`
}

type Ticket

type Ticket struct {
	AssigneeID         *UserID                  `json:"assignee_id"`
	CreatedAt          time.Time                `json:"created_at"`
	CustomFields       TicketCustomFields       `json:"custom_fields"`
	Description        string                   `json:"description"`
	DueAt              *time.Time               `json:"due_at"`
	ExternalID         *string                  `json:"external_id"`
	GroupID            *GroupID                 `json:"group_id"`
	HasIncidents       bool                     `json:"has_incidents"`
	ID                 TicketID                 `json:"id"`
	IsPublic           bool                     `json:"is_public"`
	OrganizationID     *OrganizationID          `json:"organization_id"`
	Priority           string                   `json:"priority"`
	ProblemID          *TicketID                `json:"problem_id"`
	RequesterID        UserID                   `json:"requester_id"`
	SatisfactionRating TicketSatisfactionRating `json:"satisfaction_rating"`
	Status             string                   `json:"status"`
	Subject            string                   `json:"subject"`
	SubmitterID        UserID                   `json:"submitter_id"`
	Tags               Tags                     `json:"tags"`
	TicketFormID       TicketFormID             `json:"ticket_form_id"`
	Type               *string                  `json:"type"`
	UpdatedAt          time.Time                `json:"updated_at"`
	URL                string                   `json:"url"`
	Via                TicketVia                `json:"via"`
}

type TicketAudit added in v0.0.12

type TicketAudit struct {
	ID        TicketAuditID      `json:"id"`
	TicketID  int                `json:"ticket_id"`
	CreatedAt time.Time          `json:"created_at"`
	AuthorID  int                `json:"author_id"`
	Events    []TicketAuditEvent `json:"events"`
}

type TicketAuditEvent added in v0.0.12

type TicketAuditEvent struct {
	ID            TicketAuditEventID `json:"id"`
	Type          string             `json:"type"`
	FieldName     string             `json:"field_name"`
	PreviousValue any                `json:"previous_value"`
	Value         any                `json:"value"`
}

type TicketAuditEventID added in v0.0.12

type TicketAuditEventID uint64

type TicketAuditID added in v0.0.12

type TicketAuditID uint64

type TicketAuditResponse added in v0.0.12

type TicketAuditResponse struct {
	Audit TicketAudit `json:"audit"`
}

type TicketAuditService added in v0.0.12

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

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_audits/

type TicketAuditsResponse added in v0.0.12

type TicketAuditsResponse struct {
	Audits []TicketAudit `json:"audits"`
	CursorPaginationResponse
}

type TicketCustomField

type TicketCustomField struct {
	ID    TicketFieldID `json:"id"`
	Value any           `json:"value"`
}

type TicketCustomFields added in v0.0.12

type TicketCustomFields []TicketCustomField

func (TicketCustomFields) CreateMap added in v0.0.12

func (fields TicketCustomFields) CreateMap() map[TicketFieldID]any

type TicketFieldID added in v0.0.12

type TicketFieldID uint64

type TicketForm added in v0.0.31

type TicketForm struct {
	URL            string          `json:"url"`
	Name           string          `json:"name"`
	DisplayName    string          `json:"display_name"`
	ID             TicketFormID    `json:"id"`
	RawName        string          `json:"raw_name"`
	RawDisplayName string          `json:"raw_display_name"`
	EndUserVisible bool            `json:"end_user_visible"`
	Position       int             `json:"position"`
	TicketFieldIds []TicketFieldID `json:"ticket_field_ids"`
	Active         bool            `json:"active"`
	Default        bool            `json:"default"`
	CreatedAt      time.Time       `json:"created_at"`
	UpdatedAt      time.Time       `json:"updated_at"`
	InAllBrands    bool            `json:"in_all_brands"`
}

type TicketFormID

type TicketFormID uint64

type TicketFormService added in v0.0.31

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

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_forms/

type TicketFormsResponse added in v0.0.31

type TicketFormsResponse struct {
	TicketForms []TicketForm `json:"ticket_forms"`
}

type TicketID

type TicketID uint64

type TicketPayload added in v0.0.12

type TicketPayload struct {
	Ticket any `json:"ticket"`
}

type TicketResponse

type TicketResponse struct {
	Ticket Ticket `json:"ticket"`
}

type TicketSatisfactionRating

type TicketSatisfactionRating struct {
	Score string `json:"score"`
}

type TicketService

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

https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/

type TicketVia

type TicketVia struct {
	Channel string `json:"channel"`
}

type TicketsIncrementalExportResponse

type TicketsIncrementalExportResponse struct {
	TicketsResponse
	IncrementalExportResponse
}

type TicketsResponse

type TicketsResponse struct {
	Tickets []Ticket `json:"tickets"`
}

type User

type User struct {
	ID                   UserID          `json:"id"`
	Active               bool            `json:"active"`
	CreatedAt            time.Time       `json:"created_at"`
	CustomRoleID         *CustomRoleID   `json:"custom_role_id"`
	DefaultGroupID       *GroupID        `json:"default_group_id"`
	Email                string          `json:"email"`
	ExternalID           *string         `json:"external_id"`
	IanaTimeZone         string          `json:"iana_time_zone"`
	LastLoginAt          *time.Time      `json:"last_login_at"`
	Locale               string          `json:"locale"`
	Name                 string          `json:"name"`
	OrganizationID       *OrganizationID `json:"organization_id"`
	Phone                *string         `json:"phone"`
	Role                 string          `json:"role"`
	RoleType             *int            `json:"role_type"`
	Signature            string          `json:"signature"`
	Shared               bool            `json:"shared"`
	Suspended            bool            `json:"suspended"`
	Tags                 []Tag           `json:"tags"`
	TwoFactorAuthEnabled bool            `json:"two_factor_auth_enabled"`
	UpdatedAt            time.Time       `json:"updated_at"`
	Verified             bool            `json:"verified"`
	UserFields           UserFields      `json:"user_fields"`
	Photo                *UserPhoto      `json:"photo"`
}

https://developer.zendesk.com/api-reference/ticketing/users/users/#json-format

type UserField added in v0.0.12

type UserField struct {
	Active             bool                `json:"active"`
	ID                 UserFieldID         `json:"id"`
	CreatedAt          time.Time           `json:"created_at"`
	System             bool                `json:"system"`
	Description        *string             `json:"description"`
	Key                string              `json:"key"`
	Position           uint64              `json:"position"`
	RawDescription     *string             `json:"raw_description"`
	RawTitle           *string             `json:"raw_title"`
	Title              *string             `json:"title"`
	Type               string              `json:"type"`
	UpdatedAt          *time.Time          `json:"updated_at"`
	URL                string              `json:"url"`
	CustomFieldOptions []CustomFieldOption `json:"custom_field_options"`
}

type UserFieldID added in v0.0.12

type UserFieldID uint64

type UserFieldService added in v0.0.12

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

https://developer.zendesk.com/api-reference/ticketing/users/user_fields/

type UserFields added in v0.0.12

type UserFields map[string]any

type UserFieldsResponse added in v0.0.12

type UserFieldsResponse struct {
	UserFields []UserField `json:"user_fields"`
	CursorPaginationResponse
}

type UserID

type UserID uint64

func (*UserID) UnmarshalJSON

func (userID *UserID) UnmarshalJSON(b []byte) error

type UserIdentitiesResponse added in v0.0.13

type UserIdentitiesResponse struct {
	Identities []UserIdentity `json:"identities"`
	CursorPaginationResponse
}

type UserIdentity added in v0.0.13

type UserIdentity struct {
	ID    uint64 `json:"id"`
	Value string `json:"value"`
}

type UserIdentityService added in v0.0.13

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

https://developer.zendesk.com/api-reference/ticketing/users/user_identities/

func (*UserIdentityService) List added in v0.0.13

func (s *UserIdentityService) List(
	ctx context.Context,
	userID UserID,
	pageHandler func(response UserIdentitiesResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/users/user_identities/#list-identities

type UserPayload added in v0.0.12

type UserPayload struct {
	User any `json:"user"`
}

type UserPhoto added in v0.0.12

type UserPhoto struct {
	ContentURL string `json:"content_url"`
}

type UserResponse

type UserResponse struct {
	User User `json:"user"`
}

type UserSegmentID added in v0.0.12

type UserSegmentID uint64

type UsersIncrementalExportResponse

type UsersIncrementalExportResponse struct {
	UsersResponse
	IncrementalExportResponse
}

type UsersResponse

type UsersResponse struct {
	Users []User `json:"users"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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