From dc821c59ebf9415a6b5ab6c20d16c154e1728448 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Mon, 13 Jul 2015 20:48:34 +0300 Subject: [PATCH] added account_remove console command --- console/account_remove.go | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 console/account_remove.go diff --git a/console/account_remove.go b/console/account_remove.go new file mode 100644 index 000000000..22e516038 --- /dev/null +++ b/console/account_remove.go @@ -0,0 +1,65 @@ +/* +Rating system designed to be used in VoIP Carriers World +Copyright (C) 2012-2015 ITsysCOM + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ + +package console + +import "github.com/cgrates/cgrates/utils" + +func init() { + c := &CmdRemoveAccount{ + name: "account_remove", + rpcMethod: "ApierV1.RemoveAccount", + } + commands[c.Name()] = c + c.CommandExecuter = &CommandExecuter{c} +} + +// Commander implementation +type CmdRemoveAccount struct { + name string + rpcMethod string + rpcParams *utils.AttrRemoveAccount + *CommandExecuter +} + +func (self *CmdRemoveAccount) Name() string { + return self.name +} + +func (self *CmdRemoveAccount) RpcMethod() string { + return self.rpcMethod +} + +func (self *CmdRemoveAccount) RpcParams(ptr, reset bool) interface{} { + if reset || self.rpcParams == nil { + self.rpcParams = &utils.AttrRemoveAccount{Direction: utils.OUT} + } + if ptr { + return self.rpcParams + } + return *self.rpcParams +} + +func (self *CmdRemoveAccount) PostprocessRpcParams() error { + return nil +} + +func (self *CmdRemoveAccount) RpcResult() interface{} { + var s string + return &s +}