Addon
This commit is contained in:
@@ -19,6 +19,10 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func FiltersFromFlatMap(flatMap map[string]interface{}, target interface{}) *dbs.Filters {
|
||||
return dbs.FiltersFromFlatMap(flatMap, target)
|
||||
}
|
||||
|
||||
// AbstractResource is the struct containing all of the attributes commons to all ressources
|
||||
type AbstractResource struct {
|
||||
utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name)
|
||||
@@ -381,6 +385,14 @@ func (ri *ResourceInstance[T]) UpdateAverageDuration(actualS float64) {
|
||||
ri.AverageDurationSamples++
|
||||
}
|
||||
|
||||
func (ri *ResourceInstance[T]) GetPartnerships() []ResourcePartnerITF {
|
||||
rt := []ResourcePartnerITF{}
|
||||
for _, p := range ri.Partnerships {
|
||||
rt = append(rt, p)
|
||||
}
|
||||
return rt
|
||||
}
|
||||
|
||||
type ResourcePartnerShip[T pricing.PricingProfileITF] struct {
|
||||
Namespace string `json:"namespace" bson:"namespace" default:"default-namespace"`
|
||||
PeerGroups map[string][]string `json:"peer_groups,omitempty" bson:"peer_groups,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user