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

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// KafkaOpsRequestTypeUpdateVersion is a KafkaOpsRequestType of type UpdateVersion.
	KafkaOpsRequestTypeUpdateVersion KafkaOpsRequestType = "UpdateVersion"
	// KafkaOpsRequestTypeHorizontalScaling is a KafkaOpsRequestType of type HorizontalScaling.
	KafkaOpsRequestTypeHorizontalScaling KafkaOpsRequestType = "HorizontalScaling"
	// KafkaOpsRequestTypeVerticalScaling is a KafkaOpsRequestType of type VerticalScaling.
	KafkaOpsRequestTypeVerticalScaling KafkaOpsRequestType = "VerticalScaling"
	// KafkaOpsRequestTypeVolumeExpansion is a KafkaOpsRequestType of type VolumeExpansion.
	KafkaOpsRequestTypeVolumeExpansion KafkaOpsRequestType = "VolumeExpansion"
	// KafkaOpsRequestTypeRestart is a KafkaOpsRequestType of type Restart.
	KafkaOpsRequestTypeRestart KafkaOpsRequestType = "Restart"
	// KafkaOpsRequestTypeReconfigure is a KafkaOpsRequestType of type Reconfigure.
	KafkaOpsRequestTypeReconfigure KafkaOpsRequestType = "Reconfigure"
	// KafkaOpsRequestTypeReconfigureTLS is a KafkaOpsRequestType of type ReconfigureTLS.
	KafkaOpsRequestTypeReconfigureTLS KafkaOpsRequestType = "ReconfigureTLS"
	// KafkaOpsRequestTypeRotateAuth is a KafkaOpsRequestType of type RotateAuth.
	KafkaOpsRequestTypeRotateAuth KafkaOpsRequestType = "RotateAuth"
	// KafkaOpsRequestTypeStorageMigration is a KafkaOpsRequestType of type StorageMigration.
	KafkaOpsRequestTypeStorageMigration KafkaOpsRequestType = "StorageMigration"
)

var ErrInvalidKafkaOpsRequestType = fmt.Errorf("not a valid KafkaOpsRequestType, try [%s]", strings.Join(_KafkaOpsRequestTypeNames, ", "))

var _KafkaOpsRequestTypeNames = []string{
	string(KafkaOpsRequestTypeUpdateVersion),
	string(KafkaOpsRequestTypeHorizontalScaling),
	string(KafkaOpsRequestTypeVerticalScaling),
	string(KafkaOpsRequestTypeVolumeExpansion),
	string(KafkaOpsRequestTypeRestart),
	string(KafkaOpsRequestTypeReconfigure),
	string(KafkaOpsRequestTypeReconfigureTLS),
	string(KafkaOpsRequestTypeRotateAuth),
	string(KafkaOpsRequestTypeStorageMigration),
}

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

// KafkaOpsRequestTypeValues returns a list of the values for KafkaOpsRequestType
func KafkaOpsRequestTypeValues() []KafkaOpsRequestType {
	return []KafkaOpsRequestType{
		KafkaOpsRequestTypeUpdateVersion,
		KafkaOpsRequestTypeHorizontalScaling,
		KafkaOpsRequestTypeVerticalScaling,
		KafkaOpsRequestTypeVolumeExpansion,
		KafkaOpsRequestTypeRestart,
		KafkaOpsRequestTypeReconfigure,
		KafkaOpsRequestTypeReconfigureTLS,
		KafkaOpsRequestTypeRotateAuth,
		KafkaOpsRequestTypeStorageMigration,
	}
}

// String implements the Stringer interface.
func (x KafkaOpsRequestType) 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 KafkaOpsRequestType) IsValid() bool {
	_, err := ParseKafkaOpsRequestType(string(x))
	return err == nil
}

var _KafkaOpsRequestTypeValue = map[string]KafkaOpsRequestType{
	"UpdateVersion":     KafkaOpsRequestTypeUpdateVersion,
	"HorizontalScaling": KafkaOpsRequestTypeHorizontalScaling,
	"VerticalScaling":   KafkaOpsRequestTypeVerticalScaling,
	"VolumeExpansion":   KafkaOpsRequestTypeVolumeExpansion,
	"Restart":           KafkaOpsRequestTypeRestart,
	"Reconfigure":       KafkaOpsRequestTypeReconfigure,
	"ReconfigureTLS":    KafkaOpsRequestTypeReconfigureTLS,
	"RotateAuth":        KafkaOpsRequestTypeRotateAuth,
	"StorageMigration":  KafkaOpsRequestTypeStorageMigration,
}

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

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