Add trial license api (#14603)
* Initial request trial api creation * Adding test license public certificate * Adding go client method * Applying changes to use production environment * Removing accidentally added strings Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1c9891c65e
Коммит
e0edd2bebb
@@ -5102,3 +5102,14 @@ func (c *Client4) GetChannelMemberCountsByGroup(channelID string, includeTimezon
|
||||
defer closeBody(r)
|
||||
return ChannelMemberCountsByGroupFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
|
||||
// RequestTrialLicense will request a trial license and install it in the server
|
||||
func (c *Client4) RequestTrialLicense(users int) (bool, *Response) {
|
||||
b, _ := json.Marshal(map[string]int{"users": users})
|
||||
r, err := c.DoApiPost("/trial-license", string(b))
|
||||
if err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
}
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
@@ -40,6 +40,20 @@ type Customer struct {
|
||||
Company string `json:"company"`
|
||||
}
|
||||
|
||||
type TrialLicenseRequest struct {
|
||||
ServerID string `json:"server_id"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
SiteURL string `json:"site_url"`
|
||||
SiteName string `json:"site_name"`
|
||||
Users int `json:"users"`
|
||||
}
|
||||
|
||||
func (tlr *TrialLicenseRequest) ToJson() string {
|
||||
b, _ := json.Marshal(tlr)
|
||||
return string(b)
|
||||
}
|
||||
|
||||
type Features struct {
|
||||
Users *int `json:"users"`
|
||||
LDAP *bool `json:"ldap"`
|
||||
|
||||
Ссылка в новой задаче
Block a user