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) 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) 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) 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) 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) 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) ([]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) 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) Post(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) 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
- 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 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 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 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 LocaleTypeText ¶ added in v0.1.0
LocaleTypeText returns locale type text
func UserRoleText ¶ added in v0.1.0
UserRoleText takes role type and returns role name string
Types ¶
type API ¶ added in v0.1.2
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type BaseAPI interface { Get(ctx context.Context, path string) ([]byte, error) Post(ctx context.Context, path string, data interface{}) ([]byte, 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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
AddTicketTags add tags to ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags
func (*Client) AddUserTags ¶ added in v1.0.0
AddUserTags add tags to user
ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags
func (*Client) CreateAutomation ¶ added in v1.0.0
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 ¶ added in v1.0.0
CreateBrand creates new brand https://developer.zendesk.com/rest_api/docs/support/brands#create-brand
func (*Client) CreateDynamicContentItem ¶ added in v0.1.0
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 ¶ added in v0.1.0
CreateGroup creates new group https://developer.zendesk.com/rest_api/docs/support/groups#create-group
func (*Client) CreateMacro ¶ added in v1.0.0
CreateMacro create a new macro
ref: https://developer.zendesk.com/rest_api/docs/support/macros#create-macro
func (*Client) CreateOrUpdateUser ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
CreateSLAPolicy creates new slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#create-slaPolicy
func (*Client) CreateTarget ¶ added in v1.0.0
CreateTarget creates new target ref: https://developer.zendesk.com/rest_api/docs/core/targets#create-target
func (*Client) CreateTicket ¶ added in v1.0.0
CreateTicket create a new ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#create-ticket
func (*Client) CreateTicketComment ¶ added in v1.0.0
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 ¶ added in v0.1.0
CreateUser creates new user ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#create-user
func (*Client) CreateWebhook ¶ added in v1.0.0
CreateWebhook creates new webhook.
func (*Client) DeleteAutomation ¶ added in v1.0.0
DeleteAutomation deletes the specified automation
ref: https://developer.zendesk.com/rest_api/docs/support/automations#delete-automation
func (*Client) DeleteBrand ¶ added in v1.0.0
DeleteBrand deletes the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#delete-brand
func (*Client) DeleteDynamicContentItem ¶ added in v1.0.0
DeleteDynamicContentItem deletes the specified dynamic content item.
ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#delete-item
func (*Client) DeleteGroup ¶ added in v1.0.0
DeleteGroup deletes the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#delete-group
func (*Client) DeleteMacro ¶ added in v1.0.0
DeleteMacro deletes the specified macro ref: https://developer.zendesk.com/rest_api/docs/support/macros#delete-macro
func (*Client) DeleteOrganization ¶ added in v1.0.0
DeleteOrganization deletes the specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#delete-organization
func (*Client) DeleteSLAPolicy ¶ added in v1.0.0
DeleteSLAPolicy deletes the specified slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#delete-slaPolicy
func (*Client) DeleteTarget ¶ added in v1.0.0
DeleteTarget deletes the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#delete-target
func (*Client) DeleteTicket ¶ added in v1.0.0
DeleteTicket deletes the specified ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#delete-ticket
func (*Client) DeleteTicketField ¶ added in v1.0.0
DeleteTicketField deletes the specified ticket field ref: https://developer.zendesk.com/rest_api/docs/support/ticket_fields#delete-ticket-field
func (*Client) DeleteTicketForm ¶ added in v1.0.0
DeleteTicketForm deletes the specified ticket form ref: https://developer.zendesk.com/rest_api/docs/support/ticket_forms#delete-ticket-form
func (*Client) DeleteTrigger ¶ added in v1.0.0
DeleteTrigger deletes the specified trigger
ref: https://developer.zendesk.com/rest_api/docs/support/triggers#delete-trigger
func (*Client) DeleteUpload ¶ added in v1.0.0
DeleteUpload deletes a previously uploaded file ref: https://developer.zendesk.com/rest_api/docs/support/attachments#delete-upload
func (*Client) DeleteWebhook ¶ added in v1.0.0
DeleteWebhook deletes the specified webhook.
https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#delete-webhook
func (*Client) GetAllTicketAudits ¶ added in v1.0.0
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 ¶ added in v1.0.0
GetAttachment returns the current state of an uploaded attachment ref: https://developer.zendesk.com/rest_api/docs/support/attachments#show-attachment
func (*Client) GetAutomation ¶ added in v1.0.0
GetAutomation returns the specified automation
ref: https://developer.zendesk.com/rest_api/docs/support/automations#getting-automations
func (*Client) GetAutomations ¶ added in v1.0.0
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 ¶ added in v1.0.0
GetBrand gets a specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#show-brand
func (*Client) GetCustomRoles ¶ added in v1.0.0
func (z *Client) GetCustomRoles(ctx context.Context) ([]CustomRole, error)
GetRoles fetch CustomRoles list
func (*Client) GetDynamicContentItem ¶ added in v1.0.0
GetDynamicContentItem returns the specified dynamic content item.
ref: https://developer.zendesk.com/api-reference/ticketing/ticket-management/dynamic_content/#show-item
func (*Client) GetDynamicContentItems ¶ added in v0.1.0
GetDynamicContentItems fetches dynamic content item list
https://developer.zendesk.com/rest_api/docs/support/dynamic_content#list-items
func (*Client) GetGroup ¶ added in v1.0.0
GetGroup gets a specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#show-group
func (*Client) GetGroupMemberships ¶ added in v1.0.0
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 ¶ added in v0.1.0
GetGroups fetches group list https://developer.zendesk.com/rest_api/docs/support/groups#list-groups
func (*Client) GetLocales ¶ added in v0.1.0
GetLocales lists the translation locales available for the account. https://developer.zendesk.com/rest_api/docs/support/locales#list-locales
func (*Client) GetMacro ¶ added in v1.0.0
GetMacro gets a specified macro
ref: https://developer.zendesk.com/rest_api/docs/support/macros#show-macro
func (*Client) GetMacros ¶ added in v1.0.0
GetMacros get macro list
ref: https://developer.zendesk.com/rest_api/docs/support/macros#list-macros
func (*Client) GetManyUsers ¶ added in v1.0.0
GetManyUsers fetch user list https://developer.zendesk.com/api-reference/ticketing/users/users/#show-many-users
func (*Client) GetMultipleTickets ¶ added in v1.0.0
GetMultipleTickets gets multiple specified tickets
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-multiple-tickets
func (*Client) GetOrganization ¶ added in v1.0.0
GetOrganization gets a specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#show-organization
func (*Client) GetOrganizationMemberships ¶ added in v1.0.0
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 ¶ added in v1.0.0
GetOrganizationTags get organization tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetOrganizations ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
GetSLAPolicy returns the specified slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#getting-slas/policies
func (*Client) GetTarget ¶ added in v1.0.0
GetTarget gets a specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#show-target
func (*Client) GetTargets ¶ added in v1.0.0
GetTargets fetches target list ref: https://developer.zendesk.com/rest_api/docs/core/targets#list-targets
func (*Client) GetTicket ¶ added in v1.0.0
GetTicket gets a specified ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-ticket
func (*Client) GetTicketAudit ¶ added in v1.0.0
GetTicketAudit show audit ref: https://developer.zendesk.com/rest_api/docs/support/ticket_audits#show-audit
func (*Client) GetTicketAudits ¶ added in v1.0.0
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 ¶ added in v0.1.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
GetTicketTags get ticket tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetTickets ¶ added in v1.0.0
GetTickets get ticket list
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#list-tickets
func (*Client) GetTicketsFromView ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
GetUser get an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#show-user
func (*Client) GetUserFields ¶ added in v0.1.0
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 ¶ added in v1.0.0
GetUserRelated retrieves user related user information ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user-related-information
func (*Client) GetUserTags ¶ added in v1.0.0
GetUserTags get user tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetView ¶ added in v1.0.0
GetView gets a given view ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#show-view
func (*Client) GetViews ¶ added in v1.0.0
GetViews gets all views ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#list-views
func (*Client) GetWebhook ¶ added in v1.0.0
GetWebhook gets a specified webhook.
https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#show-webhook
func (*Client) ListTicketComments ¶ added in v1.0.0
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) Search ¶ added in v1.0.0
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 ¶ added in v1.0.0
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) 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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
UpdateBrand updates a brand with the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#update-brand
func (*Client) UpdateDynamicContentItem ¶ added in v1.0.0
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 ¶ added in v1.0.0
UpdateGroup updates a group with the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#update-group
func (*Client) UpdateMacro ¶ added in v1.0.0
UpdateMacro update an existing macro ref: https://developer.zendesk.com/rest_api/docs/support/macros#update-macro
func (*Client) UpdateOrganization ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
UpdateTarget updates a field with the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#update-target
func (*Client) UpdateTicket ¶ added in v1.0.0
UpdateTicket update an existing ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#update-ticket
func (*Client) UpdateTicketField ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
UpdateUser update an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#update-user
func (*Client) UpdateWebhook ¶ added in v1.0.0
UpdateWebhook updates a webhook with the specified webhook.
https://developer.zendesk.com/api-reference/event-connectors/webhooks/webhooks/#update-webhook
func (*Client) UploadAttachment ¶ added in v1.0.0
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 ¶ added in v1.0.0
type Collaborator struct { Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` }
Collaborator is user information for collaborator field value
type Collaborators ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (c *Collaborators) List() []interface{}
List return internal array in Collaborators
func (Collaborators) MarshalJSON ¶ added in v1.0.0
func (c Collaborators) MarshalJSON() ([]byte, error)
MarshalJSON is marshaller for Collaborators
func (*Collaborators) String ¶ added in v1.0.0
func (c *Collaborators) String() string
String return string formatted for
func (*Collaborators) UnmarshalJSON ¶ added in v1.0.0
func (c *Collaborators) UnmarshalJSON(b []byte) error
UnmarshalJSON is unmarshaller for Collaborators
type Configuration ¶ added in v1.0.0
type Configuration map[string]interface{}
Configuration is a dictionary of custom configuration fields
type CountOptions ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type CustomField struct { ID int64 `json:"id"` // Valid types are string or []string. Value interface{} `json:"value"` }
func (*CustomField) UnmarshalJSON ¶ added in v1.0.0
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 ¶ added in v0.1.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type CustomRoleAPI interface {
GetCustomRoles(ctx context.Context) ([]CustomRole, error)
}
CustomRoleAPI an interface containing all CustomRole related methods
type DynamicContentAPI ¶ added in v1.0.0
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 ¶ added in v0.1.0
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 ¶ added in v0.1.0
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 ¶ added in v0.1.2
type Error struct {
// contains filtered or unexported fields
}
Error an error type containing the http response from zendesk
func (Error) Body ¶ added in v0.1.3
func (e Error) Body() io.ReadCloser
Body is the Body of the HTTP response
type GetManyUsersOptions ¶ added in v1.0.0
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 ¶ added in v0.1.0
type Group struct { ID int64 `json:"id,omitempty"` URL string `json:"url,omitempty"` Name string `json:"name"` Deleted bool `json:"deleted,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 ¶ added in v0.1.2
type GroupAPI interface { GetGroups(ctx context.Context) ([]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 GroupMembership ¶ added in v1.0.0
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 ¶ added in v1.0.0
type GroupMembershipAPI interface {
GetGroupMemberships(context.Context, *GroupMembershipListOptions) ([]GroupMembership, Page, error)
}
GroupMembershipAPI is an interface containing group membership related methods
type GroupMembershipListOptions ¶ added in v1.0.0
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 ¶ added in v0.1.0
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 ¶ added in v0.1.2
LocaleAPI an interface containing all of the local related zendesk methods
type Macro ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type OptionsError struct {
// contains filtered or unexported fields
}
OptionsError is an error type for invalid option argument.
func (*OptionsError) Error ¶ added in v1.0.0
func (e *OptionsError) Error() string
type Organization ¶ added in v1.0.0
type Organization struct { ID int64 `json:"id,omitempty"` URL string `json:"url,omitempty"` Name string `json:"name"` DomainNames []string `json:"domain_names"` GroupID int64 `json:"group_id"` Tags []string `json:"tags"` 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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type OrganizationListOptions struct {
PageOptions
}
OrganizationListOptions is options for GetOrganizations
ref: https://developer.zendesk.com/rest_api/docs/support/organizations#list-organizations
type OrganizationMembership ¶ added in v1.0.0
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 ¶ added in v1.0.0
type OrganizationMembershipAPI interface {
GetOrganizationMemberships(context.Context, *OrganizationMembershipListOptions) ([]OrganizationMembership, Page, error)
}
OrganizationMembershipAPI is an interface containing organization membership related methods
type OrganizationMembershipListOptions ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type SearchAPI ¶ added in v1.0.0
type SearchAPI interface { Search(ctx context.Context, opts *SearchOptions) (SearchResults, Page, error) SearchCount(ctx context.Context, opts *CountOptions) (int, error) }
type SearchOptions ¶ added in v1.0.0
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 ¶ added in v1.0.0
type SearchResults struct {
// contains filtered or unexported fields
}
func (*SearchResults) List ¶ added in v1.0.0
func (r *SearchResults) List() []interface{}
List return internal array in Search Results
func (*SearchResults) MarshalJSON ¶ added in v1.0.0
func (r *SearchResults) MarshalJSON() ([]byte, error)
func (*SearchResults) String ¶ added in v1.0.0
func (r *SearchResults) String() string
String return string formatted for Search results
func (*SearchResults) UnmarshalJSON ¶ added in v1.0.0
func (r *SearchResults) UnmarshalJSON(b []byte) error
type TagAPI ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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"` 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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
func NewPrivateTicketComment(body string, authorID int64) TicketComment
NewPrivateTicketComment generates and returns a new private TicketComment
func NewPublicTicketComment ¶ added in v1.0.0
func NewPublicTicketComment(body string, authorID int64) TicketComment
NewPublicTicketComment generates and returns a new TicketComment
type TicketCommentAPI ¶ added in v1.0.0
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 ¶ added in v0.1.2
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 ¶ added in v0.1.2
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v0.1.2
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
UploadWriter is used to write a zendesk attachment
type User ¶ added in v0.1.0
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"` 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 ¶ added in v0.1.2
type UserAPI interface { 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 ¶ added in v0.1.0
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 ¶ added in v1.0.0
type UserFieldListOptions ¶ added in v1.0.0
type UserFieldListOptions struct {
PageOptions
}
type UserFields ¶ added in v1.0.0
type UserFields map[string]interface{}
UserFields is a dictionary of custom user related fields
type UserListOptions ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type WebhookAuthentication ¶ added in v1.0.0
type WebhookSigningSecret ¶ added in v1.0.0
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
- via_types.go
- view.go
- webhook.go
- zendesk.go