Add methods for AccountS for replicator in apier

This commit is contained in:
TeoV
2020-12-22 11:17:42 +02:00
committed by Dan Christian Bogos
parent 382a970782
commit 432e0ff41f

View File

@@ -295,6 +295,24 @@ func (rplSv1 *ReplicatorSv1) GetActionProfile(tntID *utils.TenantIDWithOpts, rep
return nil
}
func (rplSv1 *ReplicatorSv1) GetAccountProfile(tntID *utils.TenantIDWithOpts, reply *utils.AccountProfile) error {
if rcv, err := rplSv1.dm.DataDB().GetAccountProfileDrv(tntID.Tenant, tntID.ID); err != nil {
return err
} else {
*reply = *rcv
}
return nil
}
func (rplSv1 *ReplicatorSv1) GetAccount2(tntID *utils.TenantIDWithOpts, reply *utils.Account) error {
if rcv, err := rplSv1.dm.DataDB().GetAccount2Drv(tntID.Tenant, tntID.ID); err != nil {
return err
} else {
*reply = *rcv
}
return nil
}
//GetResourceProfile
func (rplSv1 *ReplicatorSv1) GetItemLoadIDs(itemID *utils.StringWithOpts, reply *map[string]int64) error {
if rcv, err := rplSv1.dm.DataDB().GetItemLoadIDsDrv(itemID.Arg); err != nil {
@@ -528,6 +546,22 @@ func (rplSv1 *ReplicatorSv1) SetActionProfile(acp *engine.ActionProfileWithOpts,
return nil
}
func (rplSv1 *ReplicatorSv1) SetAccountProfile(acp *utils.AccountProfileWithOpts, reply *string) error {
if err := rplSv1.dm.DataDB().SetAccountProfileDrv(acp.AccountProfile); err != nil {
return err
}
*reply = utils.OK
return nil
}
func (rplSv1 *ReplicatorSv1) SetAccount2(acp *utils.AccountWithOpts, reply *string) error {
if err := rplSv1.dm.DataDB().SetAccount2Drv(acp.Account); err != nil {
return err
}
*reply = utils.OK
return nil
}
// RemoveThreshold
func (rplSv1 *ReplicatorSv1) RemoveThreshold(args *utils.TenantIDWithOpts, reply *string) error {
if err := rplSv1.dm.DataDB().RemoveThresholdDrv(args.Tenant, args.ID); err != nil {
@@ -731,6 +765,22 @@ func (rplSv1 *ReplicatorSv1) RemoveActionProfile(args *utils.TenantIDWithOpts, r
return nil
}
func (rplSv1 *ReplicatorSv1) RemoveAccountProfile(args *utils.TenantIDWithOpts, reply *string) error {
if err := rplSv1.dm.DataDB().RemoveAccountProfileDrv(args.Tenant, args.ID); err != nil {
return err
}
*reply = utils.OK
return nil
}
func (rplSv1 *ReplicatorSv1) RemoveAccount2(args *utils.TenantIDWithOpts, reply *string) error {
if err := rplSv1.dm.DataDB().RemoveAccount2Drv(args.Tenant, args.ID); err != nil {
return err
}
*reply = utils.OK
return nil
}
func (rplSv1 *ReplicatorSv1) RemoveDispatcherHost(args *utils.TenantIDWithOpts, reply *string) error {
if err := rplSv1.dm.DataDB().RemoveDispatcherHostDrv(args.Tenant, args.ID); err != nil {
return err