// Code generated by go-enum DO NOT EDIT.
// Version: example
// Revision: example
// Build Date: example
// Built By: example

//go:build example
// +build example

package example

import (
	"errors"
	"fmt"
)

const (
	// SuffixTestSomeItem is a SuffixTest of type some_item.
	SuffixTestSomeItem SuffixTest = "some_item"
)

var ErrInvalidSuffixTest = errors.New("not a valid SuffixTest")

// String implements the Stringer interface.
func (x SuffixTest) String() string {
	return string(x)
}

// IsValid provides a quick way to determine if the typed value is
// part of the allowed enumerated values
func (x SuffixTest) IsValid() bool {
	_, err := ParseSuffixTest(string(x))
	return err == nil
}

var _SuffixTestValue = map[string]SuffixTest{
	"some_item": SuffixTestSomeItem,
}

// ParseSuffixTest attempts to convert a string to a SuffixTest.
func ParseSuffixTest(name string) (SuffixTest, error) {
	if x, ok := _SuffixTestValue[name]; ok {
		return x, nil
	}
	return SuffixTest(""), fmt.Errorf("%s is %w", name, ErrInvalidSuffixTest)
}
