code: func (t *ExtendedMetricsType) UnmarshalYAML(unmarshal func(interface{}) error) error {
  	var str string
  	if err := unmarshal(&str); err != nil {
  		return err
  	}
  	if str == "" {
  		*t = DefaultExtendedMetricsType
  		return nil
  	}
  	strs := make([]string, len(validExtendedMetricsTypes))
  	for _, valid := range validExtendedMetricsTypes {
  		if str == valid.String() {
  			*t = valid
  			return nil
  		}
  		strs = append(strs, "'"+valid.String()+"'")
  	}
  	return fmt.Errorf("invalid ExtendedMetricsType '%s' valid types are: %s",
  		str, strings.Join(strs, ", "))
  }
docs: // UnmarshalYAML unmarshals an ExtendedMetricsType into a valid type from string.