adding inputs output struct based on argo naming for now
This commit is contained in:
parent
24fe99cfa5
commit
d731277914
@ -12,6 +12,7 @@ type ResourceInterface interface {
|
||||
Trim()
|
||||
ConvertToPricedResource(t tools.DataType, request *tools.APIRequest) pricing.PricedItemITF
|
||||
GetType() string
|
||||
GetSelectedInstance() ResourceInstanceITF
|
||||
SetAllowedInstances(request *tools.APIRequest)
|
||||
SetResourceModel(model *resource_model.ResourceModel)
|
||||
}
|
||||
|
@ -35,6 +35,10 @@ 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 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AbstractResource) GetType() string {
|
||||
return tools.INVALID.String()
|
||||
}
|
||||
@ -82,6 +86,13 @@ func (abs *AbstractIntanciatedResource[T]) ConvertToPricedResource(
|
||||
}
|
||||
}
|
||||
|
||||
func (r *AbstractIntanciatedResource[T]) GetSelectedInstance() ResourceInstanceITF {
|
||||
if r.SelectedInstanceIndex != nil && len(r.Instances) > *r.SelectedInstanceIndex {
|
||||
return r.Instances[*r.SelectedInstanceIndex]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (abs *AbstractIntanciatedResource[T]) SetAllowedInstances(request *tools.APIRequest) {
|
||||
abs.Instances = verifyAuthAction[T](abs.Instances, request)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user