// Code generated by "enumer -type=CredentialType -trimprefix=CredentialType -transform=snake"; DO NOT EDIT.

package dbplugin

import (
	"fmt"
)

const _CredentialTypeName = "passwordrsa_private_keyclient_certificate"

var _CredentialTypeIndex = [...]uint8{0, 8, 23, 41}

func (i CredentialType) String() string {
	if i < 0 || i >= CredentialType(len(_CredentialTypeIndex)-1) {
		return fmt.Sprintf("CredentialType(%d)", i)
	}
	return _CredentialTypeName[_CredentialTypeIndex[i]:_CredentialTypeIndex[i+1]]
}

var _CredentialTypeValues = []CredentialType{0, 1, 2}

var _CredentialTypeNameToValueMap = map[string]CredentialType{
	_CredentialTypeName[0:8]:   0,
	_CredentialTypeName[8:23]:  1,
	_CredentialTypeName[23:41]: 2,
}

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

// CredentialTypeValues returns all values of the enum
func CredentialTypeValues() []CredentialType {
	return _CredentialTypeValues
}

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