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

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// DruidOpsRequestTypeUpdateVersion is a DruidOpsRequestType of type UpdateVersion.
	DruidOpsRequestTypeUpdateVersion DruidOpsRequestType = "UpdateVersion"
	// DruidOpsRequestTypeHorizontalScaling is a DruidOpsRequestType of type HorizontalScaling.
	DruidOpsRequestTypeHorizontalScaling DruidOpsRequestType = "HorizontalScaling"
	// DruidOpsRequestTypeVerticalScaling is a DruidOpsRequestType of type VerticalScaling.
	DruidOpsRequestTypeVerticalScaling DruidOpsRequestType = "VerticalScaling"
	// DruidOpsRequestTypeVolumeExpansion is a DruidOpsRequestType of type VolumeExpansion.
	DruidOpsRequestTypeVolumeExpansion DruidOpsRequestType = "VolumeExpansion"
	// DruidOpsRequestTypeRestart is a DruidOpsRequestType of type Restart.
	DruidOpsRequestTypeRestart DruidOpsRequestType = "Restart"
	// DruidOpsRequestTypeReconfigure is a DruidOpsRequestType of type Reconfigure.
	DruidOpsRequestTypeReconfigure DruidOpsRequestType = "Reconfigure"
	// DruidOpsRequestTypeReconfigureTLS is a DruidOpsRequestType of type ReconfigureTLS.
	DruidOpsRequestTypeReconfigureTLS DruidOpsRequestType = "ReconfigureTLS"
	// DruidOpsRequestTypeRotateAuth is a DruidOpsRequestType of type RotateAuth.
	DruidOpsRequestTypeRotateAuth DruidOpsRequestType = "RotateAuth"
	// DruidOpsRequestTypeStorageMigration is a DruidOpsRequestType of type StorageMigration.
	DruidOpsRequestTypeStorageMigration DruidOpsRequestType = "StorageMigration"
)

var ErrInvalidDruidOpsRequestType = fmt.Errorf("not a valid DruidOpsRequestType, try [%s]", strings.Join(_DruidOpsRequestTypeNames, ", "))

var _DruidOpsRequestTypeNames = []string{
	string(DruidOpsRequestTypeUpdateVersion),
	string(DruidOpsRequestTypeHorizontalScaling),
	string(DruidOpsRequestTypeVerticalScaling),
	string(DruidOpsRequestTypeVolumeExpansion),
	string(DruidOpsRequestTypeRestart),
	string(DruidOpsRequestTypeReconfigure),
	string(DruidOpsRequestTypeReconfigureTLS),
	string(DruidOpsRequestTypeRotateAuth),
	string(DruidOpsRequestTypeStorageMigration),
}

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

// DruidOpsRequestTypeValues returns a list of the values for DruidOpsRequestType
func DruidOpsRequestTypeValues() []DruidOpsRequestType {
	return []DruidOpsRequestType{
		DruidOpsRequestTypeUpdateVersion,
		DruidOpsRequestTypeHorizontalScaling,
		DruidOpsRequestTypeVerticalScaling,
		DruidOpsRequestTypeVolumeExpansion,
		DruidOpsRequestTypeRestart,
		DruidOpsRequestTypeReconfigure,
		DruidOpsRequestTypeReconfigureTLS,
		DruidOpsRequestTypeRotateAuth,
		DruidOpsRequestTypeStorageMigration,
	}
}

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

var _DruidOpsRequestTypeValue = map[string]DruidOpsRequestType{
	"UpdateVersion":     DruidOpsRequestTypeUpdateVersion,
	"HorizontalScaling": DruidOpsRequestTypeHorizontalScaling,
	"VerticalScaling":   DruidOpsRequestTypeVerticalScaling,
	"VolumeExpansion":   DruidOpsRequestTypeVolumeExpansion,
	"Restart":           DruidOpsRequestTypeRestart,
	"Reconfigure":       DruidOpsRequestTypeReconfigure,
	"ReconfigureTLS":    DruidOpsRequestTypeReconfigureTLS,
	"RotateAuth":        DruidOpsRequestTypeRotateAuth,
	"StorageMigration":  DruidOpsRequestTypeStorageMigration,
}

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

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