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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ee43bf9a84
Коммит
0bf7aed02e
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user