Mm 47648 check license expandable (#21770)

* [MM-47648] Handler for check if a subscription is expandable

* Mock cloud regenerate

* PR Webapp test purpose only

* [MM-47648] Refactor and tests for expand stats for a subscription

* Fix typos

* style fix

* has to be revert

* CWS URL to Spinwick

* new spinwick url

* target portal test

* Generate token instead of send licenseId

* Rename

* Rename methods

* Revert public key and cws url

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Said Atrahouch
2022-12-27 12:08:11 +01:00
коммит произвёл GitHub
родитель dc533e59b8
Коммит b9501bc535
6 изменённых файлов: 122 добавлений и 0 удалений

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

@@ -8213,6 +8213,19 @@ func (c *Client4) GetCloudCustomer() (*CloudCustomer, *Response, error) {
return cloudCustomer, BuildResponse(r), nil
}
func (c *Client4) GetExpandStats(licenseId string) (*SubscriptionExpandStatus, *Response, error) {
r, err := c.DoAPIGet(fmt.Sprintf("%s%s?licenseID=%s", c.cloudRoute(), "/subscription/expand", licenseId), "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var subscriptionExpandable *SubscriptionExpandStatus
json.NewDecoder(r.Body).Decode(&subscriptionExpandable)
return subscriptionExpandable, BuildResponse(r), nil
}
func (c *Client4) GetSubscription() (*Subscription, *Response, error) {
r, err := c.DoAPIGet(c.cloudRoute()+"/subscription", "")
if err != nil {