diff --git a/console/suppliers.go b/console/suppliers.go new file mode 100644 index 000000000..e6c9ba14a --- /dev/null +++ b/console/suppliers.go @@ -0,0 +1,66 @@ +/* +Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +Copyright (C) ITsysCOM GmbH + +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/engine" + "github.com/cgrates/cgrates/utils" +) + +func init() { + c := &CmdGetSuppliers{ + name: "suppliers", + rpcMethod: "ApierV1.GetSupplierProfile", + rpcParams: &utils.TenantID{}, + } + commands[c.Name()] = c + c.CommandExecuter = &CommandExecuter{c} +} + +// Commander implementation +type CmdGetSuppliers struct { + name string + rpcMethod string + rpcParams *utils.TenantID + *CommandExecuter +} + +func (self *CmdGetSuppliers) Name() string { + return self.name +} + +func (self *CmdGetSuppliers) RpcMethod() string { + return self.rpcMethod +} + +func (self *CmdGetSuppliers) RpcParams(reset bool) interface{} { + if reset || self.rpcParams == nil { + self.rpcParams = &utils.TenantID{} + } + return self.rpcParams +} + +func (self *CmdGetSuppliers) PostprocessRpcParams() error { + return nil +} + +func (self *CmdGetSuppliers) RpcResult() interface{} { + atr := engine.SupplierProfile{} + return &atr +} \ No newline at end of file diff --git a/console/suppliers_remove.go b/console/suppliers_remove.go new file mode 100644 index 000000000..751f268a2 --- /dev/null +++ b/console/suppliers_remove.go @@ -0,0 +1,64 @@ +/* +Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +Copyright (C) ITsysCOM GmbH + +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" +//rename to suppliers everything +func init() { + c := &CmdRemoveSuppliers{ + name: "suppliers_remove", + rpcMethod: "ApierV1.RemSupplierProfile", + rpcParams: &utils.TenantID{}, + } + commands[c.Name()] = c + c.CommandExecuter = &CommandExecuter{c} +} + +// Commander implementation +type CmdRemoveSuppliers struct { + name string + rpcMethod string + rpcParams *utils.TenantID + *CommandExecuter +} + +func (self *CmdRemoveSuppliers) Name() string { + return self.name +} + +func (self *CmdRemoveSuppliers) RpcMethod() string { + return self.rpcMethod +} + +func (self *CmdRemoveSuppliers) RpcParams(reset bool) interface{} { + if reset || self.rpcParams == nil { + self.rpcParams = &utils.TenantID{} + } + return self.rpcParams +} + +func (self *CmdRemoveSuppliers) PostprocessRpcParams() error { + return nil +} + +func (self *CmdRemoveSuppliers) RpcResult() interface{} { + var s string + return &s +} + diff --git a/console/suppliers_set.go b/console/suppliers_set.go new file mode 100644 index 000000000..b31a84756 --- /dev/null +++ b/console/suppliers_set.go @@ -0,0 +1,63 @@ +/* +Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +Copyright (C) ITsysCOM GmbH + +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/engine" + +func init() { + c := &CmdSetSuppliers{ + name: "suppliers_set", + rpcMethod: "ApierV1.SetSupplierProfile", + rpcParams: &engine.SupplierProfile{}, + } + commands[c.Name()] = c + c.CommandExecuter = &CommandExecuter{c} +} + +// Commander implementation +type CmdSetSuppliers struct { + name string + rpcMethod string + rpcParams *engine.SupplierProfile + *CommandExecuter +} + +func (self *CmdSetSuppliers) Name() string { + return self.name +} + +func (self *CmdSetSuppliers) RpcMethod() string { + return self.rpcMethod +} + +func (self *CmdSetSuppliers) RpcParams(reset bool) interface{} { + if reset || self.rpcParams == nil { + self.rpcParams = &engine.SupplierProfile{} + } + return self.rpcParams +} + +func (self *CmdSetSuppliers) PostprocessRpcParams() error { + return nil +} + +func (self *CmdSetSuppliers) RpcResult() interface{} { + var s string + return &s +} diff --git a/console/suppliers_sort.go b/console/suppliers_sort.go new file mode 100644 index 000000000..51033fd32 --- /dev/null +++ b/console/suppliers_sort.go @@ -0,0 +1,67 @@ +/* +Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +Copyright (C) ITsysCOM GmbH + +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/engine" + "github.com/cgrates/cgrates/utils" +) + +func init() { + c := &CmdSuppliersSort{ + name: "suppliers_sort", + rpcMethod: "SupplierSv1.GetSuppliers", + rpcParams: new(utils.CGREvent), + } + commands[c.Name()] = c + c.CommandExecuter = &CommandExecuter{c} +} + +// Commander implementation +type CmdSuppliersSort struct { + name string + rpcMethod string + rpcParams *utils.CGREvent + clientArgs []string + *CommandExecuter +} + +func (self *CmdSuppliersSort) Name() string { + return self.name +} + +func (self *CmdSuppliersSort) RpcMethod() string { + return self.rpcMethod +} + +func (self *CmdSuppliersSort) RpcParams(reset bool) interface{} { + if reset || self.rpcParams == nil { + self.rpcParams = new(utils.CGREvent) + } + return self.rpcParams +} + +func (self *CmdSuppliersSort) PostprocessRpcParams() error { + return nil +} + +func (self *CmdSuppliersSort) RpcResult() interface{} { + atr := engine.SupplierProfile{} + return &atr +} \ No newline at end of file