// Code generated by "enumer -type BucketSize metric.go"; DO NOT EDIT

package metric

import (
	"fmt"
)

const _BucketSize_name = "DAYWEEKMONTHQUARTERYEAR"

var _BucketSize_index = [...]uint8{0, 3, 7, 12, 19, 23}

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

var _BucketSizeNameToValue_map = map[string]BucketSize{
	_BucketSize_name[0:3]:   1,
	_BucketSize_name[3:7]:   2,
	_BucketSize_name[7:12]:  3,
	_BucketSize_name[12:19]: 4,
	_BucketSize_name[19:23]: 5,
}

func BucketSizeString(s string) (BucketSize, error) {
	if val, ok := _BucketSizeNameToValue_map[s]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to BucketSize values", s)
}
