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

//
package httpext

import (
	"fmt"
)

const _CompressionTypeName = "gzipdeflatezstdbr"

var _CompressionTypeIndex = [...]uint8{0, 4, 11, 15, 17}

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

var _CompressionTypeValues = []CompressionType{0, 1, 2, 3}

var _CompressionTypeNameToValueMap = map[string]CompressionType{
	_CompressionTypeName[0:4]:   0,
	_CompressionTypeName[4:11]:  1,
	_CompressionTypeName[11:15]: 2,
	_CompressionTypeName[15:17]: 3,
}

// CompressionTypeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func CompressionTypeString(s string) (CompressionType, error) {
	if val, ok := _CompressionTypeNameToValueMap[s]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to CompressionType values", s)
}

// CompressionTypeValues returns all values of the enum
func CompressionTypeValues() []CompressionType {
	return _CompressionTypeValues
}

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