// UnmarshalYAML implements the yaml.Unmarshaler interface
// Unmarshals a string of the form X.Y into a Version, validating that X and Y can represent unsigned integers
164496
func (version *Version) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var versionString string
	err := unmarshal(&versionString)
	if err != nil {
		return err
	}

	newVersion := Version(versionString)
	if _, err := newVersion.major(); err != nil {
		return err
	}

	if _, err := newVersion.minor(); err != nil {
		return err
	}

	*version = newVersion
	return nil
}
309228
func (m *RuleMatchers) UnmarshalYAML(unmarshal func(interface{}) error) error {
	// Use a map[string]interface{} for validation purposes. If we used a
	// map[string][]string, the YAML unmarshaler would coerce non-string values
	// into string values, breaking our ability to validate configs. i.e., it
	// would change `title: [7, []]` into `title: ["7", "[]"]`. Using a
	// map[string]interface{} tells the unmarshaler to use natural types.
	var rawData map[string][]interface{}
	err := unmarshal(&rawData)
	if err != nil {
		return err
	}

	data := map[string][]string{}
	for key, arr := range rawData {
		data[key] = []string{}

		for _, val := range arr {
			switch v := val.(type) {
			case string:
				data[key] = append(data[key], v)
			case bool:
				if v {
					data[key] = append(data[key], "true")
				} else {
					data[key] = append(data[key], "false")
				}
			default:
				return fmt.Errorf(`Invalid log-router matcher -- key: "%s", value: %+#v.  `+
					"Only strings can be matched.", key, val)
			}
		}
	}

	for field, vals := range data {
		for _, val := range vals {
			if val == "*" && len(vals) > 1 {
				return fmt.Errorf("Invalid matcher values in %s.\n"+
					"Wildcard matcher can't co-exist with other matchers.", field)
			}
		}
	}

	*m = data
	return nil
}
880477
func (c *HTTPClientConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
	type plain HTTPClientConfig
	if err := unmarshal((*plain)(c)); err != nil {
		return err
	}
	return c.Validate()
}
1303128
func (r *Raw) Unmarshal(data []byte) error {
	if len(data) == 0 {
		r = nil
		return nil
	}
	id := Raw(make([]byte, len(data)))
	copy(id, data)
	*r = id
	return nil
}
60772
func YAML(in string) (map[string]interface{}, error) {
	obj := make(map[string]interface{})
	return unmarshalObj(obj, in, yaml.Unmarshal)
}
273979
func (s *SliceorMap) UnmarshalYAML(unmarshal func(interface{}) error) error {

	var sliceType []interface{}
	if err := unmarshal(&sliceType); err == nil {
		parts := map[string]string{}
		for _, s := range sliceType {
			if str, ok := s.(string); ok {
				str := strings.TrimSpace(str)
				keyValueSlice := strings.SplitN(str, "=", 2)

				key := keyValueSlice[0]
				val := ""
				if len(keyValueSlice) == 2 {
					val = keyValueSlice[1]
				}
				parts[key] = val
			} else {
				return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", s, s)
			}
		}
		*s = parts
		return nil
	}

	var mapType map[interface{}]interface{}
	if err := unmarshal(&mapType); err == nil {
		parts := map[string]string{}
		for k, v := range mapType {
			if sk, ok := k.(string); ok {
				if sv, ok := v.(string); ok {
					parts[sk] = sv
				} else {
					return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", v, v)
				}
			} else {
				return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", k, k)
			}
		}
		*s = parts
		return nil
	}

	return errors.New("Failed to unmarshal SliceorMap")
}
1296740
func (c *ConstraintMap) UnmarshalYAML(unmarshal func(interface{}) error) error {

	out1 := struct {
		Include map[string]string
		Exclude map[string]string
	}{
		Include: map[string]string{},
		Exclude: map[string]string{},
	}

	out2 := map[string]string{}

	unmarshal(&out1)
	unmarshal(&out2)

	c.Include = out1.Include
	c.Exclude = out1.Exclude
	for k, v := range out2 {
		c.Include[k] = v
	}
	return nil
}
197142
func (key *NwkSKey) Unmarshal(data []byte) error {
	*key = [16]byte{} // Reset the receiver
	return key.UnmarshalBinary(data)
}
188672
func (key *AppKey) Unmarshal(data []byte) error {
	*key = [16]byte{} // Reset the receiver
	return key.UnmarshalBinary(data)
}
228167
func (a *NetAddr) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var addr string
	err := unmarshal(&addr)
	if err != nil {
		return err
	}

	parsedAddr, err := ParseAddr(addr)
	if err != nil {
		return err
	}

	*a = *parsedAddr
	return nil
}
310208
func (*yamlMarshaller) Unmarshal(data []byte, v interface{}) error {
	return yaml.Unmarshal(data, v)
}
633948
func (rs *RoundStateSimple) Unmarshal(bs []byte) error {
	return cdc.UnmarshalBinaryBare(bs, rs)
}
1371860
func (n *networkList) UnmarshalYAML(unmarshal func(interface{}) error) error {
	slice := yaml.MapSlice{}
	err := unmarshal(&slice)
	if err != nil {
		return err
	}

	for _, s := range slice {
		nn := Network{}

		out, merr := yaml.Marshal(s.Value)
		if merr != nil {
			return merr
		}

		err = yaml.Unmarshal(out, &nn)
		if err != nil {
			return err
		}
		if nn.Name == "" {
			nn.Name = fmt.Sprintf("%v", s.Key)
		}
		if nn.Driver == "" {
			nn.Driver = "bridge"
		}
		n.networks = append(n.networks, &nn)
	}
	return err
}
898361
func (customCodec) Unmarshal(data []byte, obj interface{}) error {
	switch value := obj.(type) {
	case *[]byte:
		*value = data
		return nil
	default:
		return newCustomCodecUnmarshalCastError(obj)
	}
}
135352
func (eui *DevEUI) Unmarshal(data []byte) error {
	*eui = [8]byte{} // Reset the receiver
	return eui.UnmarshalBinary(data)
}
1053258
func (s *Size) Unmarshal(i interface{}) (err error) {
	if value, ok := i.(string); ok {
		*s, err = Parse(value)
		return
	}
	return fmt.Errorf("unable to unmarshal %#v to Size", i)
}
1084217
func (ia *Int64Array) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		ia.Valid = false
		return nil
	}
	if data == nil {
		ia.Int64Array, ia.Valid = nil, false
		return nil
	}
	ia.Valid = true
	return json.Unmarshal(data, &ia.Int64Array)
}