zendesk

package
v0.34.8 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LocaleENUS English (United States)
	LocaleENUS = 1
	// LocaleES Spanish - español
	LocaleES = 2
	// LocaleDE German - Deutsch
	LocaleDE = 8
	// LocaleZHTW Chinese (Traditional) - 中文(繁體)
	LocaleZHTW = 9
	// LocaleZHCN Chinese (Simplified) - 中文(简体)
	LocaleZHCN = 10
	// LocalePL Polish - polski
	LocalePL = 13
	// LocaleFR French - français
	LocaleFR = 16
	// LocalePTBR Portuguese (Brazil) - português (Brasil)
	LocalePTBR = 19
	// LocaleIT Italian - italiano
	LocaleIT = 22
	// LocaleRO Romanian - română
	LocaleRO = 23
	// LocaleIS Icelandic - íslenska
	LocaleIS = 24
	// LocaleVI Vietnamese - Tiếng Việt
	LocaleVI = 26
	// LocaleRU Russian - русский
	LocaleRU = 27
	// LocaleHE Hebrew - עברית
	LocaleHE = 30
	// LocaleNO Norwegian - norsk
	LocaleNO = 34
	// LocaleFIL Filipino
	LocaleFIL = 47
	// LocaleAR Arabic - العربية
	LocaleAR = 66
	// LocaleJA Japanese - 日本語
	LocaleJA = 67
	// LocaleKO Korean - 한국어
	LocaleKO = 69
	// LocaleSL Slovenian - slovenščina
	LocaleSL = 72
	// LocaleHR Croatian - hrvatski
	LocaleHR = 74
	// LocaleID Indonesian - Indonesia
	LocaleID = 77
	// LocaleCS Czech - čeština
	LocaleCS = 78
	// LocaleTH Thai - ไทย
	LocaleTH = 81
	// LocaleFI Finnish - suomi
	LocaleFI = 84
	// LocaleTR Turkish - Türkçe
	LocaleTR = 88
	// LocaleSV Swedish - svenska
	LocaleSV = 92
	// LocaleEL Greek - Ελληνικά
	LocaleEL = 93
	// LocaleBG Bulgarian - български
	LocaleBG = 94
	// LocaleET Estonian - eesti
	LocaleET = 101
	// LocaleDA Danish - dansk
	LocaleDA = 1000
	// LocaleSK Slovak - slovenčina
	LocaleSK = 1003
	// LocaleNL Dutch - Nederlands
	LocaleNL = 1005
	// LocaleHU Hungarian - magyar
	LocaleHU = 1009
	// LocalePT Portuguese - português
	LocalePT = 1011
	// LocaleFA Persian - فارسی
	LocaleFA = 1016
	// LocaleCA Catalan - català
	LocaleCA = 1075
	// LocaleLT Lithuanian - lietuvių
	LocaleLT = 1092
	// LocaleLV Latvian - latviešu
	LocaleLV = 1101
	// LocaleSR Serbian - српски
	LocaleSR = 1150
	// LocaleUK Ukrainian - українська
	LocaleUK = 1173
	// LocaleENGB English (United Kingdom)
	LocaleENGB = 1176
	// LocaleENCA English (Canada)
	LocaleENCA = 1181
	// LocaleESES Spanish (Spain) - español (España)
	LocaleESES = 1186
	// LocaleFRCA French (Canada) - français (Canada)
	LocaleFRCA = 1187
	// LocaleES419 Spanish (Latin America) - español (Latinoamérica)
	LocaleES419 = 1194
	// LocaleENAU English (Australia)
	LocaleENAU = 1277
	// LocaleENIN English (India)
	LocaleENIN = 1278
	// LocaleENIE English (Ireland)
	LocaleENIE = 1279
	// LocaleENSG English (Singapore)
	LocaleENSG = 1281
	// LocaleENNZ English (New Zealand)
	LocaleENNZ = 1288
	// LocaleENZA English (South Africa)
	LocaleENZA = 1289
	// LocaleFRBE French (Belgium) - français (Belgique)
	LocaleFRBE = 1291
	// LocaleFRCH French (Switzerland) - français (Suisse)
	LocaleFRCH = 1292
	// LocaleNLBE Dutch (Belgium) - Nederlands (België)
	LocaleNLBE = 1293
	// LocaleDEAT German (Austria) - Deutsch (Österreich)
	LocaleDEAT = 1294
	// LocaleDECH German (Switzerland) - Deutsch (Schweiz)
	LocaleDECH = 1295
	// LocaleHI Hindi - हिन्दी
	LocaleHI = 1303
	// LocaleMS Malay - Melayu
	LocaleMS = 1307
	// LocaleENBE English (Belgium)
	LocaleENBE = 1350
	// LocaleESMX Spanish (Mexico) - español (México)
	LocaleESMX = 1364
	// LocaleFRFR French (France) - français (France)
	LocaleFRFR = 1365
	// LocaleENPH English (Philippines)
	LocaleENPH = 1392
)
View Source
const (
	AgentWorkTimeMetric      = "agent_work_time"
	FirstReplyTimeMetric     = "first_reply_time"
	NextReplyTimeMetric      = "next_reply_time"
	PausableUpdateTimeMetric = "pausable_update_time"
	PeriodicUpdateTimeMetric = "periodic_update_time"
	RequesterWaitTimeMetric  = "requester_wait_time"
)

SLA Policy metric values

ref: https://developer.zendesk.com/rest_api/docs/support/sla_policies#metrics

View Source
const (
	// TicketCommentCreatedAtAsc defines ASC sort val.
	TicketCommentCreatedAtAsc listTicketCommentsSort = "created_at"

	// TicketCommentCreatedAtDesc defines DESC sort val.
	TicketCommentCreatedAtDesc listTicketCommentsSort = "-created_at"

	// ListTicketCommentsMaxPageSize contains the max page size.
	ListTicketCommentsMaxPageSize int = 100
)
View Source
const (
	// UserRoleEndUser end-user
	UserRoleEndUser = iota
	// UserRoleAgent agent
	UserRoleAgent
	// UserRoleAdmin admin
	UserRoleAdmin
)

Variables

