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

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// SolrOpsRequestTypeUpdateVersion is a SolrOpsRequestType of type UpdateVersion.
	SolrOpsRequestTypeUpdateVersion SolrOpsRequestType = "UpdateVersion"
	// SolrOpsRequestTypeHorizontalScaling is a SolrOpsRequestType of type HorizontalScaling.
	SolrOpsRequestTypeHorizontalScaling SolrOpsRequestType = "HorizontalScaling"
	// SolrOpsRequestTypeVerticalScaling is a SolrOpsRequestType of type VerticalScaling.
	SolrOpsRequestTypeVerticalScaling SolrOpsRequestType = "VerticalScaling"
	// SolrOpsRequestTypeVolumeExpansion is a SolrOpsRequestType of type VolumeExpansion.
	SolrOpsRequestTypeVolumeExpansion SolrOpsRequestType = "VolumeExpansion"
	// SolrOpsRequestTypeReconfigure is a SolrOpsRequestType of type Reconfigure.
	SolrOpsRequestTypeReconfigure SolrOpsRequestType = "Reconfigure"
	// SolrOpsRequestTypeRestart is a SolrOpsRequestType of type Restart.
	SolrOpsRequestTypeRestart SolrOpsRequestType = "Restart"
	// SolrOpsRequestTypeReconfigureTLS is a SolrOpsRequestType of type ReconfigureTLS.
	SolrOpsRequestTypeReconfigureTLS SolrOpsRequestType = "ReconfigureTLS"
	// SolrOpsRequestTypeRotateAuth is a SolrOpsRequestType of type RotateAuth.
	SolrOpsRequestTypeRotateAuth SolrOpsRequestType = "RotateAuth"
	// SolrOpsRequestTypeStorageMigration is a SolrOpsRequestType of type StorageMigration.
	SolrOpsRequestTypeStorageMigration SolrOpsRequestType = "StorageMigration"
)

var ErrInvalidSolrOpsRequestType = fmt.Errorf("not a valid SolrOpsRequestType, try [%s]", strings.Join(_SolrOpsRequestTypeNames, ", "))

var _SolrOpsRequestTypeNames = []string{
	string(SolrOpsRequestTypeUpdateVersion),
	string(SolrOpsRequestTypeHorizontalScaling),
	string(SolrOpsRequestTypeVerticalScaling),
	string(SolrOpsRequestTypeVolumeExpansion),
	string(SolrOpsRequestTypeReconfigure),
	string(SolrOpsRequestTypeRestart),
	string(SolrOpsRequestTypeReconfigureTLS),
	string(SolrOpsRequestTypeRotateAuth),
	string(SolrOpsRequestTypeStorageMigration),
}

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

// SolrOpsRequestTypeValues returns a list of the values for SolrOpsRequestType
func SolrOpsRequestTypeValues() []SolrOpsRequestType {
	return []SolrOpsRequestType{
		SolrOpsRequestTypeUpdateVersion,
		SolrOpsRequestTypeHorizontalScaling,
		SolrOpsRequestTypeVerticalScaling,
		SolrOpsRequestTypeVolumeExpansion,
		SolrOpsRequestTypeReconfigure,
		SolrOpsRequestTypeRestart,
		SolrOpsRequestTypeReconfigureTLS,
		SolrOpsRequestTypeRotateAuth,
		SolrOpsRequestTypeStorageMigration,
	}
}

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

var _SolrOpsRequestTypeValue = map[string]SolrOpsRequestType{
	"UpdateVersion":     SolrOpsRequestTypeUpdateVersion,
	"HorizontalScaling": SolrOpsRequestTypeHorizontalScaling,
	"VerticalScaling":   SolrOpsRequestTypeVerticalScaling,
	"VolumeExpansion":   SolrOpsRequestTypeVolumeExpansion,
	"Reconfigure":       SolrOpsRequestTypeReconfigure,
	"Restart":           SolrOpsRequestTypeRestart,
	"ReconfigureTLS":    SolrOpsRequestTypeReconfigureTLS,
	"RotateAuth":        SolrOpsRequestTypeRotateAuth,
	"StorageMigration":  SolrOpsRequestTypeStorageMigration,
}

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

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