zendesk

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 18 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 AgentScopePermission added in v0.0.35

type AgentScopePermission string
const (
	ScopeRead   AgentScopePermission = "read"
	ScopeUpdate AgentScopePermission = "update"
	ScopeDelete AgentScopePermission = "delete"
	ScopeCreate AgentScopePermission = "create"
)

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 AttachmentID added in v0.0.35

type AttachmentID uint64

type AuditID added in v0.0.35

type AuditID uint64

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 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 CustomRole added in v0.0.35

type CustomRole struct {
	Configuration   CustomRoleConfiguration `json:"configuration"`
	CreatedAt       time.Time               `json:"created_at"`
	Description     string                  `json:"description"`
	ID              CustomRoleID            `json:"id"`
	Name            string                  `json:"name"`
	RoleType        uint64                  `json:"role_type"`
	TeamMemberCount uint64                  `json:"team_member_count"`
	UpdatedAt       time.Time               `json:"updated_at"`
}

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

type CustomRoleConfiguration added in v0.0.35

type CustomRoleConfiguration struct {
	AssignTicketsToAnyGroup bool                              `json:"assign_tickets_to_any_group"`
	ChatAccess              bool                              `json:"chat_access"`
	CustomObjects           map[string]CustomRoleCustomObject `json:"custom_objects"`
}

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

type CustomRoleCustomObject added in v0.0.35

type CustomRoleCustomObject struct {
	Scopes []AgentScopePermission `json:"scopes"`
}

A list of custom object keys mapped to JSON objects that define the agent's permissions (scopes) for each object. Allowed values: "read", "update", "delete", "create". The "read" permission is required if any other scopes are specified. Example: { "shipment": { "scopes": ["read", "update"] } }.

type CustomRoleID added in v0.0.12

type CustomRoleID uint64

type CustomRoleResponse added in v0.0.35

type CustomRoleResponse struct {
	CustomRole CustomRole `json:"custom_role"`
}

type CustomRoleService added in v0.0.35

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

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

func (CustomRoleService) List added in v0.0.35

