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

package restmodels

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

// AnyDataType any data type
// swagger:model AnyDataType

type AnyDataType string

const (
	// AnyDataTypeSTRING captures enum value "STRING"
	AnyDataTypeSTRING AnyDataType = "STRING"
	// AnyDataTypeJSONSTRING captures enum value "JSONSTRING"
	AnyDataTypeJSONSTRING AnyDataType = "JSONSTRING"
	// AnyDataTypeINT captures enum value "INT"
	AnyDataTypeINT AnyDataType = "INT"
	// AnyDataTypeFLOAT captures enum value "FLOAT"
	AnyDataTypeFLOAT AnyDataType = "FLOAT"
)

// for schema
var anyDataTypeEnum []interface{}

func init() {
	var res []AnyDataType
	if err := json.Unmarshal([]byte(`["STRING","JSONSTRING","INT","FLOAT"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		anyDataTypeEnum = append(anyDataTypeEnum, v)
	}
}

func (m AnyDataType) validateAnyDataTypeEnum(path, location string, value AnyDataType) error {
	if err := validate.Enum(path, location, value, anyDataTypeEnum); err != nil {
		return err
	}
	return nil
}

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

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

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