// Code generated by go-enum DO NOT EDIT.
// Version: v0.9.2

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// ZooKeeperOpsRequestTypeUpdateVersion is a ZooKeeperOpsRequestType of type UpdateVersion.
	ZooKeeperOpsRequestTypeUpdateVersion ZooKeeperOpsRequestType = "UpdateVersion"
	// ZooKeeperOpsRequestTypeHorizontalScaling is a ZooKeeperOpsRequestType of type HorizontalScaling.
	ZooKeeperOpsRequestTypeHorizontalScaling ZooKeeperOpsRequestType = "HorizontalScaling"
	// ZooKeeperOpsRequestTypeVerticalScaling is a ZooKeeperOpsRequestType of type VerticalScaling.
	ZooKeeperOpsRequestTypeVerticalScaling ZooKeeperOpsRequestType = "VerticalScaling"
	// ZooKeeperOpsRequestTypeVolumeExpansion is a ZooKeeperOpsRequestType of type VolumeExpansion.
	ZooKeeperOpsRequestTypeVolumeExpansion ZooKeeperOpsRequestType = "VolumeExpansion"
	// ZooKeeperOpsRequestTypeRestart is a ZooKeeperOpsRequestType of type Restart.
	ZooKeeperOpsRequestTypeRestart ZooKeeperOpsRequestType = "Restart"
	// ZooKeeperOpsRequestTypeReconfigure is a ZooKeeperOpsRequestType of type Reconfigure.
	ZooKeeperOpsRequestTypeReconfigure ZooKeeperOpsRequestType = "Reconfigure"
	// ZooKeeperOpsRequestTypeReconfigureTLS is a ZooKeeperOpsRequestType of type ReconfigureTLS.
	ZooKeeperOpsRequestTypeReconfigureTLS ZooKeeperOpsRequestType = "ReconfigureTLS"
	// ZooKeeperOpsRequestTypeRotateAuth is a ZooKeeperOpsRequestType of type RotateAuth.
	ZooKeeperOpsRequestTypeRotateAuth ZooKeeperOpsRequestType = "RotateAuth"
)

var ErrInvalidZooKeeperOpsRequestType = fmt.Errorf("not a valid ZooKeeperOpsRequestType, try [%s]", strings.Join(_ZooKeeperOpsRequestTypeNames, ", "))

var _ZooKeeperOpsRequestTypeNames = []string{
	string(ZooKeeperOpsRequestTypeUpdateVersion),
	string(ZooKeeperOpsRequestTypeHorizontalScaling),
	string(ZooKeeperOpsRequestTypeVerticalScaling),
	string(ZooKeeperOpsRequestTypeVolumeExpansion),
	string(ZooKeeperOpsRequestTypeRestart),
	string(ZooKeeperOpsRequestTypeReconfigure),
	string(ZooKeeperOpsRequestTypeReconfigureTLS),
	string(ZooKeeperOpsRequestTypeRotateAuth),
}

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

// ZooKeeperOpsRequestTypeValues returns a list of the values for ZooKeeperOpsRequestType
func ZooKeeperOpsRequestTypeValues() []ZooKeeperOpsRequestType {
	return []ZooKeeperOpsRequestType{
		ZooKeeperOpsRequestTypeUpdateVersion,
		ZooKeeperOpsRequestTypeHorizontalScaling,
		ZooKeeperOpsRequestTypeVerticalScaling,
		ZooKeeperOpsRequestTypeVolumeExpansion,
		ZooKeeperOpsRequestTypeRestart,
		ZooKeeperOpsRequestTypeReconfigure,
		ZooKeeperOpsRequestTypeReconfigureTLS,
		ZooKeeperOpsRequestTypeRotateAuth,
	}
}

// String implements the Stringer interface.
func (x ZooKeeperOpsRequestType) String() string {
	return string(x)
}

// IsValid provides a quick way to determine if the typed value is
// part of the allowed enumerated values
func (x ZooKeeperOpsRequestType) IsValid() bool {
	_, err := ParseZooKeeperOpsRequestType(string(x))
	return err == nil
}

var _ZooKeeperOpsRequestTypeValue = map[string]ZooKeeperOpsRequestType{
	"UpdateVersion":     ZooKeeperOpsRequestTypeUpdateVersion,
	"HorizontalScaling": ZooKeeperOpsRequestTypeHorizontalScaling,
	"VerticalScaling":   ZooKeeperOpsRequestTypeVerticalScaling,
	"VolumeExpansion":   ZooKeeperOpsRequestTypeVolumeExpansion,
	"Restart":           ZooKeeperOpsRequestTypeRestart,
	"Reconfigure":       ZooKeeperOpsRequestTypeReconfigure,
	"ReconfigureTLS":    ZooKeeperOpsRequestTypeReconfigureTLS,
	"RotateAuth":        ZooKeeperOpsRequestTypeRotateAuth,
}

// ParseZooKeeperOpsRequestType attempts to convert a string to a ZooKeeperOpsRequestType.
func ParseZooKeeperOpsRequestType(name string) (ZooKeeperOpsRequestType, error) {
	if x, ok := _ZooKeeperOpsRequestTypeValue[name]; ok {
		return x, nil
	}
	return ZooKeeperOpsRequestType(""), fmt.Errorf("%s is %w", name, ErrInvalidZooKeeperOpsRequestType)
}

// MustParseZooKeeperOpsRequestType converts a string to a ZooKeeperOpsRequestType, and panics if is not valid.
func MustParseZooKeeperOpsRequestType(name string) ZooKeeperOpsRequestType {
	val, err := ParseZooKeeperOpsRequestType(name)
	if err != nil {
		panic(err)
	}
	return val
}
