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

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

// Category category
//
// swagger:model Category
type Category string

const (

	// CategoryA captures enum value "a"
	CategoryA Category = "a"

	// CategoryB captures enum value "b"
	CategoryB Category = "b"
)

// for schema
var categoryEnum []interface{}

func init() {
	var res []Category
	if err := json.Unmarshal([]byte(`["a","b"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		categoryEnum = append(categoryEnum, v)
	}
}

func (m Category) validateCategoryEnum(path, location string, value Category) error {
	if err := validate.Enum(path, location, value, categoryEnum); err != nil {
		return err
	}
	return nil
}

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

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

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