// Code generated by "enumer -type ClientCode -trimprefix ClientCode -output client_code_enum.go"; DO NOT EDIT.

package proto

import (
	"fmt"
	"strings"
)

const (
	_ClientCodeName_0      = "HelloQueryDataCancelPingClientTablesStatusRequest"
	_ClientCodeLowerName_0 = "helloquerydatacancelpingclienttablesstatusrequest"
	_ClientCodeName_1      = "SSHChallengeRequestSSHChallengeResponse"
	_ClientCodeLowerName_1 = "sshchallengerequestsshchallengeresponse"
)

var (
	_ClientCodeIndex_0 = [...]uint8{0, 5, 10, 14, 20, 24, 49}
	_ClientCodeIndex_1 = [...]uint8{0, 19, 39}
)

func (i ClientCode) String() string {
	switch {
	case 0 <= i && i <= 5:
		return _ClientCodeName_0[_ClientCodeIndex_0[i]:_ClientCodeIndex_0[i+1]]
	case 11 <= i && i <= 12:
		i -= 11
		return _ClientCodeName_1[_ClientCodeIndex_1[i]:_ClientCodeIndex_1[i+1]]
	default:
		return fmt.Sprintf("ClientCode(%d)", i)
	}
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _ClientCodeNoOp() {
	var x [1]struct{}
	_ = x[ClientCodeHello-(0)]
	_ = x[ClientCodeQuery-(1)]
	_ = x[ClientCodeData-(2)]
	_ = x[ClientCodeCancel-(3)]
	_ = x[ClientCodePing-(4)]
	_ = x[ClientTablesStatusRequest-(5)]
	_ = x[ClientCodeSSHChallengeRequest-(11)]
	_ = x[ClientCodeSSHChallengeResponse-(12)]
}

var _ClientCodeValues = []ClientCode{ClientCodeHello, ClientCodeQuery, ClientCodeData, ClientCodeCancel, ClientCodePing, ClientTablesStatusRequest, ClientCodeSSHChallengeRequest, ClientCodeSSHChallengeResponse}

var _ClientCodeNameToValueMap = map[string]ClientCode{
	_ClientCodeName_0[0:5]:        ClientCodeHello,
	_ClientCodeLowerName_0[0:5]:   ClientCodeHello,
	_ClientCodeName_0[5:10]:       ClientCodeQuery,
	_ClientCodeLowerName_0[5:10]:  ClientCodeQuery,
	_ClientCodeName_0[10:14]:      ClientCodeData,
	_ClientCodeLowerName_0[10:14]: ClientCodeData,
	_ClientCodeName_0[14:20]:      ClientCodeCancel,
	_ClientCodeLowerName_0[14:20]: ClientCodeCancel,
	_ClientCodeName_0[20:24]:      ClientCodePing,
	_ClientCodeLowerName_0[20:24]: ClientCodePing,
	_ClientCodeName_0[24:49]:      ClientTablesStatusRequest,
	_ClientCodeLowerName_0[24:49]: ClientTablesStatusRequest,
	_ClientCodeName_1[0:19]:       ClientCodeSSHChallengeRequest,
	_ClientCodeLowerName_1[0:19]:  ClientCodeSSHChallengeRequest,
	_ClientCodeName_1[19:39]:      ClientCodeSSHChallengeResponse,
	_ClientCodeLowerName_1[19:39]: ClientCodeSSHChallengeResponse,
}

var _ClientCodeNames = []string{
	_ClientCodeName_0[0:5],
	_ClientCodeName_0[5:10],
	_ClientCodeName_0[10:14],
	_ClientCodeName_0[14:20],
	_ClientCodeName_0[20:24],
	_ClientCodeName_0[24:49],
	_ClientCodeName_1[0:19],
	_ClientCodeName_1[19:39],
}

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

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

// ClientCodeValues returns all values of the enum
func ClientCodeValues() []ClientCode {
	return _ClientCodeValues
}

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

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