func (m Trigger) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateTriggerEnum("", "body", m); err != nil {
		return err
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
Validate validates this trigger
package models
import (
	"encoding/json"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/validate"
)
type Trigger string
const (
	TriggerIndexPrice Trigger = "index_price"
	TriggerMarkPrice Trigger = "mark_price"
	TriggerLastPrice Trigger = "last_price"
)
var triggerEnum []interface{}
func init() {
	var res []Trigger
	if err := json.Unmarshal([]byte(`["index_price","mark_price","last_price"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		triggerEnum = append(triggerEnum, v)
	}
}
func (m Trigger) validateTriggerEnum(path, location string, value Trigger) error {
	if err := validate.Enum(path, location, value, triggerEnum); err != nil {
		return err
	}
	return nil
}