// Code generated by "enumer -type=TimeFormat -transform=snake -trimprefix TimeFormat -output time_format_gen.go"; DO NOT EDIT.

package csv

import (
	"fmt"
	"strings"
)

const _TimeFormatName = "unixunix_milliunix_microunix_nanorfc3339rfc3339_nano"

var _TimeFormatIndex = [...]uint8{0, 4, 14, 24, 33, 40, 52}

const _TimeFormatLowerName = "unixunix_milliunix_microunix_nanorfc3339rfc3339_nano"

func (i TimeFormat) String() string {
	if i >= TimeFormat(len(_TimeFormatIndex)-1) {
		return fmt.Sprintf("TimeFormat(%d)", i)
	}
	return _TimeFormatName[_TimeFormatIndex[i]:_TimeFormatIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _TimeFormatNoOp() {
	var x [1]struct{}
	_ = x[TimeFormatUnix-(0)]
	_ = x[TimeFormatUnixMilli-(1)]
	_ = x[TimeFormatUnixMicro-(2)]
	_ = x[TimeFormatUnixNano-(3)]
	_ = x[TimeFormatRFC3339-(4)]
	_ = x[TimeFormatRFC3339Nano-(5)]
}

var _TimeFormatValues = []TimeFormat{TimeFormatUnix, TimeFormatUnixMilli, TimeFormatUnixMicro, TimeFormatUnixNano, TimeFormatRFC3339, TimeFormatRFC3339Nano}

var _TimeFormatNameToValueMap = map[string]TimeFormat{
	_TimeFormatName[0:4]:        TimeFormatUnix,
	_TimeFormatLowerName[0:4]:   TimeFormatUnix,
	_TimeFormatName[4:14]:       TimeFormatUnixMilli,
	_TimeFormatLowerName[4:14]:  TimeFormatUnixMilli,
	_TimeFormatName[14:24]:      TimeFormatUnixMicro,
	_TimeFormatLowerName[14:24]: TimeFormatUnixMicro,
	_TimeFormatName[24:33]:      TimeFormatUnixNano,
	_TimeFormatLowerName[24:33]: TimeFormatUnixNano,
	_TimeFormatName[33:40]:      TimeFormatRFC3339,
	_TimeFormatLowerName[33:40]: TimeFormatRFC3339,
	_TimeFormatName[40:52]:      TimeFormatRFC3339Nano,
	_TimeFormatLowerName[40:52]: TimeFormatRFC3339Nano,
}

var _TimeFormatNames = []string{
	_TimeFormatName[0:4],
	_TimeFormatName[4:14],
	_TimeFormatName[14:24],
	_TimeFormatName[24:33],
	_TimeFormatName[33:40],
	_TimeFormatName[40:52],
}

// TimeFormatString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func TimeFormatString(s string) (TimeFormat, error) {
	if val, ok := _TimeFormatNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _TimeFormatNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to TimeFormat values", s)
}

// TimeFormatValues returns all values of the enum
func TimeFormatValues() []TimeFormat {
	return _TimeFormatValues
}

// TimeFormatStrings returns a slice of all String values of the enum
func TimeFormatStrings() []string {
	strs := make([]string, len(_TimeFormatNames))
	copy(strs, _TimeFormatNames)
	return strs
}

// IsATimeFormat returns "true" if the value is listed in the enum definition. "false" otherwise
func (i TimeFormat) IsATimeFormat() bool {
	for _, v := range _TimeFormatValues {
		if i == v {
			return true
		}
	}
	return false
}
