// UnmarshallInterface from a JSON string to a MaterialAttributesPackage struct
163500
func unmarshallMaterialAttributesPackage(mapk *MaterialAttributesPackage, i map[string]interface{}) {
	for key, value := range i {
		if value == nil {
			continue
		}
		switch key {
		case "ref":
			mapk.Ref = value.(string)
		}
	}
}
1369945
func (e *EUI64) UnmarshalText(text []byte) error {
	b, err := hex.DecodeString(string(text))
	if err != nil {
		return err
	}
	if len(e) != len(b) {
		return fmt.Errorf("lorawan: exactly %d bytes are expected", len(e))
	}
	copy(e[:], b)
	return nil
}
49440
func (r *RequestSetattrV2) UnmarshalBinary(data []byte) error {
	return UnmarshalBinary(data, &r.Request, &r.Hints, &r.Attr, &r.Handle, &r.FileName)
}
918080
func (t *JSONTime) UnmarshalText(text []byte) error {
	if len(text) == 0 {
		*t = JSONTime{}
		return nil
	}
	time, err := time.Parse(time.RFC3339Nano, string(text))
	if err != nil {
		return err
	}
	*t = JSONTime(time)
	return nil
}
593649
func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error {
	return json.Unmarshal(data, v)
}
1363857
func unmarshallMaterialAttributesTfs(mtfs *MaterialAttributesTfs, i map[string]interface{}) {
	for key, value := range i {
		if value == nil {
			continue
		}
		switch key {

		case "name":
			mtfs.Name = value.(string)

		case "url":
			mtfs.URL = value.(string)
		case "project_path":
			mtfs.ProjectPath = value.(string)
		case "domain":
			mtfs.Domain = value.(string)

		case "username":
			mtfs.Username = value.(string)
		case "password":
			mtfs.Password = value.(string)
		case "encrypted_password":
			mtfs.EncryptedPassword = value.(string)

		case "destination":
			mtfs.Destination = value.(string)
		case "filter":
			mtfs.Filter = unmarshallMaterialFilter(value.(map[string]interface{}))
		case "invert_filter":
			mtfs.InvertFilter = value.(bool)
		case "auto_update":
			mtfs.AutoUpdate = value.(bool)
		}
	}
}
311479
func (b *Uint) UnmarshalText(input []byte) error {
	var u64 Uint64
	err := u64.UnmarshalText(input)
	if u64 > Uint64(^uint(0)) || err == ErrUint64Range {
		return ErrUintRange
	} else if err != nil {
		return err
	}
	*b = Uint(u64)
	return nil
}
135197
func (r *RequestGetattrV2) UnmarshalBinary(data []byte) error {
	return UnmarshalBinary(data, &r.Request, &r.AttrHint, &r.Handle, &r.FileName)
}
1251040
func (h *MerkleHash) UnmarshalBinary(data []byte) error {
	return h.h.UnmarshalBinary(data)
}
338642
func (f *Framing) UnmarshalText(data []byte) (err error) {
	s := string(data)
	switch strings.ToUpper(s) {
	case `OCTET-COUNTING`:
		fallthrough
	case `"OCTET-COUNTING"`:
		fallthrough
	case `'OCTET-COUNTING'`:
		*f = OctetCounting
		return

	case `NON-TRANSPARENT`:
		fallthrough
	case `"NON-TRANSPARENT"`:
		fallthrough
	case `'NON-TRANSPARENT'`:
		*f = NonTransparent
		return
	}
	*f = -1
	return fmt.Errorf("unknown framing")
}
507437
func (m *Material) UnmarshalJSON(b []byte) (err error) {
	raw := map[string]interface{}{}
	if err = json.Unmarshal(b, &raw); err == nil {
		err = m.Ingest(raw)
	}

	return
}
1281105
func (c *BoxComponent) UnmarshalJSON(data []byte) error {
	type alias BoxComponent
	raw := struct {
		Contents []rawFlexComponent `json:"contents"`
		*alias
	}{
		alias: (*alias)(c),
	}
	if err := json.Unmarshal(data, &raw); err != nil {
		return err
	}
	components := make([]FlexComponent, len(raw.Contents))
	for i, content := range raw.Contents {
		components[i] = content.Component
	}
	c.Contents = components
	return nil
}
1013360
func (eui *AppEUI) UnmarshalText(data []byte) error {
	e := EUI64(*eui)
	err := e.UnmarshalText(data)
	if err != nil {
		return err
	}
	*eui = AppEUI(e)
	return nil
}
347818
func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error {
	if val.Kind() == reflect.Ptr {
		if val.IsNil() {
			val.Set(reflect.New(val.Type().Elem()))
		}
		val = val.Elem()
	}

	if val.CanInterface() && val.Type().Implements(unmarshalerAttrType) {
		// This is an unmarshaler with a non-pointer receiver,
		// so it's likely to be incorrect, but we do what we're told.
		return val.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr)
	}
	if val.CanAddr() {
		pv := val.Addr()
		if pv.CanInterface() && pv.Type().Implements(unmarshalerAttrType) {
			return pv.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr)
		}
	}

	// Not an UnmarshalerAttr; try encoding.TextUnmarshaler.
	if val.CanInterface() && val.Type().Implements(textUnmarshalerType) {
		// This is an unmarshaler with a non-pointer receiver,
		// so it's likely to be incorrect, but we do what we're told.
		return val.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value))
	}
	if val.CanAddr() {
		pv := val.Addr()
		if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) {
			return pv.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value))
		}
	}

	copyValue(val, []byte(attr.Value))
	return nil
}
902429
func (r *ReplyGetattrV2) UnmarshalBinary(data []byte) error {
	return UnmarshalBinary(data, &r.Reply, &r.Attr, &r.SymlinkTarget)
}
1309316
func (r *AWSServerlessApi_DefinitionUri) UnmarshalJSON(b []byte) error {

	// Unmarshal into interface{} to check it's type
	var typecheck interface{}
	if err := json.Unmarshal(b, &typecheck); err != nil {
		return err
	}

	switch val := typecheck.(type) {

	case string:
		r.String = &val

	case map[string]interface{}:
		val = val // This ensures val is used to stop an error

		json.Unmarshal(b, &r.S3Location)

	case []interface{}:

	}

	return nil
}
163076
func (hb *HEXBytes) UnmarshalText(text []byte) error {
	b, err := hex.DecodeString(string(text))
	if err != nil {
		return err
	}
	*hb = HEXBytes(b)
	return nil
}