Documentation
¶
Index ¶
- func DocsPaginateAll(ctx context.Context, fn DocsListFunc, params url.Values, wrapperKey string, ...) ([]json.RawMessage, *types.DocsPageInfo, error)
- func ExtractDocsItems(data json.RawMessage, key string) (json.RawMessage, *types.DocsPageInfo, error)
- func ExtractEmbedded(data json.RawMessage, key string) (json.RawMessage, *types.PageInfo, error)
- func PaginateAll(ctx context.Context, fn ListFunc, params url.Values, embeddedKey string, ...) ([]json.RawMessage, *types.PageInfo, error)
- type Client
- func (c *Client) CreateAttachment(ctx context.Context, convID string, threadID string, body any) error
- func (c *Client) CreateChatThread(ctx context.Context, convID string, body any) error
- func (c *Client) CreateConversation(ctx context.Context, body any) (string, error)
- func (c *Client) CreateCustomer(ctx context.Context, body any) (string, error)
- func (c *Client) CreateCustomerThread(ctx context.Context, convID string, body any) error
- func (c *Client) CreateNote(ctx context.Context, convID string, body any) error
- func (c *Client) CreateOrganization(ctx context.Context, body any) (string, error)
- func (c *Client) CreateOrganizationProperty(ctx context.Context, body any) (string, error)
- func (c *Client) CreatePhoneThread(ctx context.Context, convID string, body any) error
- func (c *Client) CreateReply(ctx context.Context, convID string, body any) error
- func (c *Client) CreateSavedReply(ctx context.Context, body any) (string, error)
- func (c *Client) CreateWebhook(ctx context.Context, body any) (string, error)
- func (c *Client) DeleteAttachment(ctx context.Context, convID string, attachmentID string) error
- func (c *Client) DeleteConversation(ctx context.Context, id string) error
- func (c *Client) DeleteConversationSnooze(ctx context.Context, id string) error
- func (c *Client) DeleteCustomer(ctx context.Context, id string, params url.Values) error
- func (c *Client) DeleteOrganization(ctx context.Context, id string) error
- func (c *Client) DeleteOrganizationProperty(ctx context.Context, id string) error
- func (c *Client) DeleteSavedReply(ctx context.Context, id string) error
- func (c *Client) DeleteUser(ctx context.Context, id string) error
- func (c *Client) DeleteWebhook(ctx context.Context, id string) error
- func (c *Client) GetAttachmentData(ctx context.Context, convID string, attachmentID string) (json.RawMessage, error)
- func (c *Client) GetConversation(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *Client) GetConversationProperty(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetCustomer(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *Client) GetCustomerProperty(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetMailbox(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetMailboxRouting(ctx context.Context, mailboxID string) (json.RawMessage, error)
- func (c *Client) GetOrganization(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetOrganizationProperty(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetRating(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetReport(ctx context.Context, family string, params url.Values) (json.RawMessage, error)
- func (c *Client) GetResourceOwner(ctx context.Context) (json.RawMessage, error)
- func (c *Client) GetSavedReply(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetTag(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetThreadSource(ctx context.Context, convID string, threadID string) (json.RawMessage, error)
- func (c *Client) GetThreadSourceRFC822(ctx context.Context, convID string, threadID string) ([]byte, error)
- func (c *Client) GetUser(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetUserStatus(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) GetWebhook(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) ListConversationProperties(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListConversations(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListCustomerProperties(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListCustomers(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListMailboxCustomFields(ctx context.Context, mailboxID string, params url.Values) (json.RawMessage, error)
- func (c *Client) ListMailboxFolders(ctx context.Context, mailboxID string, params url.Values) (json.RawMessage, error)
- func (c *Client) ListMailboxes(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListOrganizationConversations(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *Client) ListOrganizationCustomers(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *Client) ListOrganizationProperties(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListOrganizations(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListSavedReplies(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListTags(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListTeamMembers(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *Client) ListTeams(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListThreads(ctx context.Context, convID string, params url.Values) (json.RawMessage, error)
- func (c *Client) ListUserStatuses(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListUsers(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListWebhooks(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) ListWorkflows(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *Client) OverwriteCustomer(ctx context.Context, id string, body any) error
- func (c *Client) RunWorkflow(ctx context.Context, id string, body any) error
- func (c *Client) SetUserStatus(ctx context.Context, id string, body any) error
- func (c *Client) UpdateConversation(ctx context.Context, id string, body any) error
- func (c *Client) UpdateConversationFields(ctx context.Context, id string, body any) error
- func (c *Client) UpdateConversationSnooze(ctx context.Context, id string, body any) error
- func (c *Client) UpdateConversationTags(ctx context.Context, id string, body any) error
- func (c *Client) UpdateCustomer(ctx context.Context, id string, body any) error
- func (c *Client) UpdateMailboxRouting(ctx context.Context, mailboxID string, body any) error
- func (c *Client) UpdateOrganization(ctx context.Context, id string, body any) error
- func (c *Client) UpdateOrganizationProperty(ctx context.Context, id string, body any) error
- func (c *Client) UpdateSavedReply(ctx context.Context, id string, body any) error
- func (c *Client) UpdateThread(ctx context.Context, convID string, threadID string, body any) error
- func (c *Client) UpdateWebhook(ctx context.Context, id string, body any) error
- func (c *Client) UpdateWorkflowStatus(ctx context.Context, id string, body any) error
- type ClientAPI
- type DocsClient
- func (c *DocsClient) CreateArticle(ctx context.Context, body any) (json.RawMessage, error)
- func (c *DocsClient) CreateCategory(ctx context.Context, body any) (json.RawMessage, error)
- func (c *DocsClient) CreateCollection(ctx context.Context, body any) (json.RawMessage, error)
- func (c *DocsClient) CreateRedirect(ctx context.Context, body any) (json.RawMessage, error)
- func (c *DocsClient) CreateSite(ctx context.Context, body any) (json.RawMessage, error)
- func (c *DocsClient) DeleteArticle(ctx context.Context, id string) error
- func (c *DocsClient) DeleteArticleDraft(ctx context.Context, articleID string) error
- func (c *DocsClient) DeleteCategory(ctx context.Context, id string) error
- func (c *DocsClient) DeleteCollection(ctx context.Context, id string) error
- func (c *DocsClient) DeleteRedirect(ctx context.Context, id string) error
- func (c *DocsClient) DeleteSite(ctx context.Context, id string) error
- func (c *DocsClient) FindRedirect(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) GetArticle(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) GetCategory(ctx context.Context, id string) (json.RawMessage, error)
- func (c *DocsClient) GetCollection(ctx context.Context, id string) (json.RawMessage, error)
- func (c *DocsClient) GetRedirect(ctx context.Context, id string) (json.RawMessage, error)
- func (c *DocsClient) GetRelatedArticles(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) GetRevision(ctx context.Context, articleID, revisionID string) (json.RawMessage, error)
- func (c *DocsClient) GetSite(ctx context.Context, id string) (json.RawMessage, error)
- func (c *DocsClient) GetSiteRestrictions(ctx context.Context, id string) (json.RawMessage, error)
- func (c *DocsClient) ListArticles(ctx context.Context, collectionID string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ListArticlesByCategory(ctx context.Context, categoryID string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ListCategories(ctx context.Context, collectionID string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ListCollections(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ListRedirects(ctx context.Context, siteID string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ListRevisions(ctx context.Context, articleID string, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ListSites(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) ReorderCategory(ctx context.Context, collectionID string, body any) error
- func (c *DocsClient) SaveArticleDraft(ctx context.Context, articleID string, body any) error
- func (c *DocsClient) SearchArticles(ctx context.Context, params url.Values) (json.RawMessage, error)
- func (c *DocsClient) UpdateArticle(ctx context.Context, id string, body any) error
- func (c *DocsClient) UpdateArticleViewCount(ctx context.Context, id string, body any) error
- func (c *DocsClient) UpdateCategory(ctx context.Context, id string, body any) error
- func (c *DocsClient) UpdateCollection(ctx context.Context, id string, body any) error
- func (c *DocsClient) UpdateRedirect(ctx context.Context, id string, body any) error
- func (c *DocsClient) UpdateSite(ctx context.Context, id string, body any) error
- func (c *DocsClient) UpdateSiteRestrictions(ctx context.Context, id string, body any) error
- func (c *DocsClient) UploadArticleAsset(ctx context.Context, articleID, filePath string) (json.RawMessage, error)
- func (c *DocsClient) UploadArticleSettingsAsset(ctx context.Context, filePath string) (json.RawMessage, error)
- func (c *DocsClient) UploadSettingsAsset(ctx context.Context, filePath string) (json.RawMessage, error)
- type DocsClientAPI
- type DocsListFunc
- type HALResponse
- type ListFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DocsPaginateAll ¶
func DocsPaginateAll(ctx context.Context, fn DocsListFunc, params url.Values, wrapperKey string, noPaginate bool) ([]json.RawMessage, *types.DocsPageInfo, error)
DocsPaginateAll fetches all pages using the given Docs list function. Docs API wraps results as {"<key>":{"page":1,"pages":5,"count":100,"items":[...]}}. If noPaginate is false, only the specified page is returned.
func ExtractDocsItems ¶
func ExtractDocsItems(data json.RawMessage, key string) (json.RawMessage, *types.DocsPageInfo, error)
ExtractDocsItems extracts the items array and page info from a Docs API response. Format: {"<key>":{"page":1,"pages":5,"count":100,"items":[...]}}
func ExtractEmbedded ¶
func ExtractEmbedded(data json.RawMessage, key string) (json.RawMessage, *types.PageInfo, error)
ExtractEmbedded extracts the named array from _embedded.
func PaginateAll ¶
func PaginateAll(ctx context.Context, fn ListFunc, params url.Values, embeddedKey string, noPaginate bool) ([]json.RawMessage, *types.PageInfo, error)
PaginateAll fetches all pages using the given list function and embedded key. If noPaginate is false, only the specified page is returned.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewForTest ¶
NewForTest creates a Client with a custom http.Client and no rate limiter. Used by httptest-based tests only.
func (*Client) CreateAttachment ¶
func (*Client) CreateChatThread ¶
func (*Client) CreateConversation ¶
func (*Client) CreateCustomer ¶
func (*Client) CreateCustomerThread ¶
func (*Client) CreateNote ¶
func (*Client) CreateOrganization ¶
func (*Client) CreateOrganizationProperty ¶
func (*Client) CreatePhoneThread ¶
func (*Client) CreateReply ¶
func (*Client) CreateSavedReply ¶
func (*Client) CreateWebhook ¶
func (*Client) DeleteAttachment ¶
func (*Client) DeleteConversation ¶
func (*Client) DeleteConversationSnooze ¶
func (*Client) DeleteCustomer ¶
func (*Client) DeleteOrganization ¶
func (*Client) DeleteOrganizationProperty ¶
func (*Client) DeleteSavedReply ¶
func (*Client) GetAttachmentData ¶
func (*Client) GetConversation ¶
func (*Client) GetConversationProperty ¶
func (*Client) GetCustomer ¶
func (*Client) GetCustomerProperty ¶
func (*Client) GetMailbox ¶
func (*Client) GetMailboxRouting ¶
func (*Client) GetOrganization ¶
func (*Client) GetOrganizationProperty ¶
func (*Client) GetResourceOwner ¶
func (*Client) GetSavedReply ¶
func (*Client) GetThreadSource ¶
func (*Client) GetThreadSourceRFC822 ¶
func (*Client) GetUserStatus ¶
func (*Client) GetWebhook ¶
func (*Client) ListConversationProperties ¶
func (*Client) ListConversations ¶
func (*Client) ListCustomerProperties ¶
func (*Client) ListCustomers ¶
func (*Client) ListMailboxCustomFields ¶
func (*Client) ListMailboxFolders ¶
func (*Client) ListMailboxes ¶
ListMailboxes returns the raw JSON for mailboxes list.
func (*Client) ListOrganizationConversations ¶
func (*Client) ListOrganizationCustomers ¶
func (*Client) ListOrganizationProperties ¶
func (*Client) ListOrganizations ¶
func (*Client) ListSavedReplies ¶
func (*Client) ListTeamMembers ¶
func (*Client) ListThreads ¶
func (*Client) ListUserStatuses ¶
func (*Client) ListWebhooks ¶
func (*Client) ListWorkflows ¶
func (*Client) OverwriteCustomer ¶
func (*Client) RunWorkflow ¶
func (*Client) SetUserStatus ¶
func (*Client) UpdateConversation ¶
func (*Client) UpdateConversationFields ¶
func (*Client) UpdateConversationSnooze ¶
func (*Client) UpdateConversationTags ¶
func (*Client) UpdateCustomer ¶
func (*Client) UpdateMailboxRouting ¶
func (*Client) UpdateOrganization ¶
func (*Client) UpdateOrganizationProperty ¶
func (*Client) UpdateSavedReply ¶
func (*Client) UpdateThread ¶
func (*Client) UpdateWebhook ¶
type ClientAPI ¶
type ClientAPI interface {
ListMailboxes(ctx context.Context, params url.Values) (json.RawMessage, error)
GetMailbox(ctx context.Context, id string) (json.RawMessage, error)
ListMailboxFolders(ctx context.Context, mailboxID string, params url.Values) (json.RawMessage, error)
ListMailboxCustomFields(ctx context.Context, mailboxID string, params url.Values) (json.RawMessage, error)
GetMailboxRouting(ctx context.Context, mailboxID string) (json.RawMessage, error)
UpdateMailboxRouting(ctx context.Context, mailboxID string, body any) error
ListConversations(ctx context.Context, params url.Values) (json.RawMessage, error)
GetConversation(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
CreateConversation(ctx context.Context, body any) (string, error)
UpdateConversation(ctx context.Context, id string, body any) error
UpdateConversationFields(ctx context.Context, id string, body any) error
UpdateConversationTags(ctx context.Context, id string, body any) error
UpdateConversationSnooze(ctx context.Context, id string, body any) error
DeleteConversationSnooze(ctx context.Context, id string) error
DeleteConversation(ctx context.Context, id string) error
CreateAttachment(ctx context.Context, convID string, threadID string, body any) error
GetAttachmentData(ctx context.Context, convID string, attachmentID string) (json.RawMessage, error)
DeleteAttachment(ctx context.Context, convID string, attachmentID string) error
ListThreads(ctx context.Context, convID string, params url.Values) (json.RawMessage, error)
CreateReply(ctx context.Context, convID string, body any) error
CreateNote(ctx context.Context, convID string, body any) error
CreateChatThread(ctx context.Context, convID string, body any) error
CreateCustomerThread(ctx context.Context, convID string, body any) error
CreatePhoneThread(ctx context.Context, convID string, body any) error
UpdateThread(ctx context.Context, convID string, threadID string, body any) error
GetThreadSource(ctx context.Context, convID string, threadID string) (json.RawMessage, error)
GetThreadSourceRFC822(ctx context.Context, convID string, threadID string) ([]byte, error)
ListCustomers(ctx context.Context, params url.Values) (json.RawMessage, error)
GetCustomer(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
CreateCustomer(ctx context.Context, body any) (string, error)
UpdateCustomer(ctx context.Context, id string, body any) error
OverwriteCustomer(ctx context.Context, id string, body any) error
DeleteCustomer(ctx context.Context, id string, params url.Values) error
ListTags(ctx context.Context, params url.Values) (json.RawMessage, error)
GetTag(ctx context.Context, id string) (json.RawMessage, error)
ListUsers(ctx context.Context, params url.Values) (json.RawMessage, error)
GetUser(ctx context.Context, id string) (json.RawMessage, error)
GetResourceOwner(ctx context.Context) (json.RawMessage, error)
DeleteUser(ctx context.Context, id string) error
ListUserStatuses(ctx context.Context, params url.Values) (json.RawMessage, error)
GetUserStatus(ctx context.Context, id string) (json.RawMessage, error)
SetUserStatus(ctx context.Context, id string, body any) error
ListTeams(ctx context.Context, params url.Values) (json.RawMessage, error)
ListTeamMembers(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
ListWorkflows(ctx context.Context, params url.Values) (json.RawMessage, error)
UpdateWorkflowStatus(ctx context.Context, id string, body any) error
RunWorkflow(ctx context.Context, id string, body any) error
ListWebhooks(ctx context.Context, params url.Values) (json.RawMessage, error)
GetWebhook(ctx context.Context, id string) (json.RawMessage, error)
CreateWebhook(ctx context.Context, body any) (string, error)
UpdateWebhook(ctx context.Context, id string, body any) error
DeleteWebhook(ctx context.Context, id string) error
ListSavedReplies(ctx context.Context, params url.Values) (json.RawMessage, error)
GetSavedReply(ctx context.Context, id string) (json.RawMessage, error)
CreateSavedReply(ctx context.Context, body any) (string, error)
UpdateSavedReply(ctx context.Context, id string, body any) error
DeleteSavedReply(ctx context.Context, id string) error
ListOrganizations(ctx context.Context, params url.Values) (json.RawMessage, error)
GetOrganization(ctx context.Context, id string) (json.RawMessage, error)
CreateOrganization(ctx context.Context, body any) (string, error)
UpdateOrganization(ctx context.Context, id string, body any) error
DeleteOrganization(ctx context.Context, id string) error
ListOrganizationConversations(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
ListOrganizationCustomers(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
ListOrganizationProperties(ctx context.Context, params url.Values) (json.RawMessage, error)
GetOrganizationProperty(ctx context.Context, id string) (json.RawMessage, error)
CreateOrganizationProperty(ctx context.Context, body any) (string, error)
UpdateOrganizationProperty(ctx context.Context, id string, body any) error
DeleteOrganizationProperty(ctx context.Context, id string) error
ListCustomerProperties(ctx context.Context, params url.Values) (json.RawMessage, error)
GetCustomerProperty(ctx context.Context, id string) (json.RawMessage, error)
ListConversationProperties(ctx context.Context, params url.Values) (json.RawMessage, error)
GetConversationProperty(ctx context.Context, id string) (json.RawMessage, error)
GetRating(ctx context.Context, id string) (json.RawMessage, error)
GetReport(ctx context.Context, family string, params url.Values) (json.RawMessage, error)
}
ClientAPI defines the public interface for the HelpScout API client.
type DocsClient ¶
type DocsClient struct {
// contains filtered or unexported fields
}
func NewDocs ¶
func NewDocs(apiKey string, debug bool) *DocsClient
func NewDocsForTest ¶
func NewDocsForTest(httpClient *http.Client, apiKey string) *DocsClient
NewDocsForTest creates a DocsClient with a custom http.Client and no rate limiter.
func (*DocsClient) CreateArticle ¶
func (c *DocsClient) CreateArticle(ctx context.Context, body any) (json.RawMessage, error)
func (*DocsClient) CreateCategory ¶
func (c *DocsClient) CreateCategory(ctx context.Context, body any) (json.RawMessage, error)
func (*DocsClient) CreateCollection ¶
func (c *DocsClient) CreateCollection(ctx context.Context, body any) (json.RawMessage, error)
func (*DocsClient) CreateRedirect ¶
func (c *DocsClient) CreateRedirect(ctx context.Context, body any) (json.RawMessage, error)
func (*DocsClient) CreateSite ¶
func (c *DocsClient) CreateSite(ctx context.Context, body any) (json.RawMessage, error)
func (*DocsClient) DeleteArticle ¶
func (c *DocsClient) DeleteArticle(ctx context.Context, id string) error
func (*DocsClient) DeleteArticleDraft ¶
func (c *DocsClient) DeleteArticleDraft(ctx context.Context, articleID string) error
func (*DocsClient) DeleteCategory ¶
func (c *DocsClient) DeleteCategory(ctx context.Context, id string) error
func (*DocsClient) DeleteCollection ¶
func (c *DocsClient) DeleteCollection(ctx context.Context, id string) error
func (*DocsClient) DeleteRedirect ¶
func (c *DocsClient) DeleteRedirect(ctx context.Context, id string) error
func (*DocsClient) DeleteSite ¶
func (c *DocsClient) DeleteSite(ctx context.Context, id string) error
func (*DocsClient) FindRedirect ¶
func (c *DocsClient) FindRedirect(ctx context.Context, params url.Values) (json.RawMessage, error)
func (*DocsClient) GetArticle ¶
func (c *DocsClient) GetArticle(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
func (*DocsClient) GetCategory ¶
func (c *DocsClient) GetCategory(ctx context.Context, id string) (json.RawMessage, error)
func (*DocsClient) GetCollection ¶
func (c *DocsClient) GetCollection(ctx context.Context, id string) (json.RawMessage, error)
func (*DocsClient) GetRedirect ¶
func (c *DocsClient) GetRedirect(ctx context.Context, id string) (json.RawMessage, error)
func (*DocsClient) GetRelatedArticles ¶
func (c *DocsClient) GetRelatedArticles(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
func (*DocsClient) GetRevision ¶
func (c *DocsClient) GetRevision(ctx context.Context, articleID, revisionID string) (json.RawMessage, error)
func (*DocsClient) GetSite ¶
func (c *DocsClient) GetSite(ctx context.Context, id string) (json.RawMessage, error)
func (*DocsClient) GetSiteRestrictions ¶
func (c *DocsClient) GetSiteRestrictions(ctx context.Context, id string) (json.RawMessage, error)
func (*DocsClient) ListArticles ¶
func (c *DocsClient) ListArticles(ctx context.Context, collectionID string, params url.Values) (json.RawMessage, error)
func (*DocsClient) ListArticlesByCategory ¶
func (c *DocsClient) ListArticlesByCategory(ctx context.Context, categoryID string, params url.Values) (json.RawMessage, error)
func (*DocsClient) ListCategories ¶
func (c *DocsClient) ListCategories(ctx context.Context, collectionID string, params url.Values) (json.RawMessage, error)
func (*DocsClient) ListCollections ¶
func (c *DocsClient) ListCollections(ctx context.Context, params url.Values) (json.RawMessage, error)
func (*DocsClient) ListRedirects ¶
func (c *DocsClient) ListRedirects(ctx context.Context, siteID string, params url.Values) (json.RawMessage, error)
func (*DocsClient) ListRevisions ¶
func (c *DocsClient) ListRevisions(ctx context.Context, articleID string, params url.Values) (json.RawMessage, error)
func (*DocsClient) ListSites ¶
func (c *DocsClient) ListSites(ctx context.Context, params url.Values) (json.RawMessage, error)
func (*DocsClient) ReorderCategory ¶
func (*DocsClient) SaveArticleDraft ¶
func (*DocsClient) SearchArticles ¶
func (c *DocsClient) SearchArticles(ctx context.Context, params url.Values) (json.RawMessage, error)
func (*DocsClient) UpdateArticle ¶
func (*DocsClient) UpdateArticleViewCount ¶
func (*DocsClient) UpdateCategory ¶
func (*DocsClient) UpdateCollection ¶
func (*DocsClient) UpdateRedirect ¶
func (*DocsClient) UpdateSite ¶
func (*DocsClient) UpdateSiteRestrictions ¶
func (*DocsClient) UploadArticleAsset ¶
func (c *DocsClient) UploadArticleAsset(ctx context.Context, articleID, filePath string) (json.RawMessage, error)
func (*DocsClient) UploadArticleSettingsAsset ¶
func (c *DocsClient) UploadArticleSettingsAsset(ctx context.Context, filePath string) (json.RawMessage, error)
func (*DocsClient) UploadSettingsAsset ¶
func (c *DocsClient) UploadSettingsAsset(ctx context.Context, filePath string) (json.RawMessage, error)
type DocsClientAPI ¶
type DocsClientAPI interface {
// Collections
ListCollections(ctx context.Context, params url.Values) (json.RawMessage, error)
GetCollection(ctx context.Context, id string) (json.RawMessage, error)
CreateCollection(ctx context.Context, body any) (json.RawMessage, error)
UpdateCollection(ctx context.Context, id string, body any) error
DeleteCollection(ctx context.Context, id string) error
// Categories
ListCategories(ctx context.Context, collectionID string, params url.Values) (json.RawMessage, error)
GetCategory(ctx context.Context, id string) (json.RawMessage, error)
CreateCategory(ctx context.Context, body any) (json.RawMessage, error)
UpdateCategory(ctx context.Context, id string, body any) error
ReorderCategory(ctx context.Context, collectionID string, body any) error
DeleteCategory(ctx context.Context, id string) error
// Articles
ListArticles(ctx context.Context, collectionID string, params url.Values) (json.RawMessage, error)
ListArticlesByCategory(ctx context.Context, categoryID string, params url.Values) (json.RawMessage, error)
SearchArticles(ctx context.Context, params url.Values) (json.RawMessage, error)
GetArticle(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
GetRelatedArticles(ctx context.Context, id string, params url.Values) (json.RawMessage, error)
ListRevisions(ctx context.Context, articleID string, params url.Values) (json.RawMessage, error)
GetRevision(ctx context.Context, articleID, revisionID string) (json.RawMessage, error)
CreateArticle(ctx context.Context, body any) (json.RawMessage, error)
UpdateArticle(ctx context.Context, id string, body any) error
DeleteArticle(ctx context.Context, id string) error
UploadArticleAsset(ctx context.Context, articleID, filePath string) (json.RawMessage, error)
UpdateArticleViewCount(ctx context.Context, id string, body any) error
SaveArticleDraft(ctx context.Context, articleID string, body any) error
DeleteArticleDraft(ctx context.Context, articleID string) error
// Sites
ListSites(ctx context.Context, params url.Values) (json.RawMessage, error)
GetSite(ctx context.Context, id string) (json.RawMessage, error)
CreateSite(ctx context.Context, body any) (json.RawMessage, error)
UpdateSite(ctx context.Context, id string, body any) error
DeleteSite(ctx context.Context, id string) error
GetSiteRestrictions(ctx context.Context, id string) (json.RawMessage, error)
UpdateSiteRestrictions(ctx context.Context, id string, body any) error
// Redirects
ListRedirects(ctx context.Context, siteID string, params url.Values) (json.RawMessage, error)
FindRedirect(ctx context.Context, params url.Values) (json.RawMessage, error)
GetRedirect(ctx context.Context, id string) (json.RawMessage, error)
CreateRedirect(ctx context.Context, body any) (json.RawMessage, error)
UpdateRedirect(ctx context.Context, id string, body any) error
DeleteRedirect(ctx context.Context, id string) error
// Assets
UploadArticleSettingsAsset(ctx context.Context, filePath string) (json.RawMessage, error)
UploadSettingsAsset(ctx context.Context, filePath string) (json.RawMessage, error)
}
DocsClientAPI defines the public interface for the HelpScout Docs API client.
type DocsListFunc ¶
DocsListFunc is a function that fetches a page of Docs API results.
type HALResponse ¶
type HALResponse struct {
Embedded json.RawMessage `json:"_embedded"`
Page types.PageInfo `json:"page"`
}
HALResponse represents a HAL+JSON list response from HelpScout.