// Code generated by go:generate; DO NOT EDIT.
package bfxapi

var AllTimeFrames = map[TimeFrame]struct{}{
	TimeFrame1m:  {},
	TimeFrame5m:  {},
	TimeFrame15m: {},
	TimeFrame30m: {},
	TimeFrame1h:  {},
	TimeFrame3h:  {},
	TimeFrame6h:  {},
	TimeFrame12h: {},
	TimeFrame1D:  {},
	TimeFrame1W:  {},
	TimeFrame14D: {},
	TimeFrame1M:  {},
}

var AllTimeFramesSlice = []TimeFrame{
	TimeFrame1m,
	TimeFrame5m,
	TimeFrame15m,
	TimeFrame30m,
	TimeFrame1h,
	TimeFrame3h,
	TimeFrame6h,
	TimeFrame12h,
	TimeFrame1D,
	TimeFrame1W,
	TimeFrame14D,
	TimeFrame1M,
}

func TimeFrameStrings(slice []TimeFrame) (out []string) {
	for _, el := range slice {
		out = append(out, string(el))
	}
	return out
}

// TimeFrameKeys converts a map of TimeFrame to a slice of TimeFrame
func TimeFrameKeys(values map[TimeFrame]struct{}) (slice []TimeFrame) {
	for k := range values {
		slice = append(slice, k)
	}
	return slice
}

// ValidateTimeFrame validates a value of type TimeFrame
func ValidateTimeFrame(ch TimeFrame) bool {
	_, ok := AllTimeFrames[ch]
	return ok
}
