Documentation ¶
Index ¶
- Constants
- func ActionFieldText(fieldType int) string
- func ConditionFieldText(fieldType int) string
- func LocaleTypeText(loc int) string
- func UserRoleText(role int) string
- func ViaTypeText(viaID int) string
- type API
- type APITokenCredential
- type Attachment
- type AttachmentAPI
- type Automation
- type AutomationAPI
- type AutomationAction
- type AutomationCondition
- type AutomationListOptions
- type BaseAPI
- type BasicAuthCredential
- type Brand
- type BrandAPI
- type Client
- func (z *Client) AddOrganizationTags(ctx context.Context, organizationID int64, tags []Tag) ([]Tag, error)
- func (z *Client) AddTicketTags(ctx context.Context, ticketID int64, tags []Tag) ([]Tag, error)
- func (z *Client) AddUserTags(ctx context.Context, userID int64, tags []Tag) ([]Tag, error)
- func (z *Client) CreateAutomation(ctx context.Context, automation Automation) (Automation, error)
- func (z *Client) CreateBrand(ctx context.Context, brand Brand) (Brand, error)
- func (z *Client) CreateDynamicContentItem(ctx context.Context, item DynamicContentItem) (DynamicContentItem, error)
- func (z *Client) CreateEndUserIdentity(ctx context.Context, userID int64, userIdentity UserIdentity) (UserIdentity, error)
- func (z *Client) CreateGroup(ctx context.Context, group Group) (Group, error)
- func (z *Client) CreateMacro(ctx context.Context, macro Macro) (Macro, error)
- func (z *Client) CreateOrUpdateUser(ctx context.Context, user User) (User, error)
- func (z *Client) CreateOrganization(ctx context.Context, org Organization) (Organization, error)
- func (z *Client) CreateSLAPolicy(ctx context.Context, slaPolicy SLAPolicy) (SLAPolicy, error)
- func (z *Client) CreateTarget(ctx context.Context, target Target) (Target, error)
- func (z *Client) CreateTicket(ctx context.Context, ticket Ticket) (Ticket, error)
- func (z *Client) CreateTicketComment(ctx context.Context, ticketID int64, ticketComment TicketComment) (TicketComment, error)
- func (z *Client) CreateTicketField(ctx context.Context, ticketField TicketField) (TicketField, error)
- func (z *Client) CreateTicketForm(ctx context.Context, ticketForm TicketForm) (TicketForm, error)
- func (z *Client) CreateTrigger(ctx context.Context, trigger Trigger) (Trigger, error)
- func (z *Client) CreateUser(ctx context.Context, user User) (User, error)
- func (z *Client) CreateWebhook(ctx context.Context, hook *Webhook) (*Webhook, error)
- func (z *Client) Delete(ctx context.Context, path string) error
- func (z *Client) DeleteAutomation(ctx context.Context, id int64) error
- func (z *Client) DeleteBrand(ctx context.Context, brandID int64) error
- func (z *Client) DeleteDynamicContentItem(ctx context.Context, id int64) error
- func (z *Client) DeleteEndUserIdentity(ctx context.Context, userID int64, userIdentityID int64) error
- func (z *Client) DeleteGroup(ctx context.Context, groupID int64) error
- func (z *Client) DeleteMacro(ctx context.Context, macroID int64) error
- func (z *Client) DeleteOrganization(ctx context.Context, orgID int64) error
- func (z *Client) DeleteSLAPolicy(ctx context.Context, id int64) error
- func (z *Client) DeleteTarget(ctx context.Context, targetID int64) error
- func (z *Client) DeleteTicket(ctx context.Context, ticketID int64) error
- func (z *Client) DeleteTicketField(ctx context.Context, ticketID int64) error
- func (z *Client) DeleteTicketForm(ctx context.Context, id int64) error
- func (z *Client) DeleteTrigger(ctx context.Context, id int64) error
- func (z *Client) DeleteUpload(ctx context.Context, token string) error
- func (z *Client) DeleteUser(ctx context.Context, userID int64) error
- func (z *Client) DeleteWebhook(ctx context.Context, webhookID string) error
- func (z *Client) Get(ctx context.Context, path string) ([]byte, error)
- func (z *Client) GetAllTicketAudits(ctx context.Context, opts CursorOption) ([]TicketAudit, Cursor, error)
- func (z *Client) GetAttachment(ctx context.Context, id int64) (Attachment, error)
- func (z *Client) GetAutomation(ctx context.Context, id int64) (Automation, error)
- func (z *Client) GetAutomations(ctx context.Context, opts *AutomationListOptions) ([]Automation, Page, error)
- func (z *Client) GetBrand(ctx context.Context, brandID int64) (Brand, error)
- func (z *Client) GetCustomRoles(ctx context.Context) ([]CustomRole, error)
- func (z *Client) GetDynamicContentItem(ctx context.Context, id int64) (DynamicContentItem, error)
- func (z *Client) GetDynamicContentItems(ctx context.Context) ([]DynamicContentItem, Page, error)
- func (z *Client) GetEndUserIdentites(ctx context.Context, userID int64) ([]UserIdentity, error)
- func (z *Client) GetGroup(ctx context.Context, groupID int64) (Group, error)
- func (z *Client) GetGroupMemberships(ctx context.Context, opts *GroupMembershipListOptions) ([]GroupMembership, Page, error)
- func (z *Client) GetGroups(ctx context.Context, opts *GroupListOptions) ([]Group, Page, error)
- func (z *Client) GetLocales(ctx context.Context) ([]Locale, error)
- func (z *Client) GetMacro(ctx context.Context, macroID int64) (Macro, error)
- func (z *Client) GetMacros(ctx context.Context, opts *MacroListOptions) ([]Macro, Page, error)
- func (z *Client) GetManyUsers(ctx context.Context, opts *GetManyUsersOptions) ([]User, Page, error)
- func (z *Client) GetMultipleTickets(ctx context.Context, ticketIDs []int64) ([]Ticket, error)
- func (z *Client) GetOrganization(ctx context.Context, orgID int64) (Organization, error)
- func (z *Client) GetOrganizationMemberships(ctx context.Context, opts *OrganizationMembershipListOptions) ([]OrganizationMembership, Page, error)
- func (z *Client) GetOrganizationTags(ctx context.Context, organizationID int64) ([]Tag, error)
- func (z *Client) GetOrganizations(ctx context.Context, opts *OrganizationListOptions) ([]Organization, Page, error)
- func (z *Client) GetSLAPolicies(ctx context.Context, opts *SLAPolicyListOptions) ([]SLAPolicy, Page, error)
- func (z *Client) GetSLAPolicy(ctx context.Context, id int64) (SLAPolicy, error)
- func (z *Client) GetTarget(ctx context.Context, targetID int64) (Target, error)
- func (z *Client) GetTargets(ctx context.Context) ([]Target, Page, error)
- func (z *Client) GetTicket(ctx context.Context, ticketID int64) (Ticket, error)
- func (z *Client) GetTicketAudit(ctx context.Context, ticketID, ID int64) (TicketAudit, error)
- func (z *Client) GetTicketAudits(ctx context.Context, ticketID int64, opts PageOptions) ([]TicketAudit, Page, error)
- func (z *Client) GetTicketField(ctx context.Context, ticketID int64) (TicketField, error)
- func (z *Client) GetTicketFields(ctx context.Context) ([]TicketField, Page, error)
- func (z *Client) GetTicketForm(ctx context.Context, id int64) (TicketForm, error)
- func (z *Client) GetTicketForms(ctx context.Context, options *TicketFormListOptions) ([]TicketForm, Page, error)
- func (z *Client) GetTicketTags(ctx context.Context, ticketID int64) ([]Tag, error)
- func (z *Client) GetTickets(ctx context.Context, opts *TicketListOptions) ([]Ticket, Page, error)
- func (z *Client) GetTicketsFromView(ctx context.Context, viewID int64) ([]Ticket, error)
- func (z *Client) GetTrigger(ctx context.Context, id int64) (Trigger, error)
- func (z *Client) GetTriggers(ctx context.Context, opts *TriggerListOptions) ([]Trigger, Page, error)
- func (z *Client) GetUser(ctx context.Context, userID int64) (User, error)
- func (z *Client) GetUserFields(ctx context.Context, opts *UserFieldListOptions) ([]UserField, Page, error)
- func (z *Client) GetUserRelated(ctx context.Context, userID int64) (UserRelated, error)
- func (z *Client) GetUserTags(ctx context.Context, userID int64) ([]Tag, error)
- func (z *Client) GetUserTicketsRequested(ctx context.Context, userID int64, opts *TicketListOptions) ([]Ticket, Page, error)
- func (z *Client) GetUsers(ctx context.Context, opts *UserListOptions) ([]User, Page, error)
- func (z *Client) GetView(ctx context.Context, viewID int64) (View, error)
- func (z *Client) GetViews(ctx context.Context) ([]View, Page, error)
- func (z *Client) GetWebhook(ctx context.Context, webhookID string) (*Webhook, error)
- func (z *Client) ListTicketComments(ctx context.Context, ticketID int64) ([]TicketComment, error)
- func (z *Client) MakeEndUserIdentityPrimary(ctx context.Context, userID int64, userIdentityID int64) ([]UserIdentity, error)
- func (z *Client) Post(ctx context.Context, path string, data interface{}) ([]byte, error)
- func (z *Client) Put(ctx context.Context, path string, data interface{}) ([]byte, error)
- func (z *Client) Search(ctx context.Context, opts *SearchOptions) (SearchResults, Page, error)
- func (z *Client) SearchCount(ctx context.Context, opts *CountOptions) (int, error)
- func (z *Client) SearchUsers(ctx context.Context, opts *SearchUsersOptions) ([]User, Page, error)
- func (z *Client) SetCredential(cred Credential)
- func (z *Client) SetEndpointURL(newURL string) error
- func (z *Client) SetHeader(key string, value string)
- func (z *Client) SetSubdomain(subdomain string) error
- func (z *Client) UpdateAutomation(ctx context.Context, id int64, automation Automation) (Automation, error)
- func (z *Client) UpdateBrand(ctx context.Context, brandID int64, brand Brand) (Brand, error)
- func (z *Client) UpdateDynamicContentItem(ctx context.Context, id int64, item DynamicContentItem) (DynamicContentItem, error)
- func (z *Client) UpdateGroup(ctx context.Context, groupID int64, group Group) (Group, error)
- func (z *Client) UpdateMacro(ctx context.Context, macroID int64, macro Macro) (Macro, error)
- func (z *Client) UpdateOrganization(ctx context.Context, orgID int64, org Organization) (Organization, error)
- func (z *Client) UpdateSLAPolicy(ctx context.Context, id int64, slaPolicy SLAPolicy) (SLAPolicy, error)
- func (z *Client) UpdateTarget(ctx context.Context, targetID int64, field Target) (Target, error)
- func (z *Client) UpdateTicket(ctx context.Context, ticketID int64, ticket Ticket) (Ticket, error)
- func (z *Client) UpdateTicketField(ctx context.Context, ticketID int64, field TicketField) (TicketField, error)
- func (z *Client) UpdateTicketForm(ctx context.Context, id int64, form TicketForm) (TicketForm, error)
- func (z *Client) UpdateTrigger(ctx context.Context, id int64, trigger Trigger) (Trigger, error)
- func (z *Client) UpdateUser(ctx context.Context, userID int64, user User) (User, error)
- func (z *Client) UpdateWebhook(ctx context.Context, webhookID string, hook *Webhook) error
- func (z *Client) UploadAttachment(ctx context.Context, filename string, token string) UploadWriter
- func (z *Client) VerifyEndUserIdentity(ctx context.Context, userID int64, userIdentityID int64) (UserIdentity, error)
- type Collaborator
- type Collaborators
- type Configuration
- type CountOptions
- type Credential
- type Cursor
- type CursorOption
- type CustomField
- type CustomFieldOption
- type CustomRole
- type CustomRoleAPI
- type DynamicContentAPI
- type DynamicContentItem
- type DynamicContentVariant
- type Error
- type GetManyUsersOptions
- type Group
- type GroupAPI
- type GroupListOptions
- type GroupMembership
- type GroupMembershipAPI
- type GroupMembershipListOptions
- type Locale
- type LocaleAPI
- type Macro
- type MacroAPI
- type MacroAction
- type MacroListOptions
- type OptionsError
- type Organization
- type OrganizationAPI
- type OrganizationListOptions
- type OrganizationMembership
- type OrganizationMembershipAPI
- type OrganizationMembershipListOptions
- type Page
- type PageOptions
- type Photo
- type Requester
- type SLAPolicy
- type SLAPolicyAPI
- type SLAPolicyFilter
- type SLAPolicyListOptions
- type SLAPolicyMetric
- type SearchAPI
- type SearchOptions
- type SearchResults
- type SearchUsersOptions
- type Tag
- type TagAPI
- type Target
- type TargetAPI
- type Ticket
- type TicketAPI
- type TicketAudit
- type TicketAuditAPI
- type TicketAuditVia
- type TicketComment
- type TicketCommentAPI
- type TicketField
- type TicketFieldAPI
- type TicketFieldSystemFieldOption
- type TicketForm
- type TicketFormAPI
- type TicketFormListOptions
- type TicketListOptions
- type Topic
- type Trigger
- type TriggerAPI
- type TriggerAction
- type TriggerCondition
- type TriggerListOptions
- type Upload
- type UploadWriter
- type User
- type UserAPI
- type UserField
- type UserFieldAPI
- type UserFieldListOptions
- type UserFields
- type UserIdentitiesAPI
- type UserIdentity
- type UserIdentityListOptions
- type UserListOptions
- type UserRelated
- type Via
- type View
- type ViewAPI
- type Webhook
- type WebhookAPI
- type WebhookAuthentication
- type WebhookSigningSecret
Constants ¶
const ( // ActionFieldStatus status ActionFieldStatus = iota // ActionFieldType type ActionFieldType // ActionFieldPriority priority ActionFieldPriority // ActionFieldGroupID group_id ActionFieldGroupID // ActionFieldAssigneeID assignee_id ActionFieldAssigneeID // ActionFieldSetTags set_tags ActionFieldSetTags // ActionFieldCurrentTags current_tags ActionFieldCurrentTags // ActionFieldRemoveTags remove_tags ActionFieldRemoveTags // ActionFieldSatisfactionScore satisfaction_score ActionFieldSatisfactionScore // ActionFieldNotificationUser notification_user ActionFieldNotificationUser // ActionFieldNotificationGroup notification_group ActionFieldNotificationGroup // ActionFieldNotificationTarget notification_target ActionFieldNotificationTarget // ActionFieldTweetRequester tweet_requester ActionFieldTweetRequester // ActionFieldCC cc ActionFieldCC // ActionFieldLocaleID locale_id ActionFieldLocaleID // ActionFieldSubject subject ActionFieldSubject // ActionFieldCommentValue comment_value ActionFieldCommentValue // ActionFieldCommentValueHTML comment_value_html ActionFieldCommentValueHTML // ActionFieldCommentModeIsPublic comment_mode_is_public ActionFieldCommentModeIsPublic // ActionFieldTicketFormID ticket_form_id ActionFieldTicketFormID )
action field types which defined by system https://developer.zendesk.com/rest_api/docs/core/triggers#actions-reference
const ( // ConditionFieldGroupID group_id ConditionFieldGroupID = iota // ConditionFieldAssigneeID assignee_id ConditionFieldAssigneeID // ConditionFieldRequesterID requester_id ConditionFieldRequesterID // ConditionFieldOrganizationID organization_id ConditionFieldOrganizationID // ConditionFieldCurrentTags current_tags ConditionFieldCurrentTags // ConditionFieldViaID via_id ConditionFieldViaID // ConditionFieldRecipient recipient ConditionFieldRecipient // ConditionFieldType type ConditionFieldType // ConditionFieldStatus status ConditionFieldStatus // ConditionFieldPriority priority ConditionFieldPriority // ConditionFieldDescriptionIncludesWord description_includes_word ConditionFieldDescriptionIncludesWord // ConditionFieldLocaleID locale_id ConditionFieldLocaleID // ConditionFieldSatisfactionScore satisfaction_score ConditionFieldSatisfactionScore // ConditionFieldSubjectIncludesWord subject_includes_word ConditionFieldSubjectIncludesWord // ConditionFieldCommentIncludesWord comment_includes_word ConditionFieldCommentIncludesWord // ConditionFieldCurrentViaID current_via_id ConditionFieldCurrentViaID // ConditionFieldUpdateType update_type ConditionFieldUpdateType // ConditionFieldCommentIsPublic comment_is_public ConditionFieldCommentIsPublic // ConditionFieldTicketIsPublic ticket_is_public ConditionFieldTicketIsPublic // ConditionFieldReopens reopens ConditionFieldReopens // ConditionFieldReplies ConditionFieldReplies // ConditionFieldAgentStations agent_stations ConditionFieldAgentStations // ConditionFieldGroupStations group_stations ConditionFieldGroupStations // ConditionFieldInBusinessHours in_business_hours ConditionFieldInBusinessHours // ConditionFieldRequesterTwitterFollowersCount requester_twitter_followers_count ConditionFieldRequesterTwitterFollowersCount // ConditionFieldRequesterTwitterStatusesCount requester_twitter_statuses_count ConditionFieldRequesterTwitterStatusesCount // ConditionFieldRequesterTwitterVerified requester_twitter_verified ConditionFieldRequesterTwitterVerified // ConditionFieldTicketTypeID ticket_type_id ConditionFieldTicketTypeID // ConditionFieldExactCreatedAt exact_created_at ConditionFieldExactCreatedAt // ConditionFieldNew NEW ConditionFieldNew // ConditionFieldOpen OPEN ConditionFieldOpen // ConditionFieldPending PENDING ConditionFieldPending // ConditionFieldSolved SOLVED ConditionFieldSolved // ConditionFieldClosed CLOSED ConditionFieldClosed // ConditionFieldAssignedAt assigned_at ConditionFieldAssignedAt // ConditionFieldUpdatedAt updated_at ConditionFieldUpdatedAt // ConditionFieldRequesterUpdatedAt requester_updated_at ConditionFieldRequesterUpdatedAt // ConditionFieldAssigneeUpdatedAt ConditionFieldAssigneeUpdatedAt // ConditionFieldDueDate due_date ConditionFieldDueDate // ConditionFieldUntilDueDate until_due_date ConditionFieldUntilDueDate )
condition field types which are defined by system https://developer.zendesk.com/rest_api/docs/core/triggers#conditions-reference
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 )
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
const ( // UserRoleEndUser end-user UserRoleEndUser = iota // UserRoleAgent agent UserRoleAgent // UserRoleAdmin admin UserRoleAdmin )
const ( // ViaWebForm : Web form ViaWebForm = 0 // ViaMail : Email ViaMail = 4 // ViaChat : Chat ViaChat = 29 // ViaTwitter : Twitter ViaTwitter = 30 // ViaTwitterDM : Twitter DM ViaTwitterDM = 26 // TwitterFavorite : Twitter like ViaTwitterFavorite = 23 // ViaVoicemail : Voicemail ViaVoicemail = 33 // ViaPhoneCallInbound : Phone call (incoming) ViaPhoneCallInbound = 34 // ViaPhoneCallOutbound : Phone call (outbound) ViaPhoneCallOutbound = 35 // ViaAPIVoicemail : CTI voicemail ViaAPIVoicemail = 44 // ViaAPIPhoneCallInbound : CTI phone call (inbound) ViaAPIPhoneCallInbound = 45 // ViaAPIPhoneCallOutbound : CTI phone call (outbound) ViaAPIPhoneCallOutbound = 46 // ViaSMS : SMS ViaSMS = 57 // ViaGetSatisfaction : Get Satisfaction ViaGetSatisfaction = 16 // ViaWebWidget : Web Widget ViaWebWidget = 48 // ViaMobileSDK : Mobile SDK ViaMobileSDK = 49 // ViaMobile : Mobile ViaMobile = 56 // ViaHelpCenter : Help Center post ViaHelpCenter = 50 // ViaWebService : Web service (API) ViaWebService = 5 // ViaRule : Trigger, automation ViaRule = 8 // ViaClosedTicket : Closed ticket ViaClosedTicket = 27 // ViaTicketSharing : Ticket Sharing ViaTicketSharing = 31 // ViaFacebookPost : Facebook post ViaFacebookPost = 38 // ViaFacebookMessage : Facebook private message ViaFacebookMessage = 41 // ViaSatisfactionPrediction : Satisfaction prediction ViaSatisfactionPrediction = 54 // ViaAnyChannel : Channel framework ViaAnyChannel = 55 )
https://developer.zendesk.com/rest_api/docs/support/triggers#via-types
Variables ¶
This section is empty.
Functions ¶
func ActionFieldText ¶
ActionFieldText takes field type and returns field name string
func ConditionFieldText ¶
ConditionFieldText takes field type and returns field name string
func UserRoleText ¶
UserRoleText takes role type and returns role name string
Types ¶
type API ¶
type API interface { AutomationAPI AttachmentAPI BaseAPI BrandAPI CustomRoleAPI DynamicContentAPI GroupAPI GroupMembershipAPI LocaleAPI MacroAPI OrganizationAPI OrganizationMembershipAPI SearchAPI SLAPolicyAPI TargetAPI TagAPI TicketAuditAPI TicketAPI TicketCommentAPI TicketFieldAPI TicketFormAPI TriggerAPI UserAPI UserFieldAPI ViewAPI WebhookAPI }
API an interface containing all of the zendesk client methods
type APITokenCredential ¶
type APITokenCredential struct {
// contains filtered or unexported fields
}
APITokenCredential is type of credential for API token authentication
func NewAPITokenCredential ¶
func NewAPITokenCredential(email string, apiToken string) *APITokenCredential
NewAPITokenCredential creates APITokenCredential and returns its pointer
func (APITokenCredential) Email ¶
func (c APITokenCredential) Email() string
Email is accessor which returns email address
func (APITokenCredential) Secret ¶
func (c APITokenCredential) Secret() string
Secret is accessor which returns API token
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"` Active bool `json:"active,omitempty"` Position int64 `json:"position,omitempty"` Conditions struct { All []AutomationCondition `json:"all"` Any []AutomationCondition `json:"any"` } `json:"conditions"` Actions []AutomationAction `json:"actions"` RawTitle string `json:"raw_title,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,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 }
AutomationAPI an interface containing all automation related methods
type AutomationAction ¶
type AutomationAction struct { Field string `json:"field"` Value interface{} `json:"value"` }
AutomationAction is zendesk automation action
ref: https://developer.zendesk.com/rest_api/docs/core/automations#actions
type AutomationCondition ¶
type AutomationCondition struct { Field string `json:"field"` Operator string `json:"operator"` Value string `json:"value"` }
AutomationCondition zendesk automation condition
ref: https://developer.zendesk.com/rest_api/docs/core/automations#conditions-reference
type AutomationListOptions ¶
type AutomationListOptions struct { PageOptions Active bool `url:"active,omitempty"` 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 BaseAPI ¶
type BaseAPI interface { Get(ctx context.Context, path string) ([]byte, error) Post(ctx context.Context, path string, data interface{}) ([]byte, error) Put(ctx context.Context, path string, data interface{}) ([]byte, error) Delete(ctx context.Context, path string) error }
BaseAPI encapsulates base methods for zendesk client
type BasicAuthCredential ¶
type BasicAuthCredential struct {
// contains filtered or unexported fields
}
BasicAuthCredential is type of credential for Basic authentication
func NewBasicAuthCredential ¶
func NewBasicAuthCredential(email string, password string) *BasicAuthCredential
NewBasicAuthCredential creates BasicAuthCredential and returns its pointer
func (BasicAuthCredential) Email ¶
func (c BasicAuthCredential) Email() string
Email is accessor which returns email address
func (BasicAuthCredential) Secret ¶
func (c BasicAuthCredential) Secret() string
Secret is accessor which returns password
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,omitempty"` Default bool `json:"default,omitempty"` Logo Attachment `json:"logo,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 Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client of Zendesk API
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 ¶
AddTicketTags add tags to ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags
func (*Client) AddUserTags ¶
AddUserTags add tags to user
ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags
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 ¶
CreateBrand creates new brand https://developer.zendesk.com/rest_api/docs/support/brands#create-brand
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) CreateEndUserIdentity ¶
func (z *Client) CreateEndUserIdentity(ctx context.Context, userID int64, userIdentity UserIdentity) (UserIdentity, error)
func (*Client) CreateGroup ¶
CreateGroup creates new group https://developer.zendesk.com/rest_api/docs/support/groups#create-group
func (*Client) CreateMacro ¶
CreateMacro create a new macro
ref: https://developer.zendesk.com/rest_api/docs/support/macros#create-macro
func (*Client) CreateOrUpdateUser ¶
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) CreateSLAPolicy ¶
CreateSLAPolicy creates new slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#create-slaPolicy
func (*Client) CreateTarget ¶
CreateTarget creates new target ref: https://developer.zendesk.com/rest_api/docs/core/targets#create-target
func (*Client) CreateTicket ¶
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 ¶
CreateTrigger creates new trigger
ref: https://developer.zendesk.com/rest_api/docs/support/triggers#create-trigger
func (*Client) CreateUser ¶
CreateUser creates new user ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#create-user
func (*Client) CreateWebhook ¶
CreateWebhook creates new webhook.
func (*Client) DeleteAutomation ¶
DeleteAutomation deletes the specified automation
ref: https://developer.zendesk.com/rest_api/docs/support/automations#delete-automation
func (*Client) DeleteBrand ¶
DeleteBrand deletes the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#delete-brand
func (*Client) DeleteDynamicContentItem ¶
DeleteDynamicContentItem deletes the specified dynamic content item.
ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#delete-item
func (*Client) DeleteEndUserIdentity ¶
func (*Client) DeleteGroup ¶
DeleteGroup deletes the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#delete-group
func (*Client) DeleteMacro ¶
DeleteMacro deletes the specified macro ref: https://developer.zendesk.com/rest_api/docs/support/macros#delete-macro
func (*Client) DeleteOrganization ¶
DeleteOrganization deletes the specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#delete-organization
func (*Client) DeleteSLAPolicy ¶
DeleteSLAPolicy deletes the specified slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#delete-slaPolicy
func (*Client) DeleteTarget ¶
DeleteTarget deletes the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#delete-target
func (*Client) DeleteTicket ¶
DeleteTicket deletes the specified ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#delete-ticket
func (*Client) DeleteTicketField ¶
DeleteTicketField deletes the specified ticket field ref: https://developer.zendesk.com/rest_api/docs/support/ticket_fields#delete-ticket-field
func (*Client) DeleteTicketForm ¶
DeleteTicketForm deletes the specified ticket form ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#delete-ticket-form
func (*Client) DeleteTrigger ¶
DeleteTrigger deletes the specified trigger
ref: https://developer.zendesk.com/rest_api/docs/support/triggers#delete-trigger
func (*Client) DeleteUpload ¶
DeleteUpload deletes a previously uploaded file ref: https://developer.zendesk.com/rest_api/docs/support/attachments#delete-upload
func (*Client) DeleteUser ¶
DeleteUser delete a user ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#delete-user
func (*Client) DeleteWebhook ¶
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) GetAttachment ¶
GetAttachment returns the current state of an uploaded attachment ref: https://developer.zendesk.com/rest_api/docs/support/attachments#show-attachment
func (*Client) GetAutomation ¶
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) GetBrand ¶
GetBrand gets a specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#show-brand
func (*Client) GetCustomRoles ¶
func (z *Client) GetCustomRoles(ctx context.Context) ([]CustomRole, error)
GetRoles fetch CustomRoles list
func (*Client) GetDynamicContentItem ¶
GetDynamicContentItem returns the specified dynamic content item.
ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#show-item
func (*Client) GetDynamicContentItems ¶
GetDynamicContentItems fetches dynamic content item list
https://developer.zendesk.com/rest_api/docs/support/dynamic_content#list-items
func (*Client) GetEndUserIdentites ¶
GetUserIdentites fetch trigger list
https://developer.zendesk.com/api-reference/ticketing/users/user_identities/#list-identities
func (*Client) GetGroup ¶
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) GetGroups ¶
GetGroups fetches group list https://developer.zendesk.com/rest_api/docs/support/groups#list-groups
func (*Client) GetLocales ¶
GetLocales lists the translation locales available for the account. https://developer.zendesk.com/rest_api/docs/support/locales#list-locales
func (*Client) GetMacro ¶
GetMacro gets a specified macro
ref: https://developer.zendesk.com/rest_api/docs/support/macros#show-macro
func (*Client) GetMacros ¶
GetMacros get macro list
ref: https://developer.zendesk.com/rest_api/docs/support/macros#list-macros
func (*Client) GetManyUsers ¶
GetManyUsers fetch user list https://developer.zendesk.com/api-reference/ticketing/users/users/#show-many-users
func (*Client) GetMultipleTickets ¶
GetMultipleTickets gets multiple specified tickets
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-multiple-tickets
func (*Client) GetOrganization ¶
GetOrganization gets a specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#show-organization
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) GetOrganizationTags ¶
GetOrganizationTags get organization tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
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) 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) GetSLAPolicy ¶
GetSLAPolicy returns the specified slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#getting-slas/policies
func (*Client) GetTarget ¶
GetTarget gets a specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#show-target
func (*Client) GetTargets ¶
GetTargets fetches target list ref: https://developer.zendesk.com/rest_api/docs/core/targets#list-targets
func (*Client) GetTicket ¶
GetTicket gets a specified ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-ticket
func (*Client) GetTicketAudit ¶
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) GetTicketField ¶
GetTicketField gets a specified ticket field ref: https://developer.zendesk.com/rest_api/docs/support/ticket_fields#show-ticket-field
func (*Client) GetTicketFields ¶
GetTicketFields fetches ticket field list ref: https://developer.zendesk.com/rest_api/docs/core/ticket_fields#list-ticket-fields
func (*Client) GetTicketForm ¶
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) GetTicketTags ¶
GetTicketTags get ticket tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetTickets ¶
GetTickets get ticket list
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#list-tickets
func (*Client) GetTicketsFromView ¶
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) GetTrigger ¶
GetTrigger returns the specified trigger
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) GetUser ¶
GetUser get an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#show-user
func (*Client) GetUserFields ¶
func (z *Client) GetUserFields(ctx context.Context, opts *UserFieldListOptions) ([]UserField, Page, error)
GetUserFields fetch trigger list
https://developer.zendesk.com/rest_api/docs/support/user_fields#list-user-fields
func (*Client) GetUserRelated ¶
GetUserRelated retrieves user related user information ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user-related-information
func (*Client) GetUserTags ¶
GetUserTags get user tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetUserTicketsRequested ¶
func (z *Client) GetUserTicketsRequested(ctx context.Context, userID int64, opts *TicketListOptions) ([]Ticket, Page, error)
GetTickets get all tickets requested by a user
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#list-tickets
func (*Client) GetUsers ¶
GetUsers fetch user list https://developer.zendesk.com/api-reference/ticketing/users/users/#list-users
func (*Client) GetView ¶
GetView gets a given view ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#show-view
func (*Client) GetViews ¶
GetViews gets all views ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#list-views
func (*Client) GetWebhook ¶
GetWebhook gets a specified webhook.
https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#show-webhook
func (*Client) ListTicketComments ¶
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) MakeEndUserIdentityPrimary ¶
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 ¶
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) SearchUsers ¶
SearchUsers Returns an array of users who meet the search criteria. https://developer.zendesk.com/api-reference/ticketing/users/users/#search-users
func (*Client) SetCredential ¶
func (z *Client) SetCredential(cred Credential)
SetCredential saves credential in client. It will be set to request header when call API
func (*Client) SetEndpointURL ¶
SetEndpointURL replace full URL of endpoint without subdomain validation. This is mainly used for testing to point to mock API server.
func (*Client) SetHeader ¶
SetHeader saves HTTP header in client. It will be included all API request
func (*Client) SetSubdomain ¶
SetSubdomain saves subdomain in client. It will be used when call API
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 ¶
UpdateBrand updates a brand with the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#update-brand
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) UpdateGroup ¶
UpdateGroup updates a group with the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#update-group
func (*Client) UpdateMacro ¶
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) 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) UpdateTarget ¶
UpdateTarget updates a field with the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#update-target
func (*Client) UpdateTicket ¶
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 ¶
UpdateTrigger updates the specified trigger and returns the updated one
ref: https://developer.zendesk.com/rest_api/docs/support/triggers#update-trigger
func (*Client) UpdateUser ¶
UpdateUser update an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#update-user
func (*Client) UpdateWebhook ¶
UpdateWebhook updates a webhook with the specified webhook.
https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#update-webhook
func (*Client) UploadAttachment ¶
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
func (*Client) VerifyEndUserIdentity ¶
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 Configuration ¶
type Configuration map[string]interface{}
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 Credential ¶
Credential is interface of API credential
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.
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,omitempty"` 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 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)
}
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) DeleteDynamicContentItem(ctx context.Context, id int64) 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
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,omitempty"` 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 Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error an error type containing the http response from zendesk
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"` 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) 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)
}
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 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 Macro ¶
type Macro struct { Actions []MacroAction `json:"actions"` Active bool `json:"active"` CreatedAt time.Time `json:"created_at,omitempty"` Description interface{} `json:"description"` ID int64 `json:"id,omitempty"` Position int `json:"position,omitempty"` Restriction interface{} `json:"restriction"` 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 }
MacroAPI an interface containing all macro related methods
type MacroAction ¶
MacroAction is definition of what the macro does to the ticket
ref: https://develop.zendesk.com/hc/en-us/articles/360056760874-Support-API-Actions-reference
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 OptionsError ¶
type OptionsError struct {
// contains filtered or unexported fields
}
OptionsError is an error type for invalid option argument.
func (*OptionsError) Error ¶
func (e *OptionsError) Error() string
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"` 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) UpdateOrganization(ctx context.Context, orgID int64, org Organization) (Organization, error) DeleteOrganization(ctx context.Context, orgID int64) error }
OrganizationAPI an interface containing all methods associated with zendesk organizations
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)
}
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 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
type PageOptions ¶
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 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 Requester ¶
type Requester struct { Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` LocaleID string `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 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,omitempty"` Filter struct { All []SLAPolicyFilter `json:"all"` Any []SLAPolicyFilter `json:"any"` } `json:"filter"` PolicyMetrics []SLAPolicyMetric `json:"policy_metrics,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 }
SLAPolicyAPI an interface containing all slaPolicy related methods
type SLAPolicyFilter ¶
type SLAPolicyFilter struct { Field string `json:"field"` Operator string `json:"operator"` Value string `json:"value"` }
SLAPolicyFilter zendesk slaPolicy condition
ref: https://developer.zendesk.com/rest_api/docs/core/slas/policies#conditions-reference
type SLAPolicyListOptions ¶
type SLAPolicyListOptions struct { PageOptions Active bool `url:"active,omitempty"` 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 SearchAPI ¶
type SearchAPI interface { Search(ctx context.Context, opts *SearchOptions) (SearchResults, Page, error) SearchCount(ctx context.Context, opts *CountOptions) (int, error) }
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 { ExternalIDs string `json:"external_ids,omitempty" url:"external_ids,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 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,omitempty"` // 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"` Recipient string `json:"recipient,omitempty"` RequesterID int64 `json:"requester_id,omitempty"` SubmitterID int64 `json:"submitter_id,omitempty"` AssigneeID int64 `json:"assignee_id,omitempty"` AssigneeEmail string `json:"assignee_email,omitempty"` OrganizationID int64 `json:"organization_id,omitempty"` GroupID int64 `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"` }
type TicketAPI ¶
type TicketAPI interface { GetTickets(ctx context.Context, opts *TicketListOptions) ([]Ticket, Page, error) 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) }
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) ([]TicketComment, 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,omitempty"` Required bool `json:"required,omitempty"` CollapsedForAgents bool `json:"collapsed_for_agents,omitempty"` 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,omitempty"` EditableInPortal bool `json:"editable_in_portal,omitempty"` RequiredInPortal bool `json:"required_in_portal,omitempty"` 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
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 }
TicketFieldAPI an interface containing all of 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 TicketForm ¶
type TicketForm struct { ID int64 `json:"id,omitempty"` URL string `json:"url,omitempty"` Name string `json:"name"` RawName string `json:"raw_name,omitempty"` DisplayName string `json:"display_name,omitempty"` RawDisplayName string `json:"raw_display_name,omitempty"` Position int64 `json:"position"` Active bool `json:"active,omitempty"` EndUserVisible bool `json:"end_user_visible,omitempty"` Default bool `json:"default,omitempty"` TicketFieldIDs []int64 `json:"ticket_field_ids,omitempty"` InAllBrands bool `json:"in_all_brands,omitempty"` RestrictedBrandIDs []int64 `json:"restricted_brand_ids,omitempty"` }
TicketForm is JSON payload struct
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) }
TicketFormAPI an interface containing all ticket form related methods
type TicketFormListOptions ¶
type TicketFormListOptions struct { PageOptions Active bool `url:"active,omitempty"` 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 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"` }
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,omitempty"` Position int64 `json:"position,omitempty"` Conditions struct { All []TriggerCondition `json:"all"` Any []TriggerCondition `json:"any"` } `json:"conditions"` Actions []TriggerAction `json:"actions"` Description string `json:"description,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,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 }
TriggerAPI an interface containing all trigger related methods
type TriggerAction ¶
type TriggerAction struct { Field string `json:"field"` Value interface{} `json:"value"` }
TriggerAction is zendesk trigger action
ref: https://developer.zendesk.com/rest_api/docs/core/triggers#actions
type TriggerCondition ¶
type TriggerCondition struct { Field string `json:"field"` Operator string `json:"operator"` Value interface{} `json:"value"` }
TriggerCondition zendesk trigger condition
ref: https://developer.zendesk.com/rest_api/docs/core/triggers#conditions-reference
type TriggerListOptions ¶
type TriggerListOptions struct { PageOptions Active bool `url:"active,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 ¶
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,omitempty"` 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"` 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) 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) }
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,omitempty"` System bool `json:"system,omitempty"` RegexpForValidation string `json:"regexp_for_validation,omitempty"` Tag string `json:"tag,omitempty"` CustomFieldOptions []CustomFieldOption `json:"custom_field_options"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
UserField is struct for user_field payload
type UserFieldAPI ¶
type UserFieldListOptions ¶
type UserFieldListOptions struct {
PageOptions
}
type UserFields ¶
type UserFields map[string]interface{}
UserFields is a dictionary of custom user related fields
type UserIdentitiesAPI ¶
type UserIdentitiesAPI interface {
GetEndUserIdentites(ctx context.Context, opts *UserIdentityListOptions) ([]UserIdentity, Page, error)
}
type UserIdentity ¶
type UserIdentity struct { ID int64 `json:"id,omitempty"` CreatedAt string `json:"created_at,omitempty"` DeliverableState string `json:"deliverable_state,omitempty"` Primary bool `json:"primary,omitempty"` IDType string `json:"type,omitempty"` UndeliverableCount int64 `json:"undeliverable_count,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` URL string `json:"url,omitempty"` UserID int64 `json:"user_id,omitempty"` Value string `json:"value,omitempty"` Verified bool `json:"verified,omitempty"` }
UserIdentity is struct for user_field payload
type UserIdentityListOptions ¶
type UserIdentityListOptions struct {
PageOptions
}
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 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 View ¶
type View struct { ID int64 `json:"id,omitempty"` Active bool `json:"active"` Description string `json:"description"` Position int64 `json:"position"` Title string `json:"title"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,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) GetTicketsFromView(context.Context, int64) ([]Ticket, error) }
ViewAPI encapsulates methods on view
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"` 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 WebhookAuthentication ¶
type WebhookSigningSecret ¶
Source Files ¶
- action_types.go
- api.go
- attachment.go
- automation.go
- brand.go
- collaborators.go
- condition_types.go
- credential.go
- cursor.go
- custom_field_option.go
- custom_role.go
- dynamic_content.go
- error.go
- group.go
- group_membership.go
- locale.go
- locale_types.go
- macro.go
- organization.go
- organization_membership.go
- page.go
- search.go
- sla_policy.go
- tag.go
- target.go
- ticket.go
- ticket_audit.go
- ticket_comment.go
- ticket_field.go
- ticket_form.go
- topics.go
- trigger.go
- user.go
- user_field.go
- user_identities.go
- via_types.go
- view.go
- webhook.go
- zendesk.go