func (req CreateWorkflow) Validate(optionalValidations ...func() error) error {
	v := []func() error{
		func() error { return validations.ValidateStruct(req) },
		req.validateArguments,
		req.validateParameters,
	}
	v = append(v, optionalValidations...)
	return validations.Validate(v...)
}
Validate validates CreateWorkflow.
package requests
import (
	"errors"
	"fmt"
	"strings"
	"github.com/argoproj-labs/argo-cloudops/internal/validations"
)
type CreateWorkflow struct {
	Arguments            map[string][]string `json:"arguments" yaml:"arguments"`
	EnvironmentVariables map[string]string   `json:"environment_variables" yaml:"environment_variables"`
	Framework   string            `json:"framework" yaml:"framework" valid:"required~framework is required"`
	Parameters  map[string]string `json:"parameters" yaml:"parameters"`
	ProjectName string            `json:"project_name" yaml:"project_name" valid:"required~project_name is required,alphanum~project_name must be alphanumeric,stringlength(4|32)~project_name must be between 4 and 32 characters"`
	TargetName  string            `json:"target_name" yaml:"target_name" valid:"required~target_name is required,alphanumunderscore~target_name must be alphanumeric underscore,stringlength(4|32)~target_name must be between 4 and 32 characters"`
	Type                 string `json:"type" yaml:"type" valid:"required~type is required"`
	WorkflowTemplateName string `json:"workflow_template_name" yaml:"workflow_template_name" valid:"required~workflow_template_name is required"`
}