View Source
var ValidActionValuesMap = ActionsValueValidator{
	ActionFieldStatus: {
		ValidationRegex: regexp.MustCompile("(new|open|pending|hold|solved|closed)"),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldType: {
		ValidationRegex: regexp.MustCompile("(question|incident|problem|task)"),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldPriority: {
		ValidationRegex: regexp.MustCompile("(low|normal|high|urgent)"),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldGroupID: {
		ValidationRegex: regexp.MustCompile(`(^$|current_groups|^\d+$)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldAssigneeID: {
		ValidationRegex: regexp.MustCompile(`(^$|current_user|^\d+$)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldSetTags: {
		ValidationRegex: regexp.MustCompile(`^\S+(?:\s\S+)*$`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldCurrentTags: {
		ValidationRegex: regexp.MustCompile(`^\S+(?:\s\S+)*$`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldRemoveTags: {
		ValidationRegex: regexp.MustCompile(`^\S+(?:\s\S+)*$`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldCustomStatusId: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldTicketFormID: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldFollower: {
		ValidationRegex: regexp.MustCompile(`(^$|current_user|^\d+$)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldCustomField: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionFieldSatisfactionScore: {
		ValidationRegex: regexp.MustCompile("(good_with_comment|good|bad_with_comment|bad|false|true|offered|unoffered)"),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldNotificationUser: {
		ValidationRegex: regexp.MustCompile(`(all_agents|requester_id|assignee_id|current_user|requester_and_ccs|^\d+$)`),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldNotificationGroup: {
		ValidationRegex: regexp.MustCompile(`(group_id|^\d+$)`),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldNotificationTarget: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldNotificationWebhook: {
		ValidationRegex: regexp.MustCompile("^.*$"),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldCC: {
		ValidationRegex: regexp.MustCompile(`(^$|current_user|^\d+$)`),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldLocaleID: {
		ValidationRegex: regexp.MustCompile("^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldTweetRequester: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerAutomationActionTypes,
	},
	ActionFieldBrandId: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerActionTypes,
	},
	ActionFieldAddSkills: {
		ValidationRegex: regexp.MustCompile(`^\w+(?:,\w+)*$`),
		ResourceTypes:   triggerActionTypes,
	},
	ActionFieldSetSkills: {
		ValidationRegex: regexp.MustCompile(`^\w+(?:,\w+)*$`),
		ResourceTypes:   triggerActionTypes,
	},
	ActionFieldRemoveSkills: {
		ValidationRegex: regexp.MustCompile(`^\w+(?:,\w+)*$`),
		ResourceTypes:   triggerActionTypes,
	},
	ActionFieldSubject: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   macroActionTypes,
	},
	ActionFieldCommentValue: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   macroActionTypes,
	},
	ActionFieldCommentValueHTML: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   macroActionTypes,
	},
	ActionFieldCommentModeIsPublic: {
		ValidationRegex: regexp.MustCompile("(true|false)"),
		ResourceTypes:   macroActionTypes,
	},
	ActionSideConversationTicket: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionSideConversationSlack: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionSetSchedule: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionNotificationZis: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionNotificationMessagingCsat: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   sharedActionTypes,
	},
	ActionReplyPublic: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerActionTypes,
	},
	ActionReplyInternal: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerActionTypes,
	},
}

ValidActionValuesMap Map of action fields to possible values, based on valid values from Actions Reference

View Source
var ValidConditionOperatorValues = ConditionsValueValidator{
	ConditionFieldGroupID: {
		ValidationRegex: regexp.MustCompile(`(^$|^\d+)`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Changed,
			NotChanged,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldAssigneeID: {
		ValidationRegex: regexp.MustCompile(`(^$|current_user|requester_id|^\d+)`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Changed,
			NotChanged,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldRequesterID: {
		ValidationRegex: regexp.MustCompile(`(^$|current_user|requester_id|^\d+)`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Changed,
			NotChanged,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldOrganizationID: {
		ValidationRegex: regexp.MustCompile(`(^$|^\d+$)`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Changed,
			NotChanged,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldCurrentTags: {
		ValidationRegex: regexp.MustCompile(`^\S+(?:\s\S+)*$`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators:  []Operator{Includes, NotIncludes},
	},
	ConditionFieldViaID: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators:  []Operator{Is, IsNot, Includes, NotIncludes},
	},
	ConditionFieldRecipient: {
		ValidationRegex: regexp.MustCompile(`.*`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators:  []Operator{EmptyOperator},
	},
	ConditionFieldCustomField: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators:  []Operator{Is, IsNot, WithinPreviousNDays, NotPresent, Present},
	},
	ConditionFieldCustomFieldAlt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   slaConditionTypes,
		ValidOperators:  []Operator{Is, IsNot, WithinPreviousNDays},
	},
	ConditionFieldType: {
		ValidationRegex: regexp.MustCompile(`(question|incident|problem|task)`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators:  []Operator{Is, IsNot},
	},
	ConditionFieldStatus: {
		ValidationRegex: regexp.MustCompile(`(new|open|pending|hold|solved|closed|^$)`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			LessThan,
			GreaterThan,
			Changed,
			NotChanged,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldPriority: {
		ValidationRegex: regexp.MustCompile(`(^$|low|normal|high|urgent)`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			LessThan,
			GreaterThan,
			Changed,
			NotChanged,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldLocaleID: {
		ValidationRegex: regexp.MustCompile("^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators:  []Operator{Is, IsNot},
	},
	ConditionFieldSatisfactionScore: {
		ValidationRegex: regexp.MustCompile(`(good_with_comment|good|bad_with_comment|bad|false|true|offered|unoffered)`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators: []Operator{
			Is,
			LessThan,
			GreaterThan,
			Changed,
			ChangedTo,
			ChangedFrom,
			NotChanged,
			NotChangedFrom,
			NotChangedTo,
			Value,
			ValuePrevious,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldBrandId: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators: []Operator{
			Is,
			LessThan,
			GreaterThan,
			Changed,
			ChangedTo,
			ChangedFrom,
			NotChanged,
			NotChangedFrom,
			NotChangedTo,
		},
	},
	ConditionFieldTicketFormId: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			LessThan,
			GreaterThan,
			Changed,
			ChangedTo,
			ChangedFrom,
			NotChanged,
			NotChangedFrom,
			NotChangedTo,
		},
	},
	ConditionFieldUserCustomKey: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Present,
			NotPresent,
			Includes,
			NotIncludes,
			IncludesString,
			NotIncludesString,
		},
	},
	ConditionFieldRequesterCustomKey: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Present,
			NotPresent,
			Includes,
			NotIncludes,
			IncludesString,
			NotIncludesString,
		},
	},
	ConditionFieldOrganizationCustomKey: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
			Present,
			NotPresent,
			Includes,
			NotIncludes,
			IncludesString,
			NotIncludesString,
		},
	},
	ConditionFieldSubjectIncludesWord: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Includes,
			NotIncludes,
			Is,
			IsNot,
		},
	}, ConditionFieldCommentIncludesWord: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Includes,
			NotIncludes,
			Is,
			IsNot,
		},
	},
	ConditionFieldCurrentViaID: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
	ConditionFieldUpdateType: {
		ValidationRegex: regexp.MustCompile(`(Create|Change)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators:  []Operator{EmptyOperator, Is},
	},
	ConditionFieldCommentIsPublic: {
		ValidationRegex: regexp.MustCompile(`(true|false|not_relevant|requester_can_see_comment)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators:  []Operator{EmptyOperator, Is, IsNot},
	},
	ConditionFieldTicketIsPublic: {
		ValidationRegex: regexp.MustCompile(`(public|private)`),
		ResourceTypes:   triggerAutomationConditionTypes,
		ValidOperators:  []Operator{Is, IsNot, EmptyOperator},
	},
	ConditionFieldReopens: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
		},
	},
	ConditionFieldReplies: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
		},
	},
	ConditionFieldAgentStations: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
		},
	}, ConditionFieldGroupStations: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
		},
	},
	ConditionFieldInBusinessHours: {
		ValidationRegex: regexp.MustCompile(`(true|false)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
	ConditionFieldRequesterTwitterFollowersCount: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
		},
	},
	ConditionFieldRequesterTwitterStatusesCount: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
		},
	},
	ConditionFieldRequesterTwitterVerified: {
		ValidationRegex: regexp.MustCompile(`^$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators:  []Operator{EmptyOperator},
	},
	ConditionFieldRequesterRole: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
	ConditionFieldAttachment: {
		ValidationRegex: regexp.MustCompile(`^$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators:  []Operator{EmptyOperator},
	},
	ConditionFieldIsBusinessHours: {
		ValidationRegex: regexp.MustCompile(`(true|false)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators:  []Operator{EmptyOperator},
	},
	ConditionFieldCC: {
		ValidationRegex: regexp.MustCompile(`^$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators:  []Operator{EmptyOperator},
	},
	ConditionFieldCustomStatusId: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   sharedConditionTypes,
		ValidOperators: []Operator{
			Includes,
			NotIncludes,
			Is,
			IsNot,
			Changed,
			Value,
			ValuePrevious,
			NotChanged,
			NotValue,
			NotValuePrevious,
		},
	},
	ConditionFieldTicketTypeId: {
		ValidationRegex: regexp.MustCompile(`^([1234])$`),
		ResourceTypes:   slaConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
	ConditionFieldExactCreatedAt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   slaConditionTypes,
		ValidOperators: []Operator{
			LessThan,
			LessThanEqual,
			GreaterThan,
			GreaterThanEqual,
		},
	},
	ConditionFieldNew: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldOpen: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldPending: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldHold: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldSolved: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldClosed: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldAssignedAt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldUpdatedAt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldRequesterUpdatedAt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldAssigneeUpdatedAt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldDueDate: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldUntilDueDate: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsBusinessHours,
			LessThan,
			LessThanBusinessHours,
			GreaterThan,
			GreaterThanBusinessHours,
		},
	},
	ConditionFieldDescriptionIncludesWord: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   timeBasedViewAutomationConditionTypes,
		ValidOperators:  []Operator{EmptyOperator},
	},
	ConditionFieldSlaNextBreachAt: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerAutomationViewConditionTypes,
		ValidOperators: []Operator{
			GreaterThan,
			LessThan,
			Is,
			IsNot,
		},
	},
	ConditionFieldRole: {
		ValidationRegex: regexp.MustCompile(`([\s\S]*)`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
	ConditionFieldWithinSchedule: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
	ConditionFieldScheduleId: {
		ValidationRegex: regexp.MustCompile(`^\d+$`),
		ResourceTypes:   triggerConditionTypes,
		ValidOperators: []Operator{
			Is,
			IsNot,
		},
	},
}
View Source
var ValidRequirementStatuses = []string{"new", "open", "pending", "hold", "solved"}

ValidRequirementStatuses is an array of strings denoting which statuses are available to be used in RequiredOnStatuses struct

View Source
var ValidRequirementTypes = []RequirementType{
	SomeStatuses, AllStatuses, NoStatuses,
}

ValidRequirementTypes denotes which status requirement types are valid

View Source
var ViaTypeMap = map[string]ViaType{
	"web_form":                ViaWebForm,
	"mail":                    ViaMail,
	"chat":                    ViaChat,
	"twitter":                 ViaTwitter,
	"twitter_dm":              ViaTwitterDM,
	"twitter_favorite":        ViaTwitterFavorite,
	"voicemail":               ViaVoicemail,
	"phone_call_inbound":      ViaPhoneCallInbound,
	"phone_call_outbound":     ViaPhoneCallOutbound,
	"api_voicemail":           ViaAPIVoicemail,
	"api_phone_call_inbound":  ViaAPIPhoneCallInbound,
	"api_phone_call_outbound": ViaAPIPhoneCallOutbound,
	"sms":                     ViaSMS,
	"get_satisfaction":        ViaGetSatisfaction,
	"web_widget":              ViaWebWidget,
	"mobile_sdk":              ViaMobileSDK,
	"mobile":                  ViaMobile,
	"helpcenter":              ViaHelpCenter,
	"web_service":             ViaWebService,
	"rule":                    ViaRule,
	"closed_ticket":           ViaClosedTicket,
	"ticket_sharing":          ViaTicketSharing,
	"facebook_post":           ViaFacebookPost,
	"facebook_message":        ViaFacebookMessage,
	"satisfaction_prediction": ViaSatisfactionPrediction,
	"any_channel":             ViaAnyChannel,
}

Functions

func LocaleTypeText

func LocaleTypeText(loc int) string

LocaleTypeText returns locale type text

func UserRoleText

func UserRoleText(role int) string

UserRoleText takes role type and returns role name string

func ViaTypeText

func ViaTypeText(viaID ViaType) string

ViaTypeText takes via_id and returns via_type

Types

type Action added in v0.20.4

type Action struct {
	Field string      `json:"field"`
	Value ParsedValue `json:"value,omitempty"`
}

Action is definition of what the resource does to the ticket. Zendesk Actions Reference

func (Action) Validate added in v0.23.0

func (a Action) Validate(resourceType ResourceType[ActionResourceType]) error

type ActionField added in v0.20.4

type ActionField string

ActionField action field types which defined by system, see Zendesk Actions Reference

const (
	// ActionFieldStatus status
	ActionFieldStatus ActionField = "status"
	// ActionFieldType type
	ActionFieldType ActionField = "type"
	// ActionFieldPriority priority
	ActionFieldPriority ActionField = "priority"
	// ActionFieldGroupID group_id
	ActionFieldGroupID ActionField = "group_id"
	// ActionFieldAssigneeID assignee_id
	ActionFieldAssigneeID ActionField = "assignee_id"
	// ActionFieldSetTags set_tags
	ActionFieldSetTags ActionField = "set_tags"
	// ActionFieldCurrentTags current_tags
	ActionFieldCurrentTags ActionField = "current_tags"
	// ActionFieldRemoveTags remove_tags
	ActionFieldRemoveTags ActionField = "remove_tags"
	// ActionFieldSatisfactionScore satisfaction_score
	ActionFieldSatisfactionScore ActionField = "satisfaction_score"
	// ActionFieldNotificationUser notification_user
	ActionFieldNotificationUser ActionField = "notification_user"
	// ActionFieldNotificationGroup notification_group
	ActionFieldNotificationGroup ActionField = "notification_group"
	// ActionFieldNotificationTarget notification_target
	ActionFieldNotificationTarget ActionField = "notification_target"
	// ActionFieldNotificationWebhook notification_webhook
	ActionFieldNotificationWebhook ActionField = "notification_webhook"
	// ActionFieldTweetRequester tweet_requester
	ActionFieldTweetRequester ActionField = "tweet_requester"
	// ActionFieldCC cc
	ActionFieldCC ActionField = "cc"
	// ActionFieldLocaleID locale_id
	ActionFieldLocaleID ActionField = "locale_id"
	// ActionFieldSubject subject
	ActionFieldSubject ActionField = "subject"
	// ActionFieldCommentValue comment_value
	ActionFieldCommentValue ActionField = "comment_value"
	// ActionFieldCommentValueHTML comment_value_html
	ActionFieldCommentValueHTML ActionField = "comment_value_html"
	// ActionFieldCommentModeIsPublic comment_mode_is_public
	ActionFieldCommentModeIsPublic ActionField = "comment_mode_is_public"
	// ActionFieldTicketFormID ticket_form_id
	ActionFieldTicketFormID ActionField = "ticket_form_id"
	// ActionFieldCustomStatusId custom_status_id
	ActionFieldCustomStatusId ActionField = "custom_status_id"
	// ActionFieldFollower follower
	ActionFieldFollower ActionField = "follower"
	// ActionFieldBrandId brand_id
	ActionFieldBrandId ActionField = "brand_id"
	// ActionFieldAddSkills add_skills
	ActionFieldAddSkills ActionField = "add_skills"
	// ActionFieldSetSkills set_skills
	ActionFieldSetSkills ActionField = "set_skills"
	// ActionFieldRemoveSkills remove_skills
	ActionFieldRemoveSkills ActionField = "remove_skills"
	// ActionFieldCustomField custom_field_ prefix
	ActionFieldCustomField          ActionField = "custom_fields_"
	ActionSideConversationTicket    ActionField = "side_conversation_ticket"
	ActionSideConversationSlack     ActionField = "side_conversation_slack"
	ActionSetSchedule               ActionField = "set_schedule"
	ActionNotificationZis           ActionField = "notification_zis"
	ActionNotificationMessagingCsat ActionField = "notification_messaging_csat"
	ActionReplyPublic               ActionField = "reply_public"
	ActionReplyInternal             ActionField = "reply_internal"
)

func (ActionField) String added in v0.22.0

func (a ActionField) String() string

type ActionResourceType added in v0.22.0

type ActionResourceType string

ActionResourceType String type of resource the action belongs to. Valid options are TriggerActionResource, AutomationActionResource, or MacroActionResource

const (
	TriggerActionResource    ActionResourceType = "trigger"
	AutomationActionResource ActionResourceType = "automation"
	MacroActionResource      ActionResourceType = "macro"
)

func (ActionResourceType) ToValue added in v0.23.0

func (ActionResourceType) ValidateResourceType added in v0.22.0

func (a ActionResourceType) ValidateResourceType() error

type ActionsValueValidator added in v0.23.0

type ActionsValueValidator map[ActionField]ValueValidator[ActionResourceType]

func (ActionsValueValidator) ValidKeys added in v0.23.0

func (a ActionsValueValidator) ValidKeys() []string

func (ActionsValueValidator) ValidateValue added in v0.23.0

func (a ActionsValueValidator) ValidateValue(key ActionField, value ParsedValue, _ Operator, resourceType ResourceType[ActionResourceType]) error

type AppAPI

type AppAPI interface {
	ListInstallations(ctx context.Context) ([]AppInstallation, error)
}

AppAPI is an interface containing all methods associated with zendesk apps

type AppInstallation

type AppInstallation struct {
	ID       int64  `json:"id"`
	AppID    int64  `json:"app_id"`
	Product  string `json:"product"`
	Settings struct {
		Name  string `json:"name"`
		Title string `json:"title"`
	} `json:"settings"`
	SettingsObjects []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"settings_objects"`
	Enabled                   bool      `json:"enabled"`
	Updated                   string    `json:"updated"`
	UpdatedAt                 time.Time `json:"updated_at"`
	CreatedAt                 time.Time `json:"created_at"`
	RecurringPayment          bool      `json:"recurring_payment"`
	Collapsible               bool      `json:"collapsible"`
	Paid                      bool      `json:"paid"`
	HasUnpaidSubscription     bool      `json:"has_unpaid_subscription"`
	HasIncompleteSubscription bool      `json:"has_incomplete_subscription"`
}

AppInstallation is a struct representing an app that has been installed from the Zendesk Marketplace. https://developer.zendesk.com/api-reference/ticketing/apps/apps/#example-responses-11

type Attachment

type Attachment struct {
	ID          int64   `json:"id,omitempty"`
	FileName    string  `json:"file_name,omitempty"`
	ContentURL  string  `json:"content_url,omitempty"`
	ContentType string  `json:"content_type,omitempty"`
	Size        int64   `json:"size,omitempty"`
	Thumbnails  []Photo `json:"thumbnails,omitempty"`
	Inline      bool    `json:"inline,omitempty"`
}

Attachment is struct for attachment payload https://developer.zendesk.com/rest_api/docs/support/attachments.html

type AttachmentAPI

type AttachmentAPI interface {
	UploadAttachment(ctx context.Context, filename string, token string) UploadWriter
	DeleteUpload(ctx context.Context, token string) error
	GetAttachment(ctx context.Context, id int64) (Attachment, error)
}

AttachmentAPI an interface containing all of the attachment related zendesk methods

type Automation

type Automation struct {
	ID          int64      `json:"id,omitempty"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Active      bool       `json:"active"`
	Position    int64      `json:"position,omitempty"`
	Conditions  Conditions `json:"conditions"`
	Actions     []Action   `json:"actions"`
	RawTitle    string     `json:"raw_title,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	UpdatedAt   *time.Time `json:"updated_at,omitempty"`
	URL         string     `json:"url,omitempty"`
}

Automation is zendesk automation JSON payload format

ref: https://developer.zendesk.com/rest_api/docs/core/automations#json-format

type AutomationAPI

type AutomationAPI interface {
	GetAutomations(ctx context.Context, opts *AutomationListOptions) ([]Automation, Page, error)
	CreateAutomation(ctx context.Context, automation Automation) (Automation, error)
	GetAutomation(ctx context.Context, id int64) (Automation, error)
	UpdateAutomation(ctx context.Context, id int64, automation Automation) (Automation, error)
	DeleteAutomation(ctx context.Context, id int64) error
	GetAutomationsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Automation]
	GetAutomationsOBP(ctx context.Context, opts *OBPOptions) ([]Automation, Page, error)
	GetAutomationsCBP(ctx context.Context, opts *CBPOptions) ([]Automation, client2.CursorPaginationMeta, error)
}

AutomationAPI an interface containing all automation related methods

type AutomationListOptions

type AutomationListOptions struct {
	PageOptions
	Active    bool   `url:"active"`
	SortBy    string `url:"sort_by,omitempty"`
	SortOrder string `url:"sort_order,omitempty"`
}

AutomationListOptions is options for GetAutomations

ref: https://developer.zendesk.com/rest_api/docs/support/automations#list-automations

type Brand

type Brand struct {
	ID                int64      `json:"id,omitempty"`
	URL               string     `json:"url,omitempty"`
	Name              string     `json:"name"`
	BrandURL          string     `json:"brand_url,omitempty"`
	HasHelpCenter     bool       `json:"has_help_center,omitempty"`
	HelpCenterState   string     `json:"help_center_state,omitempty"`
	Active            bool       `json:"active"`
	Default           bool       `json:"default,omitempty"`
	TicketFormIDs     []int64    `json:"ticket_form_ids,omitempty"`
	Subdomain         string     `json:"subdomain"`
	HostMapping       string     `json:"host_mapping,omitempty"`
	SignatureTemplate string     `json:"signature_template"`
	CreatedAt         time.Time  `json:"created_at,omitempty"`
	UpdatedAt         time.Time  `json:"updated_at,omitempty"`
}

Brand is struct for brand payload https://developer.zendesk.com/rest_api/docs/support/brands

type BrandAPI

type BrandAPI interface {
	CreateBrand(ctx context.Context, brand Brand) (Brand, error)
	GetBrand(ctx context.Context, brandID int64) (Brand, error)
	UpdateBrand(ctx context.Context, brandID int64, brand Brand) (Brand, error)
	DeleteBrand(ctx context.Context, brandID int64) error
}

BrandAPI an interface containing all methods associated with zendesk brands

type CBPOptions

type CBPOptions struct {
	client.CursorPagination
	CommonOptions
}

CBPOptions struct is used to specify options for listing objects in CBP (Cursor Based Pagination). It embeds the CursorPagination struct for pagination and provides an option Sort for sorting the result.

type CbpFunc

type CbpFunc[T any] func(ctx context.Context, opts *CBPOptions) ([]T, client.CursorPaginationMeta, error)

CbpFunc defines the signature of the function used to list objects in CBP.

type ChildField added in v0.24.10

type ChildField struct {
	Id                 int64              `json:"id"`
	IsRequired         bool               `json:"is_required"`
	RequiredOnStatuses RequiredOnStatuses `json:"required_on_statuses,omitempty"`
}

ChildField is used to define when to show a field based on a condition from a parent field in a form. Has attributes IsRequired and RequiredOnStatuses, which indicate if the field to show is conditional

type Client

type Client struct {
	*client.BaseClient
}

func NewClient

func NewClient(httpClient *http.Client) (*Client, error)

func NewTestClient added in v0.34.5

func NewTestClient(mockAPI *httptest.Server) *Client

func (*Client) AddOrganizationTags

func (z *Client) AddOrganizationTags(ctx context.Context, organizationID int64, tags []Tag) ([]Tag, error)

AddOrganizationTags add tags to organization

ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags

func (*Client) AddTicketTags

func (z *Client) AddTicketTags(ctx context.Context, ticketID int64, tags []Tag) ([]Tag, error)

AddTicketTags add tags to ticket

ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags

func (*Client) AddUserTags

func (z *Client) AddUserTags(ctx context.Context, userID int64, tags []Tag) ([]Tag, error)

AddUserTags add tags to user

ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags

func (*Client) AutocompleteSearchCustomObjectRecords

func (z *Client) AutocompleteSearchCustomObjectRecords(
	ctx context.Context, customObjectKey string, opts *CustomObjectAutocompleteOptions,
) ([]CustomObjectRecord, Page, error)

AutocompleteSearchCustomObjectRecords search for a custom object record by the name field https://developer.zendesk.com/api-reference/custom-objects/custom_object_records/#autocomplete-custom-object-record-search

func (*Client) CreateAutomation

func (z *Client) CreateAutomation(ctx context.Context, automation Automation) (Automation, error)

CreateAutomation creates new automation

ref: https://developer.zendesk.com/rest_api/docs/support/automations#create-automation

func (*Client) CreateBrand

func (z *Client) CreateBrand(ctx context.Context, brand Brand) (Brand, error)

CreateBrand creates new brand https://developer.zendesk.com/rest_api/docs/support/brands#create-brand

func (*Client) CreateCustomObjectRecord

func (z *Client) CreateCustomObjectRecord(
	ctx context.Context, record CustomObjectRecord, customObjectKey string,
) (CustomObjectRecord, error)

CreateCustomObjectRecord CreateCustomObject create a custom object record

func (*Client) CreateCustomRole added in v0.28.0

func (z *Client) CreateCustomRole(ctx context.Context, customRole CustomRole) (CustomRole, error)

func (*Client) CreateDynamicContentItem

func (z *Client) CreateDynamicContentItem(ctx context.Context, item DynamicContentItem) (DynamicContentItem, error)

CreateDynamicContentItem creates new dynamic content item

https://developer.zendesk.com/rest_api/docs/support/dynamic_content#create-item

func (*Client) CreateGroup

func (z *Client) CreateGroup(ctx context.Context, group Group) (Group, error)

CreateGroup creates new group https://developer.zendesk.com/rest_api/docs/support/groups#create-group

func (*Client) CreateMacro

func (z *Client) CreateMacro(ctx context.Context, macro Macro) (Macro, error)

CreateMacro create a new macro

ref: https://developer.zendesk.com/rest_api/docs/support/macros#create-macro

func (*Client) CreateOrUpdateUser

func (z *Client) CreateOrUpdateUser(ctx context.Context, user User) (User, error)

CreateOrUpdateUser creates new user or updates a matching user ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#create-or-update-user

func (*Client) CreateOrganization

func (z *Client) CreateOrganization(ctx context.Context, org Organization) (Organization, error)

CreateOrganization creates new organization https://developer.zendesk.com/rest_api/docs/support/organizations#create-organization

func (*Client) CreateOrganizationField

func (z *Client) CreateOrganizationField(ctx context.Context, organizationField OrganizationField) (OrganizationField, error)

CreateOrganizationField creates new organization field ref: https://developer.zendesk.com/api-reference/ticketing/organizations/organization_fields/#create-organization-field

func (*Client) CreateOrganizationMembership

func (z *Client) CreateOrganizationMembership(ctx context.Context, opts OrganizationMembershipOptions) (OrganizationMembership, error)

CreateOrganizationMembership creates an organization membership for an existing user and org https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/#create-membership

func (*Client) CreateSLAPolicy

func (z *Client) CreateSLAPolicy(ctx context.Context, slaPolicy SLAPolicy) (SLAPolicy, error)

CreateSLAPolicy creates new slaPolicy

ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#create-slaPolicy

func (*Client) CreateSchedule added in v0.26.0

func (z *Client) CreateSchedule(ctx context.Context, schedule Schedule) (Schedule, error)

func (*Client) CreateTarget

func (z *Client) CreateTarget(ctx context.Context, target Target) (Target, error)

CreateTarget creates new target ref: https://developer.zendesk.com/rest_api/docs/core/targets#create-target

func (*Client) CreateTicket

func (z *Client) CreateTicket(ctx context.Context, ticket Ticket) (Ticket, error)

CreateTicket create a new ticket

ref: https://developer.zendesk.com/rest_api/docs/support/tickets#create-ticket

func (*Client) CreateTicketComment

func (z *Client) CreateTicketComment(ctx context.Context, ticketID int64, ticketComment TicketComment) (TicketComment, error)

CreateTicketComment creates a comment on a ticket

ref: https://developer.zendesk.com/rest_api/docs/support/ticket_comments#create-ticket-comment

func (*Client) CreateTicketField

func (z *Client) CreateTicketField(ctx context.Context, ticketField TicketField) (TicketField, error)

CreateTicketField creates new ticket field ref: https://developer.zendesk.com/rest_api/docs/core/ticket_fields#create-ticket-field

func (*Client) CreateTicketForm

func (z *Client) CreateTicketForm(ctx context.Context, ticketForm TicketForm) (TicketForm, error)

CreateTicketForm creates new ticket form ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#create-ticket-forms

func (*Client) CreateTrigger

func (z *Client) CreateTrigger(ctx context.Context, trigger Trigger) (Trigger, error)

CreateTrigger creates new trigger

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#create-trigger

func (*Client) CreateTriggerCategory

func (z *Client) CreateTriggerCategory(ctx context.Context, triggerCategory TriggerCategory) (TriggerCategory, error)

CreateTriggerCategory creates new trigger category

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#create-trigger

func (*Client) CreateUser

func (z *Client) CreateUser(ctx context.Context, user User) (User, error)

CreateUser creates new user ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#create-user

func (*Client) CreateUserField

func (z *Client) CreateUserField(ctx context.Context, userField UserField) (UserField, error)

CreateUserField creates new user field ref: https://developer.zendesk.com/api-reference/ticketing/users/user_fields/#create-user-field

func (*Client) CreateView added in v0.20.4

func (z *Client) CreateView(ctx context.Context, newView View) (View, error)

func (*Client) DeleteAutomation

func (z *Client) DeleteAutomation(ctx context.Context, id int64) error

DeleteAutomation deletes the specified automation

ref: https://developer.zendesk.com/rest_api/docs/support/automations#delete-automation

func (*Client) DeleteBrand

func (z *Client) DeleteBrand(ctx context.Context, brandID int64) error

DeleteBrand deletes the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#delete-brand

func (*Client) DeleteCustomRole added in v0.28.0

func (z *Client) DeleteCustomRole(ctx context.Context, id int64) error

func (*Client) DeleteDynamicContentItem

func (z *Client) DeleteDynamicContentItem(ctx context.Context, id int64) error

DeleteDynamicContentItem deletes the specified dynamic content item.

ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#delete-item

func (*Client) DeleteGroup

func (z *Client) DeleteGroup(ctx context.Context, groupID int64) error

DeleteGroup deletes the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#delete-group

func (*Client) DeleteMacro

func (z *Client) DeleteMacro(ctx context.Context, macroID int64) error

DeleteMacro deletes the specified macro ref: https://developer.zendesk.com/rest_api/docs/support/macros#delete-macro

func (*Client) DeleteOrganization

func (z *Client) DeleteOrganization(ctx context.Context, orgID int64) error

DeleteOrganization deletes the specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#delete-organization

func (*Client) DeleteOrganizationField added in v0.25.7

func (z *Client) DeleteOrganizationField(ctx context.Context, id int64) error

func (*Client) DeleteSLAPolicy

func (z *Client) DeleteSLAPolicy(ctx context.Context, id int64) error

DeleteSLAPolicy deletes the specified slaPolicy

ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#delete-slaPolicy

func (*Client) DeleteSchedule added in v0.26.0

func (z *Client) DeleteSchedule(ctx context.Context, scheduleId int64) error

func (*Client) DeleteTarget

func (z *Client) DeleteTarget(ctx context.Context, targetID int64) error

DeleteTarget deletes the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#delete-target

func (*Client) DeleteTicket

func (z *Client) DeleteTicket(ctx context.Context, ticketID int64) error

DeleteTicket deletes the specified ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#delete-ticket

func (*Client) DeleteTicketField

func (z *Client) DeleteTicketField(ctx context.Context, ticketID int64) error

DeleteTicketField deletes the specified ticket field ref: https://developer.zendesk.com/rest_api/docs/support/ticket_fields#delete-ticket-field

func (*Client) DeleteTicketForm

func (z *Client) DeleteTicketForm(ctx context.Context, id int64) error

DeleteTicketForm deletes the specified ticket form ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#delete-ticket-form

func (*Client) DeleteTrigger

func (z *Client) DeleteTrigger(ctx context.Context, id int64) error

DeleteTrigger deletes the specified trigger

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#delete-trigger

func (*Client) DeleteTriggerCategory

func (z *Client) DeleteTriggerCategory(ctx context.Context, id int64) error

DeleteTriggerCategory deletes the specified trigger category

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#delete-trigger

func (*Client) DeleteUpload

func (z *Client) DeleteUpload(ctx context.Context, token string) error

DeleteUpload deletes a previously uploaded file ref: https://developer.zendesk.com/rest_api/docs/support/attachments#delete-upload

func (*Client) DeleteUserField added in v0.25.7

func (z *Client) DeleteUserField(ctx context.Context, id int64) error

func (*Client) DeleteView added in v0.20.4

func (z *Client) DeleteView(ctx context.Context, viewId int64) error

func (*Client) DeleteWebhook

func (z *Client) DeleteWebhook(ctx context.Context, webhookID string) error

DeleteWebhook deletes the specified webhook.

https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#delete-webhook

func (*Client) GetAllTicketAudits

func (z *Client) GetAllTicketAudits(ctx context.Context, opts CursorOption) ([]TicketAudit, Cursor, error)

GetAllTicketAudits list all ticket audits ref: https://developer.zendesk.com/rest_api/docs/support/ticket_audits#list-all-ticket-audits

func (*Client) GetAllTicketAuditsCBP

func (z *Client) GetAllTicketAuditsCBP(ctx context.Context, opts *CBPOptions) ([]TicketAudit, client.CursorPaginationMeta, error)

func (*Client) GetAllTicketAuditsIterator

func (z *Client) GetAllTicketAuditsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketAudit]

func (*Client) GetAllTicketAuditsOBP

func (z *Client) GetAllTicketAuditsOBP(ctx context.Context, opts *OBPOptions) ([]TicketAudit, Page, error)

func (*Client) GetAttachment

func (z *Client) GetAttachment(ctx context.Context, id int64) (Attachment, error)

GetAttachment returns the current state of an uploaded attachment ref: https://developer.zendesk.com/rest_api/docs/support/attachments#show-attachment

func (*Client) GetAutomation

func (z *Client) GetAutomation(ctx context.Context, id int64) (Automation, error)

GetAutomation returns the specified automation

ref: https://developer.zendesk.com/rest_api/docs/support/automations#getting-automations

func (*Client) GetAutomations

func (z *Client) GetAutomations(ctx context.Context, opts *AutomationListOptions) ([]Automation, Page, error)

GetAutomations fetch automation list

ref: https://developer.zendesk.com/rest_api/docs/support/automations#getting-automations

func (*Client) GetAutomationsCBP

func (z *Client) GetAutomationsCBP(ctx context.Context, opts *CBPOptions) ([]Automation, client.CursorPaginationMeta, error)

func (*Client) GetAutomationsIterator

func (z *Client) GetAutomationsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Automation]

func (*Client) GetAutomationsOBP

func (z *Client) GetAutomationsOBP(ctx context.Context, opts *OBPOptions) ([]Automation, Page, error)

func (*Client) GetBrand

func (z *Client) GetBrand(ctx context.Context, brandID int64) (Brand, error)

GetBrand gets a specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#show-brand

func (*Client) GetCountTicketsInViews

func (z *Client) GetCountTicketsInViews(ctx context.Context, ids []string) ([]ViewCount, error)

GetCountTicketsInViews count tickets in views using views ids ref https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#count-tickets-in-views

func (*Client) GetCustomRole added in v0.28.0

func (z *Client) GetCustomRole(ctx context.Context, id int64) (CustomRole, error)

func (*Client) GetCustomRoles

func (z *Client) GetCustomRoles(ctx context.Context) ([]CustomRole, error)

GetCustomRoles fetch CustomRoles list

func (*Client) GetDynamicContentItem

func (z *Client) GetDynamicContentItem(ctx context.Context, id int64) (DynamicContentItem, error)

GetDynamicContentItem returns the specified dynamic content item.

ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#show-item

func (*Client) GetDynamicContentItems

func (z *Client) GetDynamicContentItems(ctx context.Context) ([]DynamicContentItem, Page, error)

GetDynamicContentItems fetches dynamic content item list

https://developer.zendesk.com/rest_api/docs/support/dynamic_content#list-items

func (*Client) GetDynamicContentItemsCBP

func (z *Client) GetDynamicContentItemsCBP(ctx context.Context, opts *CBPOptions) ([]DynamicContentItem, client.CursorPaginationMeta, error)

func (*Client) GetDynamicContentItemsIterator

func (z *Client) GetDynamicContentItemsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[DynamicContentItem]

func (*Client) GetDynamicContentItemsOBP

func (z *Client) GetDynamicContentItemsOBP(ctx context.Context, opts *OBPOptions) ([]DynamicContentItem, Page, error)

func (*Client) GetGroup

func (z *Client) GetGroup(ctx context.Context, groupID int64) (Group, error)

GetGroup gets a specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#show-group

func (*Client) GetGroupMemberships

func (z *Client) GetGroupMemberships(ctx context.Context, opts *GroupMembershipListOptions) ([]GroupMembership, Page, error)

GetGroupMemberships gets the memberships of the specified group ref: https://developer.zendesk.com/api-reference/ticketing/groups/group_memberships/

func (*Client) GetGroupMembershipsCBP

func (z *Client) GetGroupMembershipsCBP(ctx context.Context, opts *CBPOptions) ([]GroupMembership, client.CursorPaginationMeta, error)

func (*Client) GetGroupMembershipsIterator

func (z *Client) GetGroupMembershipsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[GroupMembership]

func (*Client) GetGroupMembershipsOBP

func (z *Client) GetGroupMembershipsOBP(ctx context.Context, opts *OBPOptions) ([]GroupMembership, Page, error)

func (*Client) GetGroups

func (z *Client) GetGroups(ctx context.Context, opts *GroupListOptions) ([]Group, Page, error)

GetGroups fetches group list https://developer.zendesk.com/rest_api/docs/support/groups#list-groups

func (*Client) GetGroupsCBP

func (z *Client) GetGroupsCBP(ctx context.Context, opts *CBPOptions) ([]Group, client.CursorPaginationMeta, error)

func (*Client) GetGroupsIterator

func (z *Client) GetGroupsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Group]

func (*Client) GetGroupsOBP

func (z *Client) GetGroupsOBP(ctx context.Context, opts *OBPOptions) ([]Group, Page, error)

func (*Client) GetLocales

func (z *Client) GetLocales(ctx context.Context) ([]Locale, error)

GetLocales lists the translation locales available for the account. https://developer.zendesk.com/rest_api/docs/support/locales#list-locales

func (*Client) GetMacro

func (z *Client) GetMacro(ctx context.Context, macroID int64) (Macro, error)

GetMacro gets a specified macro

ref: https://developer.zendesk.com/rest_api/docs/support/macros#show-macro

func (*Client) GetMacros

func (z *Client) GetMacros(ctx context.Context, opts *MacroListOptions) ([]Macro, Page, error)

GetMacros get macro list

ref: https://developer.zendesk.com/rest_api/docs/support/macros#list-macros

func (*Client) GetMacrosCBP

func (z *Client) GetMacrosCBP(ctx context.Context, opts *CBPOptions) ([]Macro, client.CursorPaginationMeta, error)

func (*Client) GetMacrosIterator

func (z *Client) GetMacrosIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Macro]

func (*Client) GetMacrosOBP

func (z *Client) GetMacrosOBP(ctx context.Context, opts *OBPOptions) ([]Macro, Page, error)

func (*Client) GetMultipleTickets

func (z *Client) GetMultipleTickets(ctx context.Context, ticketIDs []int64) ([]Ticket, error)

GetMultipleTickets gets multiple specified tickets

ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-multiple-tickets

func (*Client) GetOrganization

func (z *Client) GetOrganization(ctx context.Context, orgID int64) (Organization, error)

GetOrganization gets a specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#show-organization

func (*Client) GetOrganizationByExternalID

func (z *Client) GetOrganizationByExternalID(ctx context.Context, externalID string) ([]Organization, Page, error)

GetOrganizationByExternalID gets a specified organization by external ID ref: https://developer.zendesk.com/api-reference/ticketing/organizations/organizations/#search-organizations-by-external-id

func (*Client) GetOrganizationField added in v0.25.7

func (z *Client) GetOrganizationField(ctx context.Context, id int64) (OrganizationField, error)

func (*Client) GetOrganizationFields

func (z *Client) GetOrganizationFields(ctx context.Context) ([]OrganizationField, Page, error)

GetOrganizationFields fetches organization field list ref: https://developer.zendesk.com/api-reference/ticketing/organizations/organization_fields/#list-organization-fields

func (*Client) GetOrganizationFieldsCBP

func (z *Client) GetOrganizationFieldsCBP(ctx context.Context, opts *CBPOptions) ([]OrganizationField, client.CursorPaginationMeta, error)

func (*Client) GetOrganizationFieldsIterator

func (z *Client) GetOrganizationFieldsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[OrganizationField]

func (*Client) GetOrganizationFieldsOBP

func (z *Client) GetOrganizationFieldsOBP(ctx context.Context, opts *OBPOptions) ([]OrganizationField, Page, error)

func (*Client) GetOrganizationMemberships

func (z *Client) GetOrganizationMemberships(ctx context.Context, opts *OrganizationMembershipListOptions) ([]OrganizationMembership, Page, error)

GetOrganizationMemberships gets the memberships of the specified organization ref: https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/

func (*Client) GetOrganizationMembershipsCBP

func (z *Client) GetOrganizationMembershipsCBP(ctx context.Context, opts *CBPOptions) ([]OrganizationMembership, client.CursorPaginationMeta, error)

func (*Client) GetOrganizationMembershipsIterator

func (z *Client) GetOrganizationMembershipsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[OrganizationMembership]

func (*Client) GetOrganizationMembershipsOBP

func (z *Client) GetOrganizationMembershipsOBP(ctx context.Context, opts *OBPOptions) ([]OrganizationMembership, Page, error)

func (*Client) GetOrganizationTags

func (z *Client) GetOrganizationTags(ctx context.Context, organizationID int64) ([]Tag, error)

GetOrganizationTags get organization tag list

ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags

func (*Client) GetOrganizationTickets

func (z *Client) GetOrganizationTickets(
	ctx context.Context, organizationID int64, opts *TicketListOptions,
) ([]Ticket, Page, error)

GetOrganizationTickets get organization ticket list

ref: https://developer.zendesk.com/rest_api/docs/support/tickets#list-tickets

func (*Client) GetOrganizationTicketsCBP

func (z *Client) GetOrganizationTicketsCBP(ctx context.Context, opts *CBPOptions) ([]Ticket, client.CursorPaginationMeta, error)

func (*Client) GetOrganizationTicketsIterator

func (z *Client) GetOrganizationTicketsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Ticket]

func (*Client) GetOrganizationTicketsOBP

func (z *Client) GetOrganizationTicketsOBP(ctx context.Context, opts *OBPOptions) ([]Ticket, Page, error)

func (*Client) GetOrganizationUsers

func (z *Client) GetOrganizationUsers(ctx context.Context, orgID int64, opts *UserListOptions) ([]User, Page, error)

GetOrganizationUsers fetch organization users list https://developer.zendesk.com/api-reference/ticketing/users/users/#list-users /api/v2/organizations/{organization_id}/users

func (*Client) GetOrganizationUsersCBP

func (z *Client) GetOrganizationUsersCBP(ctx context.Context, opts *CBPOptions) ([]User, client.CursorPaginationMeta, error)

func (*Client) GetOrganizationUsersIterator

func (z *Client) GetOrganizationUsersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[User]

func (*Client) GetOrganizationUsersOBP

func (z *Client) GetOrganizationUsersOBP(ctx context.Context, opts *OBPOptions) ([]User, Page, error)

func (*Client) GetOrganizations

func (z *Client) GetOrganizations(ctx context.Context, opts *OrganizationListOptions) ([]Organization, Page, error)

GetOrganizations fetch organization list

ref: https://developer.zendesk.com/rest_api/docs/support/organizations#getting-organizations

func (*Client) GetOrganizationsCBP

func (z *Client) GetOrganizationsCBP(ctx context.Context, opts *CBPOptions) ([]Organization, client.CursorPaginationMeta, error)

func (*Client) GetOrganizationsIterator

func (z *Client) GetOrganizationsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Organization]

func (*Client) GetOrganizationsOBP

func (z *Client) GetOrganizationsOBP(ctx context.Context, opts *OBPOptions) ([]Organization, Page, error)

func (*Client) GetSLAPolicies

func (z *Client) GetSLAPolicies(ctx context.Context, opts *SLAPolicyListOptions) ([]SLAPolicy, Page, error)

GetSLAPolicies fetch slaPolicy list

ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#getting-slas/policies

func (*Client) GetSLAPoliciesCBP

func (z *Client) GetSLAPoliciesCBP(ctx context.Context, opts *CBPOptions) ([]SLAPolicy, client.CursorPaginationMeta, error)

func (*Client) GetSLAPoliciesIterator

func (z *Client) GetSLAPoliciesIterator(ctx context.Context, opts *PaginationOptions) *Iterator[SLAPolicy]

func (*Client) GetSLAPoliciesOBP

func (z *Client) GetSLAPoliciesOBP(ctx context.Context, opts *OBPOptions) ([]SLAPolicy, Page, error)

func (*Client) GetSLAPolicy

func (z *Client) GetSLAPolicy(ctx context.Context, id int64) (SLAPolicy, error)

GetSLAPolicy returns the specified slaPolicy

ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#getting-slas/policies

func (*Client) GetSchedule added in v0.26.0

func (z *Client) GetSchedule(ctx context.Context, scheduleId int64) (Schedule, error)

func (*Client) GetSearchCBP

func (z *Client) GetSearchCBP(ctx context.Context, opts *CBPOptions) ([]SearchResults, client.CursorPaginationMeta, error)

func (*Client) GetSearchIterator

func (z *Client) GetSearchIterator(ctx context.Context, opts *PaginationOptions) *Iterator[SearchResults]

func (*Client) GetSearchOBP

func (z *Client) GetSearchOBP(ctx context.Context, opts *OBPOptions) ([]SearchResults, Page, error)

func (*Client) GetTarget

func (z *Client) GetTarget(ctx context.Context, targetID int64) (Target, error)

GetTarget gets a specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#show-target

func (*Client) GetTargets

func (z *Client) GetTargets(ctx context.Context) ([]Target, Page, error)

GetTargets fetches target list ref: https://developer.zendesk.com/rest_api/docs/core/targets#list-targets

func (*Client) GetTicket

func (z *Client) GetTicket(ctx context.Context, ticketID int64) (Ticket, error)

GetTicket gets a specified ticket

ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-ticket

func (*Client) GetTicketAudit

func (z *Client) GetTicketAudit(ctx context.Context, ticketID, ID int64) (TicketAudit, error)

GetTicketAudit show audit ref: https://developer.zendesk.com/rest_api/docs/support/ticket_audits#show-audit

func (*Client) GetTicketAudits

func (z *Client) GetTicketAudits(ctx context.Context, ticketID int64, opts PageOptions) ([]TicketAudit, Page, error)

GetTicketAudits list audits for a ticket ref: https://developer.zendesk.com/rest_api/docs/support/ticket_audits#list-audits-for-a-ticket

func (*Client) GetTicketAuditsCBP

func (z *Client) GetTicketAuditsCBP(ctx context.Context, opts *CBPOptions) ([]TicketAudit, client.CursorPaginationMeta, error)

func (*Client) GetTicketAuditsIterator

func (z *Client) GetTicketAuditsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketAudit]

func (*Client) GetTicketAuditsOBP

func (z *Client) GetTicketAuditsOBP(ctx context.Context, opts *OBPOptions) ([]TicketAudit, Page, error)

func (*Client) GetTicketCommentsCBP

func (z *Client) GetTicketCommentsCBP(ctx context.Context, opts *CBPOptions) ([]TicketComment, client.CursorPaginationMeta, error)

func (*Client) GetTicketCommentsIterator

func (z *Client) GetTicketCommentsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketComment]

func (*Client) GetTicketCommentsOBP

func (z *Client) GetTicketCommentsOBP(ctx context.Context, opts *OBPOptions) ([]TicketComment, Page, error)

func (*Client) GetTicketField

func (z *Client) GetTicketField(ctx context.Context, ticketID int64) (TicketField, error)

GetTicketField gets a specified ticket field ref: https://developer.zendesk.com/rest_api/docs/support/ticket_fields#show-ticket-field

func (*Client) GetTicketFields

func (z *Client) GetTicketFields(ctx context.Context) ([]TicketField, Page, error)

GetTicketFields fetches ticket field list ref: https://developer.zendesk.com/rest_api/docs/core/ticket_fields#list-ticket-fields

func (*Client) GetTicketFieldsCBP

func (z *Client) GetTicketFieldsCBP(ctx context.Context, opts *CBPOptions) ([]TicketField, client.CursorPaginationMeta, error)

func (*Client) GetTicketFieldsIterator

func (z *Client) GetTicketFieldsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketField]

func (*Client) GetTicketFieldsOBP

func (z *Client) GetTicketFieldsOBP(ctx context.Context, opts *OBPOptions) ([]TicketField, Page, error)

func (*Client) GetTicketForm

func (z *Client) GetTicketForm(ctx context.Context, id int64) (TicketForm, error)

GetTicketForm returns the specified ticket form ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#show-ticket-form

func (*Client) GetTicketForms

func (z *Client) GetTicketForms(ctx context.Context, options *TicketFormListOptions) ([]TicketForm, Page, error)

GetTicketForms fetches ticket forms ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#list-ticket-forms

func (*Client) GetTicketFormsCBP

func (z *Client) GetTicketFormsCBP(ctx context.Context, opts *CBPOptions) ([]TicketForm, client.CursorPaginationMeta, error)

func (*Client) GetTicketFormsIterator

func (z *Client) GetTicketFormsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketForm]

func (*Client) GetTicketFormsOBP

func (z *Client) GetTicketFormsOBP(ctx context.Context, opts *OBPOptions) ([]TicketForm, Page, error)

func (*Client) GetTicketMetrics

func (z *Client) GetTicketMetrics(ctx context.Context, opts *TicketMetricListOptions) ([]TicketMetric, Page, error)

GetTicketMetrics get ticket metrics list with offset based pagination

ref: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metrics/#list-ticket-metrics

func (*Client) GetTicketTags

func (z *Client) GetTicketTags(ctx context.Context, ticketID int64) ([]Tag, error)

GetTicketTags get ticket tag list

ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags

func (*Client) GetTickets

func (z *Client) GetTickets(ctx context.Context, opts *TicketListOptions) ([]Ticket, Page, error)

GetTickets get ticket list with offset based pagination

ref: https://developer.zendesk.com/rest_api/docs/support/tickets#list-tickets

func (*Client) GetTicketsCBP

func (z *Client) GetTicketsCBP(ctx context.Context, opts *CBPOptions) ([]Ticket, client.CursorPaginationMeta, error)

func (*Client) GetTicketsFromView

func (z *Client) GetTicketsFromView(ctx context.Context, viewID int64, opts *TicketListOptions,
) ([]Ticket, Page, error)

GetTicketsFromView gets the tickets of the specified view ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#list-tickets-from-a-view

func (*Client) GetTicketsFromViewCBP

func (z *Client) GetTicketsFromViewCBP(ctx context.Context, opts *CBPOptions) ([]Ticket, client.CursorPaginationMeta, error)

func (*Client) GetTicketsFromViewIterator

func (z *Client) GetTicketsFromViewIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Ticket]

func (*Client) GetTicketsFromViewOBP

func (z *Client) GetTicketsFromViewOBP(ctx context.Context, opts *OBPOptions) ([]Ticket, Page, error)

func (*Client) GetTicketsIterator

func (z *Client) GetTicketsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Ticket]

func (*Client) GetTicketsOBP

func (z *Client) GetTicketsOBP(ctx context.Context, opts *OBPOptions) ([]Ticket, Page, error)

func (*Client) GetTrigger

func (z *Client) GetTrigger(ctx context.Context, id int64) (Trigger, error)

GetTrigger returns the specified trigger

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#getting-triggers

func (*Client) GetTriggerCategories

GetTriggerCategories fetch trigger category list

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#getting-triggers

func (*Client) GetTriggerCategory

func (z *Client) GetTriggerCategory(ctx context.Context, id int64) (TriggerCategory, error)

GetTriggerCategory returns the specified trigger category

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#getting-triggers

func (*Client) GetTriggers

func (z *Client) GetTriggers(ctx context.Context, opts *TriggerListOptions) ([]Trigger, Page, error)

GetTriggers fetch trigger list

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#getting-triggers

func (*Client) GetTriggersCBP

func (z *Client) GetTriggersCBP(ctx context.Context, opts *CBPOptions) ([]Trigger, client.CursorPaginationMeta, error)

func (*Client) GetTriggersIterator

func (z *Client) GetTriggersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Trigger]

func (*Client) GetTriggersOBP

func (z *Client) GetTriggersOBP(ctx context.Context, opts *OBPOptions) ([]Trigger, Page, error)

func (*Client) GetUser

func (z *Client) GetUser(ctx context.Context, userID int64) (User, error)

GetUser get an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#show-user

func (*Client) GetUserField added in v0.25.7

func (z *Client) GetUserField(ctx context.Context, id int64) (UserField, error)

func (*Client) GetUserFieldsCBP

func (z *Client) GetUserFieldsCBP(ctx context.Context, opts *CBPOptions) ([]UserField, client.CursorPaginationMeta, error)

func (*Client) GetUserFieldsIterator

func (z *Client) GetUserFieldsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[UserField]

func (*Client) GetUserFieldsOBP

func (z *Client) GetUserFieldsOBP(ctx context.Context, opts *OBPOptions) ([]UserField, Page, error)

func (*Client) GetUserRelated

func (z *Client) GetUserRelated(ctx context.Context, userID int64) (UserRelated, error)

GetUserRelated retrieves user related user information ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user-related-information

func (*Client) GetUserTags

func (z *Client) GetUserTags(ctx context.Context, userID int64) ([]Tag, error)

GetUserTags get user tag list

ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags

func (*Client) GetUsersCBP

func (z *Client) GetUsersCBP(ctx context.Context, opts *CBPOptions) ([]User, client.CursorPaginationMeta, error)

func (*Client) GetUsersIterator

func (z *Client) GetUsersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[User]

func (*Client) GetUsersOBP

func (z *Client) GetUsersOBP(ctx context.Context, opts *OBPOptions) ([]User, Page, error)

func (*Client) GetView

func (z *Client) GetView(ctx context.Context, viewID int64) (View, error)

GetView gets a given view ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#show-view

func (*Client) GetViewsCBP

func (z *Client) GetViewsCBP(ctx context.Context, opts *CBPOptions) ([]View, client.CursorPaginationMeta, error)

func (*Client) GetViewsIterator

func (z *Client) GetViewsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[View]

func (*Client) GetViewsOBP

func (z *Client) GetViewsOBP(ctx context.Context, opts *OBPOptions) ([]View, Page, error)

func (*Client) GetWebhook

func (z *Client) GetWebhook(ctx context.Context, webhookID string) (Webhook, error)

GetWebhook gets a specified webhook.

https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#show-webhook

func (*Client) GetWebhookSigningSecret

func (z *Client) GetWebhookSigningSecret(ctx context.Context, webhookID string) (WebhookSigningSecret, error)

GetWebhookSigningSecret gets the signing secret of specified webhook.

https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#show-webhook-signing-secret

func (*Client) ListInstallations

func (z *Client) ListInstallations(ctx context.Context) ([]AppInstallation, error)

ListInstallations shows all apps installed in the current account. ref: https://developer.zendesk.com/api-reference/ticketing/apps/apps/#list-app-installations

func (*Client) ListTicketComments

func (z *Client) ListTicketComments(
	ctx context.Context,
	ticketID int64,
	opts *ListTicketCommentsOptions,
) (*ListTicketCommentsResult, error)

ListTicketComments gets a list of comment for a specified ticket

ref: https://developer.zendesk.com/rest_api/docs/support/ticket_comments#list-comments

func (*Client) MakeCommentPrivate

func (z *Client) MakeCommentPrivate(ctx context.Context, ticketID int64, ticketCommentID int64) error

MakeCommentPrivate converts an existing ticket comment to an internal note that is not publicly viewable.

ref: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#make-comment-private

func (*Client) RedactCommentAttachment

func (z *Client) RedactCommentAttachment(ctx context.Context, ticketID, commentID, attachmentID int64) error

RedactCommentAttachment deletes an attachment with attachmentID on comment with commentID for ticket with ticketID https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#redact-comment-attachment

func (*Client) RedactTicketComment

func (z *Client) RedactTicketComment(
	ctx context.Context,
	ticketCommentID int64,
	body RedactTicketCommentRequest,
) error

RedactTicketComment permanently removes words, strings, or attachments from a ticket comment

ref: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#redact-ticket-comment-in-agent-workspace

func (*Client) Search

func (z *Client) Search(ctx context.Context, opts *SearchOptions) (SearchResults, Page, error)

Search allows users to query zendesk's unified search api.

ref: https://developer.zendesk.com/rest_api/docs/support/search

func (*Client) SearchCount

func (z *Client) SearchCount(ctx context.Context, opts *CountOptions) (int, error)

SearchCount allows users to get count of results of a query of zendesk's unified search api.

ref: https://developer.zendesk.com/rest_api/docs/support/search#show-results-count

func (*Client) SearchCustomObjectRecords

func (z *Client) SearchCustomObjectRecords(
	ctx context.Context, customObjectKey string, opts *SearchCustomObjectRecordsOptions,
) ([]CustomObjectRecord, Page, error)

SearchCustomObjectRecords search for a custom object record by the name field https://developer.zendesk.com/api-reference/custom-objects/custom_object_records/#search-custom-object-records

func (*Client) SearchUsers

func (z *Client) SearchUsers(ctx context.Context, opts *SearchUsersOptions) ([]User, Page, error)

SearchUsers Returns an array of users who meet the search criteria. https://developer.zendesk.com/api-reference/ticketing/users/users/#search-users

func (*Client) SetDefaultOrganization

func (z *Client) SetDefaultOrganization(ctx context.Context, opts OrganizationMembershipOptions) (OrganizationMembership, error)

SetDefaultOrganization sets the default organization for a user that has a membership in that org https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/#set-organization-as-default

func (*Client) ShowCustomObjectRecord

func (z *Client) ShowCustomObjectRecord(
	ctx context.Context, customObjectKey string, customObjectRecordID string,
) (*CustomObjectRecord, error)

ShowCustomObjectRecord returns a custom record for a specific object using a provided id. https://developer.zendesk.com/api-reference/custom-objects/custom_object_records/#show-custom-object-record

func (*Client) UpdateAutomation

func (z *Client) UpdateAutomation(ctx context.Context, id int64, automation Automation) (Automation, error)

UpdateAutomation updates the specified automation and returns the updated one

ref: https://developer.zendesk.com/rest_api/docs/support/automations#update-automation

func (*Client) UpdateBrand

func (z *Client) UpdateBrand(ctx context.Context, brandID int64, brand Brand) (Brand, error)

UpdateBrand updates a brand with the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#update-brand

func (*Client) UpdateCustomObjectRecord

func (z *Client) UpdateCustomObjectRecord(
	ctx context.Context, customObjectKey string, customObjectRecordID string, record CustomObjectRecord,
) (*CustomObjectRecord, error)

UpdateCustomObjectRecord Updates an individual custom object record https://developer.zendesk.com/api-reference/custom-objects/custom_object_records/#update-custom-object-record

func (*Client) UpdateCustomRole added in v0.28.0

func (z *Client) UpdateCustomRole(ctx context.Context, updatedId int64, customRole CustomRole) (CustomRole, error)

func (*Client) UpdateDynamicContentItem

func (z *Client) UpdateDynamicContentItem(ctx context.Context, id int64, item DynamicContentItem) (DynamicContentItem, error)

UpdateDynamicContentItem updates the specified dynamic content item and returns the updated one

ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#update-item

func (*Client) UpdateDynamicContentVariants added in v0.27.0

func (z *Client) UpdateDynamicContentVariants(ctx context.Context, id int64, variants []DynamicContentVariant) ([]DynamicContentVariant, error)

func (*Client) UpdateGroup

func (z *Client) UpdateGroup(ctx context.Context, groupID int64, group Group) (Group, error)

UpdateGroup updates a group with the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#update-group

func (*Client) UpdateMacro

func (z *Client) UpdateMacro(ctx context.Context, macroID int64, macro Macro) (Macro, error)

UpdateMacro update an existing macro ref: https://developer.zendesk.com/rest_api/docs/support/macros#update-macro

func (*Client) UpdateOrganization

func (z *Client) UpdateOrganization(ctx context.Context, orgID int64, org Organization) (Organization, error)

UpdateOrganization updates a organization with the specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#update-organization

func (*Client) UpdateOrganizationField added in v0.25.7

func (z *Client) UpdateOrganizationField(ctx context.Context, id int64, userField OrganizationField) (OrganizationField, error)

func (*Client) UpdateSLAPolicy

func (z *Client) UpdateSLAPolicy(ctx context.Context, id int64, slaPolicy SLAPolicy) (SLAPolicy, error)

UpdateSLAPolicy updates the specified slaPolicy and returns the updated one

ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#update-slaPolicy

func (*Client) UpdateSchedule added in v0.26.0

func (z *Client) UpdateSchedule(ctx context.Context, scheduleId int64, schedule Schedule) (Schedule, error)

func (*Client) UpdateScheduleIntervals added in v0.26.3

func (z *Client) UpdateScheduleIntervals(ctx context.Context, scheduleId int64, intervals []ScheduleInterval) ([]ScheduleInterval, error)

func (*Client) UpdateTarget

func (z *Client) UpdateTarget(ctx context.Context, targetID int64, field Target) (Target, error)

UpdateTarget updates a field with the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#update-target

func (*Client) UpdateTicket

func (z *Client) UpdateTicket(ctx context.Context, ticketID int64, ticket Ticket) (Ticket, error)

UpdateTicket update an existing ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#update-ticket

func (*Client) UpdateTicketField

func (z *Client) UpdateTicketField(ctx context.Context, ticketID int64, field TicketField) (TicketField, error)

UpdateTicketField updates a field with the specified ticket field ref: https://developer.zendesk.com/rest_api/docs/support/ticket_fields#update-ticket-field

func (*Client) UpdateTicketForm

func (z *Client) UpdateTicketForm(ctx context.Context, id int64, form TicketForm) (TicketForm, error)

UpdateTicketForm updates the specified ticket form and returns the updated form ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#update-ticket-forms

func (*Client) UpdateTrigger

func (z *Client) UpdateTrigger(ctx context.Context, id int64, trigger Trigger) (Trigger, error)

UpdateTrigger updates the specified trigger and returns the updated one

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#update-trigger

func (*Client) UpdateTriggerCategory

func (z *Client) UpdateTriggerCategory(ctx context.Context, id int64, triggerCategory TriggerCategory) (TriggerCategory, error)

UpdateTriggerCategory updates the specified trigger category and returns the updated one

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#update-trigger

func (*Client) UpdateUser

func (z *Client) UpdateUser(ctx context.Context, userID int64, user User) (User, error)

UpdateUser update an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#update-user

func (*Client) UpdateUserField added in v0.25.7

func (z *Client) UpdateUserField(ctx context.Context, id int64, userField UserField) (UserField, error)

func (*Client) UpdateView added in v0.20.4

func (z *Client) UpdateView(ctx context.Context, updatedViewId int64, updatedView View) (View, error)

func (*Client) UpdateWebhook

func (z *Client) UpdateWebhook(ctx context.Context, webhookID string, hook Webhook) error

UpdateWebhook updates a webhook with the specified webhook.

https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#update-webhook

func (*Client) UploadAttachment

func (z *Client) UploadAttachment(ctx context.Context, filename string, token string) UploadWriter

UploadAttachment returns a writer that can be used to create a zendesk attachment ref: https://developer.zendesk.com/rest_api/docs/support/attachments#upload-files

type Collaborator

type Collaborator struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

Collaborator is user information for collaborator field value

type Collaborators

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

Collaborators hold array of interface which can take Collaborator

ref: https://developer.zendesk.com/rest_api/docs/support/tickets#setting-collaborators

func (*Collaborators) Append

func (c *Collaborators) Append(i interface{}) error

Append add any type of collaborator data payload to Collaborators. The type can be string, int64, Collaborator or map[string]interface{} which must include "name" and "email" field

func (*Collaborators) List

func (c *Collaborators) List() []interface{}

List return internal array in Collaborators

func (Collaborators) MarshalJSON

func (c Collaborators) MarshalJSON() ([]byte, error)

MarshalJSON is marshaller for Collaborators

func (*Collaborators) String

func (c *Collaborators) String() string

String return string formatted for

func (*Collaborators) UnmarshalJSON

func (c *Collaborators) UnmarshalJSON(b []byte) error

UnmarshalJSON is unmarshaller for Collaborators

type CommonOptions

type CommonOptions struct {
	Active        bool     `url:"active"`
	Role          string   `url:"role,omitempty"`
	Roles         []string `url:"role[],omitempty"`
	PermissionSet int64    `url:"permission_set,omitempty"`

	// SortBy can take "assignee", "assignee.name", "created_at", "group", "id",
	// "locale", "requester", "requester.name", "status", "subject", "updated_at"
	SortBy string `url:"sort_by,omitempty"`

	// SortOrder can take "asc" or "desc"
	SortOrder      string `url:"sort_order,omitempty"`
	Sort           string `url:"sort,omitempty"`
	Id             int64
	GroupID        int64 `json:"group_id,omitempty" url:"group_id,omitempty"`
	UserID         int64 `json:"user_id,omitempty" url:"user_id,omitempty"`
	OrganizationID int64 `json:"organization_id,omitempty" url:"organization_id,omitempty"`

	Access            string `json:"access"`
	Category          int    `json:"category"`
	Include           string `json:"include" url:"include,omitempty"`
	OnlyViewable      bool   `json:"only_viewable"`
	Query             string `url:"query"`
	EndUserVisible    bool   `url:"end_user_visible,omitempty"`
	FallbackToDefault bool   `url:"fallback_to_default,omitempty"`
	AssociatedToBrand bool   `url:"associated_to_brand,omitempty"`
	CategoryID        string `url:"category_id,omitempty"`

	IncludeInlineImages string `url:"include_inline_images,omitempty"`
}

type Condition added in v0.20.8

type Condition struct {
	Field    string      `json:"field"`
	Operator string      `json:"operator,omitempty"`
	Value    ParsedValue `json:"value,omitempty"`
}

Condition zendesk condition, see Zendesk Conditions Reference

func (Condition) Validate added in v0.23.0

func (c Condition) Validate(resourceType ResourceType[ConditionResourceType]) error

type ConditionField added in v0.20.4

type ConditionField string
const (
	// ConditionFieldGroupID is alias for group_id
	ConditionFieldGroupID ConditionField = "group_id"
	// ConditionFieldAssigneeID is alias for assignee_id
	ConditionFieldAssigneeID ConditionField = "assignee_id"
	// ConditionFieldRequesterID is alias for requester_id
	ConditionFieldRequesterID ConditionField = "requester_id"
	// ConditionFieldOrganizationID is alias for organization_id
	ConditionFieldOrganizationID ConditionField = "organization_id"
	// ConditionFieldCurrentTags is alias for current_tags
	ConditionFieldCurrentTags ConditionField = "current_tags"
	// ConditionFieldViaID is alias for via_id
	ConditionFieldViaID ConditionField = "via_id"
	// ConditionFieldRecipient is alias for recipient
	ConditionFieldRecipient ConditionField = "recipient"
	// ConditionFieldCustomField is alias for custom_fields_ prefix
	ConditionFieldCustomField ConditionField = "custom_fields_"
	// ConditionFieldCustomFieldAlt is alias for ticket_fields_ prefix
	ConditionFieldCustomFieldAlt ConditionField = "ticket_fields_"
	// ConditionFieldType is alias for type
	ConditionFieldType ConditionField = "type"
	// ConditionFieldStatus is alias for status
	ConditionFieldStatus ConditionField = "status"
	// ConditionFieldPriority is alias for priority
	ConditionFieldPriority ConditionField = "priority"
	// ConditionFieldDescriptionIncludesWord is alias for description_includes_word
	ConditionFieldDescriptionIncludesWord ConditionField = "description_includes_word"
	// ConditionFieldLocaleID is alias for locale_id
	ConditionFieldLocaleID ConditionField = "locale_id"
	// ConditionFieldSatisfactionScore is alias for satisfaction_score
	ConditionFieldSatisfactionScore ConditionField = "satisfaction_score"
	// ConditionFieldSubjectIncludesWord is alias for subject_includes_word
	ConditionFieldSubjectIncludesWord ConditionField = "subject_includes_word"
	// ConditionFieldCommentIncludesWord is alias for comment_includes_word
	ConditionFieldCommentIncludesWord ConditionField = "comment_includes_word"
	// ConditionFieldCurrentViaID is alias for current_via_id
	ConditionFieldCurrentViaID ConditionField = "current_via_id"
	// ConditionFieldUpdateType is alias for update_type
	ConditionFieldUpdateType ConditionField = "update_type"
	// ConditionFieldCommentIsPublic is alias for comment_is_public
	ConditionFieldCommentIsPublic ConditionField = "comment_is_public"
	// ConditionFieldTicketIsPublic is alias for ticket_is_public
	ConditionFieldTicketIsPublic ConditionField = "ticket_is_public"
	// ConditionFieldReopens is alias for reopens
	ConditionFieldReopens ConditionField = "reopens"
	// ConditionFieldReplies is alias for reopens
	ConditionFieldReplies ConditionField = "replies"
	// ConditionFieldAgentStations is alias for agent_stations
	ConditionFieldAgentStations ConditionField = "agent_stations"
	// ConditionFieldGroupStations is alias for group_stations
	ConditionFieldGroupStations ConditionField = "group_stations"
	// ConditionFieldInBusinessHours is alias for in_business_hours
	ConditionFieldInBusinessHours ConditionField = "in_business_hours"
	// ConditionFieldRequesterTwitterFollowersCount is alias for requester_twitter_followers_count
	ConditionFieldRequesterTwitterFollowersCount ConditionField = "requester_twitter_followers_count"
	// ConditionFieldRequesterTwitterStatusesCount is alias for requester_twitter_statuses_count
	ConditionFieldRequesterTwitterStatusesCount ConditionField = "requester_twitter_statuses_count"
	// ConditionFieldRequesterTwitterVerified is alias for requester_twitter_verified
	ConditionFieldRequesterTwitterVerified ConditionField = "requester_twitter_verified"
	// ConditionFieldExactCreatedAt is alias for exact_created_at
	ConditionFieldExactCreatedAt ConditionField = "exact_created_at"
	// ConditionFieldNew is alias for NEW
	ConditionFieldNew ConditionField = "NEW"
	// ConditionFieldOpen is alias for OPEN
	ConditionFieldOpen ConditionField = "OPEN"
	// ConditionFieldPending is alias for PENDING
	ConditionFieldPending ConditionField = "PENDING"
	// ConditionFieldHold is alias for HOLD
	ConditionFieldHold ConditionField = "HOLD"
	// ConditionFieldSolved is alias for SOLVED
	ConditionFieldSolved ConditionField = "SOLVED"
	// ConditionFieldClosed is alias for CLOSED
	ConditionFieldClosed ConditionField = "CLOSED"
	// ConditionFieldAssignedAt is alias for assigned_at
	ConditionFieldAssignedAt ConditionField = "assigned_at"
	// ConditionFieldUpdatedAt is alias for updated_at
	ConditionFieldUpdatedAt ConditionField = "updated_at"
	// ConditionFieldRequesterUpdatedAt is alias for requester_updated_at
	ConditionFieldRequesterUpdatedAt ConditionField = "requester_updated_at"
	// ConditionFieldAssigneeUpdatedAt is alias for assignee_updated_at
	ConditionFieldAssigneeUpdatedAt ConditionField = "assignee_updated_at"
	// ConditionFieldDueDate is alias for due_date
	ConditionFieldDueDate ConditionField = "due_date"
	// ConditionFieldUntilDueDate is alias for until_due_date
	ConditionFieldUntilDueDate ConditionField = "until_due_date"
	// ConditionFieldBrandId is alias for brand_id
	ConditionFieldBrandId ConditionField = "brand_id"
	// ConditionFieldTicketFormId is alias for ticket_form_id
	ConditionFieldTicketFormId ConditionField = "ticket_form_id"
	// ConditionFieldUserCustomKey is a prefix alias for user.custom_fields.{key} where key is replaced with a key value
	ConditionFieldUserCustomKey      ConditionField = "user.custom_fields."
	ConditionFieldRequesterCustomKey ConditionField = "requester.custom_fields."
	// ConditionFieldOrganizationCustomKey is a prefix alias for organization.custom_fields.{key} where key is replaced with a key value
	ConditionFieldOrganizationCustomKey ConditionField = "organization.custom_fields."
	// ConditionFieldIsBusinessHours is an alias for is_business_hours
	ConditionFieldIsBusinessHours ConditionField = "is_business_hours"
	// ConditionFieldRequesterRole is alias for requester_role
	ConditionFieldRequesterRole ConditionField = "requester_role"
	// ConditionFieldAttachment is alias for attachment
	ConditionFieldAttachment ConditionField = "attachment"
	// ConditionFieldCC is an alias for cc
	ConditionFieldCC ConditionField = "cc"
	// ConditionFieldCustomStatusId  is an alias for custom_status_id
	ConditionFieldCustomStatusId ConditionField = "custom_status_id"
	// ConditionFieldTicketTypeId is an alias for ticket_type_id
	ConditionFieldTicketTypeId ConditionField = "ticket_type_id"
	// ConditionFieldSlaNextBreachAt is an alias for sla_next_breach_at
	ConditionFieldSlaNextBreachAt ConditionField = "sla_next_breach_at"
	ConditionFieldRole            ConditionField = "role"
	ConditionFieldWithinSchedule  ConditionField = "within_schedule"
	ConditionFieldScheduleId      ConditionField = "schedule_id"
)

condition field types which are defined by system https://developer.zendesk.com/rest_api/docs/core/triggers#conditions-reference

func (ConditionField) String added in v0.23.0

func (c ConditionField) String() string

type ConditionFields added in v0.24.2

type ConditionFields []ConditionField

type ConditionResourceType added in v0.23.0

type ConditionResourceType string
const (
	TriggerConditionResource    ConditionResourceType = "trigger"
	AutomationConditionResource ConditionResourceType = "automation"
	ViewConditionResource       ConditionResourceType = "view"
	SlaConditionResource        ConditionResourceType = "sla"
)

func (ConditionResourceType) ToValue added in v0.23.0

func (ConditionResourceType) ValidateResourceType added in v0.23.0

func (c ConditionResourceType) ValidateResourceType() error

type ConditionValueValidator added in v0.23.0

type ConditionValueValidator ValueValidator[ConditionResourceType]

type ConditionalTicketField added in v0.24.10

type ConditionalTicketField struct {
	ParentFieldId int64        `json:"parent_field_id"`
	Value         string       `json:"value"`
	ChildFields   []ChildField `json:"child_fields"`
}

ConditionalTicketField condition which to display fields ParentFieldId is the ticket field the condition is for, where the condition is matching the value in Value. The Value will either be the tag value of a field or a case-sensitive match of a text field. Then, ChildFields is the set of fields to show when the condition is met. There is then a set of statuses to be required on, if it is required

type Conditions added in v0.20.8

type Conditions struct {
	All []Condition `json:"all,omitempty"`
	Any []Condition `json:"any,omitempty"`
}

type ConditionsValueValidator added in v0.23.0

type ConditionsValueValidator map[ConditionField]ConditionValueValidator

func (ConditionsValueValidator) ValidKeys added in v0.23.0

func (c ConditionsValueValidator) ValidKeys() []string

func (ConditionsValueValidator) ValidateValue added in v0.23.0

func (c ConditionsValueValidator) ValidateValue(key ConditionField, value ParsedValue, operator Operator, resourceType ResourceType[ConditionResourceType]) error

type Configuration

type Configuration struct {
	AssignTicketsToAnyBrand      bool   `json:"assign_tickets_to_any_brand"`
	AssignTicketsToAnyGroup      bool   `json:"assign_tickets_to_any_group"`
	ChatAccess                   bool   `json:"chat_access"`
	CustomObjects                Scopes `json:"custom_objects"`
	EndUserListAccess            string `json:"end_user_list_access"`
	EndUserProfileAccess         string `json:"end_user_profile_access"`
	ExploreAccess                string `json:"explore_access"`
	ForumAccess                  string `json:"forum_access"`
	ForumAccessRestrictedContent bool   `json:"forum_access_restricted_content"`
	LightAgent                   bool   `json:"light_agent"`
	MacroAccess                  string `json:"macro_access"`
	ManageAutomations            bool   `json:"manage_automations"`
	ManageBusinessRules          bool   `json:"manage_business_rules"`
	ManageContextualWorkspaces   bool   `json:"manage_contextual_workspaces"`
	ManageDynamicContent         bool   `json:"manage_dynamic_content"`
	ManageExtensionsAndChannels  bool   `json:"manage_extensions_and_channels"`
	ManageFacebook               bool   `json:"manage_facebook"`
	ManageGroupMemberships       bool   `json:"manage_group_memberships"`
	ManageGroups                 bool   `json:"manage_groups"`
	ManageOrganizationFields     bool   `json:"manage_organization_fields"`
	ManageOrganizations          bool   `json:"manage_organizations"`
	ManageRoles                  string `json:"manage_roles"`
	ManageSkills                 bool   `json:"manage_skills"`
	ManageSlas                   bool   `json:"manage_slas"`
	ManageSuspendedTickets       bool   `json:"manage_suspended_tickets"`
	ManageTeamMembers            string `json:"manage_team_members"`
	ManageTicketFields           bool   `json:"manage_ticket_fields"`
	ManageTicketForms            bool   `json:"manage_ticket_forms"`
	ManageTriggers               bool   `json:"manage_triggers"`
	ManageUserFields             bool   `json:"manage_user_fields"`
	OrganizationEditing          bool   `json:"organization_editing"`
	OrganizationNotesEditing     bool   `json:"organization_notes_editing"`
	ReportAccess                 string `json:"report_access"`
	SideConversationCreate       bool   `json:"side_conversation_create"`
	TicketAccess                 string `json:"ticket_access"`
	TicketCommentAccess          string `json:"ticket_comment_access"`
	TicketDeletion               bool   `json:"ticket_deletion"`
	TicketRedaction              bool   `json:"ticket_redaction"`
	ViewDeletedTickets           bool   `json:"view_deleted_tickets"`
	TicketEditing                bool   `json:"ticket_editing"`
	TicketMerge                  bool   `json:"ticket_merge"`
	TicketTagEditing             bool   `json:"ticket_tag_editing"`
	TwitterSearchAccess          bool   `json:"twitter_search_access"`
	ViewAccess                   string `json:"view_access"`
	VoiceAccess                  bool   `json:"voice_access"`
	VoiceDashboardAccess         bool   `json:"voice_dashboard_access"`
}

Configuration is a dictionary of custom configuration fields

type CountOptions

type CountOptions struct {
	Query string `url:"query"`
}

CountOptions are the options that can be provided to the search results count API

ref: https://developer.zendesk.com/rest_api/docs/support/search#show-results-count

type Cursor

type Cursor struct {
	AfterURL     string `json:"after_url"`
	AfterCursor  string `json:"after_cursor"`
	BeforeURL    string `json:"before_url"`
	BeforeCursor string `json:"before_cursor"`
}

Cursor is struct for cursor-based pagination

type CursorOption

type CursorOption struct {
	StartTime int64  `url:"start_time,omitempty"`
	Cursor    string `url:"cursor,omitempty"`
}

CursorOption is options for list methods for cursor-based pagination resources It's used to create query string.

https://developer.zendesk.com/rest_api/docs/support/incremental_export#cursor-based-incremental-exports

type CustomField

type CustomField struct {
	ID int64 `json:"id"`
	// Valid types are string or []string.
	Value interface{} `json:"value"`
}

func (*CustomField) UnmarshalJSON

func (cf *CustomField) UnmarshalJSON(data []byte) error

UnmarshalJSON Custom Unmarshal function required because a custom field's value can be a string or array of strings.

type CustomFieldOption

type CustomFieldOption struct {
	ID       *int64 `json:"id"`
	Name     string `json:"name"`
	Position int64  `json:"position,omitempty"`
	RawName  string `json:"raw_name,omitempty"`
	URL      string `json:"url,omitempty"`
	Value    string `json:"value"`
}

CustomFieldOption is struct for value of `custom_field_options`

type CustomFieldViewExec added in v0.20.4

type CustomFieldViewExec struct {
	ID         int64  `json:"id"`
	Title      string `json:"title"`
	Type       string `json:"type"`
	URL        string `json:"url"`
	Filterable bool   `json:"filterable"`
	Sortable   bool   `json:"sortable"`
}

type CustomObjectAPI

type CustomObjectAPI interface {
	CreateCustomObjectRecord(
		ctx context.Context, record CustomObjectRecord, customObjectKey string) (CustomObjectRecord, error)
	AutocompleteSearchCustomObjectRecords(
		ctx context.Context,
		customObjectKey string,
		opts *CustomObjectAutocompleteOptions,
	) ([]CustomObjectRecord, Page, error)
	SearchCustomObjectRecords(
		ctx context.Context, customObjectKey string, opts *SearchCustomObjectRecordsOptions,
	) ([]CustomObjectRecord, Page, error)
	ListCustomObjectRecords(
		ctx context.Context, customObjectKey string, opts *CustomObjectListOptions) ([]CustomObjectRecord, Page, error)
	ShowCustomObjectRecord(
		ctx context.Context, customObjectKey string, customObjectRecordID string,
	) (*CustomObjectRecord, error)
	UpdateCustomObjectRecord(
		ctx context.Context, customObjectKey string, customObjectRecordID string, record CustomObjectRecord,
	) (*CustomObjectRecord, error)
}

CustomObjectAPI an interface containing all custom object related methods

type CustomObjectAutocompleteOptions

type CustomObjectAutocompleteOptions struct {
	PageOptions
	Name string `url:"name"`
}

CustomObjectAutocompleteOptions custom object search options

type CustomObjectListOptions

type CustomObjectListOptions struct {
	PageOptions
	Ids         string `url:"filter[ids],omitempty"`
	ExternalIds string `url:"filter[external_ids],omitempty"`
}

CustomObjectListOptions custom object list options

type CustomObjectRecord

type CustomObjectRecord struct {
	Url                string                 `json:"url,omitempty"`
	Name               string                 `json:"name,omitempty"`
	ID                 string                 `json:"id,omitempty"`
	CustomObjectKey    string                 `json:"custom_object_key"`
	CustomObjectFields map[string]interface{} `json:"custom_object_fields" binding:"required"`
	CreatedByUserID    string                 `json:"created_by_user_id,omitempty"`
	UpdatedByUserID    string                 `json:"updated_by_user_id,omitempty"`
	CreatedAt          time.Time              `json:"created_at,omitempty"`
	UpdatedAt          time.Time              `json:"updated_at,omitempty"`
	ExternalID         string                 `json:"external_id,omitempty"`
}

type CustomRole

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

CustomRole is zendesk CustomRole JSON payload format https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/

type CustomRoleAPI

type CustomRoleAPI interface {
	GetCustomRoles(ctx context.Context) ([]CustomRole, error)
	GetCustomRole(ctx context.Context, id int64) (CustomRole, error)
	CreateCustomRole(ctx context.Context, customRole CustomRole) (CustomRole, error)
	UpdateCustomRole(ctx context.Context, updatedId int64, customRole CustomRole) (CustomRole, error)
	DeleteCustomRole(ctx context.Context, id int64) error
}

CustomRoleAPI an interface containing all CustomRole related methods

type DynamicContentAPI

type DynamicContentAPI interface {
	GetDynamicContentItems(ctx context.Context) ([]DynamicContentItem, Page, error)
	CreateDynamicContentItem(ctx context.Context, item DynamicContentItem) (DynamicContentItem, error)
	GetDynamicContentItem(ctx context.Context, id int64) (DynamicContentItem, error)
	UpdateDynamicContentItem(ctx context.Context, id int64, item DynamicContentItem) (DynamicContentItem, error)
	UpdateDynamicContentVariants(ctx context.Context, id int64, variants []DynamicContentVariant) ([]DynamicContentVariant, error)
	DeleteDynamicContentItem(ctx context.Context, id int64) error
	GetDynamicContentItemsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[DynamicContentItem]
	GetDynamicContentItemsOBP(ctx context.Context, opts *OBPOptions) ([]DynamicContentItem, Page, error)
	GetDynamicContentItemsCBP(ctx context.Context, opts *CBPOptions) ([]DynamicContentItem, client.CursorPaginationMeta, error)
}

DynamicContentAPI an interface containing all methods associated with zendesk dynamic content

type DynamicContentItem

type DynamicContentItem struct {
	ID              int64                   `json:"id,omitempty"`
	URL             string                  `json:"url,omitempty"`
	Name            string                  `json:"name"`
	Placeholder     string                  `json:"placeholder,omitempty"`
	DefaultLocaleID int64                   `json:"default_locale_id"`
	Outdated        bool                    `json:"outdated,omitempty"`
	Variants        []DynamicContentVariant `json:"variants"`
	CreatedAt       time.Time               `json:"created_at,omitempty"`
	UpdatedAt       time.Time               `json:"updated_at,omitempty"`
}

DynamicContentItem is zendesk dynamic content item JSON payload format

https://developer.zendesk.com/rest_api/docs/support/users

type DynamicContentVariant

type DynamicContentVariant struct {
	ID        int64     `json:"id,omitempty"`
	URL       string    `json:"url,omitempty"`
	Content   string    `json:"content"`
	LocaleID  int64     `json:"locale_id"`
	Outdated  bool      `json:"outdated,omitempty"`
	Active    bool      `json:"active"`
	Default   bool      `json:"default,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

DynamicContentVariant is zendesk dynamic content variant JSON payload format

https://developer.zendesk.com/rest_api/docs/support/dynamic_content#json-format-for-variants

type FirstReplyTime added in v0.25.0

type FirstReplyTime struct {
	ActivateOnTicketCreatedForEndUser                      bool `json:"activate_on_ticket_created_for_end_user,omitempty"`
	ActivateOnAgentTicketCreatedForEndUserWithInternalNote bool `json:"activate_on_agent_ticket_created_for_end_user_with_internal_note,omitempty"`
	ActivateOnLightAgentOnEmailForwardTicketFromEndUser    bool `json:"activate_on_light_agent_on_email_forward_ticket_from_end_user,omitempty"`
	ActivateOnAgentCreatedTicketForSelf                    bool `json:"activate_on_agent_created_ticket_for_self,omitempty"`
	FulfillOnAgentInternalNote                             bool `json:"fulfill_on_agent_internal_note,omitempty"`
}

type GetManyUsersOptions

type GetManyUsersOptions struct {
	ExternalIDs string `json:"external_ids,omitempty" url:"external_ids,omitempty"`
	IDs         string `json:"ids,omitempty" url:"ids,omitempty"`
}

GetManyUsersOptions is options for GetManyUsers

ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#show-many-users

type Group

type Group struct {
	ID          int64     `json:"id,omitempty"`
	URL         string    `json:"url,omitempty"`
	Name        string    `json:"name"`
	Default     bool      `json:"default,omitempty"`
	Deleted     bool      `json:"deleted,omitempty"`
	IsPublic    bool      `json:"is_public"`
	Description string    `json:"description,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
	UpdatedAt   time.Time `json:"updated_at,omitempty"`
}

Group is struct for group payload https://developer.zendesk.com/rest_api/docs/support/groups

type GroupAPI

type GroupAPI interface {
	GetGroups(ctx context.Context, opts *GroupListOptions) ([]Group, Page, error)
	GetGroupsOBP(ctx context.Context, opts *OBPOptions) ([]Group, Page, error)
	GetGroupsCBP(ctx context.Context, opts *CBPOptions) ([]Group, client.CursorPaginationMeta, error)
	GetGroupsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Group]
	GetGroup(ctx context.Context, groupID int64) (Group, error)
	CreateGroup(ctx context.Context, group Group) (Group, error)
	UpdateGroup(ctx context.Context, groupID int64, group Group) (Group, error)
	DeleteGroup(ctx context.Context, groupID int64) error
}

GroupAPI an interface containing all methods associated with zendesk groups

type GroupListOptions

type GroupListOptions struct {
	PageOptions
}

GroupListOptions is options for GetGroups

ref: https://developer.zendesk.com/rest_api/docs/support/groups#list-groups

type GroupMembership

type GroupMembership struct {
	ID        int64     `json:"id,omitempty"`
	URL       string    `json:"url,omitempty"`
	UserID    int64     `json:"user_id"`
	GroupID   int64     `json:"group_id"`
	Default   bool      `json:"default"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

GroupMembership is struct for group membership payload https://developer.zendesk.com/api-reference/ticketing/groups/group_memberships/

type GroupMembershipAPI

type GroupMembershipAPI interface {
	GetGroupMemberships(context.Context, *GroupMembershipListOptions) ([]GroupMembership, Page, error)
	GetGroupMembershipsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[GroupMembership]
	GetGroupMembershipsOBP(ctx context.Context, opts *OBPOptions) ([]GroupMembership, Page, error)
	GetGroupMembershipsCBP(ctx context.Context, opts *CBPOptions) ([]GroupMembership, client.CursorPaginationMeta, error)
}

GroupMembershipAPI is an interface containing group membership related methods

type GroupMembershipListOptions

type GroupMembershipListOptions struct {
	PageOptions
	GroupID int64 `json:"group_id,omitempty" url:"group_id,omitempty"`
	UserID  int64 `json:"user_id,omitempty" url:"user_id,omitempty"`
}

GroupMembershipListOptions is a struct for options for group membership list ref: https://developer.zendesk.com/api-reference/ticketing/groups/group_memberships/

type Iterator

type Iterator[T any] struct {
	CommonOptions
	// contains filtered or unexported fields
}

terator struct provides a convenient and genric way to iterate over pages of objects in either OBP or CBP. It holds state for iteration, including the current page size, a flag indicating more pages, pagination type (OBP or CBP), and sorting options.

func (*Iterator[T]) GetNext

func (i *Iterator[T]) GetNext() ([]T, error)

GetNext() retrieves the next batch of objects according to the current pagination and sorting options. It updates the state of the iterator for subsequent calls. In case of an error, it sets hasMore to false and returns an error.

func (*Iterator[T]) HasMore

func (i *Iterator[T]) HasMore() bool

HasMore() returns a boolean indicating whether more pages are available for iteration.

type ListTicketCommentsOptions

type ListTicketCommentsOptions struct {
	client.CursorPagination

	Include             string                 `url:"include,omitempty"`
	IncludeInlineImages string                 `url:"include_inline_images,omitempty"`
	Sort                listTicketCommentsSort `url:"sort,omitempty"`
}

ListTicketCommentOptions contains all the options supported by ListTicketComments endpoint.

type ListTicketCommentsResult

type ListTicketCommentsResult struct {
	TicketComments []TicketComment             `json:"comments"`
	Meta           client.CursorPaginationMeta `json:"meta"`
	Users          []User                      `json:"users"`
}

ListTicketCommentsResult contains the resulting ticket comments and cursor pagination metadata.

type Locale

type Locale struct {
	ID        int64     `json:"id"`
	URL       string    `json:"url"`
	Locale    string    `json:"locale"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Locale is zendesk locale JSON payload format https://developer.zendesk.com/rest_api/docs/support/locales

type LocaleAPI

type LocaleAPI interface {
	GetLocales(ctx context.Context) ([]Locale, error)
}

LocaleAPI an interface containing all of the local related zendesk methods

type Macro

type Macro struct {
	Actions     []Action    `json:"actions"`
	Active      bool        `json:"active"`
	CreatedAt   time.Time   `json:"created_at,omitempty"`
	Description string      `json:"description,omitempty"`
	ID          int64       `json:"id,omitempty"`
	Position    int         `json:"position,omitempty"`
	Restriction interface{} `json:"restriction,omitempty"`
	Title       string      `json:"title"`
	UpdatedAt   time.Time   `json:"updated_at,omitempty"`
	URL         string      `json:"url,omitempty"`
}

Macro is information about zendesk macro

type MacroAPI

type MacroAPI interface {
	GetMacros(ctx context.Context, opts *MacroListOptions) ([]Macro, Page, error)
	GetMacro(ctx context.Context, macroID int64) (Macro, error)
	CreateMacro(ctx context.Context, macro Macro) (Macro, error)
	UpdateMacro(ctx context.Context, macroID int64, macro Macro) (Macro, error)
	DeleteMacro(ctx context.Context, macroID int64) error
	GetMacrosIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Macro]
	GetMacrosOBP(ctx context.Context, opts *OBPOptions) ([]Macro, Page, error)
	GetMacrosCBP(ctx context.Context, opts *CBPOptions) ([]Macro, client.CursorPaginationMeta, error)
}

MacroAPI an interface containing all macro related methods

type MacroListOptions

type MacroListOptions struct {
	Access       string `json:"access"`
	Active       string `json:"active"`
	Category     int    `json:"category"`
	GroupID      int    `json:"group_id"`
	Include      string `json:"include"`
	OnlyViewable bool   `json:"only_viewable"`

	PageOptions

	// SortBy can take "created_at", "updated_at", "usage_1h", "usage_24h",
	// "usage_7d", "usage_30d", "alphabetical"
	SortBy string `url:"sort_by,omitempty"`

	// SortOrder can take "asc" or "desc"
	SortOrder string `url:"sort_order,omitempty"`
}

MacroListOptions is parameters used of GetMacros

type MetricSettings added in v0.25.0

type MetricSettings struct {
	FirstReplyTime     FirstReplyTime     `json:"first_reply_time,omitempty"`
	NextReplyTime      NextReplyTime      `json:"next_reply_time,omitempty"`
	PeriodicUpdateTime PeriodicUpdateTime `json:"periodic_update_time,omitempty"`
}

type NextReplyTime added in v0.25.0

type NextReplyTime struct {
	FulfillOnNonRequestingAgentInternalNoteAfterActivation        bool `json:"fulfill_on_non_requesting_agent_internal_note_after_activation,omitempty"`
	ActivateOnEndUserAddedInternalNote                            bool `json:"activate_on_end_user_added_internal_note,omitempty"`
	ActivateOnAgentRequestedTicketWithPublicCommentOrInternalNote bool `json:"activate_on_agent_requested_ticket_with_public_comment_or_internal_note,omitempty"`
	ActivateOnLightAgentInternalNote                              bool `json:"activate_on_light_agent_internal_note,omitempty"`
}

type OBPOptions

type OBPOptions struct {
	PageOptions
	CommonOptions
}

OBPOptions struct is used to specify options for listing objects in OBP (Offset Based Pagination). It embeds the PageOptions struct for pagination and provides options for sorting the result; SortBy specifies the field to sort by, and SortOrder specifies the order (either 'asc' or 'desc').

type ObpFunc

type ObpFunc[T any] func(ctx context.Context, opts *OBPOptions) ([]T, Page, error)

ObpFunc defines the signature of the function used to list objects in OBP.

type Operator added in v0.23.0

type Operator string
const (
	Is                       Operator = "is"
	IsNot                    Operator = "is_not"
	Includes                 Operator = "includes"
	NotIncludes              Operator = "not_includes"
	IncludesString           Operator = "includes_string"
	NotIncludesString        Operator = "not_includes_string"
	GreaterThan              Operator = "greater_than"
	LessThan                 Operator = "less_than"
	GreaterThanEqual         Operator = "greater_than_equal"
	LessThanEqual            Operator = "less_than_equal"
	IsBusinessHours          Operator = "is_business_hours"
	GreaterThanBusinessHours Operator = "greater_than_business_hours"
	LessThanBusinessHours    Operator = "less_than_business_hours"
	WithinPreviousNDays      Operator = "within_previous_n_days"
	Present                  Operator = "present"
	NotPresent               Operator = "not_present"
	Changed                  Operator = "changed"
	ChangedTo                Operator = "changed_to"
	ChangedFrom              Operator = "changed_from"
	NotChanged               Operator = "not_changed"
	NotChangedTo             Operator = "not_changed_to"
	NotChangedFrom           Operator = "not_changed_from"
	Value                    Operator = "value"
	ValuePrevious            Operator = "value_previous"
	NotValue                 Operator = "not_value"
	NotValuePrevious         Operator = "not_value_previous"
	EmptyOperator            Operator = ""
)

type Organization

type Organization struct {
	ID                 int64                  `json:"id,omitempty"`
	ExternalID         string                 `json:"external_id,omitempty"`
	URL                string                 `json:"url,omitempty"`
	Name               string                 `json:"name"`
	Details            string                 `json:"details,omitempty"`
	DomainNames        []string               `json:"domain_names"`
	GroupID            int64                  `json:"group_id"`
	SharedTickets      bool                   `json:"shared_tickets"`
	SharedComments     bool                   `json:"shared_comments"`
	Tags               []string               `json:"tags"`
	Notes              string                 `json:"notes,omitempty"`
	CreatedAt          time.Time              `json:"created_at,omitempty"`
	UpdatedAt          time.Time              `json:"updated_at,omitempty"`
	OrganizationFields map[string]interface{} `json:"organization_fields,omitempty"`
}

Organization is struct for organization payload https://developer.zendesk.com/rest_api/docs/support/organizations

type OrganizationAPI

type OrganizationAPI interface {
	GetOrganizations(ctx context.Context, opts *OrganizationListOptions) ([]Organization, Page, error)
	CreateOrganization(ctx context.Context, org Organization) (Organization, error)
	GetOrganization(ctx context.Context, orgID int64) (Organization, error)
	GetOrganizationByExternalID(ctx context.Context, externalID string) ([]Organization, Page, error)
	UpdateOrganization(ctx context.Context, orgID int64, org Organization) (Organization, error)
	DeleteOrganization(ctx context.Context, orgID int64) error
	GetOrganizationsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Organization]
	GetOrganizationsOBP(ctx context.Context, opts *OBPOptions) ([]Organization, Page, error)
	GetOrganizationsCBP(ctx context.Context, opts *CBPOptions) ([]Organization, client2.CursorPaginationMeta, error)
}

OrganizationAPI an interface containing all methods associated with zendesk organizations

type OrganizationField

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

OrganizationField represents the Organization Custom field structure

type OrganizationFieldAPI

type OrganizationFieldAPI interface {
	GetOrganizationFields(ctx context.Context) ([]OrganizationField, Page, error)
	CreateOrganizationField(ctx context.Context, organizationField OrganizationField) (OrganizationField, error)
	GetOrganizationField(ctx context.Context, id int64) (OrganizationField, error)
	UpdateOrganizationField(ctx context.Context, id int64, orgField OrganizationField) (OrganizationField, error)
	DeleteOrganizationField(ctx context.Context, id int64) error
	GetOrganizationFieldsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[OrganizationField]
	GetOrganizationFieldsOBP(ctx context.Context, opts *OBPOptions) ([]OrganizationField, Page, error)
	GetOrganizationFieldsCBP(ctx context.Context, opts *CBPOptions) ([]OrganizationField, client.CursorPaginationMeta, error)
}

OrganizationFieldAPI an interface containing all the organization field related zendesk methods

type OrganizationListOptions

type OrganizationListOptions struct {
	PageOptions
}

OrganizationListOptions is options for GetOrganizations

ref: https://developer.zendesk.com/rest_api/docs/support/organizations#list-organizations

type OrganizationMembership

type OrganizationMembership struct {
	ID             int64     `json:"id,omitempty"`
	URL            string    `json:"url,omitempty"`
	UserID         int64     `json:"user_id"`
	OrganizationID int64     `json:"organization_id"`
	Default        bool      `json:"default"`
	Name           string    `json:"organization_name"`
	CreatedAt      time.Time `json:"created_at,omitempty"`
	UpdatedAt      time.Time `json:"updated_at,omitempty"`
}

OrganizationMembership is struct for organization membership payload https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/

type OrganizationMembershipAPI

type OrganizationMembershipAPI interface {
	GetOrganizationMemberships(context.Context, *OrganizationMembershipListOptions) ([]OrganizationMembership, Page, error)
	CreateOrganizationMembership(context.Context, OrganizationMembershipOptions) (OrganizationMembership, error)
	SetDefaultOrganization(context.Context, OrganizationMembershipOptions) (OrganizationMembership, error)
	GetOrganizationMembershipsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[OrganizationMembership]
	GetOrganizationMembershipsOBP(ctx context.Context, opts *OBPOptions) ([]OrganizationMembership, Page, error)
	GetOrganizationMembershipsCBP(ctx context.Context, opts *CBPOptions) ([]OrganizationMembership, client.CursorPaginationMeta, error)
}

OrganizationMembershipAPI is an interface containing organization membership related methods

type OrganizationMembershipListOptions

type OrganizationMembershipListOptions struct {
	PageOptions
	OrganizationID int64 `json:"organization_id,omitempty" url:"organization_id,omitempty"`
	UserID         int64 `json:"user_id,omitempty" url:"user_id,omitempty"`
}

OrganizationMembershipListOptions is a struct for options for organization membership list ref: https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/

type OrganizationMembershipOptions

type OrganizationMembershipOptions struct {
	OrganizationID int64 `json:"organization_id,omitempty"`
	UserID         int64 `json:"user_id,omitempty"`
}

OrganizationMembershipOptions is a struct for options for organization membership https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/

type Page

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

Page is base struct for resource pagination

func (Page) HasNext

func (p Page) HasNext() bool

HasNext checks if the Page has next page

func (Page) HasPrev

func (p Page) HasPrev() bool

HasPrev checks if the Page has previous page

type PageOptions

type PageOptions struct {
	PerPage int `url:"per_page,omitempty"`
	Page    int `url:"page,omitempty"`
}

PageOptions is options for list method of paginatable resources. It's used to create query string.

ref: https://developer.zendesk.com/rest_api/docs/support/introduction#pagination

type PaginationOptions

type PaginationOptions struct {
	CommonOptions
	PageSize int  //default is 100
	IsCBP    bool //default is true
}

PaginationOptions struct represents general pagination options. PageSize specifies the number of items per page, IsCBP indicates if it's cursor-based pagination, SortBy and SortOrder describe how to sort the items in Offset Based Pagination, and Sort describes how to sort items in Cursor Based Pagination.

func NewPaginationOptions

func NewPaginationOptions() *PaginationOptions

NewPaginationOptions() returns a pointer to a new PaginationOptions struct with default values (PageSize is 100, IsCBP is true).

type ParsedValue added in v0.27.7

type ParsedValue struct {
	Data     string
	ListData []string
}

func (*ParsedValue) MarshalJSON added in v0.27.7

func (v *ParsedValue) MarshalJSON() ([]byte, error)

func (*ParsedValue) UnmarshalJSON added in v0.27.7

func (v *ParsedValue) UnmarshalJSON(bytes []byte) error

type PeriodicUpdateTime added in v0.25.0

type PeriodicUpdateTime struct {
	ActivateOnAgentInternalNote bool `json:"activate_on_agent_internal_note,omitempty"`
}

type Photo

type Photo struct {
	ID          int64  `json:"id"`
	FileName    string `json:"file_name"`
	ContentURL  string `json:"content_url"`
	ContentType string `json:"content_type"`
	Size        int64  `json:"size"`
}

Photo is thumbnail which is included in attachment

type RedactTicketCommentRequest

type RedactTicketCommentRequest struct {
	TicketID               int64    `json:"ticket_id"` // Required
	HTMLBody               string   `json:"html_body,omitempty"`
	ExternalAttachmentUrls []string `json:"external_attachment_urls,omitempty"`
}

RedactTicketCommentRequest contains the body of the RedactTicketComment PUT request

type RelationshipFilter

type RelationshipFilter struct {
	All []RelationshipFilterObject `json:"all"`
	Any []RelationshipFilterObject `json:"any"`
}

RelationshipFilter is struct for value of `relationship_filter`

type RelationshipFilterObject added in v0.25.6

type RelationshipFilterObject struct {
	Field    string `json:"field"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
}

type Requester

type Requester struct {
	Name     string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Locale   string `json:"locale,omitempty"`
	LocaleID int64  `json:"locale_id,omitempty"`
}

Requester is the struct that can be passed to create a new requester on ticket creation https://develop.zendesk.com/hc/en-us/articles/360059146153#creating-a-ticket-with-a-new-requester

type RequiredOnStatuses added in v0.24.10

type RequiredOnStatuses struct {
	Statuses []string        `json:"statuses,omitempty"`
	Type     RequirementType `json:"type"`
}

RequiredOnStatuses is an object that defines how status requires a child field on a form. Valid types in Type attribute are ALL_STATUSES, NO_STATUSES, and SOME_STATUSES. Statuses will enclose the statuses the field is required when Type is SOME_STATUSES. Otherwise, it is empty

func (RequiredOnStatuses) Validate added in v0.24.10

func (r RequiredOnStatuses) Validate() error

Validate validates attributes in RequiredOnStatuses struct. Returns an error if validation fails

type RequirementType added in v0.24.10

type RequirementType string
const (
	SomeStatuses RequirementType = "SOME_STATUSES"
	NoStatuses   RequirementType = "NO_STATUSES"
	AllStatuses  RequirementType = "ALL_STATUSES"
)

func (RequirementType) Validate added in v0.24.10

func (r RequirementType) Validate() error

Validate validates status requirement types

type ResourceType added in v0.23.0

type ResourceType[T any] interface {
	ValidateResourceType() error
	ToValue() T
}

type ResourceTypes added in v0.23.0

type ResourceTypes[T any] []ResourceType[T]

func (ResourceTypes[T]) Elements added in v0.23.0

func (r ResourceTypes[T]) Elements() []T

type Restriction added in v0.20.8

type Restriction struct {
	Type string  `json:"type,omitempty"`
	ID   int64   `json:"id,omitempty"`
	IDS  []int64 `json:"ids,omitempty"`
}

type SLAPolicy

type SLAPolicy struct {
	ID             int64             `json:"id,omitempty"`
	Title          string            `json:"title"`
	Description    string            `json:"description,omitempty"`
	Position       int64             `json:"position,omitempty"`
	Active         bool              `json:"active"`
	Filter         Conditions        `json:"filter"`
	PolicyMetrics  []SLAPolicyMetric `json:"policy_metrics,omitempty"`
	MetricSettings MetricSettings    `json:"metric_settings,omitempty"`
	CreatedAt      *time.Time        `json:"created_at,omitempty"`
	UpdatedAt      *time.Time        `json:"updated_at,omitempty"`
}

SLAPolicy is zendesk slaPolicy JSON payload format

ref: https://developer.zendesk.com/rest_api/docs/core/slas/policies#json-format

type SLAPolicyAPI

type SLAPolicyAPI interface {
	GetSLAPolicies(ctx context.Context, opts *SLAPolicyListOptions) ([]SLAPolicy, Page, error)
	CreateSLAPolicy(ctx context.Context, slaPolicy SLAPolicy) (SLAPolicy, error)
	GetSLAPolicy(ctx context.Context, id int64) (SLAPolicy, error)
	UpdateSLAPolicy(ctx context.Context, id int64, slaPolicy SLAPolicy) (SLAPolicy, error)
	DeleteSLAPolicy(ctx context.Context, id int64) error
	GetSLAPoliciesIterator(ctx context.Context, opts *PaginationOptions) *Iterator[SLAPolicy]
	GetSLAPoliciesOBP(ctx context.Context, opts *OBPOptions) ([]SLAPolicy, Page, error)
	GetSLAPoliciesCBP(ctx context.Context, opts *CBPOptions) ([]SLAPolicy, client2.CursorPaginationMeta, error)
}

SLAPolicyAPI an interface containing all slaPolicy related methods

type SLAPolicyListOptions

type SLAPolicyListOptions struct {
	PageOptions
	Active    bool   `url:"active"`
	SortBy    string `url:"sort_by,omitempty"`
	SortOrder string `url:"sort_order,omitempty"`
}

SLAPolicyListOptions is options for GetSLAPolicies

ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#list-slas/policies

type SLAPolicyMetric

type SLAPolicyMetric struct {
	Priority      string `json:"priority"`
	Metric        string `json:"metric"`
	Target        int    `json:"target"`
	BusinessHours bool   `json:"business_hours"`
}

type Schedule added in v0.26.0

type Schedule struct {
	Id        int64              `json:"id,omitempty"`
	Intervals []ScheduleInterval `json:"intervals,omitempty"`
	Name      string             `json:"name"`
	TimeZone  string             `json:"time_zone"`
	CreatedAt *time.Time         `json:"created_at,omitempty"`
	UpdatedAt *time.Time         `json:"updated_at,omitempty"`
}

type ScheduleAPI added in v0.26.0

type ScheduleAPI interface {
	CreateSchedule(ctx context.Context, schedule Schedule) (Schedule, error)
	GetSchedule(ctx context.Context, scheduleId int64) (Schedule, error)
	UpdateSchedule(ctx context.Context, scheduleId int64, schedule Schedule) (Schedule, error)
	DeleteSchedule(ctx context.Context, scheduleId int64) error
	UpdateScheduleIntervals(ctx context.Context, scheduleId int64, intervals []ScheduleInterval) ([]ScheduleInterval, error)
}

type ScheduleInterval added in v0.26.0

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

type Scopes added in v0.28.1

type Scopes map[string]struct {
	Scopes []string `json:"scopes"`
}

type SearchAPI

type SearchAPI interface {
	Search(ctx context.Context, opts *SearchOptions) (SearchResults, Page, error)
	SearchCount(ctx context.Context, opts *CountOptions) (int, error)
	GetSearchIterator(ctx context.Context, opts *PaginationOptions) *Iterator[SearchResults]
	GetSearchOBP(ctx context.Context, opts *OBPOptions) ([]SearchResults, Page, error)
	GetSearchCBP(ctx context.Context, opts *CBPOptions) ([]SearchResults, client2.CursorPaginationMeta, error)
}

type SearchCustomObjectRecordsOptions

type SearchCustomObjectRecordsOptions struct {
	PageOptions

	// One of name, created_at, updated_at, -name, -created_at, or -updated_at.
	// The - denotes the sort will be descending. Defaults to sorting by relevance.
	Sort string `url:"sort,omitempty"`

	// Query string
	Query string `url:"query,omitempty"`
}

type SearchOptions

type SearchOptions struct {
	PageOptions
	Query     string `url:"query"`
	SortBy    string `url:"sort_by,omitempty"`
	SortOrder string `url:"sort_order,omitempty"`
}

SearchOptions are the options that can be provided to the search API

ref: https://developer.zendesk.com/rest_api/docs/support/search#available-parameters

type SearchResults

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

func (*SearchResults) List

func (r *SearchResults) List() []interface{}

List return internal array in Search Results

func (*SearchResults) MarshalJSON

func (r *SearchResults) MarshalJSON() ([]byte, error)

func (*SearchResults) String

func (r *SearchResults) String() string

String return string formatted for Search results

func (*SearchResults) UnmarshalJSON

func (r *SearchResults) UnmarshalJSON(b []byte) error

type SearchUsersOptions

type SearchUsersOptions struct {
	PageOptions
	ExternalIDs string `json:"external_id,omitempty" url:"external_id,omitempty"`
	Query       string `json:"query,omitempty" url:"query,omitempty"`
}

SearchUsersOptions is options for SearchUsers

ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#search-users

type Tag

type Tag string

Tag is an alias for string

type TagAPI

type TagAPI interface {
	GetTicketTags(ctx context.Context, ticketID int64) ([]Tag, error)
	GetOrganizationTags(ctx context.Context, organizationID int64) ([]Tag, error)
	GetUserTags(ctx context.Context, userID int64) ([]Tag, error)
	AddTicketTags(ctx context.Context, ticketID int64, tags []Tag) ([]Tag, error)
	AddOrganizationTags(ctx context.Context, organizationID int64, tags []Tag) ([]Tag, error)
	AddUserTags(ctx context.Context, userID int64, tags []Tag) ([]Tag, error)
}

TagAPI an interface containing all tag related methods

type Target

type Target struct {
	URL       string     `json:"url,omitempty"`
	ID        int64      `json:"id,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	Type      string     `json:"type"`
	Title     string     `json:"title"`
	Active    bool       `json:"active"`
	// email_target
	Email   string `json:"email,omitempty"`
	Subject string `json:"subject,omitempty"`
	// http_target
	TargetURL   string `json:"target_url,omitempty"`
	Method      string `json:"method,omitempty"`
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	ContentType string `json:"content_type,omitempty"`
}

Target is struct for target payload

type TargetAPI

type TargetAPI interface {
	GetTargets(ctx context.Context) ([]Target, Page, error)
	CreateTarget(ctx context.Context, ticketField Target) (Target, error)
	GetTarget(ctx context.Context, ticketID int64) (Target, error)
	UpdateTarget(ctx context.Context, ticketID int64, field Target) (Target, error)
	DeleteTarget(ctx context.Context, ticketID int64) error
}

TargetAPI an interface containing all of the target related zendesk methods

type Ticket

type Ticket struct {
	ID              int64         `json:"id,omitempty"`
	URL             string        `json:"url,omitempty"`
	ExternalID      string        `json:"external_id,omitempty"`
	Type            string        `json:"type,omitempty"`
	Subject         string        `json:"subject,omitempty"`
	RawSubject      string        `json:"raw_subject,omitempty"`
	Description     string        `json:"description,omitempty"`
	Priority        string        `json:"priority,omitempty"`
	Status          string        `json:"status,omitempty"`
	CustomStatusID  int64         `json:"custom_status_id,omitempty"`
	Recipient       string        `json:"recipient,omitempty"`
	RequesterID     int64         `json:"requester_id,omitempty"`
	SubmitterID     int64         `json:"submitter_id,omitempty"`
	AssigneeID      int64         `json:"assignee_id,omitempty"`
	OrganizationID  int64         `json:"organization_id,omitempty"`
	GroupID         json.Number   `json:"group_id,omitempty"`
	CollaboratorIDs []int64       `json:"collaborator_ids,omitempty"`
	FollowerIDs     []int64       `json:"follower_ids,omitempty"`
	EmailCCIDs      []int64       `json:"email_cc_ids,omitempty"`
	ForumTopicID    int64         `json:"forum_topic_id,omitempty"`
	ProblemID       int64         `json:"problem_id,omitempty"`
	HasIncidents    bool          `json:"has_incidents,omitempty"`
	DueAt           *time.Time    `json:"due_at,omitempty"`
	Tags            []string      `json:"tags,omitempty"`
	CustomFields    []CustomField `json:"custom_fields,omitempty"`

	Via *Via `json:"via,omitempty"`

	SatisfactionRating *struct {
		ID      int64  `json:"id"`
		Score   string `json:"score"`
		Comment string `json:"comment"`
	} `json:"satisfaction_rating,omitempty"`

	SharingAgreementIDs []int64    `json:"sharing_agreement_ids,omitempty"`
	FollowupIDs         []int64    `json:"followup_ids,omitempty"`
	ViaFollowupSourceID int64      `json:"via_followup_source_id,omitempty"`
	MacroIDs            []int64    `json:"macro_ids,omitempty"`
	TicketFormID        int64      `json:"ticket_form_id,omitempty"`
	BrandID             int64      `json:"brand_id,omitempty"`
	AllowChannelback    bool       `json:"allow_channelback,omitempty"`
	AllowAttachments    bool       `json:"allow_attachments,omitempty"`
	IsPublic            bool       `json:"is_public,omitempty"`
	CreatedAt           *time.Time `json:"created_at,omitempty"`
	UpdatedAt           *time.Time `json:"updated_at,omitempty"`

	// Collaborators is POST only
	Collaborators *Collaborators `json:"collaborators,omitempty"`

	// Comment is POST only and required
	Comment *TicketComment `json:"comment,omitempty"`

	// Requester is POST only and can be used to create a ticket for a nonexistent requester
	Requester *Requester `json:"requester,omitempty"`

	// safe update fields
	// https://developer.zendesk.com/documentation/ticketing/managing-tickets/creating-and-updating-tickets/#protecting-against-ticket-update-collisions
	UpdatedStamp *time.Time `json:"updated_stamp,omitempty"`
	SafeUpdate   bool       `json:"safe_update,omitempty"`
}

type TicketAPI

type TicketAPI interface {
	GetTicketsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Ticket]
	GetTickets(ctx context.Context, opts *TicketListOptions) ([]Ticket, Page, error)
	GetTicketsOBP(ctx context.Context, opts *OBPOptions) ([]Ticket, Page, error)
	GetTicketsCBP(ctx context.Context, opts *CBPOptions) ([]Ticket, client.CursorPaginationMeta, error)
	GetOrganizationTickets(ctx context.Context, organizationID int64, ops *TicketListOptions) ([]Ticket, Page, error)
	GetOrganizationTicketsOBP(ctx context.Context, opts *OBPOptions) ([]Ticket, Page, error)
	GetOrganizationTicketsCBP(ctx context.Context, opts *CBPOptions) ([]Ticket, client.CursorPaginationMeta, error)
	GetOrganizationTicketsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Ticket]
	GetTicket(ctx context.Context, id int64) (Ticket, error)
	GetMultipleTickets(ctx context.Context, ticketIDs []int64) ([]Ticket, error)
	CreateTicket(ctx context.Context, ticket Ticket) (Ticket, error)
	UpdateTicket(ctx context.Context, ticketID int64, ticket Ticket) (Ticket, error)
	DeleteTicket(ctx context.Context, ticketID int64) error
}

TicketAPI an interface containing all ticket related methods

type TicketAudit

type TicketAudit struct {
	ID        int64          `json:"id,omitempty"`
	TicketID  int64          `json:"ticket_id,omitempty"`
	Metadata  interface{}    `json:"metadata,omitempty"`
	Via       TicketAuditVia `json:"via,omitempty"`
	CreatedAt *time.Time     `json:"created_at,omitempty"`
	AuthorID  int64          `json:"author_id,omitempty"`
	Events    []interface{}  `json:"events,omitempty"`
}

TicketAudit is struct for ticket_audit payload

type TicketAuditAPI

type TicketAuditAPI interface {
	GetAllTicketAudits(ctx context.Context, opts CursorOption) ([]TicketAudit, Cursor, error)
	GetTicketAudits(ctx context.Context, ticketID int64, opts PageOptions) ([]TicketAudit, Page, error)
	GetTicketAudit(ctx context.Context, TicketID, ID int64) (TicketAudit, error)
	GetTicketAuditsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketAudit]
	GetTicketAuditsOBP(ctx context.Context, opts *OBPOptions) ([]TicketAudit, Page, error)
	GetTicketAuditsCBP(ctx context.Context, opts *CBPOptions) ([]TicketAudit, client.CursorPaginationMeta, error)
}

TicketAuditAPI an interface containing all of the ticket audit related zendesk methods

type TicketAuditVia

type TicketAuditVia struct {
	Channel string `json:"channel,omitempty"`
	Source  struct {
		To   interface{} `json:"to,omitempty"`
		From interface{} `json:"from,omitempty"`
		Ref  string      `json:"ref,omitempty"`
	} `json:"source,omitempty"`
}

TicketAuditVia is struct for via payload

type TicketComment

type TicketComment struct {
	ID          int64                  `json:"id,omitempty"`
	Type        string                 `json:"type,omitempty"`
	Body        string                 `json:"body,omitempty"`
	HTMLBody    string                 `json:"html_body,omitempty"`
	PlainBody   string                 `json:"plain_body,omitempty"`
	Public      *bool                  `json:"public,omitempty"`
	AuthorID    int64                  `json:"author_id,omitempty"`
	Attachments []Attachment           `json:"attachments,omitempty"`
	CreatedAt   time.Time              `json:"created_at,omitempty"`
	Uploads     []string               `json:"uploads,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`

	Via *Via `json:"via,omitempty"`
}

TicketComment is a struct for ticket comment payload Via and Metadata are currently unused https://developer.zendesk.com/rest_api/docs/support/ticket_comments

func NewPrivateTicketComment

func NewPrivateTicketComment(body string, authorID int64) TicketComment

NewPrivateTicketComment generates and returns a new private TicketComment

func NewPublicTicketComment

func NewPublicTicketComment(body string, authorID int64) TicketComment

NewPublicTicketComment generates and returns a new TicketComment

type TicketCommentAPI

type TicketCommentAPI interface {
	CreateTicketComment(ctx context.Context, ticketID int64, ticketComment TicketComment) (TicketComment, error)
	ListTicketComments(ctx context.Context, ticketID int64, opts *ListTicketCommentsOptions) (*ListTicketCommentsResult, error)
	MakeCommentPrivate(ctx context.Context, ticketID int64, ticketCommentID int64) error
	GetTicketCommentsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketComment]
	GetTicketCommentsOBP(ctx context.Context, opts *OBPOptions) ([]TicketComment, Page, error)
	GetTicketCommentsCBP(ctx context.Context, opts *CBPOptions) ([]TicketComment, client.CursorPaginationMeta, error)
}

TicketCommentAPI is an interface containing all ticket comment related API methods

type TicketField

type TicketField struct {
	ID                  int64                          `json:"id,omitempty"`
	URL                 string                         `json:"url,omitempty"`
	Type                string                         `json:"type"`
	Title               string                         `json:"title"`
	RawTitle            string                         `json:"raw_title,omitempty"`
	Description         string                         `json:"description,omitempty"`
	RawDescription      string                         `json:"raw_description,omitempty"`
	Position            int64                          `json:"position,omitempty"`
	Active              bool                           `json:"active"`
	Required            bool                           `json:"required"`
	CollapsedForAgents  bool                           `json:"collapsed_for_agents"`
	RegexpForValidation string                         `json:"regexp_for_validation,omitempty"`
	TitleInPortal       string                         `json:"title_in_portal,omitempty"`
	RawTitleInPortal    string                         `json:"raw_title_in_portal,omitempty"`
	VisibleInPortal     bool                           `json:"visible_in_portal"`
	EditableInPortal    bool                           `json:"editable_in_portal"`
	RequiredInPortal    bool                           `json:"required_in_portal"`
	Tag                 string                         `json:"tag,omitempty"`
	CreatedAt           *time.Time                     `json:"created_at,omitempty"`
	UpdatedAt           *time.Time                     `json:"updated_at,omitempty"`
	SystemFieldOptions  []TicketFieldSystemFieldOption `json:"system_field_options,omitempty"`
	CustomFieldOptions  []CustomFieldOption            `json:"custom_field_options,omitempty"`
	SubTypeID           int64                          `json:"sub_type_id,omitempty"`
	Removable           bool                           `json:"removable,omitempty"`
	AgentDescription    string                         `json:"agent_description,omitempty"`
}

TicketField is struct for ticket_field payload

func (TicketField) Validate added in v0.24.0

func (f TicketField) Validate() error

type TicketFieldAPI

type TicketFieldAPI interface {
	GetTicketFields(ctx context.Context) ([]TicketField, Page, error)
	CreateTicketField(ctx context.Context, ticketField TicketField) (TicketField, error)
	GetTicketField(ctx context.Context, ticketID int64) (TicketField, error)
	UpdateTicketField(ctx context.Context, ticketID int64, field TicketField) (TicketField, error)
	DeleteTicketField(ctx context.Context, ticketID int64) error
	GetTicketFieldsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketField]
	GetTicketFieldsOBP(ctx context.Context, opts *OBPOptions) ([]TicketField, Page, error)
	GetTicketFieldsCBP(ctx context.Context, opts *CBPOptions) ([]TicketField, client.CursorPaginationMeta, error)
}

TicketFieldAPI an interface containing all the ticket field related zendesk methods

type TicketFieldSystemFieldOption

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

TicketFieldSystemFieldOption is struct for value of `system_field_options`

type TicketFieldType added in v0.24.0

type TicketFieldType string
const (
	Subject           TicketFieldType = "subject"
	Description       TicketFieldType = "description"
	Status            TicketFieldType = "status"
	TicketType        TicketFieldType = "tickettype"
	Priority          TicketFieldType = "priority"
	GroupField        TicketFieldType = "group"
	Assignee          TicketFieldType = "assignee"
	CustomStatus      TicketFieldType = "custom_status"
	Text              TicketFieldType = "text"
	TextArea          TicketFieldType = "textarea"
	Checkbox          TicketFieldType = "checkbox"
	Date              TicketFieldType = "date"
	Integer           TicketFieldType = "integer"
	Decimal           TicketFieldType = "decimal"
	Regexp            TicketFieldType = "regexp"
	PartialCreditCard TicketFieldType = "partial_credit_card"
	Multiselect       TicketFieldType = "multiselect"
	Tagger            TicketFieldType = "tagger"
)

func (TicketFieldType) String added in v0.24.0

func (t TicketFieldType) String() string

type TicketFieldsTypes added in v0.24.2

type TicketFieldsTypes []TicketFieldType

TicketFieldsTypes is a slice containing all valid ticket field names.

func (TicketFieldsTypes) StringSlice added in v0.24.2

func (t TicketFieldsTypes) StringSlice() []string

type TicketForm

type TicketForm struct {
	Active             bool                     `json:"active"`
	AgentConditions    []ConditionalTicketField `json:"agent_conditions,omitempty"`
	CreatedAt          time.Time                `json:"created_at"`
	Default            bool                     `json:"default,omitempty"`
	DisplayName        string                   `json:"display_name"`
	EndUserConditions  []ConditionalTicketField `json:"end_user_conditions,omitempty"`
	EndUserVisible     bool                     `json:"end_user_visible,omitempty"`
	ID                 int64                    `json:"id"`
	InAllBrands        bool                     `json:"in_all_brands,omitempty"`
	Name               string                   `json:"name"`
	Position           int64                    `json:"position,omitempty"`
	RawDisplayName     string                   `json:"raw_display_name,omitempty"`
	RawName            string                   `json:"raw_name,omitempty"`
	RestrictedBrandIds []int64                  `json:"restricted_brand_ids,omitempty"`
	TicketFieldIds     []int64                  `json:"ticket_field_ids"`
	UpdatedAt          time.Time                `json:"updated_at"`
	Url                string                   `json:"url"`
}

TicketForm ticket forms allow an admin to define a subset of ticket fields for display to both agents and end users. Accounts are limited to 300 ticket forms.

TicketFieldIds is used to display all ticket fields which are in this ticket form. The products use the order of the ids to show the field values in the tickets.

AgentConditions and EndUserConditions specify which ticket fields to show on the form based on a set of defined conditions

type TicketFormAPI

type TicketFormAPI interface {
	GetTicketForms(ctx context.Context, options *TicketFormListOptions) ([]TicketForm, Page, error)
	CreateTicketForm(ctx context.Context, ticketForm TicketForm) (TicketForm, error)
	DeleteTicketForm(ctx context.Context, id int64) error
	UpdateTicketForm(ctx context.Context, id int64, form TicketForm) (TicketForm, error)
	GetTicketForm(ctx context.Context, id int64) (TicketForm, error)
	GetTicketFormsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[TicketForm]
	GetTicketFormsOBP(ctx context.Context, opts *OBPOptions) ([]TicketForm, Page, error)
	GetTicketFormsCBP(ctx context.Context, opts *CBPOptions) ([]TicketForm, client.CursorPaginationMeta, error)
}

TicketFormAPI an interface containing all ticket form related methods

type TicketFormListOptions

type TicketFormListOptions struct {
	PageOptions
	Active            bool `url:"active"`
	EndUserVisible    bool `url:"end_user_visible,omitempty"`
	FallbackToDefault bool `url:"fallback_to_default,omitempty"`
	AssociatedToBrand bool `url:"associated_to_brand,omitempty"`
}

TicketFormListOptions is options for GetTicketForms

ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#available-parameters

type TicketListCBPResult

type TicketListCBPResult struct {
	Tickets []Ticket                    `json:"tickets"`
	Meta    client.CursorPaginationMeta `json:"meta"`
}

TicketListCBPResult struct represents the result of a ticket list operation in CBP. It includes an array of Ticket objects, and Meta that holds pagination metadata.

type TicketListOptions

type TicketListOptions struct {
	PageOptions

	// SortBy can take "assignee", "assignee.name", "created_at", "group", "id",
	// "locale", "requester", "requester.name", "status", "subject", "updated_at"
	SortBy string `url:"sort_by,omitempty"`

	// SortOrder can take "asc" or "desc"
	SortOrder string `url:"sort_order,omitempty"`
}

TicketListOptions struct is used to specify options for listing tickets in OBP (Offset Based Pagination). It embeds the PageOptions struct for pagination and provides options for sorting the result; SortBy specifies the field to sort by, and SortOrder specifies the order (either 'asc' or 'desc').

type TicketMetric

type TicketMetric struct {
	AgentWaitTimeInMinutes       TimeDuration `json:"agent_wait_time_in_minutes"`
	AssignedAt                   time.Time    `json:"assigned_at"`
	AssigneeStations             int          `json:"assignee_stations"`
	AssigneeUpdatedAt            time.Time    `json:"assignee_updated_at"`
	CreatedAt                    time.Time    `json:"created_at"`
	CustomStatusUpdatedAt        time.Time    `json:"custom_status_updated_at"`
	FirstResolutionTimeInMinutes TimeDuration `json:"first_resolution_time_in_minutes"`
	FullResolutionTimeInMinutes  TimeDuration `json:"full_resolution_time_in_minutes"`
	GroupStations                int          `json:"group_stations"`
	ID                           int          `json:"id"`
	InitiallyAssignedAt          time.Time    `json:"initially_assigned_at"`
	LatestCommentAddedAt         time.Time    `json:"latest_comment_added_at"`
	OnHoldTimeInMinutes          TimeDuration `json:"on_hold_time_in_minutes"`
	Reopens                      int          `json:"reopens"`
	Replies                      int          `json:"replies"`
	ReplyTimeInMinutes           TimeDuration `json:"reply_time_in_minutes"`
	ReplyTimeInSeconds           struct {
		Calendar int `json:"calendar"`
	} `json:"reply_time_in_seconds"`
	RequesterUpdatedAt         time.Time    `json:"requester_updated_at"`
	RequesterWaitTimeInMinutes TimeDuration `json:"requester_wait_time_in_minutes"`
	SolvedAt                   time.Time    `json:"solved_at"`
	StatusUpdatedAt            time.Time    `json:"status_updated_at"`
	TicketID                   int          `json:"ticket_id"`
	UpdatedAt                  time.Time    `json:"updated_at"`
}

type TicketMetricListOptions

type TicketMetricListOptions struct {
	PageOptions

	SortBy string `url:"sort_by,omitempty"`

	SortOrder string `url:"sort_order,omitempty"`
}

type TicketMetricsAPI

type TicketMetricsAPI interface {
	GetTicketMetrics(ctx context.Context, opts ...TicketMetricListOptions) ([]TicketMetric, Page, error)
	GetTicketMetric(ctx context.Context, ticketMetricsID int64) (TicketMetric, error)
	GetTicketMetricByTicket(ctx context.Context, ticketID int64) (TicketMetric, error)
}

TicketMetricsAPI is an interface containing all methods for the ticket metrics API

type TimeDuration

type TimeDuration struct {
	Business int `json:"business"`
	Calendar int `json:"calendar"`
}

TimeDuration represents a time in business or calendar days

type Topic

type Topic struct {
	ID            int64     `json:"id"`
	URL           string    `json:"url"`
	HTMLURL       string    `json:"html_url"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	Position      int       `json:"position"`
	FollowerCount int       `json:"follower_count"`
	ManageableBy  string    `json:"manageable_by"`
	UserSegmentID int64     `json:"user_segment_id"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type Trigger

type Trigger struct {
	ID          int64      `json:"id,omitempty"`
	Title       string     `json:"title"`
	Active      bool       `json:"active"`
	Position    int64      `json:"position,omitempty"`
	Conditions  Conditions `json:"conditions"`
	Actions     []Action   `json:"actions"`
	Description string     `json:"description,omitempty"`
	CategoryID  string     `json:"category_id,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	UpdatedAt   *time.Time `json:"updated_at,omitempty"`
	URL         string     `json:"url,omitempty"`
}

Trigger is zendesk trigger JSON payload format

ref: https://developer.zendesk.com/rest_api/docs/core/triggers#json-format

type TriggerAPI

type TriggerAPI interface {
	GetTriggers(ctx context.Context, opts *TriggerListOptions) ([]Trigger, Page, error)
	CreateTrigger(ctx context.Context, trigger Trigger) (Trigger, error)
	GetTrigger(ctx context.Context, id int64) (Trigger, error)
	UpdateTrigger(ctx context.Context, id int64, trigger Trigger) (Trigger, error)
	DeleteTrigger(ctx context.Context, id int64) error
	GetTriggersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Trigger]
	GetTriggersOBP(ctx context.Context, opts *OBPOptions) ([]Trigger, Page, error)
	GetTriggersCBP(ctx context.Context, opts *CBPOptions) ([]Trigger, client2.CursorPaginationMeta, error)
}

TriggerAPI an interface containing all trigger related methods

type TriggerCategory

type TriggerCategory struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	Name      string    `json:"name"`
	Position  int64     `json:"position"`
	UpdatedAt time.Time `json:"updated_at"`
}

type TriggerCategoryAPI

type TriggerCategoryAPI interface {
	GetTriggerCategories(ctx context.Context, opts *TriggerCategoryListOptions) ([]TriggerCategory, client2.CursorPaginationMeta, error)
	CreateTriggerCategory(ctx context.Context, triggerCategory TriggerCategory) (TriggerCategory, error)
	GetTriggerCategory(ctx context.Context, id int64) (TriggerCategory, error)
	UpdateTriggerCategory(ctx context.Context, id int64, triggerCategory TriggerCategory) (TriggerCategory, error)
	DeleteTriggerCategory(ctx context.Context, id int64) error
}

TriggerCategoryAPI an interface containing all trigger related methods

type TriggerCategoryListOptions

type TriggerCategoryListOptions struct {
	client2.CursorPagination
	Sort string `url:"sort,omitempty"`
}

TriggerCategoryListOptions is options for GetTriggers

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#list-triggers

type TriggerListOptions

type TriggerListOptions struct {
	PageOptions
	Active     bool   `url:"active"`
	CategoryID string `url:"category_id,omitempty"`
	SortBy     string `url:"sort_by,omitempty"`
	SortOrder  string `url:"sort_order,omitempty"`
}

TriggerListOptions is options for GetTriggers

ref: https://developer.zendesk.com/rest_api/docs/support/triggers#list-triggers

type Upload

type Upload struct {
	Attachment  Attachment   `json:"attachment"`
	Attachments []Attachment `json:"attachments"`
	Token       string       `json:"token"`
}

Upload is the API response received from zendesk whenc creating attachments

type UploadWriter

type UploadWriter interface {
	io.Writer
	Close() (Upload, error)
}

UploadWriter is used to write a zendesk attachment

type User

type User struct {
	ID                   int64      `json:"id,omitempty"`
	URL                  string     `json:"url,omitempty"`
	Email                string     `json:"email,omitempty"`
	Name                 string     `json:"name"`
	Active               bool       `json:"active"`
	Alias                string     `json:"alias,omitempty"`
	ChatOnly             bool       `json:"chat_only,omitempty"`
	CustomRoleID         int64      `json:"custom_role_id,omitempty"`
	DefaultGroupID       int64      `json:"default_group_id,omitempty"`
	Details              string     `json:"details,omitempty"`
	ExternalID           string     `json:"external_id,omitempty"`
	IanaTimezone         string     `json:"iana_time_zone,omitempty"`
	Locale               string     `json:"locale,omitempty"`
	LocaleID             int64      `json:"locale_id,omitempty"`
	Moderator            bool       `json:"moderator,omitempty"`
	Notes                string     `json:"notes,omitempty"`
	OnlyPrivateComments  bool       `json:"only_private_comments,omitempty"`
	OrganizationID       int64      `json:"organization_id,omitempty"`
	Phone                string     `json:"phone,omitempty"`
	Photo                Attachment `json:"photo,omitempty"`
	RemotePhotoURL       string     `json:"remote_photo_url,omitempty"`
	RestrictedAgent      bool       `json:"restricted_agent,omitempty"`
	Role                 string     `json:"role,omitempty"`
	RoleType             int64      `json:"role_type,omitempty"`
	Shared               bool       `json:"shared,omitempty"`
	SharedAgent          bool       `json:"shared_agent,omitempty"`
	SharedPhoneNumber    bool       `json:"shared_phone_number,omitempty"`
	Signature            string     `json:"signature,omitempty"`
	Suspended            bool       `json:"suspended,omitempty"`
	Tags                 []string   `json:"tags,omitempty"`
	TicketRestriction    string     `json:"ticket_restriction,omitempty"`
	Timezone             string     `json:"time_zone,omitempty"`
	TwoFactorAuthEnabled bool       `json:"two_factor_auth_enabled,omitempty"`
	UserFields           UserFields `json:"user_fields"`
	Verified             bool       `json:"verified,omitempty"`
	ReportCSV            bool       `json:"report_csv,omitempty"`
	LastLoginAt          time.Time  `json:"last_login_at,omitempty"`
	CreatedAt            time.Time  `json:"created_at,omitempty"`
	UpdatedAt            time.Time  `json:"updated_at,omitempty"`
}

User is zendesk user JSON payload format https://developer.zendesk.com/rest_api/docs/support/users

type UserAPI

type UserAPI interface {
	SearchUsers(ctx context.Context, opts *SearchUsersOptions) ([]User, Page, error)
	GetManyUsers(ctx context.Context, opts *GetManyUsersOptions) ([]User, Page, error)
	GetUsers(ctx context.Context, opts *UserListOptions) ([]User, Page, error)
	GetOrganizationUsers(ctx context.Context, orgID int64, opts *UserListOptions) ([]User, Page, error)
	GetUser(ctx context.Context, userID int64) (User, error)
	CreateUser(ctx context.Context, user User) (User, error)
	CreateOrUpdateUser(ctx context.Context, user User) (User, error)
	UpdateUser(ctx context.Context, userID int64, user User) (User, error)
	GetUserRelated(ctx context.Context, userID int64) (UserRelated, error)
	GetUsersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[User]
	GetUsersOBP(ctx context.Context, opts *OBPOptions) ([]User, Page, error)
	GetUsersCBP(ctx context.Context, opts *CBPOptions) ([]User, client.CursorPaginationMeta, error)
	GetOrganizationUsersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[User]
	GetOrganizationUsersOBP(ctx context.Context, opts *OBPOptions) ([]User, Page, error)
	GetOrganizationUsersCBP(ctx context.Context, opts *CBPOptions) ([]User, client.CursorPaginationMeta, error)
}

UserAPI an interface containing all user related methods

type UserField

type UserField struct {
	ID                     int64               `json:"id,omitempty"`
	URL                    string              `json:"url,omitempty"`
	Key                    string              `json:"key,omitempty"`
	Type                   string              `json:"type"`
	Title                  string              `json:"title"`
	RawTitle               string              `json:"raw_title,omitempty"`
	Description            string              `json:"description,omitempty"`
	RawDescription         string              `json:"raw_description,omitempty"`
	Position               int64               `json:"position,omitempty"`
	Active                 bool                `json:"active"`
	System                 bool                `json:"system,omitempty"`
	RegexpForValidation    string              `json:"regexp_for_validation,omitempty"`
	Tag                    string              `json:"tag,omitempty"`
	CustomFieldOptions     []CustomFieldOption `json:"custom_field_options,omitempty"`
	CreatedAt              time.Time           `json:"created_at,omitempty"`
	UpdatedAt              time.Time           `json:"updated_at,omitempty"`
	RelationshipTargetType string              `json:"relationship_target_type,omitempty"`
	RelationshipFilter     RelationshipFilter  `json:"relationship_filter,omitempty"`
}

UserField is struct for user_field payload

type UserFieldAPI

type UserFieldAPI interface {
	GetUserFields(ctx context.Context, opts *UserFieldListOptions) ([]UserField, Page, error)
	CreateUserField(ctx context.Context, userField UserField) (UserField, error)
	GetUserField(ctx context.Context, id int64) (UserField, error)
	UpdateUserField(ctx context.Context, id int64, userField UserField) (UserField, error)
	DeleteUserField(ctx context.Context, id int64) error
	GetUserFieldsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[UserField]
	GetUserFieldsOBP(ctx context.Context, opts *OBPOptions) ([]UserField, Page, error)
	GetUserFieldsCBP(ctx context.Context, opts *CBPOptions) ([]UserField, client.CursorPaginationMeta, error)
}

type UserFieldListOptions

type UserFieldListOptions struct {
	PageOptions
}

type UserFields

type UserFields map[string]interface{}

UserFields is a dictionary of custom user related fields

type UserListOptions

type UserListOptions struct {
	PageOptions
	Role          string   `url:"role,omitempty"`
	Roles         []string `url:"role[],omitempty"`
	PermissionSet int64    `url:"permission_set,omitempty"`
}

UserListOptions is options for GetUsers

ref: https://developer.zendesk.com/rest_api/docs/support/users#list-users

type UserRelated

type UserRelated struct {
	AssignedTickets           int64 `json:"assigned_tickets"`
	RequestedTickets          int64 `json:"requested_tickets"`
	CCDTickets                int64 `json:"ccd_tickets"`
	OrganizationSubscriptions int64 `json:"organization_subscriptions"`
}

UserRelated contains user related data

ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user-related-information

type ValidateValue added in v0.23.0

type ValidateValue[T any] interface {
	Validate(resourceType ResourceType[T]) error
}

type Validator added in v0.23.0

type Validator[F any, T any] interface {
	ValidateValue(key F, value ParsedValue, operator Operator, resourceType ResourceType[T]) error
	ValidKeys() []string
}

type ValueValidator added in v0.22.0

type ValueValidator[T any] struct {
	ValidationRegex *regexp.Regexp
	ResourceTypes   ResourceTypes[T]
	ValidOperators  []Operator
}

type Via

type Via struct {
	Channel string `json:"channel"`
	Source  struct {
		From map[string]interface{} `json:"from"`
		To   map[string]interface{} `json:"to"`
		Rel  string                 `json:"rel"`
	} `json:"source"`
}

Via is information about source of Ticket or TicketComment

type ViaType added in v0.23.0

type ViaType int
const (
	// ViaWebForm : Web form
	ViaWebForm ViaType = 0
	// ViaMail : Email
	ViaMail ViaType = 4
	// ViaChat : Chat
	ViaChat ViaType = 29
	// ViaTwitter : Twitter
	ViaTwitter ViaType = 30
	// ViaTwitterDM : Twitter DM
	ViaTwitterDM ViaType = 26
	// ViaTwitterFavorite : Twitter like
	ViaTwitterFavorite ViaType = 23
	// ViaVoicemail : Voicemail
	ViaVoicemail ViaType = 33
	// ViaPhoneCallInbound : Phone call (incoming)
	ViaPhoneCallInbound ViaType = 34
	// ViaPhoneCallOutbound : Phone call (outbound)
	ViaPhoneCallOutbound ViaType = 35
	// ViaAPIVoicemail : CTI voicemail
	ViaAPIVoicemail ViaType = 44
	// ViaAPIPhoneCallInbound : CTI phone call (inbound)
	ViaAPIPhoneCallInbound ViaType = 45
	// ViaAPIPhoneCallOutbound : CTI phone call (outbound)
	ViaAPIPhoneCallOutbound ViaType = 46
	// ViaSMS : SMS
	ViaSMS ViaType = 57
	// ViaGetSatisfaction : Get Satisfaction
	ViaGetSatisfaction ViaType = 16
	// ViaWebWidget : Web Widget
	ViaWebWidget ViaType = 48
	// ViaMobileSDK : Mobile SDK
	ViaMobileSDK ViaType = 49
	// ViaMobile : Mobile
	ViaMobile ViaType = 56
	// ViaHelpCenter : Help Center post
	ViaHelpCenter ViaType = 50
	// ViaWebService : Web service (API)
	ViaWebService ViaType = 5
	// ViaRule : Trigger, automation
	ViaRule ViaType = 8
	// ViaClosedTicket : Closed ticket
	ViaClosedTicket ViaType = 27
	// ViaTicketSharing : Ticket Sharing
	ViaTicketSharing ViaType = 31
	// ViaFacebookPost : Facebook post
	ViaFacebookPost ViaType = 38
	// ViaFacebookMessage : Facebook private message
	ViaFacebookMessage ViaType = 41
	// ViaSatisfactionPrediction : Satisfaction prediction
	ViaSatisfactionPrediction ViaType = 54
	// ViaAnyChannel : Channel framework
	ViaAnyChannel ViaType = 55
)

type View

type View struct {
	URL         string      `json:"url,omitempty"`
	ID          int64       `json:"id,omitempty"`
	Title       string      `json:"title,omitempty"`
	Active      bool        `json:"active"`
	UpdatedAt   string      `json:"updated_at,omitempty"`
	CreatedAt   string      `json:"created_at,omitempty"`
	Default     bool        `json:"default,omitempty"`
	Position    int64       `json:"position,omitempty"`
	Description string      `json:"description,omitempty"`
	Execution   interface{} `json:"execution,omitempty"`
	Conditions  Conditions  `json:"conditions,omitempty"`
	Restriction interface{} `json:"restriction,omitempty"`
	RawTitle    string      `json:"raw_title,omitempty"`
	All         []Condition `json:"all,omitempty"`
	Any         []Condition `json:"any,omitempty"`
	Output      ViewOutput  `json:"output,omitempty"`
}

View is struct for group membership payload https://developer.zendesk.com/api-reference/ticketing/business-rules/views/

type ViewAPI

type ViewAPI interface {
	GetView(context.Context, int64) (View, error)
	GetViews(context.Context) ([]View, Page, error)
	CreateView(ctx context.Context, newView View) (View, error)
	UpdateView(ctx context.Context, updatedId int64, udpatedView View) (View, error)
	DeleteView(context.Context, int64) error
	GetTicketsFromView(context.Context, int64, *TicketListOptions) ([]Ticket, Page, error)
	GetCountTicketsInViews(ctx context.Context, ids []string) ([]ViewCount, error)
	GetTicketsFromViewIterator(ctx context.Context, opts *PaginationOptions) *Iterator[Ticket]
	GetTicketsFromViewOBP(ctx context.Context, opts *OBPOptions) ([]Ticket, Page, error)
	GetTicketsFromViewCBP(ctx context.Context, opts *CBPOptions) ([]Ticket, client.CursorPaginationMeta, error)
	GetViewsIterator(ctx context.Context, opts *PaginationOptions) *Iterator[View]
	GetViewsOBP(ctx context.Context, opts *OBPOptions) ([]View, Page, error)
	GetViewsCBP(ctx context.Context, opts *CBPOptions) ([]View, client.CursorPaginationMeta, error)
}

ViewAPI encapsulates methods on view

type ViewColumn added in v0.21.0

type ViewColumn string
const (
	AssignedColumn          ViewColumn = "assigned"
	AssigneeColumn          ViewColumn = "assignee"
	DueDateColumn           ViewColumn = "due_date"
	GroupColumn             ViewColumn = "group"
	IDColumn                ViewColumn = "nice_id"
	UpdatedColumn           ViewColumn = "updated"
	UpdatedAssigneeColumn   ViewColumn = "updated_assignee"
	UpdatedRequesterColumn  ViewColumn = "updated_requester"
	UpdatedByTypeColumn     ViewColumn = "updated_by_type"
	OrganizationColumn      ViewColumn = "organization"
	PriorityColumn          ViewColumn = "priority"
	CreatedColumn           ViewColumn = "created"
	RequesterColumn         ViewColumn = "requester"
	LocaleIdColumn          ViewColumn = "locale_id"
	SatisfactionScoreColumn ViewColumn = "satisfaction_score"
	SolvedColumn            ViewColumn = "solved"
	StatusColumn            ViewColumn = "status"
	DescriptionColumn       ViewColumn = "description"
	SubmitterColumn         ViewColumn = "submitter"
	TicketFormColumn        ViewColumn = "ticket_form"
	TypeColumn              ViewColumn = "type"
	BrandColumn             ViewColumn = "brand"
	TicketStatusColumn      ViewColumn = "custom_status_id"
)

func (ViewColumn) String added in v0.21.1

func (c ViewColumn) String() string

type ViewCount

type ViewCount struct {
	ViewID int64  `json:"view_id"`
	URL    string `json:"url"`
	Value  int64  `json:"value"`
	Pretty string `json:"pretty"`
	Fresh  bool   `json:"fresh"`
}

type ViewExecColumn added in v0.20.4

type ViewExecColumn struct {
	ID         string  `json:"id"`
	Title      *string `json:"title,omitempty"`
	Filterable *bool   `json:"filterable,omitempty"`
	Sortable   *bool   `json:"sortable,omitempty"`
	Type       string  `json:"type,omitempty"`
	URL        *string `json:"url,omitempty"`
	Order      string  `json:"order,omitempty"`
}

type ViewExecField added in v0.20.4

type ViewExecField struct {
	ID         string `json:"id"`
	Title      string `json:"title"`
	Filterable bool   `json:"filterable"`
	Sortable   bool   `json:"sortable"`
	Order      string `json:"order,omitempty"`
}

type ViewExecution added in v0.20.4

type ViewExecution struct {
	GroupBy      string                `json:"group_by,omitempty"`
	GroupOrder   string                `json:"group_order,omitempty"`
	SortBy       string                `json:"sort_by,omitempty"`
	SortOrder    string                `json:"sort_order,omitempty"`
	Group        ViewExecColumn        `json:"group,omitempty"`
	Sort         ViewExecField         `json:"sort,omitempty"`
	Columns      []ViewExecColumn      `json:"columns,omitempty"`
	Fields       []ViewExecField       `json:"fields,omitempty"`
	CustomFields []CustomFieldViewExec `json:"custom_fields,omitempty"`
}

type ViewOutput added in v0.20.4

type ViewOutput struct {
	Columns    []string `json:"columns,omitempty"`
	GroupBy    string   `json:"group_by,omitempty"`
	GroupOrder string   `json:"group_order,omitempty"`
	SortBy     string   `json:"sort_by,omitempty"`
	SortOrder  string   `json:"sort_order,omitempty"`
}

type Webhook

type Webhook struct {
	Authentication *WebhookAuthentication `json:"authentication,omitempty"`
	CreatedAt      time.Time              `json:"created_at,omitempty"`
	CreatedBy      string                 `json:"created_by,omitempty"`
	Description    string                 `json:"description,omitempty"`
	Endpoint       string                 `json:"endpoint"`
	CustomHeaders  map[string]string      `json:"custom_headers,omitempty"`
	ExternalSource interface{}            `json:"external_source,omitempty"`
	HTTPMethod     string                 `json:"http_method"`
	ID             string                 `json:"id,omitempty"`
	Name           string                 `json:"name"`
	RequestFormat  string                 `json:"request_format"`
	SigningSecret  *WebhookSigningSecret  `json:"signing_secret,omitempty"`
	Status         string                 `json:"status"`
	Subscriptions  []string               `json:"subscriptions,omitempty"`
	UpdatedAt      time.Time              `json:"updated_at,omitempty"`
	UpdatedBy      string                 `json:"updated_by,omitempty"`
}

Webhook is struct for webhook payload. https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/

type WebhookAPI

type WebhookAPI interface {
	CreateWebhook(ctx context.Context, hook Webhook) (Webhook, error)
	GetWebhook(ctx context.Context, webhookID string) (Webhook, error)
	UpdateWebhook(ctx context.Context, webhookID string, hook Webhook) error
	DeleteWebhook(ctx context.Context, webhookID string) error
	GetWebhookSigningSecret(ctx context.Context, webhookID string) (WebhookSigningSecret, error)
}

type WebhookAuthentication

type WebhookAuthentication struct {
	Type        string             `json:"type,omitempty"`
	Data        WebhookCredentials `json:"data,omitempty"`
	AddPosition string             `json:"add_position,omitempty"`
}

type WebhookCredentials

type WebhookCredentials struct {
	HeaderName  string `json:"name,omitempty"`
	HeaderValue string `json:"value,omitempty"`
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	Token       string `json:"token,omitempty"`
}

type WebhookSigningSecret

type WebhookSigningSecret struct {
	Algorithm string `json:"algorithm"`
	Secret    string `json:"secret"`
}

Jump to

Keyboard shortcuts

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