Merge branch 'master' into mark-as-unread

Этот коммит содержится в:
Harrison Healey
2019-09-10 15:34:29 -04:00
родитель 3629f26bb9 63552416fb
Коммит 42e927cc3f
197 изменённых файлов: 5210 добавлений и 686 удалений

Просмотреть файл

@@ -268,6 +268,10 @@ func (c *Client4) GetTestEmailRoute() string {
return fmt.Sprintf("/email/test")
}
func (c *Client4) GetTestSiteURLRoute() string {
return fmt.Sprintf("/site_url/test")
}
func (c *Client4) GetTestS3Route() string {
return fmt.Sprintf("/file/s3_test")
}
@@ -2922,6 +2926,18 @@ func (c *Client4) TestEmail(config *Config) (bool, *Response) {
return CheckStatusOK(r), BuildResponse(r)
}
// TestSiteURL will test the validity of a site URL.
func (c *Client4) TestSiteURL(siteURL string) (bool, *Response) {
requestBody := make(map[string]string)
requestBody["site_url"] = siteURL
r, err := c.DoApiPost(c.GetTestSiteURLRoute(), MapToJson(requestBody))
if err != nil {
return false, BuildErrorResponse(r, err)
}
defer closeBody(r)
return CheckStatusOK(r), BuildResponse(r)
}
// TestS3Connection will attempt to connect to the AWS S3.
func (c *Client4) TestS3Connection(config *Config) (bool, *Response) {
r, err := c.DoApiPost(c.GetTestS3Route(), config.ToJson())