// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"encoding/json"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/validate"
)

// MessageType message type
// swagger:model MessageType

type MessageType string

const (
	// MessageTypeINFO captures enum value "INFO"
	MessageTypeINFO MessageType = "INFO"
	// MessageTypeERROR captures enum value "ERROR"
	MessageTypeERROR MessageType = "ERROR"
	// MessageTypeWARNING captures enum value "WARNING"
	MessageTypeWARNING MessageType = "WARNING"
	// MessageTypeEXT captures enum value "EXT"
	MessageTypeEXT MessageType = "EXT"
	// MessageTypeTASKSTARTUP captures enum value "TASK_STARTUP"
	MessageTypeTASKSTARTUP MessageType = "TASK_STARTUP"
)

// for schema
var messageTypeEnum []interface{}

func init() {
	var res []MessageType
	if err := json.Unmarshal([]byte(`["INFO","ERROR","WARNING","EXT","TASK_STARTUP"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		messageTypeEnum = append(messageTypeEnum, v)
	}
}

func (m MessageType) validateMessageTypeEnum(path, location string, value MessageType) error {
	if err := validate.Enum(path, location, value, messageTypeEnum); err != nil {
		return err
	}
	return nil
}

// Validate validates this message type
func (m MessageType) Validate(formats strfmt.Registry) error {
	var res []error

	// value enum
	if err := m.validateMessageTypeEnum("", "body", m); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
