mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add RequestTrialLicense function to the plugin API (#17551)
* Add RequestTrialLicense function to the plugin API * Fix strings IDs Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ee43bf9a84
commit
0bf7aed02e
@@ -1066,6 +1066,11 @@ type API interface {
|
||||
//
|
||||
// Minimum server version: 5.36
|
||||
PublishPluginClusterEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error
|
||||
|
||||
// RequestTrialLicense requests a trial license and installs it in the server
|
||||
//
|
||||
// Minimum server version: 5.36
|
||||
RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError
|
||||
}
|
||||
|
||||
var handshake = plugin.HandshakeConfig{
|
||||
|
||||
@@ -1127,3 +1127,10 @@ func (api *apiTimerLayer) PublishPluginClusterEvent(ev model.PluginClusterEvent,
|
||||
api.recordTime(startTime, "PublishPluginClusterEvent", _returnsA == nil)
|
||||
return _returnsA
|
||||
}
|
||||
|
||||
func (api *apiTimerLayer) RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError {
|
||||
startTime := timePkg.Now()
|
||||
_returnsA := api.apiImpl.RequestTrialLicense(requesterID, users, termsAccepted, receiveEmailsAccepted)
|
||||
api.recordTime(startTime, "RequestTrialLicense", _returnsA == nil)
|
||||
return _returnsA
|
||||
}
|
||||
|
||||
@@ -5000,3 +5000,34 @@ func (s *apiRPCServer) PublishPluginClusterEvent(args *Z_PublishPluginClusterEve
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_RequestTrialLicenseArgs struct {
|
||||
A string
|
||||
B int
|
||||
C bool
|
||||
D bool
|
||||
}
|
||||
|
||||
type Z_RequestTrialLicenseReturns struct {
|
||||
A *model.AppError
|
||||
}
|
||||
|
||||
func (g *apiRPCClient) RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError {
|
||||
_args := &Z_RequestTrialLicenseArgs{requesterID, users, termsAccepted, receiveEmailsAccepted}
|
||||
_returns := &Z_RequestTrialLicenseReturns{}
|
||||
if err := g.client.Call("Plugin.RequestTrialLicense", _args, _returns); err != nil {
|
||||
log.Printf("RPC call to RequestTrialLicense API failed: %s", err.Error())
|
||||
}
|
||||
return _returns.A
|
||||
}
|
||||
|
||||
func (s *apiRPCServer) RequestTrialLicense(args *Z_RequestTrialLicenseArgs, returns *Z_RequestTrialLicenseReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError
|
||||
}); ok {
|
||||
returns.A = hook.RequestTrialLicense(args.A, args.B, args.C, args.D)
|
||||
} else {
|
||||
return encodableError(fmt.Errorf("API RequestTrialLicense called but not implemented."))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2804,6 +2804,22 @@ func (_m *API) RemoveTeamIcon(teamID string) *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// RequestTrialLicense provides a mock function with given fields: requesterID, users, termsAccepted, receiveEmailsAccepted
|
||||
func (_m *API) RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError {
|
||||
ret := _m.Called(requesterID, users, termsAccepted, receiveEmailsAccepted)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, int, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(requesterID, users, termsAccepted, receiveEmailsAccepted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveConfig provides a mock function with given fields: config
|
||||
func (_m *API) SaveConfig(config *model.Config) *model.AppError {
|
||||
ret := _m.Called(config)
|
||||
|
||||
Reference in New Issue
Block a user