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

package types

// 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"

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

// EventType The type of event. For example, "container" or "image",
// Now we only support container, image, network and volume events.
//
// swagger:model EventType
type EventType string

const (

	// EventTypeContainer captures enum value "container"
	EventTypeContainer EventType = "container"

	// EventTypeDaemon captures enum value "daemon"
	EventTypeDaemon EventType = "daemon"

	// EventTypeImage captures enum value "image"
	EventTypeImage EventType = "image"

	// EventTypeNetwork captures enum value "network"
	EventTypeNetwork EventType = "network"

	// EventTypePlugin captures enum value "plugin"
	EventTypePlugin EventType = "plugin"

	// EventTypeVolume captures enum value "volume"
	EventTypeVolume EventType = "volume"
)

// for schema
var eventTypeEnum []interface{}

func init() {
	var res []EventType
	if err := json.Unmarshal([]byte(`["container","daemon","image","network","plugin","volume"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		eventTypeEnum = append(eventTypeEnum, v)
	}
}

func (m EventType) validateEventTypeEnum(path, location string, value EventType) error {
	if err := validate.Enum(path, location, value, eventTypeEnum); err != nil {
		return err
	}
	return nil
}

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

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

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