func (s CustomRoleService) List(
	ctx context.Context,
	pageHandler func(response CustomRolesResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/#list-custom-roles

Does not support cursor pagination.

type CustomRolesResponse added in v0.0.35

type CustomRolesResponse struct {
	CustomRoles []CustomRole `json:"custom_roles"`
	OffsetPaginationResponse
}

type CustomStatus added in v0.0.35

type CustomStatus struct {
	Active         bool                 `json:"active"`
	ID             CustomStatusID       `json:"id"`
	AgentLabel     string               `json:"agent_label"`
	StatusCategory CustomStatusCategory `json:"status_category"`
}

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

type CustomStatusCategory added in v0.0.35

type CustomStatusCategory string
const (
	StatusCategoryNew     CustomStatusCategory = "new"
	StatusCategoryOpen    CustomStatusCategory = "open"
	StatusCategoryPending CustomStatusCategory = "pending"
	StatusCategoryHold    CustomStatusCategory = "hold"
	// Tickets with a "Closed" status belong to the "StatusCategorySolved" status category.
	StatusCategorySolved CustomStatusCategory = "solved"
)

type CustomStatusID added in v0.0.35

type CustomStatusID uint64

type CustomStatusPayload added in v0.0.35

type CustomStatusPayload struct {
	CustomStatus any `json:"custom_status"`
}

type CustomStatusResponse added in v0.0.35

type CustomStatusResponse struct {
	CustomStatus CustomStatus `json:"custom_status"`
}

type CustomStatusesResponse added in v0.0.35

type CustomStatusesResponse struct {
	CustomStatuses []CustomStatus `json:"custom_statuses"`
	OffsetPaginationResponse
}

type Error

type Error struct {
	Response    *http.Response `json:"response"`
	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 GroupPayload added in v0.0.35

type GroupPayload struct {
	Group any `json:"group"`
}

type GroupResponse added in v0.0.35

type GroupResponse struct {
	Group Group `json:"group"`
}

type GroupsResponse added in v0.0.12

type GroupsResponse struct {
	Groups []Group `json:"groups"`
	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 ListProblemTicketIncidentsResponse added in v0.0.35

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

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 MalwareScanResult added in v0.0.37

type MalwareScanResult string
const (
	MalwareFound        MalwareScanResult = "malware_found"
	MalwareNotFound     MalwareScanResult = "malware_not_found"
	MalwareFailedToScan MalwareScanResult = "failed_to_scan"
	MalwareNotScanned   MalwareScanResult = "not_scanned"
)

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 OffsetPaginationResponse added in v0.0.35

type OffsetPaginationResponse struct {
	NextPage     *string `json:"next_page"`
	PreviousPage *string `json:"previous_page"`
	Count        uint64  `json:"count"`
}

https://developer.zendesk.com/api-reference/introduction/pagination/#using-offset-pagination

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 OrganizationFieldConfiguration added in v0.0.37

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

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

type OrganizationFieldConfigurationResponse added in v0.0.37

type OrganizationFieldConfigurationResponse struct {
	OrganizationField OrganizationFieldConfiguration `json:"organization_field"`
}

type OrganizationFieldID added in v0.0.35

type OrganizationFieldID uint64

type OrganizationFieldPayload added in v0.0.35

type OrganizationFieldPayload struct {
	OrganizationField any `json:"organization_field"`
}

type OrganizationFieldService added in v0.0.35

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

https://developer.zendesk.com/api-reference/ticketing/organizations/organization_fields/

type OrganizationFieldType added in v0.0.37

type OrganizationFieldType string
const (
	OrganizationFieldTypeText     OrganizationFieldType = "text"     // Default custom field type when type is not specified
	OrganizationFieldTypeTextArea OrganizationFieldType = "textarea" // For multi-line text
	OrganizationFieldTypeCheckbox OrganizationFieldType = "checkbox" // To capture a boolean value. Allowed values are true or false
	OrganizationFieldTypeDate     OrganizationFieldType = "date"     // Example: 2021-04-16
	OrganizationFieldTypeDropdown OrganizationFieldType = "dropdown" //
	OrganizationFieldTypeInteger  OrganizationFieldType = "integer"  // String composed of numbers. May contain an optional decimal point
	OrganizationFieldTypeDecimal  OrganizationFieldType = "decimal"  // For numbers containing decimals
	OrganizationFieldTypeRegexp   OrganizationFieldType = "regexp"   // Matches the Regex pattern found in the custom field settings
	OrganizationFieldTypeLookup   OrganizationFieldType = "lookup"   // A field to create a relationship  to another object such as a user, ticket, or organization
)

type OrganizationFields added in v0.0.12

type OrganizationFields map[string]any

NOTE: Organization Fields are returned as a map[string (name of field)]any (value of field), instead of the way in which Ticket Fields are returned.

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 OrganizationFieldsConfigurationResponse added in v0.0.37

type OrganizationFieldsConfigurationResponse struct {
	OrganizationFields []OrganizationFieldConfiguration `json:"organization_fields"`
	CursorPaginationResponse
}

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 TagMeta added in v0.0.37

type TagMeta struct {
	Name  Tag    `json:"name"`
	Count uint64 `json:"count"`
}

type TagSearchResponse added in v0.0.37

type TagSearchResponse struct {
	Tags []Tag `json:"tags"`
	OffsetPaginationResponse
}

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 TagsResponse added in v0.0.37

type TagsResponse struct {
	Tags []TagMeta `json:"tags"`
	CursorPaginationResponse
}

type Ticket

type Ticket struct {
	AssigneeID         *UserID                  `json:"assignee_id"`
	CreatedAt          time.Time                `json:"created_at"`
	CustomFields       []TicketField            `json:"custom_fields"`
	Description        string                   `json:"description"`
	DueAt              *time.Time               `json:"due_at"`
	ExternalID         *string                  `json:"external_id"`
	Fields             []TicketField            `json:"fields"`
	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 TicketAttachment added in v0.0.35

type TicketAttachment struct {
	ContentType           string            `json:"content_type"`
	ContentURL            string            `json:"content_url"`
	Deleted               bool              `json:"deleted"`
	FileName              string            `json:"file_name"`
	Height                uint64            `json:"height"`
	ID                    AttachmentID      `json:"id"`
	Inline                bool              `json:"inline"`
	MalwareAccessOverride bool              `json:"malware_access_override"`
	MalwareScanResult     MalwareScanResult `json:"malware_scan_result"`
	MappedContentURL      string            `json:"mapped_content_url"`
	Size                  uint64            `json:"size"`
	URL                   string            `json:"url"`
	Width                 uint64            `json:"width"`
}

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#json-format

type TicketAttachmentResponse added in v0.0.35

type TicketAttachmentResponse struct {
	Attachment TicketAttachment `json:"attachment"`
}

type TicketAttachmentService added in v0.0.35

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

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

func (TicketAttachmentService) Download added in v0.0.37

func (s TicketAttachmentService) Download(
	ctx context.Context,
	contentURL string,
	writer io.Writer,
) error

When working with attachments, we must ensure that the domain that the content is hosted on is *.zendesk.com before sending authentication credentials.

- https://developer.zendesk.com/documentation/ticketing/managing-tickets/working-with-url-properties/

- https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#json-format

func (*TicketAttachmentService) DownloadToFile added in v0.0.37

func (s *TicketAttachmentService) DownloadToFile(
	ctx context.Context,
	contentURL string,
	filePath string,
) error

type TicketAttachmentUploadResponse added in v0.0.35

type TicketAttachmentUploadResponse struct {
	Upload struct {
		Attachment  TicketAttachment   `json:"attachment"`
		Attachments []TicketAttachment `json:"attachments"`
		Token       UploadToken        `json:"token"`
	} `json:"upload"`
}

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 TicketComment added in v0.0.35

type TicketComment struct {
	ID          TicketCommentID       `json:"id"`
	Attachments []TicketAttachment    `json:"attachments"`
	AuditID     AuditID               `json:"audit_id"`
	AuthorID    UserID                `json:"author_id"`
	Body        string                `json:"body"`
	CreatedAt   time.Time             `json:"createdAt"`
	HTMLBody    string                `json:"html_body"`
	Metadata    TicketCommentMetadata `json:"metadata"`
	PlainBody   string                `json:"plain_body"`
	Public      bool                  `json:"public"`
	Type        string                `json:"type"`
	Uploads     []UploadToken         `json:"uploads"`
}

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

type TicketCommentID added in v0.0.35

type TicketCommentID uint64

type TicketCommentMetadata added in v0.0.37

type TicketCommentMetadata struct {
	System TicketCommentMetadataSystem `json:"system"`
	Via    TicketVia                   `json:"via"`
	Flags  []uint                      `json:"flags"` // https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#comment-flags
}

type TicketCommentMetadataSystem added in v0.0.37

type TicketCommentMetadataSystem struct {
	Client    string  `json:"client"`
	IPAddress string  `json:"ip_address"`
	Latitude  float64 `json:"latitude"`
	Location  string  `json:"location"`
	Longitude float64 `json:"longitude"`
}

type TicketCommentResponse added in v0.0.35

type TicketCommentResponse struct {
	Comments []TicketComment `json:"comments"`
	CursorPaginationResponse
}

type TicketCommentService added in v0.0.35

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

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

func (TicketCommentService) ListByTicketID added in v0.0.35

func (s TicketCommentService) ListByTicketID(
	ctx context.Context,
	ticketID TicketID,
	pageHandler func(response TicketCommentResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#list-comments

type TicketField added in v0.0.35

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

type TicketFieldConfiguration added in v0.0.37

type TicketFieldConfiguration struct {
	Active              bool                `json:"active"`
	AgentDescription    string              `json:"agent_description"`
	CollapsedForAgents  bool                `json:"collapsed_for_agents"`
	CreatedAt           time.Time           `json:"created_at"`
	CustomFieldOptions  []CustomFieldOption `json:"custom_field_options"`
	CustomStatuses      []CustomStatus      `json:"custom_statuses"`
	Description         string              `json:"description"`
	EditableInPortal    bool                `json:"editable_in_portal"`
	ID                  TicketFieldID       `json:"id"`
	Position            uint64              `json:"position"`
	RawDescription      string              `json:"raw_description"`
	RawTitle            string              `json:"raw_title"`
	RawTitleInPortal    string              `json:"raw_title_in_portal"`
	RegexpForValidation *string             `json:"regexp_for_validation"`
	Removable           bool                `json:"removable"`
	Required            bool                `json:"required"`
	RequiredInPortal    bool                `json:"required_in_portal"`
	Tag                 Tag                 `json:"tag"`
	Title               string              `json:"title"`
	TitleInPortal       string              `json:"title_in_portal"`
	Type                TicketFieldType     `json:"type"`
	UpdatedAt           time.Time           `json:"updated_at"`
	URL                 string              `json:"url"`
	VisibleInPortal     bool                `json:"visible_in_portal"`
}

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

type TicketFieldConfigurationResponse added in v0.0.37

type TicketFieldConfigurationResponse struct {
	TicketField TicketFieldConfiguration `json:"ticket_field"`
}

type TicketFieldID added in v0.0.12

type TicketFieldID uint64

type TicketFieldType added in v0.0.37

type TicketFieldType string
const (
	TicketFieldTypeText              TicketFieldType = "text"              // Default custom field type when type is not specified
	TicketFieldTypeTextArea          TicketFieldType = "textarea"          // For multi-line text
	TicketFieldTypeCheckbox          TicketFieldType = "checkbox"          // To capture a boolean value. Allowed values are true or false
	TicketFieldTypeDate              TicketFieldType = "date"              // Example: 2021-04-16
	TicketFieldTypeInteger           TicketFieldType = "integer"           // String composed of numbers. May contain an optional decimal point
	TicketFieldTypeDecimal           TicketFieldType = "decimal"           // For numbers containing decimals
	TicketFieldTypeRegexp            TicketFieldType = "regexp"            // Matches the Regex pattern found in the custom field settings
	TicketFieldTypePartialCreditCard TicketFieldType = "partialcreditcard" // A credit card number. Only the last 4 digits are retained
	TicketFieldTypeMultiSelect       TicketFieldType = "multiselect"       // Enables users to choose multiple options from a dropdown menu
	TicketFieldTypeTagger            TicketFieldType = "tagger"            // Single-select dropdown menu. It contains one or more tag values belonging to the field's options. Example: ( {"id": 21938362, "value": ["hd_3000", "hd_5555"]})
	TicketFieldTypeLookup            TicketFieldType = "lookup"            // A field to create a relationship  to another object such as a user, ticket, or organization
)

type TicketFields added in v0.0.37

type TicketFields []TicketField

func (TicketFields) CreateMap added in v0.0.37

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

type TicketFieldsConfigurationResponse added in v0.0.37

type TicketFieldsConfigurationResponse struct {
	TicketFields []TicketFieldConfiguration `json:"ticket_fields"`
	CursorPaginationResponse
}

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"`
}

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

type TicketFormID

type TicketFormID uint64

type TicketFormResponse added in v0.0.35

type TicketFormResponse struct {
	TicketForm TicketForm `json:"ticket_form"`
}

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/

func (TicketFormService) List added in v0.0.31

func (s TicketFormService) List(
	ctx context.Context,
) ([]TicketForm, error)

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_forms/#list-ticket-forms

Does not support pagination.

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/

func (TicketService) ListProblemTicketIncidents added in v0.0.35

func (s TicketService) ListProblemTicketIncidents(
	ctx context.Context,
	problemTicket TicketID,
	pageHandler func(response ListProblemTicketIncidentsResponse) error,
) error

type TicketTagService added in v0.0.37

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

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

func (TicketTagService) List added in v0.0.37

func (s TicketTagService) List(
	ctx context.Context,
	pageHandler func(response TagsResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#list-tags

func (TicketTagService) Search added in v0.0.37

func (s TicketTagService) Search(
	ctx context.Context,
	searchTerm string,
	pageHandler func(response TagSearchResponse) error,
) error

https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#search-tags

Does not support cursor pagination.

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 UploadToken added in v0.0.35

type UploadToken string

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                 UserRole        `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 UserFieldConfiguration added in v0.0.37

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

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

type UserFieldConfigurationResponse added in v0.0.37

type UserFieldConfigurationResponse struct {
	UserField UserFieldConfiguration `json:"user_field"`
}

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/

func (UserFieldService) Show added in v0.0.35

type UserFieldType added in v0.0.37

type UserFieldType string
const (
	UserFieldTypeText     UserFieldType = "text"     // Default custom field type when type is not specified
	UserFieldTypeTextArea UserFieldType = "textarea" // For multi-line text
	UserFieldTypeCheckbox UserFieldType = "checkbox" // To capture a boolean value. Allowed values are true or false
	UserFieldTypeDate     UserFieldType = "date"     // Example: 2021-04-16
	UserFieldTypeDropdown UserFieldType = "dropdown" //
	UserFieldTypeInteger  UserFieldType = "integer"  // String composed of numbers. May contain an optional decimal point
	UserFieldTypeDecimal  UserFieldType = "decimal"  // For numbers containing decimals
	UserFieldTypeRegexp   UserFieldType = "regexp"   // Matches the Regex pattern found in the custom field settings
	UserFieldTypeLookup   UserFieldType = "lookup"   // A field to create a relationship  to another object such as a user, ticket, or organization
)

type UserFields added in v0.0.12

type UserFields map[string]any

NOTE: User Fields are returned as a map[string (name of field)]any (value of field), instead of the way in which Ticket Fields are returned.

type UserFieldsConfigurationResponse added in v0.0.37

type UserFieldsConfigurationResponse struct {
	UserFields []UserFieldConfiguration `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 UserRole added in v0.0.35

type UserRole string
const (
	UserRoleAdmin   UserRole = "admin"
	UserRoleAgent   UserRole = "agent"
	UserRoleEndUser UserRole = "end-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