This commit is contained in:
mr
2026-04-27 11:16:50 +02:00
parent 0b54d6640d
commit f048b420d7
14 changed files with 484 additions and 30 deletions

View File

@@ -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"`