2018-06-25 15:33:13 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
|
|
// Code generated by "make pluginapi"
|
|
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
package plugin
|
|
|
|
|
|
|
|
|
|
import (
|
2018-07-03 12:58:28 -04:00
|
|
|
"fmt"
|
2018-07-27 11:17:29 -04:00
|
|
|
"log"
|
2018-07-03 12:58:28 -04:00
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
saml2 "github.com/mattermost/gosaml2"
|
2023-06-11 01:24:35 -04:00
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
|
|
|
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
2018-06-25 15:33:13 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["OnDeactivate"] = OnDeactivateID
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_OnDeactivateArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_OnDeactivateReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) OnDeactivate() error {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_OnDeactivateArgs{}
|
|
|
|
|
_returns := &Z_OnDeactivateReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[OnDeactivateID] {
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.OnDeactivate", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnDeactivate to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) OnDeactivate(args *Z_OnDeactivateArgs, returns *Z_OnDeactivateReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnDeactivate() error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnDeactivate()
|
2018-09-13 14:31:22 -04:00
|
|
|
returns.A = encodableError(returns.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook OnDeactivate called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["OnConfigurationChange"] = OnConfigurationChangeID
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_OnConfigurationChangeArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_OnConfigurationChangeReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) OnConfigurationChange() error {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_OnConfigurationChangeArgs{}
|
|
|
|
|
_returns := &Z_OnConfigurationChangeReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[OnConfigurationChangeID] {
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.OnConfigurationChange", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnConfigurationChange to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) OnConfigurationChange(args *Z_OnConfigurationChangeArgs, returns *Z_OnConfigurationChangeReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnConfigurationChange() error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnConfigurationChange()
|
2018-09-13 14:31:22 -04:00
|
|
|
returns.A = encodableError(returns.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook OnConfigurationChange called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["ExecuteCommand"] = ExecuteCommandID
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ExecuteCommandArgs struct {
|
2018-07-06 09:07:09 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.CommandArgs
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ExecuteCommandReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.CommandResponse
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) ExecuteCommand(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ExecuteCommandArgs{c, args}
|
|
|
|
|
_returns := &Z_ExecuteCommandReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[ExecuteCommandID] {
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.ExecuteCommand", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call ExecuteCommand to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) ExecuteCommand(args *Z_ExecuteCommandArgs, returns *Z_ExecuteCommandReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2018-07-06 09:07:09 -04:00
|
|
|
ExecuteCommand(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
2018-07-06 09:07:09 -04:00
|
|
|
returns.A, returns.B = hook.ExecuteCommand(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook ExecuteCommand called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-29 12:40:48 -05:00
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserHasBeenCreated"] = UserHasBeenCreatedID
|
2019-01-29 12:40:48 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasBeenCreatedArgs struct {
|
2019-01-29 12:40:48 -05:00
|
|
|
A *Context
|
|
|
|
|
B *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasBeenCreatedReturns struct {
|
2019-01-29 12:40:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) UserHasBeenCreated(c *Context, user *model.User) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserHasBeenCreatedArgs{c, user}
|
|
|
|
|
_returns := &Z_UserHasBeenCreatedReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserHasBeenCreatedID] {
|
2019-01-29 12:40:48 -05:00
|
|
|
if err := g.client.Call("Plugin.UserHasBeenCreated", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasBeenCreated to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserHasBeenCreated(args *Z_UserHasBeenCreatedArgs, returns *Z_UserHasBeenCreatedReturns) error {
|
2019-01-29 12:40:48 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasBeenCreated(c *Context, user *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasBeenCreated(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook UserHasBeenCreated called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserWillLogIn"] = UserWillLogInID
|
2019-01-29 12:40:48 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserWillLogInArgs struct {
|
2019-01-29 12:40:48 -05:00
|
|
|
A *Context
|
|
|
|
|
B *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserWillLogInReturns struct {
|
2019-01-29 12:40:48 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) UserWillLogIn(c *Context, user *model.User) string {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserWillLogInArgs{c, user}
|
|
|
|
|
_returns := &Z_UserWillLogInReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserWillLogInID] {
|
2019-01-29 12:40:48 -05:00
|
|
|
if err := g.client.Call("Plugin.UserWillLogIn", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserWillLogIn to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserWillLogIn(args *Z_UserWillLogInArgs, returns *Z_UserWillLogInReturns) error {
|
2019-01-29 12:40:48 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserWillLogIn(c *Context, user *model.User) string
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UserWillLogIn(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook UserWillLogIn called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserHasLoggedIn"] = UserHasLoggedInID
|
2019-01-29 12:40:48 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasLoggedInArgs struct {
|
2019-01-29 12:40:48 -05:00
|
|
|
A *Context
|
|
|
|
|
B *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasLoggedInReturns struct {
|
2019-01-29 12:40:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) UserHasLoggedIn(c *Context, user *model.User) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserHasLoggedInArgs{c, user}
|
|
|
|
|
_returns := &Z_UserHasLoggedInReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserHasLoggedInID] {
|
2019-01-29 12:40:48 -05:00
|
|
|
if err := g.client.Call("Plugin.UserHasLoggedIn", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasLoggedIn to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserHasLoggedIn(args *Z_UserHasLoggedInArgs, returns *Z_UserHasLoggedInReturns) error {
|
2019-01-29 12:40:48 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasLoggedIn(c *Context, user *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasLoggedIn(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook UserHasLoggedIn called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["MessageHasBeenPosted"] = MessageHasBeenPostedID
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_MessageHasBeenPostedArgs struct {
|
2018-07-06 09:07:09 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.Post
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_MessageHasBeenPostedReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) MessageHasBeenPosted(c *Context, post *model.Post) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_MessageHasBeenPostedArgs{c, post}
|
|
|
|
|
_returns := &Z_MessageHasBeenPostedReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[MessageHasBeenPostedID] {
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.MessageHasBeenPosted", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call MessageHasBeenPosted to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) MessageHasBeenPosted(args *Z_MessageHasBeenPostedArgs, returns *Z_MessageHasBeenPostedReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2018-07-06 09:07:09 -04:00
|
|
|
MessageHasBeenPosted(c *Context, post *model.Post)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
2018-07-06 09:07:09 -04:00
|
|
|
hook.MessageHasBeenPosted(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook MessageHasBeenPosted called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["MessageHasBeenUpdated"] = MessageHasBeenUpdatedID
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_MessageHasBeenUpdatedArgs struct {
|
2018-07-06 09:07:09 -04:00
|
|
|
A *Context
|
2018-06-25 15:33:13 -04:00
|
|
|
B *model.Post
|
2018-07-06 09:07:09 -04:00
|
|
|
C *model.Post
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_MessageHasBeenUpdatedReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) MessageHasBeenUpdated(c *Context, newPost, oldPost *model.Post) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_MessageHasBeenUpdatedArgs{c, newPost, oldPost}
|
|
|
|
|
_returns := &Z_MessageHasBeenUpdatedReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[MessageHasBeenUpdatedID] {
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.MessageHasBeenUpdated", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call MessageHasBeenUpdated to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) MessageHasBeenUpdated(args *Z_MessageHasBeenUpdatedArgs, returns *Z_MessageHasBeenUpdatedReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2018-07-06 09:07:09 -04:00
|
|
|
MessageHasBeenUpdated(c *Context, newPost, oldPost *model.Post)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
2018-07-06 09:07:09 -04:00
|
|
|
hook.MessageHasBeenUpdated(args.A, args.B, args.C)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook MessageHasBeenUpdated called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-14 12:33:22 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["MessageHasBeenDeleted"] = MessageHasBeenDeletedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_MessageHasBeenDeletedArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
B *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_MessageHasBeenDeletedReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) MessageHasBeenDeleted(c *Context, post *model.Post) {
|
|
|
|
|
_args := &Z_MessageHasBeenDeletedArgs{c, post}
|
|
|
|
|
_returns := &Z_MessageHasBeenDeletedReturns{}
|
|
|
|
|
if g.implemented[MessageHasBeenDeletedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.MessageHasBeenDeleted", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call MessageHasBeenDeleted to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) MessageHasBeenDeleted(args *Z_MessageHasBeenDeletedArgs, returns *Z_MessageHasBeenDeletedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
MessageHasBeenDeleted(c *Context, post *model.Post)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.MessageHasBeenDeleted(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook MessageHasBeenDeleted called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["ChannelHasBeenCreated"] = ChannelHasBeenCreatedID
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ChannelHasBeenCreatedArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.Channel
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ChannelHasBeenCreatedReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) ChannelHasBeenCreated(c *Context, channel *model.Channel) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ChannelHasBeenCreatedArgs{c, channel}
|
|
|
|
|
_returns := &Z_ChannelHasBeenCreatedReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[ChannelHasBeenCreatedID] {
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.ChannelHasBeenCreated", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call ChannelHasBeenCreated to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) ChannelHasBeenCreated(args *Z_ChannelHasBeenCreatedArgs, returns *Z_ChannelHasBeenCreatedReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ChannelHasBeenCreated(c *Context, channel *model.Channel)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.ChannelHasBeenCreated(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook ChannelHasBeenCreated called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserHasJoinedChannel"] = UserHasJoinedChannelID
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasJoinedChannelArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.ChannelMember
|
|
|
|
|
C *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasJoinedChannelReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) UserHasJoinedChannel(c *Context, channelMember *model.ChannelMember, actor *model.User) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserHasJoinedChannelArgs{c, channelMember, actor}
|
|
|
|
|
_returns := &Z_UserHasJoinedChannelReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserHasJoinedChannelID] {
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.UserHasJoinedChannel", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasJoinedChannel to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserHasJoinedChannel(args *Z_UserHasJoinedChannelArgs, returns *Z_UserHasJoinedChannelReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasJoinedChannel(c *Context, channelMember *model.ChannelMember, actor *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasJoinedChannel(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook UserHasJoinedChannel called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserHasLeftChannel"] = UserHasLeftChannelID
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasLeftChannelArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.ChannelMember
|
|
|
|
|
C *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasLeftChannelReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) UserHasLeftChannel(c *Context, channelMember *model.ChannelMember, actor *model.User) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserHasLeftChannelArgs{c, channelMember, actor}
|
|
|
|
|
_returns := &Z_UserHasLeftChannelReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserHasLeftChannelID] {
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.UserHasLeftChannel", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasLeftChannel to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserHasLeftChannel(args *Z_UserHasLeftChannelArgs, returns *Z_UserHasLeftChannelReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasLeftChannel(c *Context, channelMember *model.ChannelMember, actor *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasLeftChannel(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook UserHasLeftChannel called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserHasJoinedTeam"] = UserHasJoinedTeamID
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasJoinedTeamArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.TeamMember
|
|
|
|
|
C *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasJoinedTeamReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) UserHasJoinedTeam(c *Context, teamMember *model.TeamMember, actor *model.User) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserHasJoinedTeamArgs{c, teamMember, actor}
|
|
|
|
|
_returns := &Z_UserHasJoinedTeamReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserHasJoinedTeamID] {
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.UserHasJoinedTeam", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasJoinedTeam to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserHasJoinedTeam(args *Z_UserHasJoinedTeamArgs, returns *Z_UserHasJoinedTeamReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasJoinedTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasJoinedTeam(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook UserHasJoinedTeam called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["UserHasLeftTeam"] = UserHasLeftTeamID
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasLeftTeamArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.TeamMember
|
|
|
|
|
C *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UserHasLeftTeamReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *hooksRPCClient) UserHasLeftTeam(c *Context, teamMember *model.TeamMember, actor *model.User) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UserHasLeftTeamArgs{c, teamMember, actor}
|
|
|
|
|
_returns := &Z_UserHasLeftTeamReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[UserHasLeftTeamID] {
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.UserHasLeftTeam", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasLeftTeam to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) UserHasLeftTeam(args *Z_UserHasLeftTeamArgs, returns *Z_UserHasLeftTeamReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasLeftTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasLeftTeam(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("Hook UserHasLeftTeam called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-31 02:06:43 -04:00
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["ReactionHasBeenAdded"] = ReactionHasBeenAddedID
|
2020-10-31 02:06:43 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ReactionHasBeenAddedArgs struct {
|
2020-10-31 02:06:43 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.Reaction
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ReactionHasBeenAddedReturns struct {
|
2020-10-31 02:06:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) ReactionHasBeenAdded(c *Context, reaction *model.Reaction) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ReactionHasBeenAddedArgs{c, reaction}
|
|
|
|
|
_returns := &Z_ReactionHasBeenAddedReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[ReactionHasBeenAddedID] {
|
2020-10-31 02:06:43 -04:00
|
|
|
if err := g.client.Call("Plugin.ReactionHasBeenAdded", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call ReactionHasBeenAdded to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) ReactionHasBeenAdded(args *Z_ReactionHasBeenAddedArgs, returns *Z_ReactionHasBeenAddedReturns) error {
|
2020-10-31 02:06:43 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ReactionHasBeenAdded(c *Context, reaction *model.Reaction)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.ReactionHasBeenAdded(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook ReactionHasBeenAdded called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-18 09:36:56 -05:00
|
|
|
hookNameToId["ReactionHasBeenRemoved"] = ReactionHasBeenRemovedID
|
2020-10-31 02:06:43 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ReactionHasBeenRemovedArgs struct {
|
2020-10-31 02:06:43 -04:00
|
|
|
A *Context
|
|
|
|
|
B *model.Reaction
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ReactionHasBeenRemovedReturns struct {
|
2020-10-31 02:06:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) ReactionHasBeenRemoved(c *Context, reaction *model.Reaction) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ReactionHasBeenRemovedArgs{c, reaction}
|
|
|
|
|
_returns := &Z_ReactionHasBeenRemovedReturns{}
|
2021-02-18 09:36:56 -05:00
|
|
|
if g.implemented[ReactionHasBeenRemovedID] {
|
2020-10-31 02:06:43 -04:00
|
|
|
if err := g.client.Call("Plugin.ReactionHasBeenRemoved", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call ReactionHasBeenRemoved to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *hooksRPCServer) ReactionHasBeenRemoved(args *Z_ReactionHasBeenRemovedArgs, returns *Z_ReactionHasBeenRemovedReturns) error {
|
2020-10-31 02:06:43 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ReactionHasBeenRemoved(c *Context, reaction *model.Reaction)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.ReactionHasBeenRemoved(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook ReactionHasBeenRemoved called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-28 13:59:32 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnPluginClusterEvent"] = OnPluginClusterEventID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnPluginClusterEventArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
B model.PluginClusterEvent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnPluginClusterEventReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnPluginClusterEvent(c *Context, ev model.PluginClusterEvent) {
|
|
|
|
|
_args := &Z_OnPluginClusterEventArgs{c, ev}
|
|
|
|
|
_returns := &Z_OnPluginClusterEventReturns{}
|
|
|
|
|
if g.implemented[OnPluginClusterEventID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnPluginClusterEvent", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnPluginClusterEvent to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnPluginClusterEvent(args *Z_OnPluginClusterEventArgs, returns *Z_OnPluginClusterEventReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnPluginClusterEvent(c *Context, ev model.PluginClusterEvent)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.OnPluginClusterEvent(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnPluginClusterEvent called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-24 04:11:31 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnWebSocketConnect"] = OnWebSocketConnectID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnWebSocketConnectArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnWebSocketConnectReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnWebSocketConnect(webConnID, userID string) {
|
|
|
|
|
_args := &Z_OnWebSocketConnectArgs{webConnID, userID}
|
|
|
|
|
_returns := &Z_OnWebSocketConnectReturns{}
|
|
|
|
|
if g.implemented[OnWebSocketConnectID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnWebSocketConnect", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnWebSocketConnect to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnWebSocketConnect(args *Z_OnWebSocketConnectArgs, returns *Z_OnWebSocketConnectReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnWebSocketConnect(webConnID, userID string)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.OnWebSocketConnect(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnWebSocketConnect called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnWebSocketDisconnect"] = OnWebSocketDisconnectID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnWebSocketDisconnectArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnWebSocketDisconnectReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnWebSocketDisconnect(webConnID, userID string) {
|
|
|
|
|
_args := &Z_OnWebSocketDisconnectArgs{webConnID, userID}
|
|
|
|
|
_returns := &Z_OnWebSocketDisconnectReturns{}
|
|
|
|
|
if g.implemented[OnWebSocketDisconnectID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnWebSocketDisconnect", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnWebSocketDisconnect to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnWebSocketDisconnect(args *Z_OnWebSocketDisconnectArgs, returns *Z_OnWebSocketDisconnectReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnWebSocketDisconnect(webConnID, userID string)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.OnWebSocketDisconnect(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnWebSocketDisconnect called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
hookNameToId["WebSocketMessageHasBeenPosted"] = WebSocketMessageHasBeenPostedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_WebSocketMessageHasBeenPostedArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C *model.WebSocketRequest
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_WebSocketMessageHasBeenPostedReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) WebSocketMessageHasBeenPosted(webConnID, userID string, req *model.WebSocketRequest) {
|
|
|
|
|
_args := &Z_WebSocketMessageHasBeenPostedArgs{webConnID, userID, req}
|
|
|
|
|
_returns := &Z_WebSocketMessageHasBeenPostedReturns{}
|
|
|
|
|
if g.implemented[WebSocketMessageHasBeenPostedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.WebSocketMessageHasBeenPosted", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call WebSocketMessageHasBeenPosted to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) WebSocketMessageHasBeenPosted(args *Z_WebSocketMessageHasBeenPostedArgs, returns *Z_WebSocketMessageHasBeenPostedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
WebSocketMessageHasBeenPosted(webConnID, userID string, req *model.WebSocketRequest)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.WebSocketMessageHasBeenPosted(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook WebSocketMessageHasBeenPosted called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-20 19:46:03 -05:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["RunDataRetention"] = RunDataRetentionID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RunDataRetentionArgs struct {
|
|
|
|
|
A int64
|
|
|
|
|
B int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RunDataRetentionReturns struct {
|
|
|
|
|
A int64
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) RunDataRetention(nowTime, batchSize int64) (int64, error) {
|
|
|
|
|
_args := &Z_RunDataRetentionArgs{nowTime, batchSize}
|
|
|
|
|
_returns := &Z_RunDataRetentionReturns{}
|
|
|
|
|
if g.implemented[RunDataRetentionID] {
|
|
|
|
|
if err := g.client.Call("Plugin.RunDataRetention", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call RunDataRetention to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) RunDataRetention(args *Z_RunDataRetentionArgs, returns *Z_RunDataRetentionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RunDataRetention(nowTime, batchSize int64) (int64, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.RunDataRetention(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook RunDataRetention called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-09 14:29:00 -05:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnInstall"] = OnInstallID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnInstallArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
B model.OnInstallEvent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnInstallReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnInstall(c *Context, event model.OnInstallEvent) error {
|
|
|
|
|
_args := &Z_OnInstallArgs{c, event}
|
|
|
|
|
_returns := &Z_OnInstallReturns{}
|
|
|
|
|
if g.implemented[OnInstallID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnInstall", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnInstall to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnInstall(args *Z_OnInstallArgs, returns *Z_OnInstallReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnInstall(c *Context, event model.OnInstallEvent) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnInstall(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnInstall called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-10 00:20:00 -05:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnSendDailyTelemetry"] = OnSendDailyTelemetryID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSendDailyTelemetryArgs struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSendDailyTelemetryReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnSendDailyTelemetry() {
|
|
|
|
|
_args := &Z_OnSendDailyTelemetryArgs{}
|
|
|
|
|
_returns := &Z_OnSendDailyTelemetryReturns{}
|
|
|
|
|
if g.implemented[OnSendDailyTelemetryID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnSendDailyTelemetry", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnSendDailyTelemetry to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnSendDailyTelemetry(args *Z_OnSendDailyTelemetryArgs, returns *Z_OnSendDailyTelemetryReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnSendDailyTelemetry()
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.OnSendDailyTelemetry()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnSendDailyTelemetry called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 09:05:50 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnCloudLimitsUpdated"] = OnCloudLimitsUpdatedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnCloudLimitsUpdatedArgs struct {
|
|
|
|
|
A *model.ProductLimits
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnCloudLimitsUpdatedReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnCloudLimitsUpdated(limits *model.ProductLimits) {
|
|
|
|
|
_args := &Z_OnCloudLimitsUpdatedArgs{limits}
|
|
|
|
|
_returns := &Z_OnCloudLimitsUpdatedReturns{}
|
|
|
|
|
if g.implemented[OnCloudLimitsUpdatedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnCloudLimitsUpdated", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnCloudLimitsUpdated to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnCloudLimitsUpdated(args *Z_OnCloudLimitsUpdatedArgs, returns *Z_OnCloudLimitsUpdatedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnCloudLimitsUpdated(limits *model.ProductLimits)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.OnCloudLimitsUpdated(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnCloudLimitsUpdated called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-12 20:23:02 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["ConfigurationWillBeSaved"] = ConfigurationWillBeSavedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_ConfigurationWillBeSavedArgs struct {
|
|
|
|
|
A *model.Config
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_ConfigurationWillBeSavedReturns struct {
|
|
|
|
|
A *model.Config
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error) {
|
|
|
|
|
_args := &Z_ConfigurationWillBeSavedArgs{newCfg}
|
|
|
|
|
_returns := &Z_ConfigurationWillBeSavedReturns{}
|
|
|
|
|
if g.implemented[ConfigurationWillBeSavedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.ConfigurationWillBeSaved", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call ConfigurationWillBeSaved to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) ConfigurationWillBeSaved(args *Z_ConfigurationWillBeSavedArgs, returns *Z_ConfigurationWillBeSavedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ConfigurationWillBeSaved(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook ConfigurationWillBeSaved called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-05 09:09:07 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["EmailNotificationWillBeSent"] = EmailNotificationWillBeSentID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_EmailNotificationWillBeSentArgs struct {
|
|
|
|
|
A *model.EmailNotification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_EmailNotificationWillBeSentReturns struct {
|
|
|
|
|
A *model.EmailNotificationContent
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) EmailNotificationWillBeSent(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string) {
|
|
|
|
|
_args := &Z_EmailNotificationWillBeSentArgs{emailNotification}
|
|
|
|
|
_returns := &Z_EmailNotificationWillBeSentReturns{}
|
|
|
|
|
if g.implemented[EmailNotificationWillBeSentID] {
|
|
|
|
|
if err := g.client.Call("Plugin.EmailNotificationWillBeSent", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call EmailNotificationWillBeSent to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) EmailNotificationWillBeSent(args *Z_EmailNotificationWillBeSentArgs, returns *Z_EmailNotificationWillBeSentReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
EmailNotificationWillBeSent(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.EmailNotificationWillBeSent(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook EmailNotificationWillBeSent called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-18 12:01:50 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["NotificationWillBePushed"] = NotificationWillBePushedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_NotificationWillBePushedArgs struct {
|
2023-08-24 12:33:53 -04:00
|
|
|
A *model.PushNotification
|
|
|
|
|
B string
|
2023-08-18 12:01:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_NotificationWillBePushedReturns struct {
|
2023-08-24 12:33:53 -04:00
|
|
|
A *model.PushNotification
|
|
|
|
|
B string
|
2023-08-18 12:01:50 -04:00
|
|
|
}
|
|
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
func (g *hooksRPCClient) NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string) {
|
|
|
|
|
_args := &Z_NotificationWillBePushedArgs{pushNotification, userID}
|
2023-08-18 12:01:50 -04:00
|
|
|
_returns := &Z_NotificationWillBePushedReturns{}
|
|
|
|
|
if g.implemented[NotificationWillBePushedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.NotificationWillBePushed", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call NotificationWillBePushed to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-24 12:33:53 -04:00
|
|
|
return _returns.A, _returns.B
|
2023-08-18 12:01:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) NotificationWillBePushed(args *Z_NotificationWillBePushedArgs, returns *Z_NotificationWillBePushedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
2023-08-24 12:33:53 -04:00
|
|
|
NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string)
|
2023-08-18 12:01:50 -04:00
|
|
|
}); ok {
|
2023-08-24 12:33:53 -04:00
|
|
|
returns.A, returns.B = hook.NotificationWillBePushed(args.A, args.B)
|
2023-08-18 12:01:50 -04:00
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook NotificationWillBePushed called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-30 02:55:20 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["UserHasBeenDeactivated"] = UserHasBeenDeactivatedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UserHasBeenDeactivatedArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
B *model.User
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UserHasBeenDeactivatedReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) UserHasBeenDeactivated(c *Context, user *model.User) {
|
|
|
|
|
_args := &Z_UserHasBeenDeactivatedArgs{c, user}
|
|
|
|
|
_returns := &Z_UserHasBeenDeactivatedReturns{}
|
|
|
|
|
if g.implemented[UserHasBeenDeactivatedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.UserHasBeenDeactivated", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call UserHasBeenDeactivated to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) UserHasBeenDeactivated(args *Z_UserHasBeenDeactivatedArgs, returns *Z_UserHasBeenDeactivatedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UserHasBeenDeactivated(c *Context, user *model.User)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.UserHasBeenDeactivated(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook UserHasBeenDeactivated called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnSharedChannelsSyncMsg"] = OnSharedChannelsSyncMsgID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsSyncMsgArgs struct {
|
|
|
|
|
A *model.SyncMsg
|
|
|
|
|
B *model.RemoteCluster
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsSyncMsgReturns struct {
|
|
|
|
|
A model.SyncResponse
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error) {
|
|
|
|
|
_args := &Z_OnSharedChannelsSyncMsgArgs{msg, rc}
|
|
|
|
|
_returns := &Z_OnSharedChannelsSyncMsgReturns{}
|
|
|
|
|
if g.implemented[OnSharedChannelsSyncMsgID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnSharedChannelsSyncMsg", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnSharedChannelsSyncMsg to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnSharedChannelsSyncMsg(args *Z_OnSharedChannelsSyncMsgArgs, returns *Z_OnSharedChannelsSyncMsgReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.OnSharedChannelsSyncMsg(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnSharedChannelsSyncMsg called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnSharedChannelsPing"] = OnSharedChannelsPingID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsPingArgs struct {
|
|
|
|
|
A *model.RemoteCluster
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsPingReturns struct {
|
|
|
|
|
A bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnSharedChannelsPing(rc *model.RemoteCluster) bool {
|
|
|
|
|
_args := &Z_OnSharedChannelsPingArgs{rc}
|
|
|
|
|
_returns := &Z_OnSharedChannelsPingReturns{}
|
|
|
|
|
if g.implemented[OnSharedChannelsPingID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnSharedChannelsPing", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnSharedChannelsPing to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnSharedChannelsPing(args *Z_OnSharedChannelsPingArgs, returns *Z_OnSharedChannelsPingReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnSharedChannelsPing(rc *model.RemoteCluster) bool
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnSharedChannelsPing(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnSharedChannelsPing called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-03 12:25:53 -05:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["PreferencesHaveChanged"] = PreferencesHaveChangedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_PreferencesHaveChangedArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
B []model.Preference
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_PreferencesHaveChangedReturns struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) PreferencesHaveChanged(c *Context, preferences []model.Preference) {
|
|
|
|
|
_args := &Z_PreferencesHaveChangedArgs{c, preferences}
|
|
|
|
|
_returns := &Z_PreferencesHaveChangedReturns{}
|
|
|
|
|
if g.implemented[PreferencesHaveChangedID] {
|
|
|
|
|
if err := g.client.Call("Plugin.PreferencesHaveChanged", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call PreferencesHaveChanged to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) PreferencesHaveChanged(args *Z_PreferencesHaveChangedArgs, returns *Z_PreferencesHaveChangedReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
PreferencesHaveChanged(c *Context, preferences []model.Preference)
|
|
|
|
|
}); ok {
|
|
|
|
|
hook.PreferencesHaveChanged(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook PreferencesHaveChanged called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-16 09:48:51 -05:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnSharedChannelsAttachmentSyncMsg"] = OnSharedChannelsAttachmentSyncMsgID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsAttachmentSyncMsgArgs struct {
|
|
|
|
|
A *model.FileInfo
|
|
|
|
|
B *model.Post
|
|
|
|
|
C *model.RemoteCluster
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsAttachmentSyncMsgReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error {
|
|
|
|
|
_args := &Z_OnSharedChannelsAttachmentSyncMsgArgs{fi, post, rc}
|
|
|
|
|
_returns := &Z_OnSharedChannelsAttachmentSyncMsgReturns{}
|
|
|
|
|
if g.implemented[OnSharedChannelsAttachmentSyncMsgID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnSharedChannelsAttachmentSyncMsg", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnSharedChannelsAttachmentSyncMsg to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnSharedChannelsAttachmentSyncMsg(args *Z_OnSharedChannelsAttachmentSyncMsgArgs, returns *Z_OnSharedChannelsAttachmentSyncMsgReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnSharedChannelsAttachmentSyncMsg(args.A, args.B, args.C)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnSharedChannelsAttachmentSyncMsg called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnSharedChannelsProfileImageSyncMsg"] = OnSharedChannelsProfileImageSyncMsgID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsProfileImageSyncMsgArgs struct {
|
|
|
|
|
A *model.User
|
|
|
|
|
B *model.RemoteCluster
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSharedChannelsProfileImageSyncMsgReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error {
|
|
|
|
|
_args := &Z_OnSharedChannelsProfileImageSyncMsgArgs{user, rc}
|
|
|
|
|
_returns := &Z_OnSharedChannelsProfileImageSyncMsgReturns{}
|
|
|
|
|
if g.implemented[OnSharedChannelsProfileImageSyncMsgID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnSharedChannelsProfileImageSyncMsg", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnSharedChannelsProfileImageSyncMsg to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnSharedChannelsProfileImageSyncMsg(args *Z_OnSharedChannelsProfileImageSyncMsgArgs, returns *Z_OnSharedChannelsProfileImageSyncMsgReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnSharedChannelsProfileImageSyncMsg(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnSharedChannelsProfileImageSyncMsg called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-12 04:05:58 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["GenerateSupportData"] = GenerateSupportDataID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GenerateSupportDataArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GenerateSupportDataReturns struct {
|
|
|
|
|
A []*model.FileData
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) GenerateSupportData(c *Context) ([]*model.FileData, error) {
|
|
|
|
|
_args := &Z_GenerateSupportDataArgs{c}
|
|
|
|
|
_returns := &Z_GenerateSupportDataReturns{}
|
|
|
|
|
if g.implemented[GenerateSupportDataID] {
|
|
|
|
|
if err := g.client.Call("Plugin.GenerateSupportData", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call GenerateSupportData to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) GenerateSupportData(args *Z_GenerateSupportDataArgs, returns *Z_GenerateSupportDataReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GenerateSupportData(c *Context) ([]*model.FileData, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GenerateSupportData(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook GenerateSupportData called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
func init() {
|
|
|
|
|
hookNameToId["OnSAMLLogin"] = OnSAMLLoginID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSAMLLoginArgs struct {
|
|
|
|
|
A *Context
|
|
|
|
|
B *model.User
|
|
|
|
|
C *saml2.AssertionInfo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_OnSAMLLoginReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *hooksRPCClient) OnSAMLLogin(c *Context, user *model.User, assertion *saml2.AssertionInfo) error {
|
|
|
|
|
_args := &Z_OnSAMLLoginArgs{c, user, assertion}
|
|
|
|
|
_returns := &Z_OnSAMLLoginReturns{}
|
|
|
|
|
if g.implemented[OnSAMLLoginID] {
|
|
|
|
|
if err := g.client.Call("Plugin.OnSAMLLogin", _args, _returns); err != nil {
|
|
|
|
|
g.log.Error("RPC call OnSAMLLogin to plugin failed.", mlog.Err(err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *hooksRPCServer) OnSAMLLogin(args *Z_OnSAMLLoginArgs, returns *Z_OnSAMLLoginReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OnSAMLLogin(c *Context, user *model.User, assertion *saml2.AssertionInfo) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OnSAMLLogin(args.A, args.B, args.C)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("Hook OnSAMLLogin called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RegisterCommandArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Command
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RegisterCommandReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) RegisterCommand(command *model.Command) error {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_RegisterCommandArgs{command}
|
|
|
|
|
_returns := &Z_RegisterCommandReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.RegisterCommand", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to RegisterCommand API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) RegisterCommand(args *Z_RegisterCommandArgs, returns *Z_RegisterCommandReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RegisterCommand(command *model.Command) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RegisterCommand(args.A)
|
2020-06-11 08:44:50 -04:00
|
|
|
returns.A = encodableError(returns.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API RegisterCommand called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UnregisterCommandArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UnregisterCommandReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UnregisterCommand(teamID, trigger string) error {
|
|
|
|
|
_args := &Z_UnregisterCommandArgs{teamID, trigger}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UnregisterCommandReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UnregisterCommand", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UnregisterCommand API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UnregisterCommand(args *Z_UnregisterCommandArgs, returns *Z_UnregisterCommandReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UnregisterCommand(teamID, trigger string) error
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UnregisterCommand(args.A, args.B)
|
2020-06-11 08:44:50 -04:00
|
|
|
returns.A = encodableError(returns.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UnregisterCommand called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ExecuteSlashCommandArgs struct {
|
2020-07-07 12:31:03 -04:00
|
|
|
A *model.CommandArgs
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ExecuteSlashCommandReturns struct {
|
2020-07-07 12:31:03 -04:00
|
|
|
A *model.CommandResponse
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.CommandResponse, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ExecuteSlashCommandArgs{commandArgs}
|
|
|
|
|
_returns := &Z_ExecuteSlashCommandReturns{}
|
2020-07-07 12:31:03 -04:00
|
|
|
if err := g.client.Call("Plugin.ExecuteSlashCommand", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ExecuteSlashCommand API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) ExecuteSlashCommand(args *Z_ExecuteSlashCommandArgs, returns *Z_ExecuteSlashCommandReturns) error {
|
2020-07-07 12:31:03 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.CommandResponse, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ExecuteSlashCommand(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ExecuteSlashCommand called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetConfigArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetConfigReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.Config
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetConfig() *model.Config {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetConfigArgs{}
|
|
|
|
|
_returns := &Z_GetConfigReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.GetConfig", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetConfig API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetConfig(args *Z_GetConfigArgs, returns *Z_GetConfigReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetConfig() *model.Config
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetConfig()
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetConfig called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUnsanitizedConfigArgs struct {
|
2019-09-03 18:41:52 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUnsanitizedConfigReturns struct {
|
2019-09-03 18:41:52 -04:00
|
|
|
A *model.Config
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetUnsanitizedConfig() *model.Config {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetUnsanitizedConfigArgs{}
|
|
|
|
|
_returns := &Z_GetUnsanitizedConfigReturns{}
|
2019-09-03 18:41:52 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUnsanitizedConfig", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUnsanitizedConfig API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUnsanitizedConfig(args *Z_GetUnsanitizedConfigArgs, returns *Z_GetUnsanitizedConfigReturns) error {
|
2019-09-03 18:41:52 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUnsanitizedConfig() *model.Config
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetUnsanitizedConfig()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUnsanitizedConfig called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SaveConfigArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.Config
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SaveConfigReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) SaveConfig(config *model.Config) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_SaveConfigArgs{config}
|
|
|
|
|
_returns := &Z_SaveConfigReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.SaveConfig", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to SaveConfig API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SaveConfig(args *Z_SaveConfigArgs, returns *Z_SaveConfigReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SaveConfig(config *model.Config) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SaveConfig(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API SaveConfig called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPluginConfigArgs struct {
|
2018-11-19 12:27:15 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPluginConfigReturns struct {
|
2022-07-05 02:46:50 -04:00
|
|
|
A map[string]any
|
2018-11-19 12:27:15 -05:00
|
|
|
}
|
|
|
|
|
|
2022-07-05 02:46:50 -04:00
|
|
|
func (g *apiRPCClient) GetPluginConfig() map[string]any {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPluginConfigArgs{}
|
|
|
|
|
_returns := &Z_GetPluginConfigReturns{}
|
2018-11-19 12:27:15 -05:00
|
|
|
if err := g.client.Call("Plugin.GetPluginConfig", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPluginConfig API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPluginConfig(args *Z_GetPluginConfigArgs, returns *Z_GetPluginConfigReturns) error {
|
2018-11-19 12:27:15 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2022-07-05 02:46:50 -04:00
|
|
|
GetPluginConfig() map[string]any
|
2018-11-19 12:27:15 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetPluginConfig()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPluginConfig called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SavePluginConfigArgs struct {
|
2022-07-05 02:46:50 -04:00
|
|
|
A map[string]any
|
2018-11-19 12:27:15 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SavePluginConfigReturns struct {
|
2018-11-19 12:27:15 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-05 02:46:50 -04:00
|
|
|
func (g *apiRPCClient) SavePluginConfig(config map[string]any) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_SavePluginConfigArgs{config}
|
|
|
|
|
_returns := &Z_SavePluginConfigReturns{}
|
2018-11-19 12:27:15 -05:00
|
|
|
if err := g.client.Call("Plugin.SavePluginConfig", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SavePluginConfig API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SavePluginConfig(args *Z_SavePluginConfigArgs, returns *Z_SavePluginConfigReturns) error {
|
2018-11-19 12:27:15 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2022-07-05 02:46:50 -04:00
|
|
|
SavePluginConfig(config map[string]any) *model.AppError
|
2018-11-19 12:27:15 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SavePluginConfig(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SavePluginConfig called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetBundlePathArgs struct {
|
2019-03-18 18:01:26 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetBundlePathReturns struct {
|
2019-03-18 18:01:26 -04:00
|
|
|
A string
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetBundlePath() (string, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetBundlePathArgs{}
|
|
|
|
|
_returns := &Z_GetBundlePathReturns{}
|
2019-03-18 18:01:26 -04:00
|
|
|
if err := g.client.Call("Plugin.GetBundlePath", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetBundlePath API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetBundlePath(args *Z_GetBundlePathArgs, returns *Z_GetBundlePathReturns) error {
|
2019-03-18 18:01:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetBundlePath() (string, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetBundlePath()
|
2020-06-11 08:44:50 -04:00
|
|
|
returns.B = encodableError(returns.B)
|
2019-03-18 18:01:26 -04:00
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetBundlePath called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetLicenseArgs struct {
|
2019-03-13 12:31:47 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetLicenseReturns struct {
|
2019-03-13 12:31:47 -04:00
|
|
|
A *model.License
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetLicense() *model.License {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetLicenseArgs{}
|
|
|
|
|
_returns := &Z_GetLicenseReturns{}
|
2019-03-13 12:31:47 -04:00
|
|
|
if err := g.client.Call("Plugin.GetLicense", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetLicense API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetLicense(args *Z_GetLicenseArgs, returns *Z_GetLicenseReturns) error {
|
2019-03-13 12:31:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetLicense() *model.License
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetLicense()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetLicense called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-20 06:12:58 -04:00
|
|
|
type Z_IsEnterpriseReadyArgs struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_IsEnterpriseReadyReturns struct {
|
|
|
|
|
A bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) IsEnterpriseReady() bool {
|
|
|
|
|
_args := &Z_IsEnterpriseReadyArgs{}
|
|
|
|
|
_returns := &Z_IsEnterpriseReadyReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.IsEnterpriseReady", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to IsEnterpriseReady API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) IsEnterpriseReady(args *Z_IsEnterpriseReadyArgs, returns *Z_IsEnterpriseReadyReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
IsEnterpriseReady() bool
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.IsEnterpriseReady()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API IsEnterpriseReady called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetServerVersionArgs struct {
|
2018-09-27 12:56:47 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetServerVersionReturns struct {
|
2018-09-27 12:56:47 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetServerVersion() string {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetServerVersionArgs{}
|
|
|
|
|
_returns := &Z_GetServerVersionReturns{}
|
2018-09-27 12:56:47 -04:00
|
|
|
if err := g.client.Call("Plugin.GetServerVersion", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetServerVersion API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetServerVersion(args *Z_GetServerVersionArgs, returns *Z_GetServerVersionReturns) error {
|
2018-09-27 12:56:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetServerVersion() string
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetServerVersion()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetServerVersion called but not implemented."))
|
2019-03-13 12:31:47 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetSystemInstallDateArgs struct {
|
2019-03-13 12:31:47 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetSystemInstallDateReturns struct {
|
2019-03-13 12:31:47 -04:00
|
|
|
A int64
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetSystemInstallDate() (int64, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetSystemInstallDateArgs{}
|
|
|
|
|
_returns := &Z_GetSystemInstallDateReturns{}
|
2019-03-13 12:31:47 -04:00
|
|
|
if err := g.client.Call("Plugin.GetSystemInstallDate", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetSystemInstallDate API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetSystemInstallDate(args *Z_GetSystemInstallDateArgs, returns *Z_GetSystemInstallDateReturns) error {
|
2019-03-13 12:31:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetSystemInstallDate() (int64, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetSystemInstallDate()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetSystemInstallDate called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetDiagnosticIdArgs struct {
|
2019-03-13 12:31:47 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetDiagnosticIdReturns struct {
|
2019-03-13 12:31:47 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetDiagnosticId() string {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetDiagnosticIdArgs{}
|
|
|
|
|
_returns := &Z_GetDiagnosticIdReturns{}
|
2019-03-13 12:31:47 -04:00
|
|
|
if err := g.client.Call("Plugin.GetDiagnosticId", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetDiagnosticId API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetDiagnosticId(args *Z_GetDiagnosticIdArgs, returns *Z_GetDiagnosticIdReturns) error {
|
2019-03-13 12:31:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetDiagnosticId() string
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetDiagnosticId()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetDiagnosticId called but not implemented."))
|
2018-09-27 12:56:47 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTelemetryIdArgs struct {
|
2020-09-08 14:30:54 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTelemetryIdReturns struct {
|
2020-09-08 14:30:54 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetTelemetryId() string {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetTelemetryIdArgs{}
|
|
|
|
|
_returns := &Z_GetTelemetryIdReturns{}
|
2020-09-08 14:30:54 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTelemetryId", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetTelemetryId API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTelemetryId(args *Z_GetTelemetryIdArgs, returns *Z_GetTelemetryIdReturns) error {
|
2020-09-08 14:30:54 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetTelemetryId() string
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetTelemetryId()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetTelemetryId called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateUserArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateUserReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) CreateUser(user *model.User) (*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_CreateUserArgs{user}
|
|
|
|
|
_returns := &Z_CreateUserReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.CreateUser", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to CreateUser API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateUser(args *Z_CreateUserArgs, returns *Z_CreateUserReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateUser(user *model.User) (*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateUser(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CreateUser called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteUserArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteUserReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) DeleteUser(userID string) *model.AppError {
|
|
|
|
|
_args := &Z_DeleteUserArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_DeleteUserReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.DeleteUser", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to DeleteUser API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteUser(args *Z_DeleteUserArgs, returns *Z_DeleteUserReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
DeleteUser(userID string) *model.AppError
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteUser(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API DeleteUser called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersArgs struct {
|
2019-01-30 12:55:02 -05:00
|
|
|
A *model.UserGetOptions
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersReturns struct {
|
2019-01-30 12:55:02 -05:00
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 14:55:46 -04:00
|
|
|
func (g *apiRPCClient) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetUsersArgs{options}
|
|
|
|
|
_returns := &Z_GetUsersReturns{}
|
2019-01-30 12:55:02 -05:00
|
|
|
if err := g.client.Call("Plugin.GetUsers", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUsers API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUsers(args *Z_GetUsersArgs, returns *Z_GetUsersReturns) error {
|
2019-01-30 12:55:02 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2019-03-15 14:55:46 -04:00
|
|
|
GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError)
|
2019-01-30 12:55:02 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUsers(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUsers called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-15 10:06:40 -04:00
|
|
|
type Z_GetUsersByIdsArgs struct {
|
|
|
|
|
A []string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetUsersByIdsReturns struct {
|
|
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetUsersByIds(userIDs []string) ([]*model.User, *model.AppError) {
|
|
|
|
|
_args := &Z_GetUsersByIdsArgs{userIDs}
|
|
|
|
|
_returns := &Z_GetUsersByIdsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetUsersByIds", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUsersByIds API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetUsersByIds(args *Z_GetUsersByIdsArgs, returns *Z_GetUsersByIdsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUsersByIds(userIDs []string) ([]*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUsersByIds(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUsersByIds called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetUser(userID string) (*model.User, *model.AppError) {
|
|
|
|
|
_args := &Z_GetUserArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetUserReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUser", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetUser API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUser(args *Z_GetUserArgs, returns *Z_GetUserReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetUser(userID string) (*model.User, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUser(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetUser called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserByEmailArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserByEmailReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetUserByEmail(email string) (*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetUserByEmailArgs{email}
|
|
|
|
|
_returns := &Z_GetUserByEmailReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUserByEmail", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetUserByEmail API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUserByEmail(args *Z_GetUserByEmailArgs, returns *Z_GetUserByEmailReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUserByEmail(email string) (*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUserByEmail(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetUserByEmail called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserByUsernameArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserByUsernameReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetUserByUsername(name string) (*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetUserByUsernameArgs{name}
|
|
|
|
|
_returns := &Z_GetUserByUsernameReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUserByUsername", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetUserByUsername API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUserByUsername(args *Z_GetUserByUsernameArgs, returns *Z_GetUserByUsernameReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUserByUsername(name string) (*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUserByUsername(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetUserByUsername called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersByUsernamesArgs struct {
|
2018-10-18 09:11:30 -04:00
|
|
|
A []string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersByUsernamesReturns struct {
|
2018-10-18 09:11:30 -04:00
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetUsersByUsernames(usernames []string) ([]*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetUsersByUsernamesArgs{usernames}
|
|
|
|
|
_returns := &Z_GetUsersByUsernamesReturns{}
|
2018-10-18 09:11:30 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUsersByUsernames", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUsersByUsernames API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUsersByUsernames(args *Z_GetUsersByUsernamesArgs, returns *Z_GetUsersByUsernamesReturns) error {
|
2018-10-18 09:11:30 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUsersByUsernames(usernames []string) ([]*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUsersByUsernames(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUsersByUsernames called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersInTeamArgs struct {
|
2018-10-15 12:24:26 -04:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersInTeamReturns struct {
|
2018-10-15 12:24:26 -04:00
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetUsersInTeam(teamID string, page int, perPage int) ([]*model.User, *model.AppError) {
|
|
|
|
|
_args := &Z_GetUsersInTeamArgs{teamID, page, perPage}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetUsersInTeamReturns{}
|
2018-10-15 12:24:26 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUsersInTeam", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUsersInTeam API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUsersInTeam(args *Z_GetUsersInTeamArgs, returns *Z_GetUsersInTeamReturns) error {
|
2018-10-15 12:24:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetUsersInTeam(teamID string, page int, perPage int) ([]*model.User, *model.AppError)
|
2018-10-15 12:24:26 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUsersInTeam(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUsersInTeam called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-04 13:50:19 -05:00
|
|
|
type Z_GetPreferenceForUserArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPreferenceForUserReturns struct {
|
|
|
|
|
A model.Preference
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPreferenceForUser(userID, category, name string) (model.Preference, *model.AppError) {
|
|
|
|
|
_args := &Z_GetPreferenceForUserArgs{userID, category, name}
|
|
|
|
|
_returns := &Z_GetPreferenceForUserReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPreferenceForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPreferenceForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPreferenceForUser(args *Z_GetPreferenceForUserArgs, returns *Z_GetPreferenceForUserReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPreferenceForUser(userID, category, name string) (model.Preference, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPreferenceForUser(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPreferenceForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPreferencesForUserArgs struct {
|
2020-05-28 13:15:47 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPreferencesForUserReturns struct {
|
2020-05-28 13:15:47 -04:00
|
|
|
A []model.Preference
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetPreferencesForUser(userID string) ([]model.Preference, *model.AppError) {
|
|
|
|
|
_args := &Z_GetPreferencesForUserArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetPreferencesForUserReturns{}
|
2020-05-28 13:15:47 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPreferencesForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPreferencesForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPreferencesForUser(args *Z_GetPreferencesForUserArgs, returns *Z_GetPreferencesForUserReturns) error {
|
2020-05-28 13:15:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetPreferencesForUser(userID string) ([]model.Preference, *model.AppError)
|
2020-05-28 13:15:47 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPreferencesForUser(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPreferencesForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdatePreferencesForUserArgs struct {
|
2020-05-28 13:15:47 -04:00
|
|
|
A string
|
|
|
|
|
B []model.Preference
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdatePreferencesForUserReturns struct {
|
2020-05-28 13:15:47 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdatePreferencesForUser(userID string, preferences []model.Preference) *model.AppError {
|
|
|
|
|
_args := &Z_UpdatePreferencesForUserArgs{userID, preferences}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdatePreferencesForUserReturns{}
|
2020-05-28 13:15:47 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdatePreferencesForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdatePreferencesForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdatePreferencesForUser(args *Z_UpdatePreferencesForUserArgs, returns *Z_UpdatePreferencesForUserReturns) error {
|
2020-05-28 13:15:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdatePreferencesForUser(userID string, preferences []model.Preference) *model.AppError
|
2020-05-28 13:15:47 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UpdatePreferencesForUser(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdatePreferencesForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeletePreferencesForUserArgs struct {
|
2020-05-28 13:15:47 -04:00
|
|
|
A string
|
|
|
|
|
B []model.Preference
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeletePreferencesForUserReturns struct {
|
2020-05-28 13:15:47 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) DeletePreferencesForUser(userID string, preferences []model.Preference) *model.AppError {
|
|
|
|
|
_args := &Z_DeletePreferencesForUserArgs{userID, preferences}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_DeletePreferencesForUserReturns{}
|
2020-05-28 13:15:47 -04:00
|
|
|
if err := g.client.Call("Plugin.DeletePreferencesForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeletePreferencesForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeletePreferencesForUser(args *Z_DeletePreferencesForUserArgs, returns *Z_DeletePreferencesForUserReturns) error {
|
2020-05-28 13:15:47 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
DeletePreferencesForUser(userID string, preferences []model.Preference) *model.AppError
|
2020-05-28 13:15:47 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeletePreferencesForUser(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeletePreferencesForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
type Z_GetSessionArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetSessionReturns struct {
|
|
|
|
|
A *model.Session
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetSession(sessionID string) (*model.Session, *model.AppError) {
|
|
|
|
|
_args := &Z_GetSessionArgs{sessionID}
|
|
|
|
|
_returns := &Z_GetSessionReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetSession", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetSession API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetSession(args *Z_GetSessionArgs, returns *Z_GetSessionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetSession(sessionID string) (*model.Session, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetSession(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetSession called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateSessionArgs struct {
|
|
|
|
|
A *model.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateSessionReturns struct {
|
|
|
|
|
A *model.Session
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateSession(session *model.Session) (*model.Session, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateSessionArgs{session}
|
|
|
|
|
_returns := &Z_CreateSessionReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateSession", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateSession API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateSession(args *Z_CreateSessionArgs, returns *Z_CreateSessionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateSession(session *model.Session) (*model.Session, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateSession(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateSession called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_ExtendSessionExpiryArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_ExtendSessionExpiryReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ExtendSessionExpiry(sessionID string, newExpiry int64) *model.AppError {
|
|
|
|
|
_args := &Z_ExtendSessionExpiryArgs{sessionID, newExpiry}
|
|
|
|
|
_returns := &Z_ExtendSessionExpiryReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.ExtendSessionExpiry", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ExtendSessionExpiry API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) ExtendSessionExpiry(args *Z_ExtendSessionExpiryArgs, returns *Z_ExtendSessionExpiryReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ExtendSessionExpiry(sessionID string, newExpiry int64) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.ExtendSessionExpiry(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ExtendSessionExpiry called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RevokeSessionArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RevokeSessionReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RevokeSession(sessionID string) *model.AppError {
|
|
|
|
|
_args := &Z_RevokeSessionArgs{sessionID}
|
|
|
|
|
_returns := &Z_RevokeSessionReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RevokeSession", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RevokeSession API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RevokeSession(args *Z_RevokeSessionArgs, returns *Z_RevokeSessionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RevokeSession(sessionID string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RevokeSession(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RevokeSession called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
type Z_CreateUserAccessTokenArgs struct {
|
|
|
|
|
A *model.UserAccessToken
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateUserAccessTokenReturns struct {
|
|
|
|
|
A *model.UserAccessToken
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateUserAccessTokenArgs{token}
|
|
|
|
|
_returns := &Z_CreateUserAccessTokenReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateUserAccessToken", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateUserAccessToken API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateUserAccessToken(args *Z_CreateUserAccessTokenArgs, returns *Z_CreateUserAccessTokenReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateUserAccessToken(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateUserAccessToken called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RevokeUserAccessTokenArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RevokeUserAccessTokenReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RevokeUserAccessToken(tokenID string) *model.AppError {
|
|
|
|
|
_args := &Z_RevokeUserAccessTokenArgs{tokenID}
|
|
|
|
|
_returns := &Z_RevokeUserAccessTokenReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RevokeUserAccessToken", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RevokeUserAccessToken API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RevokeUserAccessToken(args *Z_RevokeUserAccessTokenArgs, returns *Z_RevokeUserAccessTokenReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RevokeUserAccessToken(tokenID string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RevokeUserAccessToken(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RevokeUserAccessToken called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamIconArgs struct {
|
2018-11-16 08:17:42 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamIconReturns struct {
|
2018-11-16 08:17:42 -05:00
|
|
|
A []byte
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamIcon(teamID string) ([]byte, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamIconArgs{teamID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamIconReturns{}
|
2018-11-16 08:17:42 -05:00
|
|
|
if err := g.client.Call("Plugin.GetTeamIcon", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetTeamIcon API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamIcon(args *Z_GetTeamIconArgs, returns *Z_GetTeamIconReturns) error {
|
2018-11-16 08:17:42 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamIcon(teamID string) ([]byte, *model.AppError)
|
2018-11-16 08:17:42 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamIcon(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetTeamIcon called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SetTeamIconArgs struct {
|
2018-11-16 10:52:07 -05:00
|
|
|
A string
|
|
|
|
|
B []byte
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SetTeamIconReturns struct {
|
2018-11-16 10:52:07 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) SetTeamIcon(teamID string, data []byte) *model.AppError {
|
|
|
|
|
_args := &Z_SetTeamIconArgs{teamID, data}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_SetTeamIconReturns{}
|
2018-11-16 10:52:07 -05:00
|
|
|
if err := g.client.Call("Plugin.SetTeamIcon", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SetTeamIcon API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SetTeamIcon(args *Z_SetTeamIconArgs, returns *Z_SetTeamIconReturns) error {
|
2018-11-16 10:52:07 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
SetTeamIcon(teamID string, data []byte) *model.AppError
|
2018-11-16 10:52:07 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SetTeamIcon(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SetTeamIcon called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RemoveTeamIconArgs struct {
|
2018-11-20 09:43:42 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RemoveTeamIconReturns struct {
|
2018-11-20 09:43:42 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) RemoveTeamIcon(teamID string) *model.AppError {
|
|
|
|
|
_args := &Z_RemoveTeamIconArgs{teamID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_RemoveTeamIconReturns{}
|
2018-11-20 09:43:42 -05:00
|
|
|
if err := g.client.Call("Plugin.RemoveTeamIcon", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RemoveTeamIcon API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) RemoveTeamIcon(args *Z_RemoveTeamIconArgs, returns *Z_RemoveTeamIconReturns) error {
|
2018-11-20 09:43:42 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
RemoveTeamIcon(teamID string) *model.AppError
|
2018-11-20 09:43:42 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RemoveTeamIcon(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RemoveTeamIcon called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateUserArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateUserReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) UpdateUser(user *model.User) (*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UpdateUserArgs{user}
|
|
|
|
|
_returns := &Z_UpdateUserReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateUser", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateUser API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateUser(args *Z_UpdateUserArgs, returns *Z_UpdateUserReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateUser(user *model.User) (*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateUser(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateUser called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserStatusArgs struct {
|
2018-07-16 15:49:26 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserStatusReturns struct {
|
2018-07-16 15:49:26 -04:00
|
|
|
A *model.Status
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetUserStatus(userID string) (*model.Status, *model.AppError) {
|
|
|
|
|
_args := &Z_GetUserStatusArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetUserStatusReturns{}
|
2018-07-16 15:49:26 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUserStatus", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetUserStatus API failed: %s", err.Error())
|
2018-07-16 15:49:26 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUserStatus(args *Z_GetUserStatusArgs, returns *Z_GetUserStatusReturns) error {
|
2018-07-16 15:49:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetUserStatus(userID string) (*model.Status, *model.AppError)
|
2018-07-16 15:49:26 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUserStatus(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetUserStatus called but not implemented."))
|
2018-07-16 15:49:26 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserStatusesByIdsArgs struct {
|
2018-07-16 15:49:26 -04:00
|
|
|
A []string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUserStatusesByIdsReturns struct {
|
2018-07-16 15:49:26 -04:00
|
|
|
A []*model.Status
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetUserStatusesByIdsArgs{userIds}
|
|
|
|
|
_returns := &Z_GetUserStatusesByIdsReturns{}
|
2018-07-16 15:49:26 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUserStatusesByIds", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetUserStatusesByIds API failed: %s", err.Error())
|
2018-07-16 15:49:26 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUserStatusesByIds(args *Z_GetUserStatusesByIdsArgs, returns *Z_GetUserStatusesByIdsReturns) error {
|
2018-07-16 15:49:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUserStatusesByIds(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetUserStatusesByIds called but not implemented."))
|
2018-07-16 15:49:26 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateUserStatusArgs struct {
|
2018-07-16 15:49:26 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateUserStatusReturns struct {
|
2018-07-16 15:49:26 -04:00
|
|
|
A *model.Status
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdateUserStatus(userID, status string) (*model.Status, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateUserStatusArgs{userID, status}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdateUserStatusReturns{}
|
2018-07-16 15:49:26 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateUserStatus", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateUserStatus API failed: %s", err.Error())
|
2018-07-16 15:49:26 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateUserStatus(args *Z_UpdateUserStatusArgs, returns *Z_UpdateUserStatusReturns) error {
|
2018-07-16 15:49:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdateUserStatus(userID, status string) (*model.Status, *model.AppError)
|
2018-07-16 15:49:26 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateUserStatus(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateUserStatus called but not implemented."))
|
2018-07-16 15:49:26 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-16 14:38:26 -04:00
|
|
|
type Z_SetUserStatusTimedDNDArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SetUserStatusTimedDNDReturns struct {
|
|
|
|
|
A *model.Status
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) SetUserStatusTimedDND(userId string, endtime int64) (*model.Status, *model.AppError) {
|
|
|
|
|
_args := &Z_SetUserStatusTimedDNDArgs{userId, endtime}
|
|
|
|
|
_returns := &Z_SetUserStatusTimedDNDReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.SetUserStatusTimedDND", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SetUserStatusTimedDND API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) SetUserStatusTimedDND(args *Z_SetUserStatusTimedDNDArgs, returns *Z_SetUserStatusTimedDNDReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SetUserStatusTimedDND(userId string, endtime int64) (*model.Status, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.SetUserStatusTimedDND(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SetUserStatusTimedDND called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateUserActiveArgs struct {
|
2018-12-12 10:18:41 -05:00
|
|
|
A string
|
|
|
|
|
B bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateUserActiveReturns struct {
|
2018-12-12 10:18:41 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdateUserActive(userID string, active bool) *model.AppError {
|
|
|
|
|
_args := &Z_UpdateUserActiveArgs{userID, active}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdateUserActiveReturns{}
|
2018-12-12 10:18:41 -05:00
|
|
|
if err := g.client.Call("Plugin.UpdateUserActive", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateUserActive API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateUserActive(args *Z_UpdateUserActiveArgs, returns *Z_UpdateUserActiveReturns) error {
|
2018-12-12 10:18:41 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdateUserActive(userID string, active bool) *model.AppError
|
2018-12-12 10:18:41 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UpdateUserActive(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateUserActive called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 11:11:20 -05:00
|
|
|
type Z_UpdateUserCustomStatusArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B *model.CustomStatus
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateUserCustomStatusReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateUserCustomStatus(userID string, customStatus *model.CustomStatus) *model.AppError {
|
|
|
|
|
_args := &Z_UpdateUserCustomStatusArgs{userID, customStatus}
|
|
|
|
|
_returns := &Z_UpdateUserCustomStatusReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateUserCustomStatus", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateUserCustomStatus API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateUserCustomStatus(args *Z_UpdateUserCustomStatusArgs, returns *Z_UpdateUserCustomStatusReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateUserCustomStatus(userID string, customStatus *model.CustomStatus) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UpdateUserCustomStatus(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateUserCustomStatus called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RemoveUserCustomStatusArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RemoveUserCustomStatusReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RemoveUserCustomStatus(userID string) *model.AppError {
|
|
|
|
|
_args := &Z_RemoveUserCustomStatusArgs{userID}
|
|
|
|
|
_returns := &Z_RemoveUserCustomStatusReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RemoveUserCustomStatus", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RemoveUserCustomStatus API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RemoveUserCustomStatus(args *Z_RemoveUserCustomStatusArgs, returns *Z_RemoveUserCustomStatusReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RemoveUserCustomStatus(userID string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RemoveUserCustomStatus(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RemoveUserCustomStatus called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersInChannelArgs struct {
|
2018-10-22 08:49:50 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C int
|
|
|
|
|
D int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetUsersInChannelReturns struct {
|
2018-10-22 08:49:50 -04:00
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetUsersInChannel(channelID, sortBy string, page, perPage int) ([]*model.User, *model.AppError) {
|
|
|
|
|
_args := &Z_GetUsersInChannelArgs{channelID, sortBy, page, perPage}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetUsersInChannelReturns{}
|
2018-10-22 08:49:50 -04:00
|
|
|
if err := g.client.Call("Plugin.GetUsersInChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUsersInChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetUsersInChannel(args *Z_GetUsersInChannelArgs, returns *Z_GetUsersInChannelReturns) error {
|
2018-10-22 08:49:50 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetUsersInChannel(channelID, sortBy string, page, perPage int) ([]*model.User, *model.AppError)
|
2018-10-22 08:49:50 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUsersInChannel(args.A, args.B, args.C, args.D)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUsersInChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetLDAPUserAttributesArgs struct {
|
2018-08-29 14:07:27 -04:00
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetLDAPUserAttributesReturns struct {
|
2018-08-29 14:07:27 -04:00
|
|
|
A map[string]string
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetLDAPUserAttributes(userID string, attributes []string) (map[string]string, *model.AppError) {
|
|
|
|
|
_args := &Z_GetLDAPUserAttributesArgs{userID, attributes}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetLDAPUserAttributesReturns{}
|
2018-08-29 14:07:27 -04:00
|
|
|
if err := g.client.Call("Plugin.GetLDAPUserAttributes", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetLDAPUserAttributes API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetLDAPUserAttributes(args *Z_GetLDAPUserAttributesArgs, returns *Z_GetLDAPUserAttributesReturns) error {
|
2018-08-29 14:07:27 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetLDAPUserAttributes(userID string, attributes []string) (map[string]string, *model.AppError)
|
2018-08-29 14:07:27 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetLDAPUserAttributes(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetLDAPUserAttributes called but not implemented."))
|
2018-08-29 14:07:27 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Team
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) CreateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_CreateTeamArgs{team}
|
|
|
|
|
_returns := &Z_CreateTeamReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.CreateTeam", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to CreateTeam API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateTeam(args *Z_CreateTeamArgs, returns *Z_CreateTeamReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateTeam(team *model.Team) (*model.Team, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateTeam(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CreateTeam called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteTeamArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteTeamReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) DeleteTeam(teamID string) *model.AppError {
|
|
|
|
|
_args := &Z_DeleteTeamArgs{teamID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_DeleteTeamReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.DeleteTeam", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to DeleteTeam API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteTeam(args *Z_DeleteTeamArgs, returns *Z_DeleteTeamReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
DeleteTeam(teamID string) *model.AppError
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteTeam(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API DeleteTeam called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamsArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamsReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A []*model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetTeams() ([]*model.Team, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetTeamsArgs{}
|
|
|
|
|
_returns := &Z_GetTeamsReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTeams", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetTeams API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeams(args *Z_GetTeamsArgs, returns *Z_GetTeamsReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetTeams() ([]*model.Team, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeams()
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetTeams called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeam(teamID string) (*model.Team, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamArgs{teamID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTeam", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetTeam API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeam(args *Z_GetTeamArgs, returns *Z_GetTeamReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeam(teamID string) (*model.Team, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeam(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetTeam called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamByNameArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamByNameReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetTeamByName(name string) (*model.Team, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetTeamByNameArgs{name}
|
|
|
|
|
_returns := &Z_GetTeamByNameReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTeamByName", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetTeamByName API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamByName(args *Z_GetTeamByNameArgs, returns *Z_GetTeamByNameReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetTeamByName(name string) (*model.Team, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamByName(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetTeamByName called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamsUnreadForUserArgs struct {
|
2018-11-07 14:23:02 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamsUnreadForUserReturns struct {
|
2018-11-07 14:23:02 -05:00
|
|
|
A []*model.TeamUnread
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamsUnreadForUserArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamsUnreadForUserReturns{}
|
2018-11-07 14:23:02 -05:00
|
|
|
if err := g.client.Call("Plugin.GetTeamsUnreadForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetTeamsUnreadForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamsUnreadForUser(args *Z_GetTeamsUnreadForUserArgs, returns *Z_GetTeamsUnreadForUserReturns) error {
|
2018-11-07 14:23:02 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model.AppError)
|
2018-11-07 14:23:02 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamsUnreadForUser(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetTeamsUnreadForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateTeamArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Team
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateTeamReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UpdateTeamArgs{team}
|
|
|
|
|
_returns := &Z_UpdateTeamReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateTeam", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateTeam API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateTeam(args *Z_UpdateTeamArgs, returns *Z_UpdateTeamReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateTeam(team *model.Team) (*model.Team, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateTeam(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateTeam called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchTeamsArgs struct {
|
2019-01-16 03:13:15 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchTeamsReturns struct {
|
2019-01-16 03:13:15 -05:00
|
|
|
A []*model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) SearchTeams(term string) ([]*model.Team, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_SearchTeamsArgs{term}
|
|
|
|
|
_returns := &Z_SearchTeamsReturns{}
|
2019-01-16 03:13:15 -05:00
|
|
|
if err := g.client.Call("Plugin.SearchTeams", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchTeams API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SearchTeams(args *Z_SearchTeamsArgs, returns *Z_SearchTeamsReturns) error {
|
2019-01-16 03:13:15 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SearchTeams(term string) ([]*model.Team, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.SearchTeams(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchTeams called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamsForUserArgs struct {
|
2018-10-17 10:37:52 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamsForUserReturns struct {
|
2018-10-17 10:37:52 -04:00
|
|
|
A []*model.Team
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamsForUserArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamsForUserReturns{}
|
2018-10-17 10:37:52 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTeamsForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetTeamsForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamsForUser(args *Z_GetTeamsForUserArgs, returns *Z_GetTeamsForUserReturns) error {
|
2018-10-17 10:37:52 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamsForUser(userID string) ([]*model.Team, *model.AppError)
|
2018-10-17 10:37:52 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamsForUser(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetTeamsForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamMemberArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamMemberReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.TeamMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) CreateTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateTeamMemberArgs{teamID, userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_CreateTeamMemberReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.CreateTeamMember", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to CreateTeamMember API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateTeamMember(args *Z_CreateTeamMemberArgs, returns *Z_CreateTeamMemberReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
CreateTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError)
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateTeamMember(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CreateTeamMember called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamMembersArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamMembersReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A []*model.TeamMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) CreateTeamMembers(teamID string, userIds []string, requestorId string) ([]*model.TeamMember, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateTeamMembersArgs{teamID, userIds, requestorId}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_CreateTeamMembersReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.CreateTeamMembers", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to CreateTeamMembers API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateTeamMembers(args *Z_CreateTeamMembersArgs, returns *Z_CreateTeamMembersReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
CreateTeamMembers(teamID string, userIds []string, requestorId string) ([]*model.TeamMember, *model.AppError)
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateTeamMembers(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CreateTeamMembers called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamMembersGracefullyArgs struct {
|
2020-01-14 08:29:50 -05:00
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateTeamMembersGracefullyReturns struct {
|
2020-01-14 08:29:50 -05:00
|
|
|
A []*model.TeamMemberWithError
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) CreateTeamMembersGracefully(teamID string, userIds []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateTeamMembersGracefullyArgs{teamID, userIds, requestorId}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_CreateTeamMembersGracefullyReturns{}
|
2020-01-14 08:29:50 -05:00
|
|
|
if err := g.client.Call("Plugin.CreateTeamMembersGracefully", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateTeamMembersGracefully API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateTeamMembersGracefully(args *Z_CreateTeamMembersGracefullyArgs, returns *Z_CreateTeamMembersGracefullyReturns) error {
|
2020-01-14 08:29:50 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
CreateTeamMembersGracefully(teamID string, userIds []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError)
|
2020-01-14 08:29:50 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateTeamMembersGracefully(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateTeamMembersGracefully called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteTeamMemberArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteTeamMemberReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) DeleteTeamMember(teamID, userID, requestorId string) *model.AppError {
|
|
|
|
|
_args := &Z_DeleteTeamMemberArgs{teamID, userID, requestorId}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_DeleteTeamMemberReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.DeleteTeamMember", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to DeleteTeamMember API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteTeamMember(args *Z_DeleteTeamMemberArgs, returns *Z_DeleteTeamMemberReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
DeleteTeamMember(teamID, userID, requestorId string) *model.AppError
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteTeamMember(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API DeleteTeamMember called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamMembersArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamMembersReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A []*model.TeamMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamMembers(teamID string, page, perPage int) ([]*model.TeamMember, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamMembersArgs{teamID, page, perPage}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamMembersReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTeamMembers", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetTeamMembers API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamMembers(args *Z_GetTeamMembersArgs, returns *Z_GetTeamMembersReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamMembers(teamID string, page, perPage int) ([]*model.TeamMember, *model.AppError)
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamMembers(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetTeamMembers called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamMemberArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamMemberReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.TeamMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamMemberArgs{teamID, userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamMemberReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.GetTeamMember", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetTeamMember API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamMember(args *Z_GetTeamMemberArgs, returns *Z_GetTeamMemberReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError)
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamMember(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetTeamMember called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamMembersForUserArgs struct {
|
2019-02-23 14:41:19 -05:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamMembersForUserReturns struct {
|
2019-02-23 14:41:19 -05:00
|
|
|
A []*model.TeamMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamMembersForUser(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamMembersForUserArgs{userID, page, perPage}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamMembersForUserReturns{}
|
2019-02-23 14:41:19 -05:00
|
|
|
if err := g.client.Call("Plugin.GetTeamMembersForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetTeamMembersForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamMembersForUser(args *Z_GetTeamMembersForUserArgs, returns *Z_GetTeamMembersForUserReturns) error {
|
2019-02-23 14:41:19 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamMembersForUser(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError)
|
2019-02-23 14:41:19 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamMembersForUser(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetTeamMembersForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateTeamMemberRolesArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateTeamMemberRolesReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.TeamMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdateTeamMemberRoles(teamID, userID, newRoles string) (*model.TeamMember, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateTeamMemberRolesArgs{teamID, userID, newRoles}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdateTeamMemberRolesReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateTeamMemberRoles", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateTeamMemberRoles API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateTeamMemberRoles(args *Z_UpdateTeamMemberRolesArgs, returns *Z_UpdateTeamMemberRolesReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdateTeamMemberRoles(teamID, userID, newRoles string) (*model.TeamMember, *model.AppError)
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateTeamMemberRoles(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateTeamMemberRoles called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateChannelArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateChannelReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_CreateChannelArgs{channel}
|
|
|
|
|
_returns := &Z_CreateChannelReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.CreateChannel", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to CreateChannel API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateChannel(args *Z_CreateChannelArgs, returns *Z_CreateChannelReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateChannel(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CreateChannel called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteChannelArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteChannelReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) DeleteChannel(channelId string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_DeleteChannelArgs{channelId}
|
|
|
|
|
_returns := &Z_DeleteChannelReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.DeleteChannel", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to DeleteChannel API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteChannel(args *Z_DeleteChannelArgs, returns *Z_DeleteChannelReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteChannel(channelId string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteChannel(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API DeleteChannel called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPublicChannelsForTeamArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPublicChannelsForTeamReturns struct {
|
2018-11-19 08:43:49 -05:00
|
|
|
A []*model.Channel
|
2018-07-06 18:32:55 -04:00
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetPublicChannelsForTeam(teamID string, page, perPage int) ([]*model.Channel, *model.AppError) {
|
|
|
|
|
_args := &Z_GetPublicChannelsForTeamArgs{teamID, page, perPage}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetPublicChannelsForTeamReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPublicChannelsForTeam", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetPublicChannelsForTeam API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPublicChannelsForTeam(args *Z_GetPublicChannelsForTeamArgs, returns *Z_GetPublicChannelsForTeamReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetPublicChannelsForTeam(teamID string, page, perPage int) ([]*model.Channel, *model.AppError)
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPublicChannelsForTeam(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetPublicChannelsForTeam called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetChannel(channelId string) (*model.Channel, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetChannelArgs{channelId}
|
|
|
|
|
_returns := &Z_GetChannelReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannel", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetChannel API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannel(args *Z_GetChannelArgs, returns *Z_GetChannelReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetChannel(channelId string) (*model.Channel, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannel(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetChannel called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelByNameArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
2018-07-30 15:06:08 -04:00
|
|
|
C bool
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelByNameReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
|
|
|
|
_args := &Z_GetChannelByNameArgs{teamID, name, includeDeleted}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetChannelByNameReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelByName", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetChannelByName API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelByName(args *Z_GetChannelByNameArgs, returns *Z_GetChannelByNameReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
2018-07-30 15:06:08 -04:00
|
|
|
returns.A, returns.B = hook.GetChannelByName(args.A, args.B, args.C)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetChannelByName called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelByNameForTeamNameArgs struct {
|
2018-07-20 12:03:08 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
2018-07-30 15:06:08 -04:00
|
|
|
C bool
|
2018-07-20 12:03:08 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelByNameForTeamNameReturns struct {
|
2018-07-20 12:03:08 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 15:06:08 -04:00
|
|
|
func (g *apiRPCClient) GetChannelByNameForTeamName(teamName, channelName string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetChannelByNameForTeamNameArgs{teamName, channelName, includeDeleted}
|
|
|
|
|
_returns := &Z_GetChannelByNameForTeamNameReturns{}
|
2018-07-20 12:03:08 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelByNameForTeamName", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetChannelByNameForTeamName API failed: %s", err.Error())
|
2018-07-20 12:03:08 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelByNameForTeamName(args *Z_GetChannelByNameForTeamNameArgs, returns *Z_GetChannelByNameForTeamNameReturns) error {
|
2018-07-20 12:03:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2018-07-30 15:06:08 -04:00
|
|
|
GetChannelByNameForTeamName(teamName, channelName string, includeDeleted bool) (*model.Channel, *model.AppError)
|
2018-07-20 12:03:08 -04:00
|
|
|
}); ok {
|
2018-07-30 15:06:08 -04:00
|
|
|
returns.A, returns.B = hook.GetChannelByNameForTeamName(args.A, args.B, args.C)
|
2018-07-20 12:03:08 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetChannelByNameForTeamName called but not implemented."))
|
2018-07-20 12:03:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelsForTeamForUserArgs struct {
|
2018-10-15 12:27:45 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelsForTeamForUserReturns struct {
|
2018-11-20 08:50:34 -05:00
|
|
|
A []*model.Channel
|
2018-10-15 12:27:45 -04:00
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetChannelsForTeamForUser(teamID, userID string, includeDeleted bool) ([]*model.Channel, *model.AppError) {
|
|
|
|
|
_args := &Z_GetChannelsForTeamForUserArgs{teamID, userID, includeDeleted}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetChannelsForTeamForUserReturns{}
|
2018-10-15 12:27:45 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelsForTeamForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetChannelsForTeamForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelsForTeamForUser(args *Z_GetChannelsForTeamForUserArgs, returns *Z_GetChannelsForTeamForUserReturns) error {
|
2018-10-15 12:27:45 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetChannelsForTeamForUser(teamID, userID string, includeDeleted bool) ([]*model.Channel, *model.AppError)
|
2018-10-15 12:27:45 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelsForTeamForUser(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetChannelsForTeamForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelStatsArgs struct {
|
2018-10-25 13:24:43 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelStatsReturns struct {
|
2018-10-25 13:24:43 -04:00
|
|
|
A *model.ChannelStats
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetChannelStatsArgs{channelId}
|
|
|
|
|
_returns := &Z_GetChannelStatsReturns{}
|
2018-10-25 13:24:43 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelStats", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetChannelStats API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelStats(args *Z_GetChannelStatsArgs, returns *Z_GetChannelStatsReturns) error {
|
2018-10-25 13:24:43 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelStats(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetChannelStats called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetDirectChannelArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetDirectChannelReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetDirectChannelArgs{userId1, userId2}
|
|
|
|
|
_returns := &Z_GetDirectChannelReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetDirectChannel", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetDirectChannel API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetDirectChannel(args *Z_GetDirectChannelArgs, returns *Z_GetDirectChannelReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetDirectChannel(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetDirectChannel called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupChannelArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A []string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupChannelReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetGroupChannelArgs{userIds}
|
|
|
|
|
_returns := &Z_GetGroupChannelReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetGroupChannel", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetGroupChannel API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetGroupChannel(args *Z_GetGroupChannelArgs, returns *Z_GetGroupChannelReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupChannel(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetGroupChannel called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateChannelArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateChannelReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Channel
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UpdateChannelArgs{channel}
|
|
|
|
|
_returns := &Z_UpdateChannelReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateChannel", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateChannel API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateChannel(args *Z_UpdateChannelArgs, returns *Z_UpdateChannelReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateChannel(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateChannel called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchChannelsArgs struct {
|
2018-10-15 12:23:46 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchChannelsReturns struct {
|
2018-11-20 08:50:34 -05:00
|
|
|
A []*model.Channel
|
2018-10-15 12:23:46 -04:00
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) SearchChannels(teamID string, term string) ([]*model.Channel, *model.AppError) {
|
|
|
|
|
_args := &Z_SearchChannelsArgs{teamID, term}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_SearchChannelsReturns{}
|
2018-10-15 12:23:46 -04:00
|
|
|
if err := g.client.Call("Plugin.SearchChannels", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchChannels API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SearchChannels(args *Z_SearchChannelsArgs, returns *Z_SearchChannelsReturns) error {
|
2018-10-15 12:23:46 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
SearchChannels(teamID string, term string) ([]*model.Channel, *model.AppError)
|
2018-10-15 12:23:46 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.SearchChannels(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchChannels called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
type Z_CreateChannelSidebarCategoryArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C *model.SidebarCategoryWithChannels
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateChannelSidebarCategoryReturns struct {
|
|
|
|
|
A *model.SidebarCategoryWithChannels
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateChannelSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateChannelSidebarCategoryArgs{userID, teamID, newCategory}
|
|
|
|
|
_returns := &Z_CreateChannelSidebarCategoryReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateChannelSidebarCategory", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateChannelSidebarCategory API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateChannelSidebarCategory(args *Z_CreateChannelSidebarCategoryArgs, returns *Z_CreateChannelSidebarCategoryReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateChannelSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateChannelSidebarCategory(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateChannelSidebarCategory called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetChannelSidebarCategoriesArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetChannelSidebarCategoriesReturns struct {
|
|
|
|
|
A *model.OrderedSidebarCategories
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetChannelSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError) {
|
|
|
|
|
_args := &Z_GetChannelSidebarCategoriesArgs{userID, teamID}
|
|
|
|
|
_returns := &Z_GetChannelSidebarCategoriesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetChannelSidebarCategories", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetChannelSidebarCategories API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetChannelSidebarCategories(args *Z_GetChannelSidebarCategoriesArgs, returns *Z_GetChannelSidebarCategoriesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetChannelSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelSidebarCategories(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetChannelSidebarCategories called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateChannelSidebarCategoriesArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C []*model.SidebarCategoryWithChannels
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateChannelSidebarCategoriesReturns struct {
|
|
|
|
|
A []*model.SidebarCategoryWithChannels
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateChannelSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateChannelSidebarCategoriesArgs{userID, teamID, categories}
|
|
|
|
|
_returns := &Z_UpdateChannelSidebarCategoriesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateChannelSidebarCategories", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateChannelSidebarCategories API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateChannelSidebarCategories(args *Z_UpdateChannelSidebarCategoriesArgs, returns *Z_UpdateChannelSidebarCategoriesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateChannelSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateChannelSidebarCategories(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateChannelSidebarCategories called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchUsersArgs struct {
|
2018-11-30 10:47:17 -05:00
|
|
|
A *model.UserSearch
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchUsersReturns struct {
|
2018-11-30 10:47:17 -05:00
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_SearchUsersArgs{search}
|
|
|
|
|
_returns := &Z_SearchUsersReturns{}
|
2018-11-30 10:47:17 -05:00
|
|
|
if err := g.client.Call("Plugin.SearchUsers", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchUsers API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SearchUsers(args *Z_SearchUsersArgs, returns *Z_SearchUsersReturns) error {
|
2018-11-30 10:47:17 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.SearchUsers(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchUsers called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchPostsInTeamArgs struct {
|
2019-02-13 01:41:32 -05:00
|
|
|
A string
|
|
|
|
|
B []*model.SearchParams
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchPostsInTeamReturns struct {
|
2019-02-13 01:41:32 -05:00
|
|
|
A []*model.Post
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError) {
|
|
|
|
|
_args := &Z_SearchPostsInTeamArgs{teamID, paramsList}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_SearchPostsInTeamReturns{}
|
2019-02-13 01:41:32 -05:00
|
|
|
if err := g.client.Call("Plugin.SearchPostsInTeam", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchPostsInTeam API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SearchPostsInTeam(args *Z_SearchPostsInTeamArgs, returns *Z_SearchPostsInTeamReturns) error {
|
2019-02-13 01:41:32 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError)
|
2019-02-13 01:41:32 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.SearchPostsInTeam(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchPostsInTeam called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchPostsInTeamForUserArgs struct {
|
2020-06-23 21:58:44 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C model.SearchParameter
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SearchPostsInTeamForUserReturns struct {
|
2020-06-23 21:58:44 -04:00
|
|
|
A *model.PostSearchResults
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) SearchPostsInTeamForUser(teamID string, userID string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError) {
|
|
|
|
|
_args := &Z_SearchPostsInTeamForUserArgs{teamID, userID, searchParams}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_SearchPostsInTeamForUserReturns{}
|
2020-06-23 21:58:44 -04:00
|
|
|
if err := g.client.Call("Plugin.SearchPostsInTeamForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchPostsInTeamForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SearchPostsInTeamForUser(args *Z_SearchPostsInTeamForUserArgs, returns *Z_SearchPostsInTeamForUserReturns) error {
|
2020-06-23 21:58:44 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
SearchPostsInTeamForUser(teamID string, userID string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError)
|
2020-06-23 21:58:44 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.SearchPostsInTeamForUser(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchPostsInTeamForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_AddChannelMemberArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_AddChannelMemberReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.ChannelMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) AddChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
_args := &Z_AddChannelMemberArgs{channelId, userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_AddChannelMemberReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.AddChannelMember", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to AddChannelMember API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) AddChannelMember(args *Z_AddChannelMemberArgs, returns *Z_AddChannelMemberReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
AddChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.AddChannelMember(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API AddChannelMember called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_AddUserToChannelArgs struct {
|
2019-10-17 19:11:26 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_AddUserToChannelReturns struct {
|
2019-10-17 19:11:26 -04:00
|
|
|
A *model.ChannelMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) AddUserToChannel(channelId, userID, asUserId string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
_args := &Z_AddUserToChannelArgs{channelId, userID, asUserId}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_AddUserToChannelReturns{}
|
2019-10-17 19:11:26 -04:00
|
|
|
if err := g.client.Call("Plugin.AddUserToChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to AddUserToChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) AddUserToChannel(args *Z_AddUserToChannelArgs, returns *Z_AddUserToChannelReturns) error {
|
2019-10-17 19:11:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
AddUserToChannel(channelId, userID, asUserId string) (*model.ChannelMember, *model.AppError)
|
2019-10-17 19:11:26 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.AddUserToChannel(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API AddUserToChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMemberArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMemberReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.ChannelMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
_args := &Z_GetChannelMemberArgs{channelId, userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetChannelMemberReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelMember", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetChannelMember API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelMember(args *Z_GetChannelMemberArgs, returns *Z_GetChannelMemberReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelMember(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetChannelMember called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMembersArgs struct {
|
2018-10-03 16:07:54 -04:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMembersReturns struct {
|
2021-08-17 05:18:33 -04:00
|
|
|
A model.ChannelMembers
|
2018-10-03 16:07:54 -04:00
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-17 05:18:33 -04:00
|
|
|
func (g *apiRPCClient) GetChannelMembers(channelId string, page, perPage int) (model.ChannelMembers, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetChannelMembersArgs{channelId, page, perPage}
|
|
|
|
|
_returns := &Z_GetChannelMembersReturns{}
|
2018-10-03 16:07:54 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelMembers", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetChannelMembers API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelMembers(args *Z_GetChannelMembersArgs, returns *Z_GetChannelMembersReturns) error {
|
2018-10-03 16:07:54 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-08-17 05:18:33 -04:00
|
|
|
GetChannelMembers(channelId string, page, perPage int) (model.ChannelMembers, *model.AppError)
|
2018-10-03 16:07:54 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelMembers(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetChannelMembers called but not implemented."))
|
2018-10-31 09:29:20 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMembersByIdsArgs struct {
|
2018-10-31 09:29:20 -04:00
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMembersByIdsReturns struct {
|
2021-08-17 05:18:33 -04:00
|
|
|
A model.ChannelMembers
|
2018-10-31 09:29:20 -04:00
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-17 05:18:33 -04:00
|
|
|
func (g *apiRPCClient) GetChannelMembersByIds(channelId string, userIds []string) (model.ChannelMembers, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetChannelMembersByIdsArgs{channelId, userIds}
|
|
|
|
|
_returns := &Z_GetChannelMembersByIdsReturns{}
|
2018-10-31 09:29:20 -04:00
|
|
|
if err := g.client.Call("Plugin.GetChannelMembersByIds", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetChannelMembersByIds API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelMembersByIds(args *Z_GetChannelMembersByIdsArgs, returns *Z_GetChannelMembersByIdsReturns) error {
|
2018-10-31 09:29:20 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-08-17 05:18:33 -04:00
|
|
|
GetChannelMembersByIds(channelId string, userIds []string) (model.ChannelMembers, *model.AppError)
|
2018-10-31 09:29:20 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelMembersByIds(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetChannelMembersByIds called but not implemented."))
|
2018-10-03 16:07:54 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMembersForUserArgs struct {
|
2019-02-23 14:41:19 -05:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C int
|
|
|
|
|
D int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetChannelMembersForUserReturns struct {
|
2019-02-23 14:41:19 -05:00
|
|
|
A []*model.ChannelMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetChannelMembersForUser(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError) {
|
|
|
|
|
_args := &Z_GetChannelMembersForUserArgs{teamID, userID, page, perPage}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetChannelMembersForUserReturns{}
|
2019-02-23 14:41:19 -05:00
|
|
|
if err := g.client.Call("Plugin.GetChannelMembersForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetChannelMembersForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetChannelMembersForUser(args *Z_GetChannelMembersForUserArgs, returns *Z_GetChannelMembersForUserReturns) error {
|
2019-02-23 14:41:19 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetChannelMembersForUser(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError)
|
2019-02-23 14:41:19 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetChannelMembersForUser(args.A, args.B, args.C, args.D)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetChannelMembersForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateChannelMemberRolesArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateChannelMemberRolesReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.ChannelMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdateChannelMemberRoles(channelId, userID, newRoles string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateChannelMemberRolesArgs{channelId, userID, newRoles}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdateChannelMemberRolesReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateChannelMemberRoles", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateChannelMemberRoles API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateChannelMemberRoles(args *Z_UpdateChannelMemberRolesArgs, returns *Z_UpdateChannelMemberRolesReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdateChannelMemberRoles(channelId, userID, newRoles string) (*model.ChannelMember, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateChannelMemberRoles(args.A, args.B, args.C)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateChannelMemberRoles called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateChannelMemberNotificationsArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateChannelMemberNotificationsReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.ChannelMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdateChannelMemberNotifications(channelId, userID string, notifications map[string]string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateChannelMemberNotificationsArgs{channelId, userID, notifications}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdateChannelMemberNotificationsReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateChannelMemberNotifications", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdateChannelMemberNotifications API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateChannelMemberNotifications(args *Z_UpdateChannelMemberNotificationsArgs, returns *Z_UpdateChannelMemberNotificationsReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdateChannelMemberNotifications(channelId, userID string, notifications map[string]string) (*model.ChannelMember, *model.AppError)
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateChannelMemberNotifications(args.A, args.B, args.C)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdateChannelMemberNotifications called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2024-01-11 13:24:52 -05:00
|
|
|
|
|
|
|
|
type Z_PatchChannelMembersNotificationsArgs struct {
|
|
|
|
|
A []*model.ChannelMemberIdentifier
|
|
|
|
|
B map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_PatchChannelMembersNotificationsReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) PatchChannelMembersNotifications(members []*model.ChannelMemberIdentifier, notifyProps map[string]string) *model.AppError {
|
|
|
|
|
_args := &Z_PatchChannelMembersNotificationsArgs{members, notifyProps}
|
|
|
|
|
_returns := &Z_PatchChannelMembersNotificationsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.PatchChannelMembersNotifications", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to PatchChannelMembersNotifications API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) PatchChannelMembersNotifications(args *Z_PatchChannelMembersNotificationsArgs, returns *Z_PatchChannelMembersNotificationsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
PatchChannelMembersNotifications(members []*model.ChannelMemberIdentifier, notifyProps map[string]string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.PatchChannelMembersNotifications(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API PatchChannelMembersNotifications called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2018-06-25 15:33:13 -04:00
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupArgs struct {
|
2019-10-22 14:38:08 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupReturns struct {
|
2019-10-22 14:38:08 -04:00
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroup(groupId string) (*model.Group, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetGroupArgs{groupId}
|
|
|
|
|
_returns := &Z_GetGroupReturns{}
|
2019-10-22 14:38:08 -04:00
|
|
|
if err := g.client.Call("Plugin.GetGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetGroup(args *Z_GetGroupArgs, returns *Z_GetGroupReturns) error {
|
2019-10-22 14:38:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroup(groupId string) (*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroup(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupByNameArgs struct {
|
2019-10-22 14:38:08 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupByNameReturns struct {
|
2019-10-22 14:38:08 -04:00
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-18 14:17:36 -04:00
|
|
|
func (g *apiRPCClient) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetGroupByNameArgs{name}
|
|
|
|
|
_returns := &Z_GetGroupByNameReturns{}
|
2019-10-22 14:38:08 -04:00
|
|
|
if err := g.client.Call("Plugin.GetGroupByName", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupByName API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetGroupByName(args *Z_GetGroupByNameArgs, returns *Z_GetGroupByNameReturns) error {
|
2019-10-22 14:38:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2020-06-18 14:17:36 -04:00
|
|
|
GetGroupByName(name string) (*model.Group, *model.AppError)
|
2019-10-22 14:38:08 -04:00
|
|
|
}); ok {
|
2020-06-18 14:17:36 -04:00
|
|
|
returns.A, returns.B = hook.GetGroupByName(args.A)
|
2019-10-22 14:38:08 -04:00
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupByName called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-12 13:01:28 -04:00
|
|
|
type Z_GetGroupMemberUsersArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupMemberUsersReturns struct {
|
|
|
|
|
A []*model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroupMemberUsers(groupID string, page, perPage int) ([]*model.User, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupMemberUsersArgs{groupID, page, perPage}
|
|
|
|
|
_returns := &Z_GetGroupMemberUsersReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetGroupMemberUsers", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupMemberUsers API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetGroupMemberUsers(args *Z_GetGroupMemberUsersArgs, returns *Z_GetGroupMemberUsersReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroupMemberUsers(groupID string, page, perPage int) ([]*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupMemberUsers(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupMemberUsers called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupsBySourceArgs struct {
|
|
|
|
|
A model.GroupSource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupsBySourceReturns struct {
|
|
|
|
|
A []*model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupsBySourceArgs{groupSource}
|
|
|
|
|
_returns := &Z_GetGroupsBySourceReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetGroupsBySource", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupsBySource API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetGroupsBySource(args *Z_GetGroupsBySourceArgs, returns *Z_GetGroupsBySourceReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupsBySource(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupsBySource called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupsForUserArgs struct {
|
2019-10-22 14:38:08 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetGroupsForUserReturns struct {
|
2019-10-22 14:38:08 -04:00
|
|
|
A []*model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetGroupsForUser(userID string) ([]*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupsForUserArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetGroupsForUserReturns{}
|
2019-10-22 14:38:08 -04:00
|
|
|
if err := g.client.Call("Plugin.GetGroupsForUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupsForUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetGroupsForUser(args *Z_GetGroupsForUserArgs, returns *Z_GetGroupsForUserReturns) error {
|
2019-10-22 14:38:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetGroupsForUser(userID string) ([]*model.Group, *model.AppError)
|
2019-10-22 14:38:08 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupsForUser(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupsForUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteChannelMemberArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteChannelMemberReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) DeleteChannelMember(channelId, userID string) *model.AppError {
|
|
|
|
|
_args := &Z_DeleteChannelMemberArgs{channelId, userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_DeleteChannelMemberReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.DeleteChannelMember", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to DeleteChannelMember API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteChannelMember(args *Z_DeleteChannelMemberArgs, returns *Z_DeleteChannelMemberReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
DeleteChannelMember(channelId, userID string) *model.AppError
|
2018-06-25 15:33:13 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteChannelMember(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API DeleteChannelMember called but not implemented."))
|
2018-10-17 17:06:14 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreatePostArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreatePostReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Post
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) CreatePost(post *model.Post) (*model.Post, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_CreatePostArgs{post}
|
|
|
|
|
_returns := &Z_CreatePostReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.CreatePost", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to CreatePost API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreatePost(args *Z_CreatePostArgs, returns *Z_CreatePostReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreatePost(post *model.Post) (*model.Post, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreatePost(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CreatePost called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_AddReactionArgs struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A *model.Reaction
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_AddReactionReturns struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A *model.Reaction
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) AddReaction(reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_AddReactionArgs{reaction}
|
|
|
|
|
_returns := &Z_AddReactionReturns{}
|
2018-08-20 12:22:08 -04:00
|
|
|
if err := g.client.Call("Plugin.AddReaction", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to AddReaction API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) AddReaction(args *Z_AddReactionArgs, returns *Z_AddReactionReturns) error {
|
2018-08-20 12:22:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
AddReaction(reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.AddReaction(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API AddReaction called but not implemented."))
|
2018-08-20 12:22:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RemoveReactionArgs struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A *model.Reaction
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RemoveReactionReturns struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RemoveReaction(reaction *model.Reaction) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_RemoveReactionArgs{reaction}
|
|
|
|
|
_returns := &Z_RemoveReactionReturns{}
|
2018-08-20 12:22:08 -04:00
|
|
|
if err := g.client.Call("Plugin.RemoveReaction", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RemoveReaction API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) RemoveReaction(args *Z_RemoveReactionArgs, returns *Z_RemoveReactionReturns) error {
|
2018-08-20 12:22:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RemoveReaction(reaction *model.Reaction) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RemoveReaction(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API RemoveReaction called but not implemented."))
|
2018-08-20 12:22:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetReactionsArgs struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetReactionsReturns struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A []*model.Reaction
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetReactions(postId string) ([]*model.Reaction, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetReactionsArgs{postId}
|
|
|
|
|
_returns := &Z_GetReactionsReturns{}
|
2018-08-20 12:22:08 -04:00
|
|
|
if err := g.client.Call("Plugin.GetReactions", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetReactions API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetReactions(args *Z_GetReactionsArgs, returns *Z_GetReactionsReturns) error {
|
2018-08-20 12:22:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetReactions(postId string) ([]*model.Reaction, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetReactions(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetReactions called but not implemented."))
|
2018-08-20 12:22:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SendEphemeralPostArgs struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A string
|
|
|
|
|
B *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SendEphemeralPostReturns struct {
|
2018-07-06 18:32:55 -04:00
|
|
|
A *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) SendEphemeralPost(userID string, post *model.Post) *model.Post {
|
|
|
|
|
_args := &Z_SendEphemeralPostArgs{userID, post}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_SendEphemeralPostReturns{}
|
2018-07-06 18:32:55 -04:00
|
|
|
if err := g.client.Call("Plugin.SendEphemeralPost", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to SendEphemeralPost API failed: %s", err.Error())
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SendEphemeralPost(args *Z_SendEphemeralPostArgs, returns *Z_SendEphemeralPostReturns) error {
|
2018-07-06 18:32:55 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
SendEphemeralPost(userID string, post *model.Post) *model.Post
|
2018-07-06 18:32:55 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SendEphemeralPost(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API SendEphemeralPost called but not implemented."))
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateEphemeralPostArgs struct {
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
A string
|
|
|
|
|
B *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateEphemeralPostReturns struct {
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
A *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) UpdateEphemeralPost(userID string, post *model.Post) *model.Post {
|
|
|
|
|
_args := &Z_UpdateEphemeralPostArgs{userID, post}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_UpdateEphemeralPostReturns{}
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
if err := g.client.Call("Plugin.UpdateEphemeralPost", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateEphemeralPost API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateEphemeralPost(args *Z_UpdateEphemeralPostArgs, returns *Z_UpdateEphemeralPostReturns) error {
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
UpdateEphemeralPost(userID string, post *model.Post) *model.Post
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UpdateEphemeralPost(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateEphemeralPost called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteEphemeralPostArgs struct {
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
A string
|
2019-05-16 06:32:13 -04:00
|
|
|
B string
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteEphemeralPostReturns struct {
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) DeleteEphemeralPost(userID, postId string) {
|
|
|
|
|
_args := &Z_DeleteEphemeralPostArgs{userID, postId}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_DeleteEphemeralPostReturns{}
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
if err := g.client.Call("Plugin.DeleteEphemeralPost", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteEphemeralPost API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteEphemeralPost(args *Z_DeleteEphemeralPostArgs, returns *Z_DeleteEphemeralPostReturns) error {
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
DeleteEphemeralPost(userID, postId string)
|
MM-10516: Added support for PostActions in ephemeral posts (#10258)
* Added support for PostActions in ephemeral posts
The general approach is that we take all the metadata that DoPostAction
needs to process client DoPostActionRequests, and store it in a
serialized, encrypted Cookie field, in the PostAction struct.
The client then must send it back, and it is then used to process
PostActions as a fallback top the metadata in the database.
This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`.
In a cluster environment it must be the same for all instances.
- Added type PostActionCookie, and a Cookie string to PostAction.
- Added App.AddActionCookiesToPost.
- Use App.AddActionCookiesToPost in api4.createEphemeralPost,
App.SendEphemeralPost, App.UpdateEphemeralPost.
- Added App.DoPostActionWithCookie to process incoming requests with
cookies. For backward compatibility, it prefers the metadata in the
database; falls back to cookie.
- Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost.
- Added App.encryptActionCookie/App.decryptActionCookie.
* Style
* Fixed an unfortunate typo, tested with matterpoll
* minor PR feedback
* Fixed uninitialized Context
* Fixed another test failure
* Fixed permission check
* Added api test for DoPostActionWithCookie
* Replaced config.ActionCookieSecret with Server.PostActionCookieSecret
Modeled after AsymetricSigningKey
* style
* Set DeleteAt in DeleteEphemeralPost
* PR feedback
* Removed deadwood comment
* Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
|
|
|
}); ok {
|
|
|
|
|
hook.DeleteEphemeralPost(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteEphemeralPost called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeletePostArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeletePostReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) DeletePost(postId string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_DeletePostArgs{postId}
|
|
|
|
|
_returns := &Z_DeletePostReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.DeletePost", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to DeletePost API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeletePost(args *Z_DeletePostArgs, returns *Z_DeletePostReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeletePost(postId string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeletePost(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API DeletePost called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostThreadArgs struct {
|
2018-10-15 09:19:36 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostThreadReturns struct {
|
2018-10-15 09:19:36 -04:00
|
|
|
A *model.PostList
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPostThread(postId string) (*model.PostList, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPostThreadArgs{postId}
|
|
|
|
|
_returns := &Z_GetPostThreadReturns{}
|
2018-10-15 09:19:36 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPostThread", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPostThread API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPostThread(args *Z_GetPostThreadArgs, returns *Z_GetPostThreadReturns) error {
|
2018-10-15 09:19:36 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPostThread(postId string) (*model.PostList, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPostThread(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPostThread called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Post
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) GetPost(postId string) (*model.Post, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPostArgs{postId}
|
|
|
|
|
_returns := &Z_GetPostReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPost", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to GetPost API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPost(args *Z_GetPostArgs, returns *Z_GetPostReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPost(postId string) (*model.Post, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPost(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetPost called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsSinceArgs struct {
|
2018-10-15 10:04:22 -04:00
|
|
|
A string
|
|
|
|
|
B int64
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsSinceReturns struct {
|
2018-10-15 10:04:22 -04:00
|
|
|
A *model.PostList
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPostsSinceArgs{channelId, time}
|
|
|
|
|
_returns := &Z_GetPostsSinceReturns{}
|
2018-10-15 10:04:22 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPostsSince", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPostsSince API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPostsSince(args *Z_GetPostsSinceArgs, returns *Z_GetPostsSinceReturns) error {
|
2018-10-15 10:04:22 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPostsSince(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPostsSince called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsAfterArgs struct {
|
2018-10-18 12:11:15 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C int
|
|
|
|
|
D int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsAfterReturns struct {
|
2018-10-18 12:11:15 -04:00
|
|
|
A *model.PostList
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPostsAfter(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPostsAfterArgs{channelId, postId, page, perPage}
|
|
|
|
|
_returns := &Z_GetPostsAfterReturns{}
|
2018-10-18 12:11:15 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPostsAfter", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPostsAfter API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPostsAfter(args *Z_GetPostsAfterArgs, returns *Z_GetPostsAfterReturns) error {
|
2018-10-18 12:11:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPostsAfter(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPostsAfter(args.A, args.B, args.C, args.D)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPostsAfter called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsBeforeArgs struct {
|
2018-10-15 13:18:23 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C int
|
|
|
|
|
D int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsBeforeReturns struct {
|
2018-10-15 13:18:23 -04:00
|
|
|
A *model.PostList
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPostsBefore(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPostsBeforeArgs{channelId, postId, page, perPage}
|
|
|
|
|
_returns := &Z_GetPostsBeforeReturns{}
|
2018-10-15 13:18:23 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPostsBefore", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPostsBefore API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPostsBefore(args *Z_GetPostsBeforeArgs, returns *Z_GetPostsBeforeReturns) error {
|
2018-10-15 13:18:23 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPostsBefore(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPostsBefore(args.A, args.B, args.C, args.D)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPostsBefore called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsForChannelArgs struct {
|
2018-10-10 09:23:36 -04:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPostsForChannelReturns struct {
|
2018-10-10 09:23:36 -04:00
|
|
|
A *model.PostList
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPostsForChannel(channelId string, page, perPage int) (*model.PostList, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPostsForChannelArgs{channelId, page, perPage}
|
|
|
|
|
_returns := &Z_GetPostsForChannelReturns{}
|
2018-10-10 09:23:36 -04:00
|
|
|
if err := g.client.Call("Plugin.GetPostsForChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPostsForChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPostsForChannel(args *Z_GetPostsForChannelArgs, returns *Z_GetPostsForChannelReturns) error {
|
2018-10-10 09:23:36 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPostsForChannel(channelId string, page, perPage int) (*model.PostList, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPostsForChannel(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPostsForChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamStatsArgs struct {
|
2019-01-15 04:22:04 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetTeamStatsReturns struct {
|
2019-01-15 04:22:04 -05:00
|
|
|
A *model.TeamStats
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetTeamStats(teamID string) (*model.TeamStats, *model.AppError) {
|
|
|
|
|
_args := &Z_GetTeamStatsArgs{teamID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetTeamStatsReturns{}
|
2019-01-15 04:22:04 -05:00
|
|
|
if err := g.client.Call("Plugin.GetTeamStats", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetTeamStats API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetTeamStats(args *Z_GetTeamStatsArgs, returns *Z_GetTeamStatsReturns) error {
|
2019-01-15 04:22:04 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetTeamStats(teamID string) (*model.TeamStats, *model.AppError)
|
2019-01-15 04:22:04 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetTeamStats(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetTeamStats called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdatePostArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Post
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdatePostReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.Post
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) UpdatePost(post *model.Post) (*model.Post, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UpdatePostArgs{post}
|
|
|
|
|
_returns := &Z_UpdatePostReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdatePost", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to UpdatePost API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdatePost(args *Z_UpdatePostArgs, returns *Z_UpdatePostReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdatePost(post *model.Post) (*model.Post, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdatePost(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API UpdatePost called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetProfileImageArgs struct {
|
2018-10-15 10:23:41 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetProfileImageReturns struct {
|
2018-10-15 10:23:41 -04:00
|
|
|
A []byte
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) GetProfileImage(userID string) ([]byte, *model.AppError) {
|
|
|
|
|
_args := &Z_GetProfileImageArgs{userID}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_GetProfileImageReturns{}
|
2018-10-15 10:23:41 -04:00
|
|
|
if err := g.client.Call("Plugin.GetProfileImage", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetProfileImage API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetProfileImage(args *Z_GetProfileImageArgs, returns *Z_GetProfileImageReturns) error {
|
2018-10-15 10:23:41 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
GetProfileImage(userID string) ([]byte, *model.AppError)
|
2018-10-15 10:23:41 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetProfileImage(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetProfileImage called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SetProfileImageArgs struct {
|
2018-11-15 15:23:03 -05:00
|
|
|
A string
|
|
|
|
|
B []byte
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SetProfileImageReturns struct {
|
2018-11-15 15:23:03 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) SetProfileImage(userID string, data []byte) *model.AppError {
|
|
|
|
|
_args := &Z_SetProfileImageArgs{userID, data}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_SetProfileImageReturns{}
|
2018-11-15 15:23:03 -05:00
|
|
|
if err := g.client.Call("Plugin.SetProfileImage", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SetProfileImage API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SetProfileImage(args *Z_SetProfileImageArgs, returns *Z_SetProfileImageReturns) error {
|
2018-11-15 15:23:03 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
SetProfileImage(userID string, data []byte) *model.AppError
|
2018-11-15 15:23:03 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SetProfileImage(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SetProfileImage called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiListArgs struct {
|
2018-11-05 08:50:08 -05:00
|
|
|
A string
|
|
|
|
|
B int
|
|
|
|
|
C int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiListReturns struct {
|
2018-11-05 08:50:08 -05:00
|
|
|
A []*model.Emoji
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetEmojiListArgs{sortBy, page, perPage}
|
|
|
|
|
_returns := &Z_GetEmojiListReturns{}
|
2018-11-05 08:50:08 -05:00
|
|
|
if err := g.client.Call("Plugin.GetEmojiList", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetEmojiList API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetEmojiList(args *Z_GetEmojiListArgs, returns *Z_GetEmojiListReturns) error {
|
2018-11-05 08:50:08 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetEmojiList(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetEmojiList called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiByNameArgs struct {
|
2018-10-15 17:09:30 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiByNameReturns struct {
|
2018-10-15 17:09:30 -04:00
|
|
|
A *model.Emoji
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetEmojiByName(name string) (*model.Emoji, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetEmojiByNameArgs{name}
|
|
|
|
|
_returns := &Z_GetEmojiByNameReturns{}
|
2018-10-15 17:09:30 -04:00
|
|
|
if err := g.client.Call("Plugin.GetEmojiByName", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetEmojiByName API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetEmojiByName(args *Z_GetEmojiByNameArgs, returns *Z_GetEmojiByNameReturns) error {
|
2018-10-15 17:09:30 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetEmojiByName(name string) (*model.Emoji, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetEmojiByName(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetEmojiByName called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiArgs struct {
|
2018-10-25 09:54:10 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiReturns struct {
|
2018-10-25 09:54:10 -04:00
|
|
|
A *model.Emoji
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetEmojiArgs{emojiId}
|
|
|
|
|
_returns := &Z_GetEmojiReturns{}
|
2018-10-25 09:54:10 -04:00
|
|
|
if err := g.client.Call("Plugin.GetEmoji", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetEmoji API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetEmoji(args *Z_GetEmojiArgs, returns *Z_GetEmojiReturns) error {
|
2018-10-25 09:54:10 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetEmoji(emojiId string) (*model.Emoji, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetEmoji(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetEmoji called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CopyFileInfosArgs struct {
|
2018-08-02 10:37:31 -04:00
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CopyFileInfosReturns struct {
|
2018-08-02 10:37:31 -04:00
|
|
|
A []string
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) {
|
|
|
|
|
_args := &Z_CopyFileInfosArgs{userID, fileIds}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_CopyFileInfosReturns{}
|
2018-08-02 10:37:31 -04:00
|
|
|
if err := g.client.Call("Plugin.CopyFileInfos", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CopyFileInfos API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CopyFileInfos(args *Z_CopyFileInfosArgs, returns *Z_CopyFileInfosReturns) error {
|
2018-08-02 10:37:31 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError)
|
2018-08-02 10:37:31 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CopyFileInfos(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API CopyFileInfos called but not implemented."))
|
2018-08-02 10:37:31 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileInfoArgs struct {
|
2018-08-20 12:18:25 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileInfoReturns struct {
|
2018-08-20 12:18:25 -04:00
|
|
|
A *model.FileInfo
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetFileInfoArgs{fileId}
|
|
|
|
|
_returns := &Z_GetFileInfoReturns{}
|
2018-08-20 12:18:25 -04:00
|
|
|
if err := g.client.Call("Plugin.GetFileInfo", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetFileInfo API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetFileInfo(args *Z_GetFileInfoArgs, returns *Z_GetFileInfoReturns) error {
|
2018-08-20 12:18:25 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetFileInfo(fileId string) (*model.FileInfo, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetFileInfo(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API GetFileInfo called but not implemented."))
|
2018-08-20 12:18:25 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-30 16:43:40 -04:00
|
|
|
type Z_SetFileSearchableContentArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SetFileSearchableContentReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) SetFileSearchableContent(fileID string, content string) *model.AppError {
|
|
|
|
|
_args := &Z_SetFileSearchableContentArgs{fileID, content}
|
|
|
|
|
_returns := &Z_SetFileSearchableContentReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.SetFileSearchableContent", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SetFileSearchableContent API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) SetFileSearchableContent(args *Z_SetFileSearchableContentArgs, returns *Z_SetFileSearchableContentReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SetFileSearchableContent(fileID string, content string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SetFileSearchableContent(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SetFileSearchableContent called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileInfosArgs struct {
|
2020-02-14 15:21:54 -05:00
|
|
|
A int
|
|
|
|
|
B int
|
|
|
|
|
C *model.GetFileInfosOptions
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileInfosReturns struct {
|
2020-02-14 15:21:54 -05:00
|
|
|
A []*model.FileInfo
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetFileInfosArgs{page, perPage, opt}
|
|
|
|
|
_returns := &Z_GetFileInfosReturns{}
|
2020-02-14 15:21:54 -05:00
|
|
|
if err := g.client.Call("Plugin.GetFileInfos", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetFileInfos API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetFileInfos(args *Z_GetFileInfosArgs, returns *Z_GetFileInfosReturns) error {
|
2020-02-14 15:21:54 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetFileInfos(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetFileInfos called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileArgs struct {
|
2018-12-13 04:46:42 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileReturns struct {
|
2018-12-13 04:46:42 -05:00
|
|
|
A []byte
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetFile(fileId string) ([]byte, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetFileArgs{fileId}
|
|
|
|
|
_returns := &Z_GetFileReturns{}
|
2018-12-13 04:46:42 -05:00
|
|
|
if err := g.client.Call("Plugin.GetFile", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetFile API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetFile(args *Z_GetFileArgs, returns *Z_GetFileReturns) error {
|
2018-12-13 04:46:42 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetFile(fileId string) ([]byte, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetFile(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetFile called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileLinkArgs struct {
|
2018-10-17 20:31:51 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetFileLinkReturns struct {
|
2018-10-17 20:31:51 -04:00
|
|
|
A string
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetFileLink(fileId string) (string, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetFileLinkArgs{fileId}
|
|
|
|
|
_returns := &Z_GetFileLinkReturns{}
|
2018-10-17 20:31:51 -04:00
|
|
|
if err := g.client.Call("Plugin.GetFileLink", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetFileLink API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetFileLink(args *Z_GetFileLinkArgs, returns *Z_GetFileLinkReturns) error {
|
2018-10-17 20:31:51 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetFileLink(fileId string) (string, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetFileLink(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetFileLink called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ReadFileArgs struct {
|
2018-08-20 12:18:25 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ReadFileReturns struct {
|
2018-08-20 12:18:25 -04:00
|
|
|
A []byte
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ReadFile(path string) ([]byte, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ReadFileArgs{path}
|
|
|
|
|
_returns := &Z_ReadFileReturns{}
|
2018-08-20 12:18:25 -04:00
|
|
|
if err := g.client.Call("Plugin.ReadFile", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ReadFile API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) ReadFile(args *Z_ReadFileArgs, returns *Z_ReadFileReturns) error {
|
2018-08-20 12:18:25 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ReadFile(path string) ([]byte, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ReadFile(args.A)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API ReadFile called but not implemented."))
|
2018-08-20 12:18:25 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiImageArgs struct {
|
2018-10-18 16:07:21 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetEmojiImageReturns struct {
|
2018-10-18 16:07:21 -04:00
|
|
|
A []byte
|
|
|
|
|
B string
|
|
|
|
|
C *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetEmojiImageArgs{emojiId}
|
|
|
|
|
_returns := &Z_GetEmojiImageReturns{}
|
2018-10-18 16:07:21 -04:00
|
|
|
if err := g.client.Call("Plugin.GetEmojiImage", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetEmojiImage API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B, _returns.C
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetEmojiImage(args *Z_GetEmojiImageArgs, returns *Z_GetEmojiImageReturns) error {
|
2018-10-18 16:07:21 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetEmojiImage(emojiId string) ([]byte, string, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B, returns.C = hook.GetEmojiImage(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetEmojiImage called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UploadFileArgs struct {
|
2018-11-07 15:24:54 -05:00
|
|
|
A []byte
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UploadFileReturns struct {
|
2018-11-07 15:24:54 -05:00
|
|
|
A *model.FileInfo
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UploadFileArgs{data, channelId, filename}
|
|
|
|
|
_returns := &Z_UploadFileReturns{}
|
2018-11-07 15:24:54 -05:00
|
|
|
if err := g.client.Call("Plugin.UploadFile", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UploadFile API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UploadFile(args *Z_UploadFileArgs, returns *Z_UploadFileReturns) error {
|
2018-11-07 15:24:54 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UploadFile(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UploadFile called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_OpenInteractiveDialogArgs struct {
|
2018-11-19 15:27:17 -05:00
|
|
|
A model.OpenDialogRequest
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_OpenInteractiveDialogReturns struct {
|
2018-11-19 15:27:17 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_OpenInteractiveDialogArgs{dialog}
|
|
|
|
|
_returns := &Z_OpenInteractiveDialogReturns{}
|
2018-11-19 15:27:17 -05:00
|
|
|
if err := g.client.Call("Plugin.OpenInteractiveDialog", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to OpenInteractiveDialog API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) OpenInteractiveDialog(args *Z_OpenInteractiveDialogArgs, returns *Z_OpenInteractiveDialogReturns) error {
|
2018-11-19 15:27:17 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.OpenInteractiveDialog(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API OpenInteractiveDialog called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPluginsArgs struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPluginsReturns struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A []*model.Manifest
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPlugins() ([]*model.Manifest, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPluginsArgs{}
|
|
|
|
|
_returns := &Z_GetPluginsReturns{}
|
2018-11-08 13:17:07 -05:00
|
|
|
if err := g.client.Call("Plugin.GetPlugins", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPlugins API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPlugins(args *Z_GetPluginsArgs, returns *Z_GetPluginsReturns) error {
|
2018-11-08 13:17:07 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPlugins() ([]*model.Manifest, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPlugins()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPlugins called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_EnablePluginArgs struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_EnablePluginReturns struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) EnablePlugin(id string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_EnablePluginArgs{id}
|
|
|
|
|
_returns := &Z_EnablePluginReturns{}
|
2018-11-08 13:17:07 -05:00
|
|
|
if err := g.client.Call("Plugin.EnablePlugin", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to EnablePlugin API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) EnablePlugin(args *Z_EnablePluginArgs, returns *Z_EnablePluginReturns) error {
|
2018-11-08 13:17:07 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
EnablePlugin(id string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.EnablePlugin(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API EnablePlugin called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DisablePluginArgs struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DisablePluginReturns struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DisablePlugin(id string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_DisablePluginArgs{id}
|
|
|
|
|
_returns := &Z_DisablePluginReturns{}
|
2018-11-08 13:17:07 -05:00
|
|
|
if err := g.client.Call("Plugin.DisablePlugin", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DisablePlugin API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DisablePlugin(args *Z_DisablePluginArgs, returns *Z_DisablePluginReturns) error {
|
2018-11-08 13:17:07 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DisablePlugin(id string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DisablePlugin(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DisablePlugin called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RemovePluginArgs struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_RemovePluginReturns struct {
|
2018-11-08 13:17:07 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RemovePlugin(id string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_RemovePluginArgs{id}
|
|
|
|
|
_returns := &Z_RemovePluginReturns{}
|
2018-11-08 13:17:07 -05:00
|
|
|
if err := g.client.Call("Plugin.RemovePlugin", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RemovePlugin API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) RemovePlugin(args *Z_RemovePluginArgs, returns *Z_RemovePluginReturns) error {
|
2018-11-08 13:17:07 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RemovePlugin(id string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RemovePlugin(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RemovePlugin called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPluginStatusArgs struct {
|
2018-11-15 15:23:03 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetPluginStatusReturns struct {
|
2018-11-15 15:23:03 -05:00
|
|
|
A *model.PluginStatus
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetPluginStatusArgs{id}
|
|
|
|
|
_returns := &Z_GetPluginStatusReturns{}
|
2018-11-15 15:23:03 -05:00
|
|
|
if err := g.client.Call("Plugin.GetPluginStatus", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPluginStatus API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetPluginStatus(args *Z_GetPluginStatusArgs, returns *Z_GetPluginStatusReturns) error {
|
2018-11-15 15:23:03 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPluginStatus(id string) (*model.PluginStatus, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPluginStatus(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPluginStatus called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVSetArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
B []byte
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVSetReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) KVSet(key string, value []byte) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVSetArgs{key, value}
|
|
|
|
|
_returns := &Z_KVSetReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.KVSet", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to KVSet API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVSet(args *Z_KVSetArgs, returns *Z_KVSetReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVSet(key string, value []byte) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.KVSet(args.A, args.B)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API KVSet called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVCompareAndSetArgs struct {
|
2019-04-23 13:35:17 -04:00
|
|
|
A string
|
|
|
|
|
B []byte
|
|
|
|
|
C []byte
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVCompareAndSetReturns struct {
|
2019-04-23 13:35:17 -04:00
|
|
|
A bool
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) KVCompareAndSet(key string, oldValue, newValue []byte) (bool, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVCompareAndSetArgs{key, oldValue, newValue}
|
|
|
|
|
_returns := &Z_KVCompareAndSetReturns{}
|
2019-04-23 13:35:17 -04:00
|
|
|
if err := g.client.Call("Plugin.KVCompareAndSet", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to KVCompareAndSet API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVCompareAndSet(args *Z_KVCompareAndSetArgs, returns *Z_KVCompareAndSetReturns) error {
|
2019-04-23 13:35:17 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVCompareAndSet(key string, oldValue, newValue []byte) (bool, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.KVCompareAndSet(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API KVCompareAndSet called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVCompareAndDeleteArgs struct {
|
2019-08-21 22:25:38 -04:00
|
|
|
A string
|
|
|
|
|
B []byte
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVCompareAndDeleteReturns struct {
|
2019-08-21 22:25:38 -04:00
|
|
|
A bool
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) KVCompareAndDelete(key string, oldValue []byte) (bool, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVCompareAndDeleteArgs{key, oldValue}
|
|
|
|
|
_returns := &Z_KVCompareAndDeleteReturns{}
|
2019-08-21 22:25:38 -04:00
|
|
|
if err := g.client.Call("Plugin.KVCompareAndDelete", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to KVCompareAndDelete API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVCompareAndDelete(args *Z_KVCompareAndDeleteArgs, returns *Z_KVCompareAndDeleteReturns) error {
|
2019-08-21 22:25:38 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVCompareAndDelete(key string, oldValue []byte) (bool, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.KVCompareAndDelete(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API KVCompareAndDelete called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVSetWithOptionsArgs struct {
|
2019-11-04 07:49:54 -05:00
|
|
|
A string
|
2019-12-03 04:46:15 -05:00
|
|
|
B []byte
|
2019-11-04 07:49:54 -05:00
|
|
|
C model.PluginKVSetOptions
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVSetWithOptionsReturns struct {
|
2019-11-04 07:49:54 -05:00
|
|
|
A bool
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-03 04:46:15 -05:00
|
|
|
func (g *apiRPCClient) KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVSetWithOptionsArgs{key, value, options}
|
|
|
|
|
_returns := &Z_KVSetWithOptionsReturns{}
|
2019-11-04 07:49:54 -05:00
|
|
|
if err := g.client.Call("Plugin.KVSetWithOptions", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to KVSetWithOptions API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVSetWithOptions(args *Z_KVSetWithOptionsArgs, returns *Z_KVSetWithOptionsReturns) error {
|
2019-11-04 07:49:54 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
2019-12-03 04:46:15 -05:00
|
|
|
KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError)
|
2019-11-04 07:49:54 -05:00
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.KVSetWithOptions(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API KVSetWithOptions called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVSetWithExpiryArgs struct {
|
2018-10-10 13:55:12 -04:00
|
|
|
A string
|
|
|
|
|
B []byte
|
|
|
|
|
C int64
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVSetWithExpiryReturns struct {
|
2018-10-10 13:55:12 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVSetWithExpiryArgs{key, value, expireInSeconds}
|
|
|
|
|
_returns := &Z_KVSetWithExpiryReturns{}
|
2018-10-10 13:55:12 -04:00
|
|
|
if err := g.client.Call("Plugin.KVSetWithExpiry", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to KVSetWithExpiry API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVSetWithExpiry(args *Z_KVSetWithExpiryArgs, returns *Z_KVSetWithExpiryReturns) error {
|
2018-10-10 13:55:12 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.KVSetWithExpiry(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API KVSetWithExpiry called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVGetArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVGetReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A []byte
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) KVGet(key string) ([]byte, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVGetArgs{key}
|
|
|
|
|
_returns := &Z_KVGetReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.KVGet", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to KVGet API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVGet(args *Z_KVGetArgs, returns *Z_KVGetReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVGet(key string) ([]byte, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.KVGet(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API KVGet called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVDeleteArgs struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVDeleteReturns struct {
|
2018-06-25 15:33:13 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 10:29:50 -04:00
|
|
|
func (g *apiRPCClient) KVDelete(key string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVDeleteArgs{key}
|
|
|
|
|
_returns := &Z_KVDeleteReturns{}
|
2018-06-25 15:33:13 -04:00
|
|
|
if err := g.client.Call("Plugin.KVDelete", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to KVDelete API failed: %s", err.Error())
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVDelete(args *Z_KVDeleteArgs, returns *Z_KVDeleteReturns) error {
|
2018-06-25 15:33:13 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVDelete(key string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.KVDelete(args.A)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API KVDelete called but not implemented."))
|
2018-06-25 15:33:13 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2018-06-27 08:46:38 -04:00
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVDeleteAllArgs struct {
|
2018-10-10 13:55:12 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVDeleteAllReturns struct {
|
2018-10-10 13:55:12 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) KVDeleteAll() *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVDeleteAllArgs{}
|
|
|
|
|
_returns := &Z_KVDeleteAllReturns{}
|
2018-10-10 13:55:12 -04:00
|
|
|
if err := g.client.Call("Plugin.KVDeleteAll", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to KVDeleteAll API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVDeleteAll(args *Z_KVDeleteAllArgs, returns *Z_KVDeleteAllReturns) error {
|
2018-10-10 13:55:12 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVDeleteAll() *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.KVDeleteAll()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API KVDeleteAll called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVListArgs struct {
|
2018-10-03 16:04:37 -04:00
|
|
|
A int
|
|
|
|
|
B int
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_KVListReturns struct {
|
2018-10-03 16:04:37 -04:00
|
|
|
A []string
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) KVList(page, perPage int) ([]string, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_KVListArgs{page, perPage}
|
|
|
|
|
_returns := &Z_KVListReturns{}
|
2018-10-03 16:04:37 -04:00
|
|
|
if err := g.client.Call("Plugin.KVList", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to KVList API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) KVList(args *Z_KVListArgs, returns *Z_KVListReturns) error {
|
2018-10-03 16:04:37 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
KVList(page, perPage int) ([]string, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.KVList(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API KVList called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PublishWebSocketEventArgs struct {
|
2018-06-27 08:46:38 -04:00
|
|
|
A string
|
2022-07-05 02:46:50 -04:00
|
|
|
B map[string]any
|
2018-06-27 08:46:38 -04:00
|
|
|
C *model.WebsocketBroadcast
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PublishWebSocketEventReturns struct {
|
2018-06-27 08:46:38 -04:00
|
|
|
}
|
|
|
|
|
|
2022-07-05 02:46:50 -04:00
|
|
|
func (g *apiRPCClient) PublishWebSocketEvent(event string, payload map[string]any, broadcast *model.WebsocketBroadcast) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_PublishWebSocketEventArgs{event, payload, broadcast}
|
|
|
|
|
_returns := &Z_PublishWebSocketEventReturns{}
|
2018-06-27 08:46:38 -04:00
|
|
|
if err := g.client.Call("Plugin.PublishWebSocketEvent", _args, _returns); err != nil {
|
2018-07-27 11:17:29 -04:00
|
|
|
log.Printf("RPC call to PublishWebSocketEvent API failed: %s", err.Error())
|
2018-06-27 08:46:38 -04:00
|
|
|
}
|
2018-09-03 08:08:40 -04:00
|
|
|
|
2018-06-27 08:46:38 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) PublishWebSocketEvent(args *Z_PublishWebSocketEventArgs, returns *Z_PublishWebSocketEventReturns) error {
|
2018-06-27 08:46:38 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2022-07-05 02:46:50 -04:00
|
|
|
PublishWebSocketEvent(event string, payload map[string]any, broadcast *model.WebsocketBroadcast)
|
2018-06-27 08:46:38 -04:00
|
|
|
}); ok {
|
|
|
|
|
hook.PublishWebSocketEvent(args.A, args.B, args.C)
|
2018-07-03 12:58:28 -04:00
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API PublishWebSocketEvent called but not implemented."))
|
2018-07-03 12:58:28 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_HasPermissionToArgs struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A string
|
|
|
|
|
B *model.Permission
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_HasPermissionToReturns struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) HasPermissionTo(userID string, permission *model.Permission) bool {
|
|
|
|
|
_args := &Z_HasPermissionToArgs{userID, permission}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_HasPermissionToReturns{}
|
2018-08-20 12:22:08 -04:00
|
|
|
if err := g.client.Call("Plugin.HasPermissionTo", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to HasPermissionTo API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) HasPermissionTo(args *Z_HasPermissionToArgs, returns *Z_HasPermissionToReturns) error {
|
2018-08-20 12:22:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
HasPermissionTo(userID string, permission *model.Permission) bool
|
2018-08-20 12:22:08 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.HasPermissionTo(args.A, args.B)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API HasPermissionTo called but not implemented."))
|
2018-08-20 12:22:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_HasPermissionToTeamArgs struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C *model.Permission
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_HasPermissionToTeamReturns struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) HasPermissionToTeam(userID, teamID string, permission *model.Permission) bool {
|
|
|
|
|
_args := &Z_HasPermissionToTeamArgs{userID, teamID, permission}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_HasPermissionToTeamReturns{}
|
2018-08-20 12:22:08 -04:00
|
|
|
if err := g.client.Call("Plugin.HasPermissionToTeam", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to HasPermissionToTeam API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) HasPermissionToTeam(args *Z_HasPermissionToTeamArgs, returns *Z_HasPermissionToTeamReturns) error {
|
2018-08-20 12:22:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
HasPermissionToTeam(userID, teamID string, permission *model.Permission) bool
|
2018-08-20 12:22:08 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.HasPermissionToTeam(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API HasPermissionToTeam called but not implemented."))
|
2018-08-20 12:22:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_HasPermissionToChannelArgs struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C *model.Permission
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_HasPermissionToChannelReturns struct {
|
2018-08-20 12:22:08 -04:00
|
|
|
A bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) HasPermissionToChannel(userID, channelId string, permission *model.Permission) bool {
|
|
|
|
|
_args := &Z_HasPermissionToChannelArgs{userID, channelId, permission}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_HasPermissionToChannelReturns{}
|
2018-08-20 12:22:08 -04:00
|
|
|
if err := g.client.Call("Plugin.HasPermissionToChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to HasPermissionToChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) HasPermissionToChannel(args *Z_HasPermissionToChannelArgs, returns *Z_HasPermissionToChannelReturns) error {
|
2018-08-20 12:22:08 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
HasPermissionToChannel(userID, channelId string, permission *model.Permission) bool
|
2018-08-20 12:22:08 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.HasPermissionToChannel(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
2018-09-13 14:31:22 -04:00
|
|
|
return encodableError(fmt.Errorf("API HasPermissionToChannel called but not implemented."))
|
2018-08-20 12:22:08 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-07 12:43:33 -05:00
|
|
|
type Z_RolesGrantPermissionArgs struct {
|
|
|
|
|
A []string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RolesGrantPermissionReturns struct {
|
|
|
|
|
A bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RolesGrantPermission(roleNames []string, permissionId string) bool {
|
|
|
|
|
_args := &Z_RolesGrantPermissionArgs{roleNames, permissionId}
|
|
|
|
|
_returns := &Z_RolesGrantPermissionReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RolesGrantPermission", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RolesGrantPermission API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RolesGrantPermission(args *Z_RolesGrantPermissionArgs, returns *Z_RolesGrantPermissionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RolesGrantPermission(roleNames []string, permissionId string) bool
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RolesGrantPermission(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RolesGrantPermission called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SendMailArgs struct {
|
2019-01-10 04:06:14 -05:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_SendMailReturns struct {
|
2019-01-10 04:06:14 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) SendMail(to, subject, htmlBody string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_SendMailArgs{to, subject, htmlBody}
|
|
|
|
|
_returns := &Z_SendMailReturns{}
|
2019-01-10 04:06:14 -05:00
|
|
|
if err := g.client.Call("Plugin.SendMail", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SendMail API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) SendMail(args *Z_SendMailArgs, returns *Z_SendMailReturns) error {
|
2019-01-10 04:06:14 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SendMail(to, subject, htmlBody string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SendMail(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SendMail called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateBotArgs struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.Bot
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateBotReturns struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.Bot
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_CreateBotArgs{bot}
|
|
|
|
|
_returns := &Z_CreateBotReturns{}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if err := g.client.Call("Plugin.CreateBot", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateBot API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateBot(args *Z_CreateBotArgs, returns *Z_CreateBotReturns) error {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateBot(bot *model.Bot) (*model.Bot, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateBot(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateBot called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PatchBotArgs struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A string
|
|
|
|
|
B *model.BotPatch
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PatchBotReturns struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.Bot
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_PatchBotArgs{botUserId, botPatch}
|
|
|
|
|
_returns := &Z_PatchBotReturns{}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if err := g.client.Call("Plugin.PatchBot", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to PatchBot API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) PatchBot(args *Z_PatchBotArgs, returns *Z_PatchBotReturns) error {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.PatchBot(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API PatchBot called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetBotArgs struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A string
|
|
|
|
|
B bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetBotReturns struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.Bot
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetBotArgs{botUserId, includeDeleted}
|
|
|
|
|
_returns := &Z_GetBotReturns{}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if err := g.client.Call("Plugin.GetBot", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetBot API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetBot(args *Z_GetBotArgs, returns *Z_GetBotReturns) error {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetBot(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetBot called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetBotsArgs struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.BotGetOptions
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetBotsReturns struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A []*model.Bot
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetBotsArgs{options}
|
|
|
|
|
_returns := &Z_GetBotsReturns{}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if err := g.client.Call("Plugin.GetBots", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetBots API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetBots(args *Z_GetBotsArgs, returns *Z_GetBotsReturns) error {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetBots(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetBots called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateBotActiveArgs struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A string
|
|
|
|
|
B bool
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateBotActiveReturns struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.Bot
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UpdateBotActiveArgs{botUserId, active}
|
|
|
|
|
_returns := &Z_UpdateBotActiveReturns{}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if err := g.client.Call("Plugin.UpdateBotActive", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateBotActive API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateBotActive(args *Z_UpdateBotActiveArgs, returns *Z_UpdateBotActiveReturns) error {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateBotActive(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateBotActive called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PermanentDeleteBotArgs struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PermanentDeleteBotReturns struct {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) PermanentDeleteBot(botUserId string) *model.AppError {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_PermanentDeleteBotArgs{botUserId}
|
|
|
|
|
_returns := &Z_PermanentDeleteBotReturns{}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if err := g.client.Call("Plugin.PermanentDeleteBot", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to PermanentDeleteBot API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) PermanentDeleteBot(args *Z_PermanentDeleteBotArgs, returns *Z_PermanentDeleteBotReturns) error {
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
PermanentDeleteBot(botUserId string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.PermanentDeleteBot(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API PermanentDeleteBot called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2019-07-11 12:00:12 -04:00
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PublishUserTypingArgs struct {
|
2020-06-16 05:41:05 -04:00
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_PublishUserTypingReturns struct {
|
2020-06-16 05:41:05 -04:00
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
func (g *apiRPCClient) PublishUserTyping(userID, channelId, parentId string) *model.AppError {
|
|
|
|
|
_args := &Z_PublishUserTypingArgs{userID, channelId, parentId}
|
2021-03-23 05:32:54 -04:00
|
|
|
_returns := &Z_PublishUserTypingReturns{}
|
2020-06-16 05:41:05 -04:00
|
|
|
if err := g.client.Call("Plugin.PublishUserTyping", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to PublishUserTyping API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) PublishUserTyping(args *Z_PublishUserTypingArgs, returns *Z_PublishUserTypingReturns) error {
|
2020-06-16 05:41:05 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2021-04-22 00:33:45 -04:00
|
|
|
PublishUserTyping(userID, channelId, parentId string) *model.AppError
|
2020-06-16 05:41:05 -04:00
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.PublishUserTyping(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API PublishUserTyping called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateCommandArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A *model.Command
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_CreateCommandReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A *model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateCommand(cmd *model.Command) (*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_CreateCommandArgs{cmd}
|
|
|
|
|
_returns := &Z_CreateCommandReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.CreateCommand", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateCommand API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) CreateCommand(args *Z_CreateCommandArgs, returns *Z_CreateCommandReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateCommand(cmd *model.Command) (*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateCommand(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateCommand called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListCommandsArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListCommandsReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A []*model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ListCommands(teamID string) ([]*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ListCommandsArgs{teamID}
|
|
|
|
|
_returns := &Z_ListCommandsReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.ListCommands", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ListCommands API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) ListCommands(args *Z_ListCommandsArgs, returns *Z_ListCommandsReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ListCommands(teamID string) ([]*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ListCommands(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ListCommands called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListCustomCommandsArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListCustomCommandsReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A []*model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ListCustomCommands(teamID string) ([]*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ListCustomCommandsArgs{teamID}
|
|
|
|
|
_returns := &Z_ListCustomCommandsReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.ListCustomCommands", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ListCustomCommands API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) ListCustomCommands(args *Z_ListCustomCommandsArgs, returns *Z_ListCustomCommandsReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ListCustomCommands(teamID string) ([]*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ListCustomCommands(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ListCustomCommands called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListPluginCommandsArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListPluginCommandsReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A []*model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ListPluginCommands(teamID string) ([]*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ListPluginCommandsArgs{teamID}
|
|
|
|
|
_returns := &Z_ListPluginCommandsReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.ListPluginCommands", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ListPluginCommands API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) ListPluginCommands(args *Z_ListPluginCommandsArgs, returns *Z_ListPluginCommandsReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ListPluginCommands(teamID string) ([]*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ListPluginCommands(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ListPluginCommands called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListBuiltInCommandsArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_ListBuiltInCommandsReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A []*model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ListBuiltInCommands() ([]*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_ListBuiltInCommandsArgs{}
|
|
|
|
|
_returns := &Z_ListBuiltInCommandsReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.ListBuiltInCommands", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ListBuiltInCommands API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) ListBuiltInCommands(args *Z_ListBuiltInCommandsArgs, returns *Z_ListBuiltInCommandsReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ListBuiltInCommands() ([]*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ListBuiltInCommands()
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ListBuiltInCommands called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetCommandArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_GetCommandReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A *model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetCommand(commandID string) (*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_GetCommandArgs{commandID}
|
|
|
|
|
_returns := &Z_GetCommandReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.GetCommand", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetCommand API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) GetCommand(args *Z_GetCommandArgs, returns *Z_GetCommandReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetCommand(commandID string) (*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetCommand(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetCommand called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateCommandArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A string
|
|
|
|
|
B *model.Command
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_UpdateCommandReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A *model.Command
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateCommand(commandID string, updatedCmd *model.Command) (*model.Command, error) {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_UpdateCommandArgs{commandID, updatedCmd}
|
|
|
|
|
_returns := &Z_UpdateCommandReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.UpdateCommand", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateCommand API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) UpdateCommand(args *Z_UpdateCommandArgs, returns *Z_UpdateCommandReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateCommand(commandID string, updatedCmd *model.Command) (*model.Command, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateCommand(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateCommand called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteCommandArgs struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
type Z_DeleteCommandReturns struct {
|
2020-07-31 11:40:15 -04:00
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeleteCommand(commandID string) error {
|
2021-03-23 05:32:54 -04:00
|
|
|
_args := &Z_DeleteCommandArgs{commandID}
|
|
|
|
|
_returns := &Z_DeleteCommandReturns{}
|
2020-07-31 11:40:15 -04:00
|
|
|
if err := g.client.Call("Plugin.DeleteCommand", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteCommand API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-23 05:32:54 -04:00
|
|
|
func (s *apiRPCServer) DeleteCommand(args *Z_DeleteCommandArgs, returns *Z_DeleteCommandReturns) error {
|
2020-07-31 11:40:15 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteCommand(commandID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteCommand(args.A)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteCommand called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2021-04-28 13:59:32 -04:00
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
type Z_CreateOAuthAppArgs struct {
|
|
|
|
|
A *model.OAuthApp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateOAuthAppReturns struct {
|
|
|
|
|
A *model.OAuthApp
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateOAuthAppArgs{app}
|
|
|
|
|
_returns := &Z_CreateOAuthAppReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateOAuthApp", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateOAuthApp API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateOAuthApp(args *Z_CreateOAuthAppArgs, returns *Z_CreateOAuthAppReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateOAuthApp(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateOAuthApp called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetOAuthAppArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetOAuthAppReturns struct {
|
|
|
|
|
A *model.OAuthApp
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError) {
|
|
|
|
|
_args := &Z_GetOAuthAppArgs{appID}
|
|
|
|
|
_returns := &Z_GetOAuthAppReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetOAuthApp", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetOAuthApp API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetOAuthApp(args *Z_GetOAuthAppArgs, returns *Z_GetOAuthAppReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetOAuthApp(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetOAuthApp called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateOAuthAppArgs struct {
|
|
|
|
|
A *model.OAuthApp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateOAuthAppReturns struct {
|
|
|
|
|
A *model.OAuthApp
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateOAuthAppArgs{app}
|
|
|
|
|
_returns := &Z_UpdateOAuthAppReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateOAuthApp", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateOAuthApp API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateOAuthApp(args *Z_UpdateOAuthAppArgs, returns *Z_UpdateOAuthAppReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateOAuthApp(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateOAuthApp called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteOAuthAppArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteOAuthAppReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeleteOAuthApp(appID string) *model.AppError {
|
|
|
|
|
_args := &Z_DeleteOAuthAppArgs{appID}
|
|
|
|
|
_returns := &Z_DeleteOAuthAppReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeleteOAuthApp", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteOAuthApp API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeleteOAuthApp(args *Z_DeleteOAuthAppArgs, returns *Z_DeleteOAuthAppReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteOAuthApp(appID string) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteOAuthApp(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteOAuthApp called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-28 13:59:32 -04:00
|
|
|
type Z_PublishPluginClusterEventArgs struct {
|
|
|
|
|
A model.PluginClusterEvent
|
|
|
|
|
B model.PluginClusterEventSendOptions
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_PublishPluginClusterEventReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) PublishPluginClusterEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error {
|
|
|
|
|
_args := &Z_PublishPluginClusterEventArgs{ev, opts}
|
|
|
|
|
_returns := &Z_PublishPluginClusterEventReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.PublishPluginClusterEvent", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to PublishPluginClusterEvent API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) PublishPluginClusterEvent(args *Z_PublishPluginClusterEventArgs, returns *Z_PublishPluginClusterEventReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
PublishPluginClusterEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.PublishPluginClusterEvent(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API PublishPluginClusterEvent called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2021-05-14 04:35:59 -04:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
2022-05-09 09:05:50 -04:00
|
|
|
|
|
|
|
|
type Z_GetCloudLimitsArgs struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetCloudLimitsReturns struct {
|
|
|
|
|
A *model.ProductLimits
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetCloudLimits() (*model.ProductLimits, error) {
|
|
|
|
|
_args := &Z_GetCloudLimitsArgs{}
|
|
|
|
|
_returns := &Z_GetCloudLimitsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetCloudLimits", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetCloudLimits API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetCloudLimits(args *Z_GetCloudLimitsArgs, returns *Z_GetCloudLimitsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetCloudLimits() (*model.ProductLimits, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetCloudLimits()
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetCloudLimits called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2022-06-22 04:36:00 -04:00
|
|
|
|
|
|
|
|
type Z_EnsureBotUserArgs struct {
|
|
|
|
|
A *model.Bot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_EnsureBotUserReturns struct {
|
|
|
|
|
A string
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) EnsureBotUser(bot *model.Bot) (string, error) {
|
|
|
|
|
_args := &Z_EnsureBotUserArgs{bot}
|
|
|
|
|
_returns := &Z_EnsureBotUserReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.EnsureBotUser", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to EnsureBotUser API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) EnsureBotUser(args *Z_EnsureBotUserArgs, returns *Z_EnsureBotUserReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
EnsureBotUser(bot *model.Bot) (string, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.EnsureBotUser(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API EnsureBotUser called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2022-11-03 14:43:30 -04:00
|
|
|
|
|
|
|
|
type Z_RegisterCollectionAndTopicArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RegisterCollectionAndTopicReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RegisterCollectionAndTopic(collectionType, topicType string) error {
|
|
|
|
|
_args := &Z_RegisterCollectionAndTopicArgs{collectionType, topicType}
|
|
|
|
|
_returns := &Z_RegisterCollectionAndTopicReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RegisterCollectionAndTopic", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RegisterCollectionAndTopic API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RegisterCollectionAndTopic(args *Z_RegisterCollectionAndTopicArgs, returns *Z_RegisterCollectionAndTopicReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RegisterCollectionAndTopic(collectionType, topicType string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.RegisterCollectionAndTopic(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RegisterCollectionAndTopic called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2022-11-22 16:26:22 -05:00
|
|
|
|
|
|
|
|
type Z_CreateUploadSessionArgs struct {
|
|
|
|
|
A *model.UploadSession
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateUploadSessionReturns struct {
|
|
|
|
|
A *model.UploadSession
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, error) {
|
|
|
|
|
_args := &Z_CreateUploadSessionArgs{us}
|
|
|
|
|
_returns := &Z_CreateUploadSessionReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateUploadSession", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateUploadSession API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateUploadSession(args *Z_CreateUploadSessionArgs, returns *Z_CreateUploadSessionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateUploadSession(us *model.UploadSession) (*model.UploadSession, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateUploadSession(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateUploadSession called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetUploadSessionArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetUploadSessionReturns struct {
|
|
|
|
|
A *model.UploadSession
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetUploadSession(uploadID string) (*model.UploadSession, error) {
|
|
|
|
|
_args := &Z_GetUploadSessionArgs{uploadID}
|
|
|
|
|
_returns := &Z_GetUploadSessionReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetUploadSession", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetUploadSession API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetUploadSession(args *Z_GetUploadSessionArgs, returns *Z_GetUploadSessionReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetUploadSession(uploadID string) (*model.UploadSession, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetUploadSession(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetUploadSession called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2023-08-18 13:05:26 -04:00
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
type Z_SendPushNotificationArgs struct {
|
|
|
|
|
A *model.PushNotification
|
|
|
|
|
B string
|
2023-08-18 13:05:26 -04:00
|
|
|
}
|
|
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
type Z_SendPushNotificationReturns struct {
|
|
|
|
|
A *model.AppError
|
2023-08-18 13:05:26 -04:00
|
|
|
}
|
|
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
func (g *apiRPCClient) SendPushNotification(notification *model.PushNotification, userID string) *model.AppError {
|
|
|
|
|
_args := &Z_SendPushNotificationArgs{notification, userID}
|
|
|
|
|
_returns := &Z_SendPushNotificationReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.SendPushNotification", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SendPushNotification API failed: %s", err.Error())
|
2023-08-18 13:05:26 -04:00
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
func (s *apiRPCServer) SendPushNotification(args *Z_SendPushNotificationArgs, returns *Z_SendPushNotificationReturns) error {
|
2023-08-18 13:05:26 -04:00
|
|
|
if hook, ok := s.impl.(interface {
|
2023-08-24 12:33:53 -04:00
|
|
|
SendPushNotification(notification *model.PushNotification, userID string) *model.AppError
|
2023-08-18 13:05:26 -04:00
|
|
|
}); ok {
|
2023-08-24 12:33:53 -04:00
|
|
|
returns.A = hook.SendPushNotification(args.A, args.B)
|
2023-08-18 13:05:26 -04:00
|
|
|
} else {
|
2023-08-24 12:33:53 -04:00
|
|
|
return encodableError(fmt.Errorf("API SendPushNotification called but not implemented."))
|
2023-08-18 13:05:26 -04:00
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2023-11-10 20:55:33 -05:00
|
|
|
|
|
|
|
|
type Z_UpdateUserAuthArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B *model.UserAuth
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateUserAuthReturns struct {
|
|
|
|
|
A *model.UserAuth
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateUserAuthArgs{userID, userAuth}
|
|
|
|
|
_returns := &Z_UpdateUserAuthReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateUserAuth", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateUserAuth API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateUserAuth(args *Z_UpdateUserAuthArgs, returns *Z_UpdateUserAuthReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateUserAuth(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateUserAuth called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
|
|
|
|
|
type Z_RegisterPluginForSharedChannelsArgs struct {
|
|
|
|
|
A model.RegisterPluginOpts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RegisterPluginForSharedChannelsReturns struct {
|
|
|
|
|
A string
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error) {
|
|
|
|
|
_args := &Z_RegisterPluginForSharedChannelsArgs{opts}
|
|
|
|
|
_returns := &Z_RegisterPluginForSharedChannelsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RegisterPluginForSharedChannels", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RegisterPluginForSharedChannels API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RegisterPluginForSharedChannels(args *Z_RegisterPluginForSharedChannelsArgs, returns *Z_RegisterPluginForSharedChannelsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.RegisterPluginForSharedChannels(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RegisterPluginForSharedChannels called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UnregisterPluginForSharedChannelsArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UnregisterPluginForSharedChannelsReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UnregisterPluginForSharedChannels(pluginID string) error {
|
|
|
|
|
_args := &Z_UnregisterPluginForSharedChannelsArgs{pluginID}
|
|
|
|
|
_returns := &Z_UnregisterPluginForSharedChannelsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UnregisterPluginForSharedChannels", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UnregisterPluginForSharedChannels API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UnregisterPluginForSharedChannels(args *Z_UnregisterPluginForSharedChannelsArgs, returns *Z_UnregisterPluginForSharedChannelsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UnregisterPluginForSharedChannels(pluginID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UnregisterPluginForSharedChannels(args.A)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UnregisterPluginForSharedChannels called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_ShareChannelArgs struct {
|
|
|
|
|
A *model.SharedChannel
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_ShareChannelReturns struct {
|
|
|
|
|
A *model.SharedChannel
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
|
|
|
|
_args := &Z_ShareChannelArgs{sc}
|
|
|
|
|
_returns := &Z_ShareChannelReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.ShareChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to ShareChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) ShareChannel(args *Z_ShareChannelArgs, returns *Z_ShareChannelReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.ShareChannel(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API ShareChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateSharedChannelArgs struct {
|
|
|
|
|
A *model.SharedChannel
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateSharedChannelReturns struct {
|
|
|
|
|
A *model.SharedChannel
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
|
|
|
|
_args := &Z_UpdateSharedChannelArgs{sc}
|
|
|
|
|
_returns := &Z_UpdateSharedChannelReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateSharedChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateSharedChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateSharedChannel(args *Z_UpdateSharedChannelArgs, returns *Z_UpdateSharedChannelReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateSharedChannel(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateSharedChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UnshareChannelArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UnshareChannelReturns struct {
|
|
|
|
|
A bool
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UnshareChannel(channelID string) (unshared bool, err error) {
|
|
|
|
|
_args := &Z_UnshareChannelArgs{channelID}
|
|
|
|
|
_returns := &Z_UnshareChannelReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UnshareChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UnshareChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UnshareChannel(args *Z_UnshareChannelArgs, returns *Z_UnshareChannelReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UnshareChannel(channelID string) (unshared bool, err error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UnshareChannel(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UnshareChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateSharedChannelCursorArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C model.GetPostsSinceForSyncCursor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateSharedChannelCursorReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error {
|
|
|
|
|
_args := &Z_UpdateSharedChannelCursorArgs{channelID, remoteID, cusror}
|
|
|
|
|
_returns := &Z_UpdateSharedChannelCursorReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateSharedChannelCursor", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateSharedChannelCursor API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateSharedChannelCursor(args *Z_UpdateSharedChannelCursorArgs, returns *Z_UpdateSharedChannelCursorReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UpdateSharedChannelCursor(args.A, args.B, args.C)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateSharedChannelCursor called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SyncSharedChannelArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SyncSharedChannelReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) SyncSharedChannel(channelID string) error {
|
|
|
|
|
_args := &Z_SyncSharedChannelArgs{channelID}
|
|
|
|
|
_returns := &Z_SyncSharedChannelReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.SyncSharedChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SyncSharedChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) SyncSharedChannel(args *Z_SyncSharedChannelArgs, returns *Z_SyncSharedChannelReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
SyncSharedChannel(channelID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.SyncSharedChannel(args.A)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SyncSharedChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_InviteRemoteToChannelArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
2024-02-09 10:47:12 -05:00
|
|
|
D bool
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_InviteRemoteToChannelReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-09 10:47:12 -05:00
|
|
|
func (g *apiRPCClient) InviteRemoteToChannel(channelID string, remoteID string, userID string, shareIfNotShared bool) error {
|
|
|
|
|
_args := &Z_InviteRemoteToChannelArgs{channelID, remoteID, userID, shareIfNotShared}
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
_returns := &Z_InviteRemoteToChannelReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.InviteRemoteToChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to InviteRemoteToChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) InviteRemoteToChannel(args *Z_InviteRemoteToChannelArgs, returns *Z_InviteRemoteToChannelReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
2024-02-09 10:47:12 -05:00
|
|
|
InviteRemoteToChannel(channelID string, remoteID string, userID string, shareIfNotShared bool) error
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
}); ok {
|
2024-02-09 10:47:12 -05:00
|
|
|
returns.A = hook.InviteRemoteToChannel(args.A, args.B, args.C, args.D)
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API InviteRemoteToChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UninviteRemoteFromChannelArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UninviteRemoteFromChannelReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UninviteRemoteFromChannel(channelID string, remoteID string) error {
|
|
|
|
|
_args := &Z_UninviteRemoteFromChannelArgs{channelID, remoteID}
|
|
|
|
|
_returns := &Z_UninviteRemoteFromChannelReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UninviteRemoteFromChannel", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UninviteRemoteFromChannel API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UninviteRemoteFromChannel(args *Z_UninviteRemoteFromChannelArgs, returns *Z_UninviteRemoteFromChannelReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UninviteRemoteFromChannel(channelID string, remoteID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.UninviteRemoteFromChannel(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UninviteRemoteFromChannel called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2024-03-29 18:22:54 -04:00
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
type Z_UpsertGroupMemberArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertGroupMemberReturns struct {
|
|
|
|
|
A *model.GroupMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
|
|
|
|
|
_args := &Z_UpsertGroupMemberArgs{groupID, userID}
|
|
|
|
|
_returns := &Z_UpsertGroupMemberReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpsertGroupMember", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpsertGroupMember API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpsertGroupMember(args *Z_UpsertGroupMemberArgs, returns *Z_UpsertGroupMemberReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpsertGroupMember(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpsertGroupMember called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertGroupMembersArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertGroupMembersReturns struct {
|
|
|
|
|
A []*model.GroupMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpsertGroupMembers(groupID string, userIDs []string) ([]*model.GroupMember, *model.AppError) {
|
|
|
|
|
_args := &Z_UpsertGroupMembersArgs{groupID, userIDs}
|
|
|
|
|
_returns := &Z_UpsertGroupMembersReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpsertGroupMembers", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpsertGroupMembers API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpsertGroupMembers(args *Z_UpsertGroupMembersArgs, returns *Z_UpsertGroupMembersReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpsertGroupMembers(groupID string, userIDs []string) ([]*model.GroupMember, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpsertGroupMembers(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpsertGroupMembers called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupByRemoteIDArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B model.GroupSource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupByRemoteIDReturns struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupByRemoteIDArgs{remoteID, groupSource}
|
|
|
|
|
_returns := &Z_GetGroupByRemoteIDReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetGroupByRemoteID", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupByRemoteID API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetGroupByRemoteID(args *Z_GetGroupByRemoteIDArgs, returns *Z_GetGroupByRemoteIDReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupByRemoteID(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupByRemoteID called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateGroupArgs struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateGroupReturns struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_CreateGroupArgs{group}
|
|
|
|
|
_returns := &Z_CreateGroupReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateGroup(args *Z_CreateGroupArgs, returns *Z_CreateGroupReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateGroup(group *model.Group) (*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreateGroup(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateGroupArgs struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateGroupReturns struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateGroupArgs{group}
|
|
|
|
|
_returns := &Z_UpdateGroupReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateGroup(args *Z_UpdateGroupArgs, returns *Z_UpdateGroupReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateGroup(group *model.Group) (*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateGroup(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupReturns struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeleteGroup(groupID string) (*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_DeleteGroupArgs{groupID}
|
|
|
|
|
_returns := &Z_DeleteGroupReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeleteGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeleteGroup(args *Z_DeleteGroupArgs, returns *Z_DeleteGroupReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteGroup(groupID string) (*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.DeleteGroup(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RestoreGroupArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RestoreGroupReturns struct {
|
|
|
|
|
A *model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RestoreGroup(groupID string) (*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_RestoreGroupArgs{groupID}
|
|
|
|
|
_returns := &Z_RestoreGroupReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RestoreGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RestoreGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RestoreGroup(args *Z_RestoreGroupArgs, returns *Z_RestoreGroupReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RestoreGroup(groupID string) (*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.RestoreGroup(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RestoreGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupMemberArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupMemberReturns struct {
|
|
|
|
|
A *model.GroupMember
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
|
|
|
|
|
_args := &Z_DeleteGroupMemberArgs{groupID, userID}
|
|
|
|
|
_returns := &Z_DeleteGroupMemberReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeleteGroupMember", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteGroupMember API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeleteGroupMember(args *Z_DeleteGroupMemberArgs, returns *Z_DeleteGroupMemberReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.DeleteGroupMember(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteGroupMember called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupSyncableArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C model.GroupSyncableType
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupSyncableReturns struct {
|
|
|
|
|
A *model.GroupSyncable
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupSyncableArgs{groupID, syncableID, syncableType}
|
|
|
|
|
_returns := &Z_GetGroupSyncableReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetGroupSyncable", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupSyncable API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetGroupSyncable(args *Z_GetGroupSyncableArgs, returns *Z_GetGroupSyncableReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupSyncable(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupSyncable called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupSyncablesArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B model.GroupSyncableType
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupSyncablesReturns struct {
|
|
|
|
|
A []*model.GroupSyncable
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupSyncablesArgs{groupID, syncableType}
|
|
|
|
|
_returns := &Z_GetGroupSyncablesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetGroupSyncables", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroupSyncables API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetGroupSyncables(args *Z_GetGroupSyncablesArgs, returns *Z_GetGroupSyncablesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroupSyncables(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroupSyncables called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertGroupSyncableArgs struct {
|
|
|
|
|
A *model.GroupSyncable
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertGroupSyncableReturns struct {
|
|
|
|
|
A *model.GroupSyncable
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
_args := &Z_UpsertGroupSyncableArgs{groupSyncable}
|
|
|
|
|
_returns := &Z_UpsertGroupSyncableReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpsertGroupSyncable", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpsertGroupSyncable API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpsertGroupSyncable(args *Z_UpsertGroupSyncableArgs, returns *Z_UpsertGroupSyncableReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpsertGroupSyncable(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpsertGroupSyncable called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateGroupSyncableArgs struct {
|
|
|
|
|
A *model.GroupSyncable
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateGroupSyncableReturns struct {
|
|
|
|
|
A *model.GroupSyncable
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateGroupSyncableArgs{groupSyncable}
|
|
|
|
|
_returns := &Z_UpdateGroupSyncableReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateGroupSyncable", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateGroupSyncable API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateGroupSyncable(args *Z_UpdateGroupSyncableArgs, returns *Z_UpdateGroupSyncableReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateGroupSyncable(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateGroupSyncable called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupSyncableArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C model.GroupSyncableType
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupSyncableReturns struct {
|
|
|
|
|
A *model.GroupSyncable
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
_args := &Z_DeleteGroupSyncableArgs{groupID, syncableID, syncableType}
|
|
|
|
|
_returns := &Z_DeleteGroupSyncableReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeleteGroupSyncable", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteGroupSyncable API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeleteGroupSyncable(args *Z_DeleteGroupSyncableArgs, returns *Z_DeleteGroupSyncableReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.DeleteGroupSyncable(args.A, args.B, args.C)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteGroupSyncable called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-29 18:22:54 -04:00
|
|
|
type Z_UpdateUserRolesArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdateUserRolesReturns struct {
|
|
|
|
|
A *model.User
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdateUserRoles(userID, newRoles string) (*model.User, *model.AppError) {
|
|
|
|
|
_args := &Z_UpdateUserRolesArgs{userID, newRoles}
|
|
|
|
|
_returns := &Z_UpdateUserRolesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdateUserRoles", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdateUserRoles API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdateUserRoles(args *Z_UpdateUserRolesArgs, returns *Z_UpdateUserRolesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdateUserRoles(userID, newRoles string) (*model.User, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdateUserRoles(args.A, args.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdateUserRoles called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2024-08-26 07:39:29 -04:00
|
|
|
|
|
|
|
|
type Z_GetPluginIDArgs struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPluginIDReturns struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPluginID() string {
|
|
|
|
|
_args := &Z_GetPluginIDArgs{}
|
|
|
|
|
_returns := &Z_GetPluginIDReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPluginID", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPluginID API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPluginID(args *Z_GetPluginIDArgs, returns *Z_GetPluginIDReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPluginID() string
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.GetPluginID()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPluginID called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2025-03-13 12:00:15 -04:00
|
|
|
|
|
|
|
|
type Z_GetGroupsArgs struct {
|
|
|
|
|
A int
|
|
|
|
|
B int
|
|
|
|
|
C model.GroupSearchOpts
|
|
|
|
|
D *model.ViewUsersRestrictions
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetGroupsReturns struct {
|
|
|
|
|
A []*model.Group
|
|
|
|
|
B *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetGroups(page, perPage int, opts model.GroupSearchOpts, viewRestrictions *model.ViewUsersRestrictions) ([]*model.Group, *model.AppError) {
|
|
|
|
|
_args := &Z_GetGroupsArgs{page, perPage, opts, viewRestrictions}
|
|
|
|
|
_returns := &Z_GetGroupsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetGroups", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetGroups API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetGroups(args *Z_GetGroupsArgs, returns *Z_GetGroupsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetGroups(page, perPage int, opts model.GroupSearchOpts, viewRestrictions *model.ViewUsersRestrictions) ([]*model.Group, *model.AppError)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetGroups(args.A, args.B, args.C, args.D)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetGroups called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2025-05-21 14:44:34 -04:00
|
|
|
|
|
|
|
|
type Z_CreateDefaultSyncableMembershipsArgs struct {
|
|
|
|
|
A model.CreateDefaultMembershipParams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreateDefaultSyncableMembershipsReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreateDefaultSyncableMemberships(params model.CreateDefaultMembershipParams) *model.AppError {
|
|
|
|
|
_args := &Z_CreateDefaultSyncableMembershipsArgs{params}
|
|
|
|
|
_returns := &Z_CreateDefaultSyncableMembershipsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreateDefaultSyncableMemberships", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreateDefaultSyncableMemberships API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreateDefaultSyncableMemberships(args *Z_CreateDefaultSyncableMembershipsArgs, returns *Z_CreateDefaultSyncableMembershipsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreateDefaultSyncableMemberships(params model.CreateDefaultMembershipParams) *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.CreateDefaultSyncableMemberships(args.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreateDefaultSyncableMemberships called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupConstrainedMembershipsArgs struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeleteGroupConstrainedMembershipsReturns struct {
|
|
|
|
|
A *model.AppError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeleteGroupConstrainedMemberships() *model.AppError {
|
|
|
|
|
_args := &Z_DeleteGroupConstrainedMembershipsArgs{}
|
|
|
|
|
_returns := &Z_DeleteGroupConstrainedMembershipsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeleteGroupConstrainedMemberships", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeleteGroupConstrainedMemberships API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeleteGroupConstrainedMemberships(args *Z_DeleteGroupConstrainedMembershipsArgs, returns *Z_DeleteGroupConstrainedMembershipsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeleteGroupConstrainedMemberships() *model.AppError
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeleteGroupConstrainedMemberships()
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeleteGroupConstrainedMemberships called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2025-06-10 19:10:28 -04:00
|
|
|
|
|
|
|
|
type Z_CreatePropertyFieldArgs struct {
|
|
|
|
|
A *model.PropertyField
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreatePropertyFieldReturns struct {
|
|
|
|
|
A *model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreatePropertyField(field *model.PropertyField) (*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_CreatePropertyFieldArgs{field}
|
|
|
|
|
_returns := &Z_CreatePropertyFieldReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreatePropertyField", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreatePropertyField API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreatePropertyField(args *Z_CreatePropertyFieldArgs, returns *Z_CreatePropertyFieldReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreatePropertyField(field *model.PropertyField) (*model.PropertyField, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreatePropertyField(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreatePropertyField called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyFieldArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyFieldReturns struct {
|
|
|
|
|
A *model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPropertyField(groupID, fieldID string) (*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_GetPropertyFieldArgs{groupID, fieldID}
|
|
|
|
|
_returns := &Z_GetPropertyFieldReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPropertyField", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPropertyField API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPropertyField(args *Z_GetPropertyFieldArgs, returns *Z_GetPropertyFieldReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPropertyField(groupID, fieldID string) (*model.PropertyField, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPropertyField(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPropertyField called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyFieldsArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyFieldsReturns struct {
|
|
|
|
|
A []*model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPropertyFields(groupID string, ids []string) ([]*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_GetPropertyFieldsArgs{groupID, ids}
|
|
|
|
|
_returns := &Z_GetPropertyFieldsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPropertyFields", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPropertyFields API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPropertyFields(args *Z_GetPropertyFieldsArgs, returns *Z_GetPropertyFieldsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPropertyFields(groupID string, ids []string) ([]*model.PropertyField, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPropertyFields(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPropertyFields called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyFieldArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B *model.PropertyField
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyFieldReturns struct {
|
|
|
|
|
A *model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdatePropertyField(groupID string, field *model.PropertyField) (*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_UpdatePropertyFieldArgs{groupID, field}
|
|
|
|
|
_returns := &Z_UpdatePropertyFieldReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdatePropertyField", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdatePropertyField API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdatePropertyField(args *Z_UpdatePropertyFieldArgs, returns *Z_UpdatePropertyFieldReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdatePropertyField(groupID string, field *model.PropertyField) (*model.PropertyField, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdatePropertyField(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdatePropertyField called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyFieldArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyFieldReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeletePropertyField(groupID, fieldID string) error {
|
|
|
|
|
_args := &Z_DeletePropertyFieldArgs{groupID, fieldID}
|
|
|
|
|
_returns := &Z_DeletePropertyFieldReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeletePropertyField", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeletePropertyField API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeletePropertyField(args *Z_DeletePropertyFieldArgs, returns *Z_DeletePropertyFieldReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeletePropertyField(groupID, fieldID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeletePropertyField(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeletePropertyField called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SearchPropertyFieldsArgs struct {
|
|
|
|
|
A string
|
2025-09-11 18:56:01 -04:00
|
|
|
B model.PropertyFieldSearchOpts
|
2025-06-10 19:10:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SearchPropertyFieldsReturns struct {
|
|
|
|
|
A []*model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 18:56:01 -04:00
|
|
|
func (g *apiRPCClient) SearchPropertyFields(groupID string, opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_SearchPropertyFieldsArgs{groupID, opts}
|
2025-06-10 19:10:28 -04:00
|
|
|
_returns := &Z_SearchPropertyFieldsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.SearchPropertyFields", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchPropertyFields API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) SearchPropertyFields(args *Z_SearchPropertyFieldsArgs, returns *Z_SearchPropertyFieldsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
2025-09-11 18:56:01 -04:00
|
|
|
SearchPropertyFields(groupID string, opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error)
|
2025-06-10 19:10:28 -04:00
|
|
|
}); ok {
|
2025-09-11 18:56:01 -04:00
|
|
|
returns.A, returns.B = hook.SearchPropertyFields(args.A, args.B)
|
2025-06-10 19:10:28 -04:00
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchPropertyFields called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 15:49:14 -04:00
|
|
|
type Z_CountPropertyFieldsArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CountPropertyFieldsReturns struct {
|
|
|
|
|
A int64
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CountPropertyFields(groupID string, includeDeleted bool) (int64, error) {
|
|
|
|
|
_args := &Z_CountPropertyFieldsArgs{groupID, includeDeleted}
|
|
|
|
|
_returns := &Z_CountPropertyFieldsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CountPropertyFields", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CountPropertyFields API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CountPropertyFields(args *Z_CountPropertyFieldsArgs, returns *Z_CountPropertyFieldsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CountPropertyFields(groupID string, includeDeleted bool) (int64, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CountPropertyFields(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CountPropertyFields called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CountPropertyFieldsForTargetArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
D bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CountPropertyFieldsForTargetReturns struct {
|
|
|
|
|
A int64
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CountPropertyFieldsForTarget(groupID, targetType, targetID string, includeDeleted bool) (int64, error) {
|
|
|
|
|
_args := &Z_CountPropertyFieldsForTargetArgs{groupID, targetType, targetID, includeDeleted}
|
|
|
|
|
_returns := &Z_CountPropertyFieldsForTargetReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CountPropertyFieldsForTarget", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CountPropertyFieldsForTarget API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CountPropertyFieldsForTarget(args *Z_CountPropertyFieldsForTargetArgs, returns *Z_CountPropertyFieldsForTargetReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CountPropertyFieldsForTarget(groupID, targetType, targetID string, includeDeleted bool) (int64, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CountPropertyFieldsForTarget(args.A, args.B, args.C, args.D)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CountPropertyFieldsForTarget called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
type Z_CreatePropertyValueArgs struct {
|
|
|
|
|
A *model.PropertyValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_CreatePropertyValueReturns struct {
|
|
|
|
|
A *model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) CreatePropertyValue(value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_CreatePropertyValueArgs{value}
|
|
|
|
|
_returns := &Z_CreatePropertyValueReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.CreatePropertyValue", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to CreatePropertyValue API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) CreatePropertyValue(args *Z_CreatePropertyValueArgs, returns *Z_CreatePropertyValueReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
CreatePropertyValue(value *model.PropertyValue) (*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.CreatePropertyValue(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API CreatePropertyValue called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyValueArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyValueReturns struct {
|
|
|
|
|
A *model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPropertyValue(groupID, valueID string) (*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_GetPropertyValueArgs{groupID, valueID}
|
|
|
|
|
_returns := &Z_GetPropertyValueReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPropertyValue", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPropertyValue API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPropertyValue(args *Z_GetPropertyValueArgs, returns *Z_GetPropertyValueReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPropertyValue(groupID, valueID string) (*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPropertyValue(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPropertyValue called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyValuesArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B []string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyValuesReturns struct {
|
|
|
|
|
A []*model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPropertyValues(groupID string, ids []string) ([]*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_GetPropertyValuesArgs{groupID, ids}
|
|
|
|
|
_returns := &Z_GetPropertyValuesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPropertyValues", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPropertyValues API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPropertyValues(args *Z_GetPropertyValuesArgs, returns *Z_GetPropertyValuesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPropertyValues(groupID string, ids []string) ([]*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPropertyValues(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPropertyValues called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyValueArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B *model.PropertyValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyValueReturns struct {
|
|
|
|
|
A *model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdatePropertyValue(groupID string, value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_UpdatePropertyValueArgs{groupID, value}
|
|
|
|
|
_returns := &Z_UpdatePropertyValueReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdatePropertyValue", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdatePropertyValue API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdatePropertyValue(args *Z_UpdatePropertyValueArgs, returns *Z_UpdatePropertyValueReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdatePropertyValue(groupID string, value *model.PropertyValue) (*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdatePropertyValue(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdatePropertyValue called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertPropertyValueArgs struct {
|
|
|
|
|
A *model.PropertyValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertPropertyValueReturns struct {
|
|
|
|
|
A *model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpsertPropertyValue(value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_UpsertPropertyValueArgs{value}
|
|
|
|
|
_returns := &Z_UpsertPropertyValueReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpsertPropertyValue", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpsertPropertyValue API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpsertPropertyValue(args *Z_UpsertPropertyValueArgs, returns *Z_UpsertPropertyValueReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpsertPropertyValue(value *model.PropertyValue) (*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpsertPropertyValue(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpsertPropertyValue called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyValueArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyValueReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeletePropertyValue(groupID, valueID string) error {
|
|
|
|
|
_args := &Z_DeletePropertyValueArgs{groupID, valueID}
|
|
|
|
|
_returns := &Z_DeletePropertyValueReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeletePropertyValue", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeletePropertyValue API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeletePropertyValue(args *Z_DeletePropertyValueArgs, returns *Z_DeletePropertyValueReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeletePropertyValue(groupID, valueID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeletePropertyValue(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeletePropertyValue called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SearchPropertyValuesArgs struct {
|
|
|
|
|
A string
|
2025-09-11 18:56:01 -04:00
|
|
|
B model.PropertyValueSearchOpts
|
2025-06-10 19:10:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_SearchPropertyValuesReturns struct {
|
|
|
|
|
A []*model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 18:56:01 -04:00
|
|
|
func (g *apiRPCClient) SearchPropertyValues(groupID string, opts model.PropertyValueSearchOpts) ([]*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_SearchPropertyValuesArgs{groupID, opts}
|
2025-06-10 19:10:28 -04:00
|
|
|
_returns := &Z_SearchPropertyValuesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.SearchPropertyValues", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to SearchPropertyValues API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) SearchPropertyValues(args *Z_SearchPropertyValuesArgs, returns *Z_SearchPropertyValuesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
2025-09-11 18:56:01 -04:00
|
|
|
SearchPropertyValues(groupID string, opts model.PropertyValueSearchOpts) ([]*model.PropertyValue, error)
|
2025-06-10 19:10:28 -04:00
|
|
|
}); ok {
|
2025-09-11 18:56:01 -04:00
|
|
|
returns.A, returns.B = hook.SearchPropertyValues(args.A, args.B)
|
2025-06-10 19:10:28 -04:00
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API SearchPropertyValues called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RegisterPropertyGroupArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_RegisterPropertyGroupReturns struct {
|
|
|
|
|
A *model.PropertyGroup
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) RegisterPropertyGroup(name string) (*model.PropertyGroup, error) {
|
|
|
|
|
_args := &Z_RegisterPropertyGroupArgs{name}
|
|
|
|
|
_returns := &Z_RegisterPropertyGroupReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.RegisterPropertyGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to RegisterPropertyGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) RegisterPropertyGroup(args *Z_RegisterPropertyGroupArgs, returns *Z_RegisterPropertyGroupReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
RegisterPropertyGroup(name string) (*model.PropertyGroup, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.RegisterPropertyGroup(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API RegisterPropertyGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyGroupArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyGroupReturns struct {
|
|
|
|
|
A *model.PropertyGroup
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPropertyGroup(name string) (*model.PropertyGroup, error) {
|
|
|
|
|
_args := &Z_GetPropertyGroupArgs{name}
|
|
|
|
|
_returns := &Z_GetPropertyGroupReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPropertyGroup", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPropertyGroup API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPropertyGroup(args *Z_GetPropertyGroupArgs, returns *Z_GetPropertyGroupReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPropertyGroup(name string) (*model.PropertyGroup, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPropertyGroup(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPropertyGroup called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyFieldByNameArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_GetPropertyFieldByNameReturns struct {
|
|
|
|
|
A *model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) GetPropertyFieldByName(groupID, targetID, name string) (*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_GetPropertyFieldByNameArgs{groupID, targetID, name}
|
|
|
|
|
_returns := &Z_GetPropertyFieldByNameReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.GetPropertyFieldByName", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to GetPropertyFieldByName API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) GetPropertyFieldByName(args *Z_GetPropertyFieldByNameArgs, returns *Z_GetPropertyFieldByNameReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
GetPropertyFieldByName(groupID, targetID, name string) (*model.PropertyField, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.GetPropertyFieldByName(args.A, args.B, args.C)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API GetPropertyFieldByName called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyFieldsArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B []*model.PropertyField
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyFieldsReturns struct {
|
|
|
|
|
A []*model.PropertyField
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdatePropertyFields(groupID string, fields []*model.PropertyField) ([]*model.PropertyField, error) {
|
|
|
|
|
_args := &Z_UpdatePropertyFieldsArgs{groupID, fields}
|
|
|
|
|
_returns := &Z_UpdatePropertyFieldsReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdatePropertyFields", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdatePropertyFields API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdatePropertyFields(args *Z_UpdatePropertyFieldsArgs, returns *Z_UpdatePropertyFieldsReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdatePropertyFields(groupID string, fields []*model.PropertyField) ([]*model.PropertyField, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdatePropertyFields(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdatePropertyFields called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyValuesArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B []*model.PropertyValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpdatePropertyValuesReturns struct {
|
|
|
|
|
A []*model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpdatePropertyValues(groupID string, values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_UpdatePropertyValuesArgs{groupID, values}
|
|
|
|
|
_returns := &Z_UpdatePropertyValuesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpdatePropertyValues", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpdatePropertyValues API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpdatePropertyValues(args *Z_UpdatePropertyValuesArgs, returns *Z_UpdatePropertyValuesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpdatePropertyValues(groupID string, values []*model.PropertyValue) ([]*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpdatePropertyValues(args.A, args.B)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpdatePropertyValues called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertPropertyValuesArgs struct {
|
|
|
|
|
A []*model.PropertyValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_UpsertPropertyValuesReturns struct {
|
|
|
|
|
A []*model.PropertyValue
|
|
|
|
|
B error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) UpsertPropertyValues(values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
|
|
|
|
_args := &Z_UpsertPropertyValuesArgs{values}
|
|
|
|
|
_returns := &Z_UpsertPropertyValuesReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.UpsertPropertyValues", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to UpsertPropertyValues API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A, _returns.B
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) UpsertPropertyValues(args *Z_UpsertPropertyValuesArgs, returns *Z_UpsertPropertyValuesReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
UpsertPropertyValues(values []*model.PropertyValue) ([]*model.PropertyValue, error)
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A, returns.B = hook.UpsertPropertyValues(args.A)
|
|
|
|
|
returns.B = encodableError(returns.B)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API UpsertPropertyValues called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyValuesForTargetArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
C string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyValuesForTargetReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeletePropertyValuesForTarget(groupID, targetType, targetID string) error {
|
|
|
|
|
_args := &Z_DeletePropertyValuesForTargetArgs{groupID, targetType, targetID}
|
|
|
|
|
_returns := &Z_DeletePropertyValuesForTargetReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeletePropertyValuesForTarget", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeletePropertyValuesForTarget API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeletePropertyValuesForTarget(args *Z_DeletePropertyValuesForTargetArgs, returns *Z_DeletePropertyValuesForTargetReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeletePropertyValuesForTarget(groupID, targetType, targetID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeletePropertyValuesForTarget(args.A, args.B, args.C)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeletePropertyValuesForTarget called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyValuesForFieldArgs struct {
|
|
|
|
|
A string
|
|
|
|
|
B string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Z_DeletePropertyValuesForFieldReturns struct {
|
|
|
|
|
A error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (g *apiRPCClient) DeletePropertyValuesForField(groupID, fieldID string) error {
|
|
|
|
|
_args := &Z_DeletePropertyValuesForFieldArgs{groupID, fieldID}
|
|
|
|
|
_returns := &Z_DeletePropertyValuesForFieldReturns{}
|
|
|
|
|
if err := g.client.Call("Plugin.DeletePropertyValuesForField", _args, _returns); err != nil {
|
|
|
|
|
log.Printf("RPC call to DeletePropertyValuesForField API failed: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return _returns.A
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *apiRPCServer) DeletePropertyValuesForField(args *Z_DeletePropertyValuesForFieldArgs, returns *Z_DeletePropertyValuesForFieldReturns) error {
|
|
|
|
|
if hook, ok := s.impl.(interface {
|
|
|
|
|
DeletePropertyValuesForField(groupID, fieldID string) error
|
|
|
|
|
}); ok {
|
|
|
|
|
returns.A = hook.DeletePropertyValuesForField(args.A, args.B)
|
|
|
|
|
returns.A = encodableError(returns.A)
|
|
|
|
|
} else {
|
|
|
|
|
return encodableError(fmt.Errorf("API DeletePropertyValuesForField called but not implemented."))
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|