// UnmarshalText implements the encoding/TextUnmarshaler interface
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
}
170604
func (u *UUID) UnmarshalText(data []byte) error {
	if len(data) == 0 {
		return nil
	}
	id := Parse(string(data))
	if id == nil {
		return errors.New("invalid UUID")
	}
	*u = id
	return nil
}
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
}
1246457
func (du *DataURL) UnmarshalText(text []byte) error {
	decoded, err := DecodeString(string(text))
	if err != nil {
		return err
	}
	*du = *decoded
	return nil
}
211176
func (co *ChangeOption) UnmarshalText(b []byte) error {
	s := strings.ToLower(strings.Trim(string(b), `"`))
	switch s {
	case strings.ToLower(string(RestartAllOnInstanceChanged)), strings.ToLower(string(RestartAllOnInstanceZeroDown)):
		*co = ChangeOption(s)
	case "":
		*co = DefaultChangeOption
	default:
		return errors.New("Invalid ChangeOption: " + s)
	}
	return nil
}
623930
func (n *ID) UnmarshalText(text []byte) error {
	id, err := parseID(string(text))
	if err != nil {
		return err
	}
	*n = id
	return nil
}
857886
func (h *UnprefixedHash) UnmarshalText(input []byte) error {
	return hexutil.UnmarshalFixedUnprefixedText("UnprefixedHash", input, h[:])
}
210235
func (o *UUID) UnmarshalText(uuid []byte) error {
	id, err := parse(string(uuid))
	if err == nil {
		o.UnmarshalBinary(id)
	}
	return err
}
942787
func (s *UUID) UnmarshalText(text []byte) error {
	var ss []string
	for _, x := range strings.Split(string(text), ",") {
		ss = append(ss, strings.TrimSpace(x))
	}
	us, err := strSliceToUUIDSlice(ss)
	if err != nil {
		return errors.WithStack(err)
	}
	*s = us
	return nil
}
338703
func (n *Node) UnmarshalText(text []byte) error {
	dec, err := ParseV4(string(text))
	if err == nil {
		*n = *dec
	}
	return err
}
1373719
func (d *Date) UnmarshalText(data []byte) (err error) {
	d.Time, err = time.Parse(fullDate, string(data))
	return err
}
708729
func (b *UnmarshallableBool) UnmarshalText(data []byte) error {
	s := strings.ToLower(string(data))
	switch s {
	case "1", "true":
		*b = true
	case "0", "false":
		*b = false
	default:
		return fmt.Errorf("Boolean unmarshal error: invalid input %s", s)
	}
	return nil
}
994040
func (p *PHYPayload) UnmarshalText(text []byte) error {
	b, err := base64.StdEncoding.DecodeString(string(text))
	if err != nil {
		return err
	}
	return p.UnmarshalBinary(b)
}
637046
func (a *Address) UnmarshalText(input []byte) error {
	return hexutil.UnmarshalFixedText("Address", input, a[:])
}
803221
func (id *ID) UnmarshalText(buf []byte) error {
	s := string(buf)
	bytes, err := hex.DecodeString(s)
	if err != nil {
		return errors.WithStack(InvalidIDError{s})
	}
	return id.UnmarshalBinary(bytes)
}
113960
func (key *AppSKey) UnmarshalText(data []byte) error {
	e := AES128Key(*key)
	err := e.UnmarshalText(data)
	if err != nil {
		return err
	}
	*key = AppSKey(e)
	return nil
}
878407
func (t *TxTimestamp) UnmarshalText(text []byte) error {
	i, err := strconv.ParseInt(string(text), 10, 64)
	if err != nil {
		return err
	}
	*t = TxTimestamp(time.Unix(i, 0))
	return nil
}