From e8c9ccaa7e47f1cba3d2b126f6ebbb092fa43235 Mon Sep 17 00:00:00 2001 From: Daniel Hodan Date: Wed, 17 Oct 2018 16:37:52 +0200 Subject: GH-9607: Add GetTeamsForUser to plugin API (#9644) * add GetTeamsForUser to plugin api * Add version comment, fix comment typo --- plugin/client_rpc_generated.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'plugin/client_rpc_generated.go') diff --git a/plugin/client_rpc_generated.go b/plugin/client_rpc_generated.go index b53f10aff..5c14f4d4a 100644 --- a/plugin/client_rpc_generated.go +++ b/plugin/client_rpc_generated.go @@ -1177,6 +1177,35 @@ func (s *apiRPCServer) UpdateTeam(args *Z_UpdateTeamArgs, returns *Z_UpdateTeamR return nil } +type Z_GetTeamsForUserArgs struct { + A string +} + +type Z_GetTeamsForUserReturns struct { + A []*model.Team + B *model.AppError +} + +func (g *apiRPCClient) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { + _args := &Z_GetTeamsForUserArgs{userId} + _returns := &Z_GetTeamsForUserReturns{} + 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 +} + +func (s *apiRPCServer) GetTeamsForUser(args *Z_GetTeamsForUserArgs, returns *Z_GetTeamsForUserReturns) error { + if hook, ok := s.impl.(interface { + GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) + }); ok { + returns.A, returns.B = hook.GetTeamsForUser(args.A) + } else { + return encodableError(fmt.Errorf("API GetTeamsForUser called but not implemented.")) + } + return nil +} + type Z_CreateTeamMemberArgs struct { A string B string -- cgit v1.2.3-1-g7c22