Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Michael Kochell
2022-05-25 12:36:08 -04:00
коммит произвёл GitHub
родитель 54a88fb532
Коммит ea5bfe3fd9
22 изменённых файлов: 634 добавлений и 22 удалений

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

@@ -324,14 +324,14 @@ func (c *Client4) cloudRoute() string {
return "/cloud"
}
func (c *Client4) usageRoute() string {
return "/usage"
}
func (c *Client4) testEmailRoute() string {
return "/email/test"
}
func (c *Client4) usageRoute() string {
return "/usage"
}
func (c *Client4) testSiteURLRoute() string {
return "/site_url/test"
}
@@ -8110,3 +8110,16 @@ func (c *Client4) GetPostsUsage() (*PostsUsage, *Response, error) {
err = json.NewDecoder(r.Body).Decode(&usage)
return usage, BuildResponse(r), err
}
// GetIntegrationsUsage returns usage information on integrations, including the count of enabled integrations
func (c *Client4) GetIntegrationsUsage() (*IntegrationsUsage, *Response, error) {
r, err := c.DoAPIGet(c.usageRoute()+"/integrations", "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var usage *IntegrationsUsage
err = json.NewDecoder(r.Body).Decode(&usage)
return usage, BuildResponse(r), err
}