oc-lib/models/resources/interfaces.go
2025-01-14 09:15:50 +01:00

49 lines
1.3 KiB
Go

package resources
import (
"time"
"cloud.o-forge.io/core/oc-lib/models/common/pricing"
"cloud.o-forge.io/core/oc-lib/models/resources/resource_model"
"cloud.o-forge.io/core/oc-lib/models/utils"
"cloud.o-forge.io/core/oc-lib/tools"
)
type ShallowResourceInterface interface {
utils.DBObject
GetType() tools.DataType
GetCreatorID() string
GetPricingID() string
GetLocationStart() *time.Time
GetLocationEnd() *time.Time
GetExplicitDurationInS() float64
SetStartUsage(start time.Time)
SetEndUsage(end time.Time)
GetPartnership(request *tools.APIRequest) ResourcePartnerITF
SetResourceModel(model *resource_model.ResourceModel)
}
type ResourceInterface interface {
utils.DBObject
Trim()
Transform() utils.DBObject
ConvertToPricedResource(t tools.DataType, request *tools.APIRequest) pricing.PricedItemITF
SetAllowedInstances(request *tools.APIRequest)
SetResourceModel(model *resource_model.ResourceModel)
SetSelection(selection *int)
}
type ResourceInstanceITF interface {
GetID() string
GetName() string
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
GetPeerGroups() ([]ResourcePartnerITF, []map[string][]string)
ClearPeerGroups()
}
type ResourcePartnerITF interface {
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
GetPeerGroups() map[string][]string
ClearPeerGroups()
}