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

// SectionType section type
//
// swagger:model SectionType
type SectionType string

const (

	// SectionTypeMath captures enum value "math"
	SectionTypeMath SectionType = "math"

	// SectionTypeScience captures enum value "science"
	SectionTypeScience SectionType = "science"

	// SectionTypeReading captures enum value "reading"
	SectionTypeReading SectionType = "reading"
)

// for schema
var sectionTypeEnum []interface{}

func init() {
	var res []SectionType
	if err := json.Unmarshal([]byte(`["math","science","reading"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		sectionTypeEnum = append(sectionTypeEnum, v)
	}
}

func (m SectionType) validateSectionTypeEnum(path, location string, value SectionType) error {
	if err := validate.Enum(path, location, value, sectionTypeEnum); err != nil {
		return err
	}
	return nil
}

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

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

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