// Code generated by "enumer -type=AutocommitDMLMode -trimprefix=AutocommitDMLMode -transform=snake_upper"; DO NOT EDIT.

package enums

import (
	"fmt"
	"strings"
)

const _AutocommitDMLModeName = "TRANSACTIONALPARTITIONED_NON_ATOMIC"

var _AutocommitDMLModeIndex = [...]uint8{0, 13, 35}

const _AutocommitDMLModeLowerName = "transactionalpartitioned_non_atomic"

func (i AutocommitDMLMode) String() string {
	if i < 0 || i >= AutocommitDMLMode(len(_AutocommitDMLModeIndex)-1) {
		return fmt.Sprintf("AutocommitDMLMode(%d)", i)
	}
	return _AutocommitDMLModeName[_AutocommitDMLModeIndex[i]:_AutocommitDMLModeIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _AutocommitDMLModeNoOp() {
	var x [1]struct{}
	_ = x[AutocommitDMLModeTransactional-(0)]
	_ = x[AutocommitDMLModePartitionedNonAtomic-(1)]
}

var _AutocommitDMLModeValues = []AutocommitDMLMode{AutocommitDMLModeTransactional, AutocommitDMLModePartitionedNonAtomic}

var _AutocommitDMLModeNameToValueMap = map[string]AutocommitDMLMode{
	_AutocommitDMLModeName[0:13]:       AutocommitDMLModeTransactional,
	_AutocommitDMLModeLowerName[0:13]:  AutocommitDMLModeTransactional,
	_AutocommitDMLModeName[13:35]:      AutocommitDMLModePartitionedNonAtomic,
	_AutocommitDMLModeLowerName[13:35]: AutocommitDMLModePartitionedNonAtomic,
}

var _AutocommitDMLModeNames = []string{
	_AutocommitDMLModeName[0:13],
	_AutocommitDMLModeName[13:35],
}

// AutocommitDMLModeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func AutocommitDMLModeString(s string) (AutocommitDMLMode, error) {
	if val, ok := _AutocommitDMLModeNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _AutocommitDMLModeNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to AutocommitDMLMode values", s)
}

// AutocommitDMLModeValues returns all values of the enum
func AutocommitDMLModeValues() []AutocommitDMLMode {
	return _AutocommitDMLModeValues
}

// AutocommitDMLModeStrings returns a slice of all String values of the enum
func AutocommitDMLModeStrings() []string {
	strs := make([]string, len(_AutocommitDMLModeNames))
	copy(strs, _AutocommitDMLModeNames)
	return strs
}

// IsAAutocommitDMLMode returns "true" if the value is listed in the enum definition. "false" otherwise
func (i AutocommitDMLMode) IsAAutocommitDMLMode() bool {
	for _, v := range _AutocommitDMLModeValues {
		if i == v {
			return true
		}
	}
	return false
}
