adding inputs output struct based on argo naming for now
This commit is contained in:
parent
d731277914
commit
1ad9ce09cb
@ -12,12 +12,13 @@ type ResourceInterface interface {
|
||||
Trim()
|
||||
ConvertToPricedResource(t tools.DataType, request *tools.APIRequest) pricing.PricedItemITF
|
||||
GetType() string
|
||||
GetSelectedInstance() ResourceInstanceITF
|
||||
GetSelectedInstance() utils.DBObject
|
||||
SetAllowedInstances(request *tools.APIRequest)
|
||||
SetResourceModel(model *resource_model.ResourceModel)
|
||||
}
|
||||
|
||||
type ResourceInstanceITF interface {
|
||||
utils.DBObject
|
||||
GetID() string
|
||||
GetName() string
|
||||
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
|
||||
|
@ -35,7 +35,7 @@ type AbstractResource struct {
|
||||
SelectedInstanceIndex *int `json:"selected_instance_index,omitempty" bson:"selected_instance_index,omitempty"` // SelectedInstance is the selected instance
|
||||
}
|
||||
|
||||
func (r *AbstractResource) GetSelectedInstance() ResourceInstanceITF {
|
||||
func (r *AbstractResource) GetSelectedInstance() utils.DBObject {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ func (abs *AbstractIntanciatedResource[T]) ConvertToPricedResource(
|
||||
}
|
||||
}
|
||||
|
||||
func (r *AbstractIntanciatedResource[T]) GetSelectedInstance() ResourceInstanceITF {
|
||||
func (r *AbstractIntanciatedResource[T]) GetSelectedInstance() utils.DBObject {
|
||||
if r.SelectedInstanceIndex != nil && len(r.Instances) > *r.SelectedInstanceIndex {
|
||||
return r.Instances[*r.SelectedInstanceIndex]
|
||||
}
|
||||
@ -140,8 +140,7 @@ type GeoPoint struct {
|
||||
}
|
||||
|
||||
type ResourceInstance[T ResourcePartnerITF] struct {
|
||||
UUID string `json:"id,omitempty" bson:"id,omitempty"`
|
||||
Name string `json:"name,omitempty" bson:"name,omitempty"`
|
||||
utils.AbstractObject
|
||||
Location GeoPoint `json:"location,omitempty" bson:"location,omitempty"`
|
||||
Country countries.CountryCode `json:"country,omitempty" bson:"country,omitempty"`
|
||||
AccessProtocol string `json:"access_protocol,omitempty" bson:"access_protocol,omitempty"`
|
||||
@ -150,6 +149,10 @@ type ResourceInstance[T ResourcePartnerITF] struct {
|
||||
Partnerships []T `json:"partnerships,omitempty" bson:"partnerships,omitempty"`
|
||||
}
|
||||
|
||||
func (ri *ResourceInstance[T]) GetAccessor(request *tools.APIRequest) utils.Accessor {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ri *ResourceInstance[T]) GetID() string {
|
||||
return ri.UUID
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user