// UnmarshalText implements encoding.TextUnmarshaler.
514911
func (t *ISO8601Time) UnmarshalText(text []byte) error {
	ts, err := time.Parse(time.RFC3339, string(text))
	if err != nil {
		return err
	}
	*t = ISO8601Time(ts)
	return nil
}
203837
func (r *RGBA) UnmarshalText(i []byte) (err error) {
	var p uint64
	if p, err = strconv.ParseUint(string(i), 16, 32); err != nil {
		err = errors.Wrapf(err, "astiimage: parsing uint %s failed", i)
		return
	}
	r.R = uint8(p & 0xff)
	r.G = uint8(p >> 8 & 0xff)
	r.B = uint8(p >> 16 & 0xff)
	r.A = uint8(p >> 24 & 0xff)
	return
}
1120075
func (s *String) UnmarshalText(text []byte) error {
	r := csv.NewReader(bytes.NewReader(text))

	var words []string
	for {
		record, err := r.Read()
		if err == io.EOF {
			break
		}
		if err != nil {
			return err
		}

		words = append(words, record...)
	}

	*s = String(words)
	return nil
}
323056
func (p *HostPolicy) UnmarshalText(b []byte) error {
	s := strings.Trim(string(b), `"`)
	switch s {
	case LeastCommitted, PreferSeparate, RequireSeparate:
		*p = HostPolicy(s)
	case "":
		*p = DEFAULT
	default:
		return errors.New("Invalid HostPolicy: " + s)
	}
	return nil
}
398858
func (i *HexOrDecimal64) UnmarshalText(input []byte) error {
	int, ok := ParseUint64(string(input))
	if !ok {
		return fmt.Errorf("invalid hex or decimal integer %q", input)
	}
	*i = HexOrDecimal64(int)
	return nil
}
1145437
func (z *Dec) UnmarshalText(data []byte) error {
	_, ok := z.SetString(string(data))
	if !ok {
		return fmt.Errorf("invalid inf.Dec")
	}
	return nil
}
393887
func (p *FileMode) UnmarshalText(data []byte) error {
	if len(data) < 3 {
		return invalidFileMode
	}
	if len(data) == 3 {
		data = []byte{'0', data[0], data[1], data[2]}
	}
	m, err := strconv.ParseUint(string(data), 8, 32)
	if err != nil {
		return err
	}
	*p = FileMode(m)
	return nil
}
1323886
func (k *OrderAwareKey) UnmarshalText(text []byte) error {
	i := atomic.AddUint64(&keyOrderCounter, 1)
	k.Order = i
	k.Key = string(text)
	return nil
}
898573
func (d *Duration) UnmarshalText(text []byte) error {
	return d.Set(string(text))
}
1140343
func (r *Recipient) UnmarshalText(text []byte) error {
	s := string(text)
	if s[len(s)-1:] != ">" {
		*r = Recipient{Email: s}
		return nil
	}

	i := strings.Index(s, "<")
	// at least 1 char followed by a space
	if i < 2 {
		return fmt.Errorf("malformed recipient string '%s'", s)
	}
	*r = Recipient{
		Name:  strings.TrimSpace(s[:i]),
		Email: s[i+1 : len(s)-1],
	}

	return nil
}
754746
func (i *Int) UnmarshalText(text []byte) error {
	var ss []int
	for _, x := range strings.Split(string(text), ",") {
		f, err := strconv.Atoi(x)
		if err != nil {
			return errors.WithStack(err)
		}
		ss = append(ss, f)
	}
	*i = ss
	return nil
}
969155
func (v *ExceptionType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "UNKNOWN":
		*v = ExceptionTypeUnknown
		return nil
	case "UNKNOWN_METHOD":
		*v = ExceptionTypeUnknownMethod
		return nil
	case "INVALID_MESSAGE_TYPE":
		*v = ExceptionTypeInvalidMessageType
		return nil
	case "WRONG_METHOD_NAME":
		*v = ExceptionTypeWrongMethodName
		return nil
	case "BAD_SEQUENCE_ID":
		*v = ExceptionTypeBadSequenceID
		return nil
	case "MISSING_RESULT":
		*v = ExceptionTypeMissingResult
		return nil
	case "INTERNAL_ERROR":
		*v = ExceptionTypeInternalError
		return nil
	case "PROTOCOL_ERROR":
		*v = ExceptionTypeProtocolError
		return nil
	case "INVALID_TRANSFORM":
		*v = ExceptionTypeInvalidTransform
		return nil
	case "INVALID_PROTOCOL":
		*v = ExceptionTypeInvalidProtocol
		return nil
	case "UNSUPPORTED_CLIENT_TYPE":
		*v = ExceptionTypeUnsupportedClientType
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "ExceptionType", err)
		}
		*v = ExceptionType(val)
		return nil
	}
}
1004449
func (l *Level) UnmarshalText(text []byte) (err error) {
	if bytes.Equal(text, levelBytesDebug) {
		*l = LevelDebug
	} else if bytes.Equal(text, levelBytesInfo) {
		*l = LevelInfo
	} else if bytes.Equal(text, levelBytesWarn) {
		*l = LevelWarn
	} else if bytes.Equal(text, levelBytesError) {
		*l = LevelError
	} else if bytes.Equal(text, levelBytesFatal) {
		*l = LevelFatal
	} else {
		err = fmt.Errorf("Uknown level %v", string(text))
	}
	return
}
1266732
func (p *Prefix) UnmarshalText(txt []byte) error {
	_, n, err := net.ParseCIDR(string(txt))
	if err != nil {
		return err
	}
	copy(p.IP.To16(), n.IP.To16())
	copy(p.Mask, n.Mask)
	return nil
}
1233279
func (addr *DevAddr) UnmarshalText(data []byte) error {
	parsed, err := ParseDevAddr(string(data))
	if err != nil {
		return err
	}
	*addr = DevAddr(parsed)
	return nil
}
86057
func (n *NetID) UnmarshalText(text []byte) error {
	b, err := hex.DecodeString(string(text))
	if err != nil {
		return err
	}
	if len(b) != len(n) {
		return fmt.Errorf("lorawan: exactly %d bytes are expected", len(n))
	}
	copy(n[:], b)
	return nil
}
583177
func (t *Timestamp) UnmarshalText(text []byte) (err error) {
	var i int
	if i, err = strconv.Atoi(string(bytes.Trim(text, "\""))); err != nil {
		return
	}
	t.Time = time.Unix(int64(i), 0)
	return
}