[MM-31497] - Prevent end users from inviting people and exceeding the free tier limits (#16786)

* [MM-31497] - Prevent end users from inviting people and exceeding the free tier limits

* Update error

* Commit forgotten code

* Chnage impl-1

* Change impl-2

* Remove test

* Include tier status

* Renable permissions check

* Change endpoint name

* Update endpoint

* Update api4/cloud.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Add test for new endpoint

* Format code

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Этот коммит содержится в:
Allan Guwatudde
2021-02-03 18:56:40 +03:00
коммит произвёл GitHub
родитель d489868f28
Коммит ddd9439706
4 изменённых файлов: 49 добавлений и 1 удалений

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

@@ -5752,6 +5752,18 @@ func (c *Client4) GetSubscription() (*Subscription, *Response) {
return subscription, BuildResponse(r)
}
func (c *Client4) GetSubscriptionStats() (*SubscriptionStats, *Response) {
r, appErr := c.DoApiGet(c.GetCloudRoute()+"/subscription/stats", "")
if appErr != nil {
return nil, BuildErrorResponse(r, appErr)
}
defer closeBody(r)
var stats *SubscriptionStats
json.NewDecoder(r.Body).Decode(&stats)
return stats, BuildResponse(r)
}
func (c *Client4) GetInvoicesForSubscription() ([]*Invoice, *Response) {
r, appErr := c.DoApiGet(c.GetCloudRoute()+"/subscription/invoices", "")
if appErr != nil {