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

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// HazelcastOpsRequestTypeUpdateVersion is a HazelcastOpsRequestType of type UpdateVersion.
	HazelcastOpsRequestTypeUpdateVersion HazelcastOpsRequestType = "UpdateVersion"
	// HazelcastOpsRequestTypeHorizontalScaling is a HazelcastOpsRequestType of type HorizontalScaling.
	HazelcastOpsRequestTypeHorizontalScaling HazelcastOpsRequestType = "HorizontalScaling"
	// HazelcastOpsRequestTypeVerticalScaling is a HazelcastOpsRequestType of type VerticalScaling.
	HazelcastOpsRequestTypeVerticalScaling HazelcastOpsRequestType = "VerticalScaling"
	// HazelcastOpsRequestTypeVolumeExpansion is a HazelcastOpsRequestType of type VolumeExpansion.
	HazelcastOpsRequestTypeVolumeExpansion HazelcastOpsRequestType = "VolumeExpansion"
	// HazelcastOpsRequestTypeReconfigure is a HazelcastOpsRequestType of type Reconfigure.
	HazelcastOpsRequestTypeReconfigure HazelcastOpsRequestType = "Reconfigure"
	// HazelcastOpsRequestTypeRestart is a HazelcastOpsRequestType of type Restart.
	HazelcastOpsRequestTypeRestart HazelcastOpsRequestType = "Restart"
	// HazelcastOpsRequestTypeReconfigureTLS is a HazelcastOpsRequestType of type ReconfigureTLS.
	HazelcastOpsRequestTypeReconfigureTLS HazelcastOpsRequestType = "ReconfigureTLS"
	// HazelcastOpsRequestTypeRotateAuth is a HazelcastOpsRequestType of type RotateAuth.
	HazelcastOpsRequestTypeRotateAuth HazelcastOpsRequestType = "RotateAuth"
	// HazelcastOpsRequestTypeStorageMigration is a HazelcastOpsRequestType of type StorageMigration.
	HazelcastOpsRequestTypeStorageMigration HazelcastOpsRequestType = "StorageMigration"
)

var ErrInvalidHazelcastOpsRequestType = fmt.Errorf("not a valid HazelcastOpsRequestType, try [%s]", strings.Join(_HazelcastOpsRequestTypeNames, ", "))

var _HazelcastOpsRequestTypeNames = []string{
	string(HazelcastOpsRequestTypeUpdateVersion),
	string(HazelcastOpsRequestTypeHorizontalScaling),
	string(HazelcastOpsRequestTypeVerticalScaling),
	string(HazelcastOpsRequestTypeVolumeExpansion),
	string(HazelcastOpsRequestTypeReconfigure),
	string(HazelcastOpsRequestTypeRestart),
	string(HazelcastOpsRequestTypeReconfigureTLS),
	string(HazelcastOpsRequestTypeRotateAuth),
	string(HazelcastOpsRequestTypeStorageMigration),
}

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

// HazelcastOpsRequestTypeValues returns a list of the values for HazelcastOpsRequestType
func HazelcastOpsRequestTypeValues() []HazelcastOpsRequestType {
	return []HazelcastOpsRequestType{
		HazelcastOpsRequestTypeUpdateVersion,
		HazelcastOpsRequestTypeHorizontalScaling,
		HazelcastOpsRequestTypeVerticalScaling,
		HazelcastOpsRequestTypeVolumeExpansion,
		HazelcastOpsRequestTypeReconfigure,
		HazelcastOpsRequestTypeRestart,
		HazelcastOpsRequestTypeReconfigureTLS,
		HazelcastOpsRequestTypeRotateAuth,
		HazelcastOpsRequestTypeStorageMigration,
	}
}

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

var _HazelcastOpsRequestTypeValue = map[string]HazelcastOpsRequestType{
	"UpdateVersion":     HazelcastOpsRequestTypeUpdateVersion,
	"HorizontalScaling": HazelcastOpsRequestTypeHorizontalScaling,
	"VerticalScaling":   HazelcastOpsRequestTypeVerticalScaling,
	"VolumeExpansion":   HazelcastOpsRequestTypeVolumeExpansion,
	"Reconfigure":       HazelcastOpsRequestTypeReconfigure,
	"Restart":           HazelcastOpsRequestTypeRestart,
	"ReconfigureTLS":    HazelcastOpsRequestTypeReconfigureTLS,
	"RotateAuth":        HazelcastOpsRequestTypeRotateAuth,
	"StorageMigration":  HazelcastOpsRequestTypeStorageMigration,
}

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

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