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 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) 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) DeleteAutomation(ctx context.Context, id int64) error
- func (z *Client) DeleteBrand(ctx context.Context, brandID int64) error
- func (z *Client) DeleteGroup(ctx context.Context, groupID 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) 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) GetDynamicContentItems(ctx context.Context) ([]DynamicContentItem, Page, error)
- func (z *Client) GetGroup(ctx context.Context, groupID int64) (Group, error)
- func (z *Client) GetGroups(ctx context.Context) ([]Group, Page, error)
- func (z *Client) GetLocales(ctx context.Context) ([]Locale, 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) GetOrganizationTags(ctx context.Context, organizationID int64) ([]Tag, 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) 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) GetUserTags(ctx context.Context, userID int64) ([]Tag, error)
- func (z *Client) GetUsers(ctx context.Context, opts *UserListOptions) ([]User, Page, error)
- func (z *Client) ListTicketComments(ctx context.Context, ticketID int64) ([]TicketComment, error)
- func (z *Client) Search(ctx context.Context, opts *SearchOptions) (SearchResults, 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) UpdateGroup(ctx context.Context, groupID int64, group Group) (Group, 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) UploadAttachment(ctx context.Context, filename string, token string) UploadWriter
- type Collaborator
- type Collaborators
- type Credential
- type Cursor
- type CursorOption
- type CustomField
- type CustomFieldOption
- type DynamicContentAPI
- type DynamicContentItem
- type DynamicContentVariant
- type Error
- type Group
- type GroupAPI
- type Locale
- type LocaleAPI
- type OptionsError
- type Organization
- type OrganizationAPI
- type Page
- type PageOptions
- type Photo
- 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 UserListOptions
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 LocaleENUS = 1 // LocaleES Spanish - español LocaleES = 2 // LocaleDE German - Deutsch LocaleDE = 8 // LocaleZHTW Traditional Chinese - 繁體中文 LocaleZHTW = 9 // LocaleZHCN Simplified Chinese - 简体中文 LocaleZHCN = 10 // LocalePL Polish - polski LocalePL = 13 // LocaleFR French - français LocaleFR = 16 // LocalePTBR Brazilian Portuguese - 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 British English LocaleENGB = 1176 // LocaleENCA Canadian English LocaleENCA = 1181 // LocaleESES European Spanish - español de España LocaleESES = 1186 // LocaleFRCA Canadian French - français canadien LocaleFRCA = 1187 // LocaleES419 Latin American Spanish - español latinoamericano LocaleES419 = 1194 // LocaleENAU Australian English 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 Swiss French - français suisse LocaleFRCH = 1292 // LocaleNLBE Flemish - Nederlands (België) LocaleNLBE = 1293 // LocaleDEAT Austrian German - Österreichisches Deutsch LocaleDEAT = 1294 // LocaleDECH Swiss High German - Schweizer Hochdeutsch LocaleDECH = 1295 // LocaleSRME Serbian (Montenegro) - srpski (Crna Gora) LocaleSRME = 1298 // LocaleHI Hindi - हिन्दी LocaleHI = 1303 // LocaleMS Malay - Bahasa Melayu LocaleMS = 1307 // LocaleENBE English (Belgium) LocaleENBE = 1350 // LocaleESMX Mexican Spanish - español de 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 BrandAPI DynamicContentAPI GroupAPI LocaleAPI TicketAPI TicketFieldAPI TicketFormAPI TriggerAPI TargetAPI UserAPI UserFieldAPI OrganizationAPI SearchAPI SLAPolicyAPI TagAPI TicketAuditAPI TicketCommentAPI }
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
AddTicketTags add tags to ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags
func (*Client) AddUserTags ¶ added in v0.8.1
AddUserTags add tags to user
ref: https://developer.zendesk.com/rest_api/docs/support/tags#add-tags
func (*Client) CreateAutomation ¶ added in v0.8.1
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 v0.8.1
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) CreateOrganization ¶ added in v0.8.1
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 v0.8.1
CreateSLAPolicy creates new slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#create-slaPolicy
func (*Client) CreateTarget ¶ added in v0.8.1
CreateTarget creates new target ref: https://developer.zendesk.com/rest_api/docs/core/targets#create-target
func (*Client) CreateTicket ¶ added in v0.8.1
CreateTicket create a new ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#create-ticket
func (*Client) CreateTicketComment ¶ added in v0.8.1
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/rest_api/docs/core/triggers#create-trigger
func (*Client) DeleteAutomation ¶ added in v0.8.1
DeleteAutomation deletes the specified automation
ref: https://developer.zendesk.com/rest_api/docs/support/automations#delete-automation
func (*Client) DeleteBrand ¶ added in v0.8.1
DeleteBrand deletes the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#delete-brand
func (*Client) DeleteGroup ¶ added in v0.8.1
DeleteGroup deletes the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#delete-group
func (*Client) DeleteOrganization ¶ added in v0.8.1
DeleteOrganization deletes the specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#delete-organization
func (*Client) DeleteSLAPolicy ¶ added in v0.8.1
DeleteSLAPolicy deletes the specified slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#delete-slaPolicy
func (*Client) DeleteTarget ¶ added in v0.8.1
DeleteTarget deletes the specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#delete-target
func (*Client) DeleteTicket ¶ added in v0.8.1
DeleteTicket deletes the specified ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#delete-ticket
func (*Client) DeleteTicketField ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
DeleteTrigger deletes the specified trigger
ref: https://developer.zendesk.com/rest_api/docs/support/triggers#delete-trigger
func (*Client) DeleteUpload ¶ added in v0.8.1
DeleteUpload deletes a previously uploaded file ref: https://developer.zendesk.com/rest_api/docs/support/attachments#delete-upload
func (*Client) GetAllTicketAudits ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
GetAutomation returns the specified automation
ref: https://developer.zendesk.com/rest_api/docs/support/automations#getting-automations
func (*Client) GetAutomations ¶ added in v0.8.1
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 v0.8.1
GetBrand gets a specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#show-brand
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 v0.8.1
GetGroup gets a specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#show-group
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) GetMultipleTickets ¶ added in v0.8.1
GetMultipleTickets gets multiple specified tickets
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-multiple-tickets
func (*Client) GetOrganization ¶ added in v0.8.1
GetOrganization gets a specified organization ref: https://developer.zendesk.com/rest_api/docs/support/organizations#show-organization
func (*Client) GetOrganizationTags ¶ added in v0.8.1
GetOrganizationTags get organization tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetSLAPolicies ¶ added in v0.8.1
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 v0.8.1
GetSLAPolicy returns the specified slaPolicy
ref: https://developer.zendesk.com/rest_api/docs/support/slas/policies#getting-slas/policies
func (*Client) GetTarget ¶ added in v0.8.1
GetTarget gets a specified target ref: https://developer.zendesk.com/rest_api/docs/support/targets#show-target
func (*Client) GetTargets ¶ added in v0.8.1
GetTargets fetches target list ref: https://developer.zendesk.com/rest_api/docs/core/targets#list-targets
func (*Client) GetTicket ¶ added in v0.8.1
GetTicket gets a specified ticket
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#show-ticket
func (*Client) GetTicketAudit ¶ added in v0.8.1
GetTicketAudit show audit ref: https://developer.zendesk.com/rest_api/docs/support/ticket_audits#show-audit
func (*Client) GetTicketAudits ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
GetTicketTags get ticket tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) GetTickets ¶ added in v0.8.1
GetTickets get ticket list
ref: https://developer.zendesk.com/rest_api/docs/support/tickets#list-tickets
func (*Client) GetTrigger ¶ added in v0.8.1
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 v0.8.1
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) GetUserTags ¶ added in v0.8.1
GetUserTags get user tag list
ref: https://developer.zendesk.com/rest_api/docs/support/tags#show-tags
func (*Client) ListTicketComments ¶ added in v0.8.1
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 v0.8.1
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) 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 v0.8.1
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 v0.8.1
UpdateBrand updates a brand with the specified brand ref: https://developer.zendesk.com/rest_api/docs/support/brands#update-brand
func (*Client) UpdateGroup ¶ added in v0.8.1
UpdateGroup updates a group with the specified group ref: https://developer.zendesk.com/rest_api/docs/support/groups#update-group
func (*Client) UpdateOrganization ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
UpdateTicket update an existing ticket ref: https://developer.zendesk.com/rest_api/docs/support/tickets#update-ticket
func (*Client) UpdateTicketField ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
UpdateUser update an existing user ref: https://developer.zendesk.com/rest_api/docs/support/users#update-user
func (*Client) UploadAttachment ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
func (c *Collaborators) List() []interface{}
List return internal array in Collaborators
func (*Collaborators) MarshalJSON ¶ added in v0.8.1
func (c *Collaborators) MarshalJSON() ([]byte, error)
MarshalJSON is marshaller for Collaborators
func (*Collaborators) String ¶ added in v0.8.1
func (c *Collaborators) String() string
String return string formatted for
func (*Collaborators) UnmarshalJSON ¶ added in v0.8.1
func (c *Collaborators) UnmarshalJSON(b []byte) error
UnmarshalJSON is unmarshaller for Collaborators
type Credential ¶
Credential is interface of API credential
type Cursor ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
type CustomField struct { ID int64 `json:"id"` // Valid types are string or []string. Value interface{} `json:"value"` }
func (*CustomField) UnmarshalJSON ¶ added in v0.8.1
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 DynamicContentAPI ¶ added in v0.8.1
type DynamicContentAPI interface { GetDynamicContentItems(ctx context.Context) ([]DynamicContentItem, Page, error) CreateDynamicContentItem(ctx context.Context, item DynamicContentItem) (DynamicContentItem, 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 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 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 OptionsError ¶ added in v0.8.1
type OptionsError struct {
// contains filtered or unexported fields
}
OptionsError is an error type for invalid option argument.
func (*OptionsError) Error ¶ added in v0.8.1
func (e *OptionsError) Error() string
type Organization ¶ added in v0.8.1
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 v0.8.1
type OrganizationAPI interface { 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 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 v0.8.1
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 v0.8.1
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 SLAPolicy ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
type SearchAPI ¶ added in v0.8.1
type SearchAPI interface {
Search(ctx context.Context, opts *SearchOptions) (SearchResults, Page, error)
}
type SearchOptions ¶ added in v0.8.1
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 v0.8.1
type SearchResults struct {
// contains filtered or unexported fields
}
func (*SearchResults) List ¶ added in v0.8.1
func (r *SearchResults) List() []interface{}
List return internal array in Search Results
func (*SearchResults) MarshalJSON ¶ added in v0.8.1
func (r *SearchResults) MarshalJSON() ([]byte, error)
func (*SearchResults) String ¶ added in v0.8.1
func (r *SearchResults) String() string
String return string formatted for Search results
func (*SearchResults) UnmarshalJSON ¶ added in v0.8.1
func (r *SearchResults) UnmarshalJSON(b []byte) error
type TagAPI ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 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"` } `json:"via"` 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"` }
type TicketAPI ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 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"` } `json:"via"` }
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 v0.8.1
func NewPrivateTicketComment(body string, authorID int64) TicketComment
NewPrivateTicketComment generates and returns a new private TicketComment
func NewPublicTicketComment ¶ added in v0.8.1
func NewPublicTicketComment(body string, authorID int64) TicketComment
NewPublicTicketComment generates and returns a new TicketComment
type TicketCommentAPI ¶ added in v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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 v0.8.1
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"` RoleType int64 `json:"role_type,omitempty"` Details string `json:"details,omitempty"` ExternalID string `json:"external_id,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"` DefaultGroupID int64 `json:"default_group_id,omitempty"` Phone string `json:"phone,omitempty"` Photo Attachment `json:"photo,omitempty"` RestrictedAgent bool `json:"restricted_agent,omitempty"` Role string `json:"role,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"` //TODO: UserFields UserFields 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 { 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) UpdateUser(ctx context.Context, userID int64, user User) (User, 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 v0.8.1
type UserFieldListOptions ¶ added in v0.8.1
type UserFieldListOptions struct {
PageOptions
}
type UserListOptions ¶ added in v0.8.1
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
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
- dynamic_content.go
- error.go
- group.go
- locale.go
- locale_types.go
- organization.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
- zendesk.go