diff options
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 693008734..091f33844 100644 --- a/model/client4.go +++ b/model/client4.go @@ -318,6 +318,10 @@ func (c *Client4) GetAnalyticsRoute() string { return fmt.Sprintf("/analytics") } +func (c *Client4) GetTimezonesRoute() string { + return fmt.Sprintf(c.GetSystemRoute() + "/timezones") +} + func (c *Client4) DoApiGet(url string, etag string) (*http.Response, *AppError) { return c.DoApiRequest(http.MethodGet, c.ApiUrl+url, "", etag) } @@ -3173,6 +3177,18 @@ func (c *Client4) DeleteReaction(reaction *Reaction) (bool, *Response) { } } +// Timezone Section + +// GetSupportedTimezone returns a page of supported timezones on the system. +func (c *Client4) GetSupportedTimezone() (SupportedTimezones, *Response) { + if r, err := c.DoApiGet(c.GetTimezonesRoute(), ""); err != nil { + return nil, BuildErrorResponse(r, err) + } else { + defer closeBody(r) + return TimezonesFromJson(r.Body), BuildResponse(r) + } +} + // Open Graph Metadata Section // OpenGraph return the open graph metadata for a particular url if the site have the metadata |