adding inputs output struct based on argo naming for now
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user