Documentation
¶
Index ¶
- Constants
- type AppError
- type Article
- type ArticlePage
- type ArticleResult
- type ArticleSearchPage
- type Attachment
- type CollaboratorEntry
- type Comment
- type CommentPage
- type CreateTicketRequest
- type CustomField
- type GetTicketOptions
- type ListArticlesOptions
- type ListCommentsOptions
- type ListTicketsOptions
- type PageLinks
- type PageMeta
- type Requester
- type SearchArticlesOptions
- type SearchOptions
- type SearchPage
- type SearchResult
- type Ticket
- type TicketPage
- type TicketResult
- type UpdateTicketRequest
- type User
Constants ¶
View Source
const ( ExitSuccess = 0 ExitGeneral = 1 ExitArgError = 2 ExitAuthError = 3 ExitRetryable = 4 ExitNotFound = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct {
Code string `json:"code"`
Message string `json:"message"`
ExitCode int `json:"exitCode"`
RetryAfter int `json:"retryAfter,omitempty"`
}
func NewArgError ¶
func NewAuthError ¶
func NewGeneralError ¶
func NewNotFoundError ¶
func NewRetryableError ¶
type Article ¶ added in v0.3.0
type Article struct {
ID int64 `json:"id"`
Title string `json:"title"`
Body string `json:"body,omitempty"`
AuthorID int64 `json:"author_id,omitempty"`
SectionID int64 `json:"section_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Promoted bool `json:"promoted"`
Draft bool `json:"draft"`
HTMLURL string `json:"html_url,omitempty"`
LabelNames []string `json:"label_names,omitempty"`
Locale string `json:"locale,omitempty"`
}
type ArticlePage ¶ added in v0.3.0
type ArticleResult ¶ added in v0.3.0
type ArticleResult struct {
Article Article `json:"article"`
}
type ArticleSearchPage ¶ added in v0.3.0
type Attachment ¶ added in v0.3.0
type Attachment struct {
ID int64 `json:"id"`
FileName string `json:"file_name"`
ContentURL string `json:"content_url"`
ContentType string `json:"content_type"`
Size int64 `json:"size"`
Inline bool `json:"inline"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Thumbnails []Attachment `json:"thumbnails,omitempty"`
}
func (Attachment) HumanSize ¶ added in v0.4.5
func (a Attachment) HumanSize() string
HumanSize returns a human-readable file size string.
func (Attachment) IsImage ¶ added in v0.4.5
func (a Attachment) IsImage() bool
IsImage returns true if the attachment has an image content type.
type CollaboratorEntry ¶ added in v0.4.5
CollaboratorEntry represents a CC recipient for ticket comments. It can be a user ID, an email address, or a name+email pair.
func (CollaboratorEntry) MarshalJSON ¶ added in v0.4.5
func (c CollaboratorEntry) MarshalJSON() ([]byte, error)
type Comment ¶
type Comment struct {
ID int64 `json:"id,omitempty"`
Body string `json:"body"`
HTMLBody string `json:"html_body,omitempty"`
PlainBody string `json:"plain_body,omitempty"`
Type string `json:"type,omitempty"`
Public *bool `json:"public,omitempty"`
AuthorID int64 `json:"author_id,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type CommentPage ¶ added in v0.3.0
type CreateTicketRequest ¶
type CreateTicketRequest struct {
Subject string `json:"subject"`
Comment Comment `json:"comment"`
Priority string `json:"priority,omitempty"`
Type string `json:"type,omitempty"`
Status string `json:"status,omitempty"`
AssigneeID int64 `json:"assignee_id,omitempty"`
GroupID int64 `json:"group_id,omitempty"`
Tags []string `json:"tags,omitempty"`
CustomFields []CustomField `json:"custom_fields,omitempty"`
RequesterEmail string `json:"-"`
RequesterName string `json:"-"`
Requester *Requester `json:"requester,omitempty"`
}
type CustomField ¶
type CustomField struct {
ID int64 `json:"id"`
Value interface{} `json:"value"`
}
type GetTicketOptions ¶
type GetTicketOptions struct {
Include string
}
type ListArticlesOptions ¶ added in v0.3.0
type ListCommentsOptions ¶ added in v0.3.0
type ListTicketsOptions ¶
type SearchArticlesOptions ¶ added in v0.3.0
type SearchOptions ¶
type SearchPage ¶
type SearchPage struct {
Results []SearchResult `json:"results"`
Users []User `json:"users,omitempty"`
Meta PageMeta `json:"meta"`
Links PageLinks `json:"links"`
Count int `json:"count"`
}
type SearchResult ¶
type Ticket ¶
type Ticket struct {
ID int64 `json:"id"`
URL string `json:"url,omitempty"`
Subject string `json:"subject"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Priority string `json:"priority,omitempty"`
Type string `json:"type,omitempty"`
RequesterID int64 `json:"requester_id,omitempty"`
AssigneeID int64 `json:"assignee_id,omitempty"`
GroupID int64 `json:"group_id,omitempty"`
OrganizationID int64 `json:"organization_id,omitempty"`
Tags []string `json:"tags,omitempty"`
CustomFields []CustomField `json:"custom_fields,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type TicketPage ¶
type TicketResult ¶ added in v0.2.0
type UpdateTicketRequest ¶
type UpdateTicketRequest struct {
Subject string `json:"subject,omitempty"`
Comment *Comment `json:"comment,omitempty"`
Priority string `json:"priority,omitempty"`
Status string `json:"status,omitempty"`
AssigneeID *int64 `json:"assignee_id,omitempty"`
GroupID *int64 `json:"group_id,omitempty"`
Tags []string `json:"tags,omitempty"`
AddTags []string `json:"additional_tags,omitempty"`
RemoveTags []string `json:"remove_tags,omitempty"`
CustomFields []CustomField `json:"custom_fields,omitempty"`
AdditionalCollaborators []CollaboratorEntry `json:"additional_collaborators,omitempty"`
SafeUpdate bool `json:"safe_update,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.