// Code generated by go-enum DO NOT EDIT.
// Version: 0.5.8
// Revision: 3d844c8ecc59661ed7aa17bfd65727bc06a60ad8
// Build Date: 2023-09-18T14:55:21Z
// Built By: goreleaser

package chat

import (
	"fmt"
	"strings"
)

const (
	// ListOutputTable is a ListOutput of type Table.
	ListOutputTable ListOutput = iota
	// ListOutputJson is a ListOutput of type Json.
	ListOutputJson
)

var ErrInvalidListOutput = fmt.Errorf("not a valid ListOutput, try [%s]", strings.Join(_ListOutputNames, ", "))

const _ListOutputName = "tablejson"

var _ListOutputNames = []string{
	_ListOutputName[0:5],
	_ListOutputName[5:9],
}

// ListOutputNames returns a list of possible string values of ListOutput.
func ListOutputNames() []string {
	tmp := make([]string, len(_ListOutputNames))
	copy(tmp, _ListOutputNames)
	return tmp
}

// ListOutputValues returns a list of the values for ListOutput
func ListOutputValues() []ListOutput {
	return []ListOutput{
		ListOutputTable,
		ListOutputJson,
	}
}

var _ListOutputMap = map[ListOutput]string{
	ListOutputTable: _ListOutputName[0:5],
	ListOutputJson:  _ListOutputName[5:9],
}

// String implements the Stringer interface.
func (x ListOutput) String() string {
	if str, ok := _ListOutputMap[x]; ok {
		return str
	}
	return fmt.Sprintf("ListOutput(%d)", x)
}

// IsValid provides a quick way to determine if the typed value is
// part of the allowed enumerated values
func (x ListOutput) IsValid() bool {
	_, ok := _ListOutputMap[x]
	return ok
}

var _ListOutputValue = map[string]ListOutput{
	_ListOutputName[0:5]:                  ListOutputTable,
	strings.ToLower(_ListOutputName[0:5]): ListOutputTable,
	_ListOutputName[5:9]:                  ListOutputJson,
	strings.ToLower(_ListOutputName[5:9]): ListOutputJson,
}

// ParseListOutput attempts to convert a string to a ListOutput.
func ParseListOutput(name string) (ListOutput, error) {
	if x, ok := _ListOutputValue[name]; ok {
		return x, nil
	}
	// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.
	if x, ok := _ListOutputValue[strings.ToLower(name)]; ok {
		return x, nil
	}
	return ListOutput(0), fmt.Errorf("%s is %w", name, ErrInvalidListOutput)
}

// Set implements the Golang flag.Value interface func.
func (x *ListOutput) Set(val string) error {
	v, err := ParseListOutput(val)
	*x = v
	return err
}

// Get implements the Golang flag.Getter interface func.
func (x *ListOutput) Get() interface{} {
	return *x
}

// Type implements the github.com/spf13/pFlag Value interface.
func (x *ListOutput) Type() string {
	return "ListOutput"
}
