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

// Built By: go install

package v1alpha1

import (
	"fmt"
	"strings"
)

const (
	// MySQLOpsRequestTypeUpdateVersion is a MySQLOpsRequestType of type UpdateVersion.
	MySQLOpsRequestTypeUpdateVersion MySQLOpsRequestType = "UpdateVersion"
	// MySQLOpsRequestTypeHorizontalScaling is a MySQLOpsRequestType of type HorizontalScaling.
	MySQLOpsRequestTypeHorizontalScaling MySQLOpsRequestType = "HorizontalScaling"
	// MySQLOpsRequestTypeVerticalScaling is a MySQLOpsRequestType of type VerticalScaling.
	MySQLOpsRequestTypeVerticalScaling MySQLOpsRequestType = "VerticalScaling"
	// MySQLOpsRequestTypeVolumeExpansion is a MySQLOpsRequestType of type VolumeExpansion.
	MySQLOpsRequestTypeVolumeExpansion MySQLOpsRequestType = "VolumeExpansion"
	// MySQLOpsRequestTypeRestart is a MySQLOpsRequestType of type Restart.
	MySQLOpsRequestTypeRestart MySQLOpsRequestType = "Restart"
	// MySQLOpsRequestTypeReconfigure is a MySQLOpsRequestType of type Reconfigure.
	MySQLOpsRequestTypeReconfigure MySQLOpsRequestType = "Reconfigure"
	// MySQLOpsRequestTypeReconfigureTLS is a MySQLOpsRequestType of type ReconfigureTLS.
	MySQLOpsRequestTypeReconfigureTLS MySQLOpsRequestType = "ReconfigureTLS"
	// MySQLOpsRequestTypeRotateAuth is a MySQLOpsRequestType of type RotateAuth.
	MySQLOpsRequestTypeRotateAuth MySQLOpsRequestType = "RotateAuth"
	// MySQLOpsRequestTypeReplicationModeTransformation is a MySQLOpsRequestType of type ReplicationModeTransformation.
	MySQLOpsRequestTypeReplicationModeTransformation MySQLOpsRequestType = "ReplicationModeTransformation"
	// MySQLOpsRequestTypeStorageMigration is a MySQLOpsRequestType of type StorageMigration.
	MySQLOpsRequestTypeStorageMigration MySQLOpsRequestType = "StorageMigration"
)

var ErrInvalidMySQLOpsRequestType = fmt.Errorf("not a valid MySQLOpsRequestType, try [%s]", strings.Join(_MySQLOpsRequestTypeNames, ", "))

var _MySQLOpsRequestTypeNames = []string{
	string(MySQLOpsRequestTypeUpdateVersion),
	string(MySQLOpsRequestTypeHorizontalScaling),
	string(MySQLOpsRequestTypeVerticalScaling),
	string(MySQLOpsRequestTypeVolumeExpansion),
	string(MySQLOpsRequestTypeRestart),
	string(MySQLOpsRequestTypeReconfigure),
	string(MySQLOpsRequestTypeReconfigureTLS),
	string(MySQLOpsRequestTypeRotateAuth),
	string(MySQLOpsRequestTypeReplicationModeTransformation),
	string(MySQLOpsRequestTypeStorageMigration),
}

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

// MySQLOpsRequestTypeValues returns a list of the values for MySQLOpsRequestType
func MySQLOpsRequestTypeValues() []MySQLOpsRequestType {
	return []MySQLOpsRequestType{
		MySQLOpsRequestTypeUpdateVersion,
		MySQLOpsRequestTypeHorizontalScaling,
		MySQLOpsRequestTypeVerticalScaling,
		MySQLOpsRequestTypeVolumeExpansion,
		MySQLOpsRequestTypeRestart,
		MySQLOpsRequestTypeReconfigure,
		MySQLOpsRequestTypeReconfigureTLS,
		MySQLOpsRequestTypeRotateAuth,
		MySQLOpsRequestTypeReplicationModeTransformation,
		MySQLOpsRequestTypeStorageMigration,
	}
}

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

var _MySQLOpsRequestTypeValue = map[string]MySQLOpsRequestType{
	"UpdateVersion":                 MySQLOpsRequestTypeUpdateVersion,
	"HorizontalScaling":             MySQLOpsRequestTypeHorizontalScaling,
	"VerticalScaling":               MySQLOpsRequestTypeVerticalScaling,
	"VolumeExpansion":               MySQLOpsRequestTypeVolumeExpansion,
	"Restart":                       MySQLOpsRequestTypeRestart,
	"Reconfigure":                   MySQLOpsRequestTypeReconfigure,
	"ReconfigureTLS":                MySQLOpsRequestTypeReconfigureTLS,
	"RotateAuth":                    MySQLOpsRequestTypeRotateAuth,
	"ReplicationModeTransformation": MySQLOpsRequestTypeReplicationModeTransformation,
	"StorageMigration":              MySQLOpsRequestTypeStorageMigration,
}

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

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