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

// ErrorType error type
// swagger:model ErrorType
type ErrorType string

const (
	// ErrorTypeCONTENT captures enum value "CONTENT"
	ErrorTypeCONTENT = "CONTENT"
	// ErrorTypeINFRASTRUCTURE captures enum value "INFRASTRUCTURE"
	ErrorTypeINFRASTRUCTURE = "INFRASTRUCTURE"
)

// for schema
var errorTypeEnum []interface{}

func init() {
	var res []ErrorType
	if err := json.Unmarshal([]byte(`["CONTENT", "INFRASTRCTURE"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		errorTypeEnum = append(errorTypeEnum, v)
	}
}

func (m ErrorType) validateErrorTypeEnum(path, location string, value ErrorType) error {
	if err := validate.Enum(path, location, value, errorTypeEnum); err != nil {
		return err
	}
	return nil
}

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

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

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