2024-12-12 16:25:47 +01:00
|
|
|
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()
|
2025-01-14 08:17:22 +01:00
|
|
|
Transform() utils.DBObject
|
2025-01-13 11:24:07 +01:00
|
|
|
ConvertToPricedResource(t tools.DataType, request *tools.APIRequest) pricing.PricedItemITF
|
2024-12-12 16:25:47 +01:00
|
|
|
SetAllowedInstances(request *tools.APIRequest)
|
|
|
|
SetResourceModel(model *resource_model.ResourceModel)
|
|
|
|
}
|
|
|
|
|
2025-01-13 11:24:07 +01:00
|
|
|
type ResourceInstanceITF interface {
|
2024-12-12 16:25:47 +01:00
|
|
|
GetID() string
|
2025-01-13 11:24:07 +01:00
|
|
|
GetName() string
|
|
|
|
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
|
2024-12-12 16:25:47 +01:00
|
|
|
GetPeerGroups() ([]ResourcePartnerITF, []map[string][]string)
|
|
|
|
ClearPeerGroups()
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResourcePartnerITF interface {
|
2025-01-13 11:24:07 +01:00
|
|
|
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
|
2024-12-12 16:25:47 +01:00
|
|
|
GetPeerGroups() map[string][]string
|
|
|
|
ClearPeerGroups()
|
|
|
|
}
|