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

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// ClickHouseOpsRequestTypeRestart is a ClickHouseOpsRequestType of type Restart.
	ClickHouseOpsRequestTypeRestart ClickHouseOpsRequestType = "Restart"
	// ClickHouseOpsRequestTypeVerticalScaling is a ClickHouseOpsRequestType of type VerticalScaling.
	ClickHouseOpsRequestTypeVerticalScaling ClickHouseOpsRequestType = "VerticalScaling"
	// ClickHouseOpsRequestTypeHorizontalScaling is a ClickHouseOpsRequestType of type HorizontalScaling.
	ClickHouseOpsRequestTypeHorizontalScaling ClickHouseOpsRequestType = "HorizontalScaling"
	// ClickHouseOpsRequestTypeUpdateVersion is a ClickHouseOpsRequestType of type UpdateVersion.
	ClickHouseOpsRequestTypeUpdateVersion ClickHouseOpsRequestType = "UpdateVersion"
	// ClickHouseOpsRequestTypeVolumeExpansion is a ClickHouseOpsRequestType of type VolumeExpansion.
	ClickHouseOpsRequestTypeVolumeExpansion ClickHouseOpsRequestType = "VolumeExpansion"
	// ClickHouseOpsRequestTypeReconfigure is a ClickHouseOpsRequestType of type Reconfigure.
	ClickHouseOpsRequestTypeReconfigure ClickHouseOpsRequestType = "Reconfigure"
	// ClickHouseOpsRequestTypeReconfigureTLS is a ClickHouseOpsRequestType of type ReconfigureTLS.
	ClickHouseOpsRequestTypeReconfigureTLS ClickHouseOpsRequestType = "ReconfigureTLS"
	// ClickHouseOpsRequestTypeRotateAuth is a ClickHouseOpsRequestType of type RotateAuth.
	ClickHouseOpsRequestTypeRotateAuth ClickHouseOpsRequestType = "RotateAuth"
	// ClickHouseOpsRequestTypeStorageMigration is a ClickHouseOpsRequestType of type StorageMigration.
	ClickHouseOpsRequestTypeStorageMigration ClickHouseOpsRequestType = "StorageMigration"
)

var ErrInvalidClickHouseOpsRequestType = fmt.Errorf("not a valid ClickHouseOpsRequestType, try [%s]", strings.Join(_ClickHouseOpsRequestTypeNames, ", "))

var _ClickHouseOpsRequestTypeNames = []string{
	string(ClickHouseOpsRequestTypeRestart),
	string(ClickHouseOpsRequestTypeVerticalScaling),
	string(ClickHouseOpsRequestTypeHorizontalScaling),
	string(ClickHouseOpsRequestTypeUpdateVersion),
	string(ClickHouseOpsRequestTypeVolumeExpansion),
	string(ClickHouseOpsRequestTypeReconfigure),
	string(ClickHouseOpsRequestTypeReconfigureTLS),
	string(ClickHouseOpsRequestTypeRotateAuth),
	string(ClickHouseOpsRequestTypeStorageMigration),
}

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

// ClickHouseOpsRequestTypeValues returns a list of the values for ClickHouseOpsRequestType
func ClickHouseOpsRequestTypeValues() []ClickHouseOpsRequestType {
	return []ClickHouseOpsRequestType{
		ClickHouseOpsRequestTypeRestart,
		ClickHouseOpsRequestTypeVerticalScaling,
		ClickHouseOpsRequestTypeHorizontalScaling,
		ClickHouseOpsRequestTypeUpdateVersion,
		ClickHouseOpsRequestTypeVolumeExpansion,
		ClickHouseOpsRequestTypeReconfigure,
		ClickHouseOpsRequestTypeReconfigureTLS,
		ClickHouseOpsRequestTypeRotateAuth,
		ClickHouseOpsRequestTypeStorageMigration,
	}
}

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

var _ClickHouseOpsRequestTypeValue = map[string]ClickHouseOpsRequestType{
	"Restart":           ClickHouseOpsRequestTypeRestart,
	"VerticalScaling":   ClickHouseOpsRequestTypeVerticalScaling,
	"HorizontalScaling": ClickHouseOpsRequestTypeHorizontalScaling,
	"UpdateVersion":     ClickHouseOpsRequestTypeUpdateVersion,
	"VolumeExpansion":   ClickHouseOpsRequestTypeVolumeExpansion,
	"Reconfigure":       ClickHouseOpsRequestTypeReconfigure,
	"ReconfigureTLS":    ClickHouseOpsRequestTypeReconfigureTLS,
	"RotateAuth":        ClickHouseOpsRequestTypeRotateAuth,
	"StorageMigration":  ClickHouseOpsRequestTypeStorageMigration,
}

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

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