Replaced TenantIDWithOpts with TenantIDWithAPIOpts

This commit is contained in:
andronache
2021-03-17 16:51:14 +02:00
committed by Dan Christian Bogos
parent 8b0748b139
commit a6f41adaf9
105 changed files with 943 additions and 943 deletions

View File

@@ -26,7 +26,7 @@ func init() {
c := &CmdGetAccountsProfile{
name: "accounts_profile",
rpcMethod: utils.APIerSv1GetAccountProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -36,7 +36,7 @@ func init() {
type CmdGetAccountsProfile struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -50,7 +50,7 @@ func (self *CmdGetAccountsProfile) RpcMethod() string {
func (self *CmdGetAccountsProfile) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{}
self.rpcParams = &utils.TenantIDWithAPIOpts{}
}
return self.rpcParams
}

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveAccountsProfile{
name: "accounts_profile_remove",
rpcMethod: utils.APIerSv1RemoveAccountProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +33,7 @@ func init() {
type CmdRemoveAccountsProfile struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -47,7 +47,7 @@ func (self *CmdRemoveAccountsProfile) RpcMethod() string {
func (self *CmdRemoveAccountsProfile) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -27,7 +27,7 @@ func init() {
c := &CmdGetAttributes{
name: "attributes_profile",
rpcMethod: utils.APIerSv1GetAttributeProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +37,7 @@ func init() {
type CmdGetAttributes struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -51,7 +51,7 @@ func (self *CmdGetAttributes) RpcMethod() string {
func (self *CmdGetAttributes) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{}
self.rpcParams = &utils.TenantIDWithAPIOpts{}
}
return self.rpcParams
}

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveAttributes{
name: "attributes_profile_remove",
rpcMethod: utils.APIerSv1RemoveAttributeProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +33,7 @@ func init() {
type CmdRemoveAttributes struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -47,7 +47,7 @@ func (self *CmdRemoveAttributes) RpcMethod() string {
func (self *CmdRemoveAttributes) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveChargers{
name: "chargers_profile_remove",
rpcMethod: utils.APIerSv1RemoveChargerProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +33,7 @@ func init() {
type CmdRemoveChargers struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -47,7 +47,7 @@ func (self *CmdRemoveChargers) RpcMethod() string {
func (self *CmdRemoveChargers) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{}
self.rpcParams = &utils.TenantIDWithAPIOpts{}
}
return self.rpcParams
}

View File

@@ -244,13 +244,13 @@ func TestGetFormatedSliceResult(t *testing.T) {
}
func TestFromJSONInterestingFields2(t *testing.T) {
jsn := utils.ToJSON(&utils.TenantIDWithOpts{
jsn := utils.ToJSON(&utils.TenantIDWithAPIOpts{
TenantID: new(utils.TenantID),
Opts: make(map[string]interface{}),
APIOpts: make(map[string]interface{}),
})
line := FromJSON([]byte(jsn), []string{"Tenant", "ID", "Opts"})
expected := `Tenant="" ID="" Opts={}`
line := FromJSON([]byte(jsn), []string{"Tenant", "ID", "APIOpts"})
expected := `Tenant="" ID="" APIOpts={}`
if line != expected {
t.Log(jsn)
t.Errorf("Expected: %s got: '%s'", expected, line)

View File

@@ -37,7 +37,7 @@ func init() {
type CmdDebit struct {
name string
rpcMethod string
rpcParams *engine.CallDescriptorWithOpts
rpcParams *engine.CallDescriptorWithAPIOpts
clientArgs []string
*CommandExecuter
}
@@ -52,9 +52,9 @@ func (self *CmdDebit) RpcMethod() string {
func (self *CmdDebit) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.CallDescriptorWithOpts{
self.rpcParams = &engine.CallDescriptorWithAPIOpts{
CallDescriptor: new(engine.CallDescriptor),
Opts: make(map[string]interface{}),
APIOpts: make(map[string]interface{}),
}
}
return self.rpcParams

View File

@@ -37,7 +37,7 @@ func init() {
type CmdMaxDebit struct {
name string
rpcMethod string
rpcParams *engine.CallDescriptorWithOpts
rpcParams *engine.CallDescriptorWithAPIOpts
clientArgs []string
*CommandExecuter
}
@@ -52,9 +52,9 @@ func (self *CmdMaxDebit) RpcMethod() string {
func (self *CmdMaxDebit) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.CallDescriptorWithOpts{
self.rpcParams = &engine.CallDescriptorWithAPIOpts{
CallDescriptor: new(engine.CallDescriptor),
Opts: make(map[string]interface{}),
APIOpts: make(map[string]interface{}),
}
}
return self.rpcParams

View File

@@ -35,7 +35,7 @@ func init() {
type CmdRemoveDispatcherHost struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -49,7 +49,7 @@ func (self *CmdRemoveDispatcherHost) RpcMethod() string {
func (self *CmdRemoveDispatcherHost) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -35,7 +35,7 @@ func init() {
type CmdRemoveDispatcherProfile struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -49,7 +49,7 @@ func (self *CmdRemoveDispatcherProfile) RpcMethod() string {
func (self *CmdRemoveDispatcherProfile) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveFilter{
name: "filter_remove",
rpcMethod: utils.APIerSv1RemoveFilter,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -34,7 +34,7 @@ func init() {
type CmdRemoveFilter struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -48,7 +48,7 @@ func (self *CmdRemoveFilter) RpcMethod() string {
func (self *CmdRemoveFilter) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -41,7 +41,7 @@ func init() {
type CmdGetMaxDuration struct {
name string
rpcMethod string
rpcParams *engine.CallDescriptorWithOpts
rpcParams *engine.CallDescriptorWithAPIOpts
clientArgs []string
*CommandExecuter
}
@@ -56,9 +56,9 @@ func (self *CmdGetMaxDuration) RpcMethod() string {
func (self *CmdGetMaxDuration) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.CallDescriptorWithOpts{
self.rpcParams = &engine.CallDescriptorWithAPIOpts{
CallDescriptor: new(engine.CallDescriptor),
Opts: make(map[string]interface{}),
APIOpts: make(map[string]interface{}),
}
}
return self.rpcParams

View File

@@ -27,7 +27,7 @@ func init() {
c := &CmdGetRateProfile{
name: "rates_profile",
rpcMethod: utils.APIerSv1GetRateProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +37,7 @@ func init() {
type CmdGetRateProfile struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -51,7 +51,7 @@ func (self *CmdGetRateProfile) RpcMethod() string {
func (self *CmdGetRateProfile) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{}
self.rpcParams = &utils.TenantIDWithAPIOpts{}
}
return self.rpcParams
}

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveRateProfile{
name: "rates_profile_remove",
rpcMethod: utils.APIerSv1RemoveRateProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +33,7 @@ func init() {
type CmdRemoveRateProfile struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -47,7 +47,7 @@ func (self *CmdRemoveRateProfile) RpcMethod() string {
func (self *CmdRemoveRateProfile) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -27,7 +27,7 @@ func init() {
c := &CmdGetResource{
name: "resources",
rpcMethod: utils.ResourceSv1GetResource,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +37,7 @@ func init() {
type CmdGetResource struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -51,9 +51,9 @@ func (self *CmdGetResource) RpcMethod() string {
func (self *CmdGetResource) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{
self.rpcParams = &utils.TenantIDWithAPIOpts{
TenantID: new(utils.TenantID),
Opts: map[string]interface{}{},
APIOpts: map[string]interface{}{},
}
}
return self.rpcParams

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveResource{
name: "resources_profile_remove",
rpcMethod: utils.APIerSv1RemoveResourceProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -34,7 +34,7 @@ func init() {
type CmdRemoveResource struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -48,7 +48,7 @@ func (self *CmdRemoveResource) RpcMethod() string {
func (self *CmdRemoveResource) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveRoute{
name: "routes_profile_remove",
rpcMethod: utils.APIerSv1RemoveRouteProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +33,7 @@ func init() {
type CmdRemoveRoute struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -47,7 +47,7 @@ func (self *CmdRemoveRoute) RpcMethod() string {
func (self *CmdRemoveRoute) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -26,7 +26,7 @@ func init() {
c := &CmdGetStatQueueStringMetrics{
name: "stats_metrics",
rpcMethod: utils.StatSv1GetQueueStringMetrics,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -36,7 +36,7 @@ func init() {
type CmdGetStatQueueStringMetrics struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -50,9 +50,9 @@ func (self *CmdGetStatQueueStringMetrics) RpcMethod() string {
func (self *CmdGetStatQueueStringMetrics) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{
self.rpcParams = &utils.TenantIDWithAPIOpts{
TenantID: new(utils.TenantID),
Opts: make(map[string]interface{}),
APIOpts: make(map[string]interface{}),
}
}
return self.rpcParams

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveStatQueue{
name: "stats_profile_remove",
rpcMethod: utils.APIerSv1RemoveStatQueueProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -34,7 +34,7 @@ func init() {
type CmdRemoveStatQueue struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -48,7 +48,7 @@ func (self *CmdRemoveStatQueue) RpcMethod() string {
func (self *CmdRemoveStatQueue) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}

View File

@@ -27,7 +27,7 @@ func init() {
c := &CmdGetThreshold{
name: "threshold",
rpcMethod: utils.ThresholdSv1GetThreshold,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -36,7 +36,7 @@ func init() {
type CmdGetThreshold struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -50,9 +50,9 @@ func (self *CmdGetThreshold) RpcMethod() string {
func (self *CmdGetThreshold) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{
self.rpcParams = &utils.TenantIDWithAPIOpts{
TenantID: new(utils.TenantID),
Opts: make(map[string]interface{}),
APIOpts: make(map[string]interface{}),
}
}
return self.rpcParams

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdRemoveThreshold{
name: "thresholds_profile_remove",
rpcMethod: utils.APIerSv1RemoveThresholdProfile,
rpcParams: &utils.TenantIDWithOpts{},
rpcParams: &utils.TenantIDWithAPIOpts{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +33,7 @@ func init() {
type CmdRemoveThreshold struct {
name string
rpcMethod string
rpcParams *utils.TenantIDWithOpts
rpcParams *utils.TenantIDWithAPIOpts
*CommandExecuter
}
@@ -47,7 +47,7 @@ func (self *CmdRemoveThreshold) RpcMethod() string {
func (self *CmdRemoveThreshold) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantIDWithOpts{Opts: make(map[string]interface{})}
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]interface{})}
}
return self.rpcParams
}