// UnmarshalTOML decodes the parsed data to the object
196595
func (i *InfluxDBV2) UnmarshalTOML(data interface{}) error {
	dataOK, ok := data.(map[string]interface{})
	if !ok {
		return errors.New("bad urls for influxdb_v2 output plugin")
	}
	urls, ok := dataOK["urls"].([]interface{})
	if !ok {
		return errors.New("urls is not an array for influxdb_v2 output plugin")
	}
	for _, url := range urls {
		i.URLs = append(i.URLs, url.(string))
	}

	i.Token, ok = dataOK["token"].(string)
	if !ok {
		return errors.New("token is missing for influxdb_v2 output plugin")
	}

	i.Organization, ok = dataOK["organization"].(string)
	if !ok {
		return errors.New("organization is missing for influxdb_v2 output plugin")
	}

	i.Bucket, ok = dataOK["bucket"].(string)
	if !ok {
		return errors.New("bucket is missing for influxdb_v2 output plugin")
	}
	return nil
}
68383
func (f *Field) UnmarshalText(p []byte) error {
	r, err := Parse(string(p))
	if err != nil {
		return err
	}

	f.reference = r
	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
}
161082
func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error {
	n, err := XMLToStruct(d, nil)
	if err != nil {
		return err
	}
	if n.Children != nil {
		for _, root := range n.Children {
			for _, c := range root {
				if wrappedChild, ok := c.Children[wrapper]; ok {
					c = wrappedChild[0] // pull out wrapped element
				}

				err = parse(reflect.ValueOf(v), c, "")
				if err != nil {
					if err == io.EOF {
						return nil
					}
					return err
				}
			}
		}
		return nil
	}
	return nil
}
1287578
func (h *HTMLElement) Unmarshal(v interface{}) error {
	return UnmarshalHTML(v, h.DOM, nil)
}
551245
func (u *UUID) UnmarshalText(text []byte) (err error) {
	if len(text) < 32 {
		err = fmt.Errorf("uuid: UUID string too short: %s", text)
		return
	}

	t := text[:]

	if bytes.Equal(t[:9], urnPrefix) {
		t = t[9:]
	} else if t[0] == '{' {
		t = t[1:]
	}

	b := u[:]

	for _, byteGroup := range byteGroups {
		if t[0] == '-' {
			t = t[1:]
		}

		if len(t) < byteGroup {
			err = fmt.Errorf("uuid: UUID string too short: %s", text)
			return
		}

		_, err = hex.Decode(b[:byteGroup/2], t[:byteGroup])

		if err != nil {
			return
		}

		t = t[byteGroup:]
		b = b[byteGroup/2:]
	}

	return
}
1073502
func (args *WriterArgs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	// Make subtype to avoid recursive UnmarshalXML().
	type subWriterArgs WriterArgs
	parsedArgs := subWriterArgs{}
	if err := d.DecodeElement(&parsedArgs, &start); err != nil {
		return err
	}

	switch len(parsedArgs.RecordDelimiter) {
	case 0:
		parsedArgs.RecordDelimiter = defaultRecordDelimiter
	case 1, 2:
	default:
		return fmt.Errorf("invalid RecordDelimiter '%v'", parsedArgs.RecordDelimiter)
	}

	*args = WriterArgs(parsedArgs)
	args.unmarshaled = true
	return nil
}
844887
func (args *ReaderArgs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	// Make subtype to avoid recursive UnmarshalXML().
	type subReaderArgs ReaderArgs
	parsedArgs := subReaderArgs{}
	if err := d.DecodeElement(&parsedArgs, &start); err != nil {
		return err
	}

	parsedArgs.ContentType = strings.ToLower(parsedArgs.ContentType)
	switch parsedArgs.ContentType {
	case document, lines:
	default:
		return errInvalidJSONType(fmt.Errorf("invalid ContentType '%v'", parsedArgs.ContentType))
	}

	*args = ReaderArgs(parsedArgs)
	args.unmarshaled = true
	return nil
}
403470
func (msl *MessageSetList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	for {
		var msgset MessageSet
		tok, err := nextNonWhitespaceToken(d)
		if err != nil {
			return err
		} else if end, ok := tok.(xml.EndElement); ok && end.Name.Local == start.Name.Local {
			// If we found the end of our starting element, we're done parsing
			return nil
		} else if _, ok := tok.(xml.StartElement); ok {
			// Found starting tag for <xxxMSGSET>. Get the next one (xxxMSGSETVn) and decode that struct
			tok, err := nextNonWhitespaceToken(d)
			if err != nil {
				return err
			} else if versionStart, ok := tok.(xml.StartElement); ok {
				if err := d.DecodeElement(&msgset, &versionStart); err != nil {
					return err
				}
			} else {
				return errors.New("Invalid MSGSETLIST formatting")
			}
			msgset.Name = msgset.XMLName.Local

			// Eat ending tags for <xxxMSGSET>
			tok, err = nextNonWhitespaceToken(d)
			if err != nil {
				return err
			} else if _, ok := tok.(xml.EndElement); !ok {
				return errors.New("Invalid MSGSETLIST formatting")
			}
		} else {
			return errors.New("MSGSETLIST didn't find an opening xxxMSGSETVn element")
		}
		*msl = MessageSetList(append(*(*[]MessageSet)(msl), msgset))
	}
}
139227
func (d *Duration) UnmarshalText(text []byte) error {
	// Ignore if there is no value set.
	if len(text) == 0 {
		return nil
	}

	// Otherwise parse as a duration formatted string.
	duration, err := time.ParseDuration(string(text))
	if err != nil {
		return err
	}

	// Set duration and return.
	*d = Duration(duration)
	return nil
}
623930
func (n *ID) UnmarshalText(text []byte) error {
	id, err := parseID(string(text))
	if err != nil {
		return err
	}
	*n = id
	return nil
}
580242
func (t *Time) UnmarshalText(data []byte) error {
	tt, err := time.Parse(time.RFC3339, string(data))
	if _, ok := err.(*time.ParseError); ok {
		tt, err = time.Parse(DeisDatetimeFormat, string(data))
		if _, ok := err.(*time.ParseError); ok {
			tt, err = time.Parse(PyOpenSSLTimeDateTimeFormat, string(data))
		}
	}
	*t = Time{&tt}
	return err
}
210235
func (o *UUID) UnmarshalText(uuid []byte) error {
	id, err := parse(string(uuid))
	if err == nil {
		o.UnmarshalBinary(id)
	}
	return err
}
228218
func (id *ID) UnmarshalText(data []byte) error {
	pid, err := IDB58Decode(string(data))
	if err != nil {
		return err
	}
	*id = pid
	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
}
994040
func (p *PHYPayload) UnmarshalText(text []byte) error {
	b, err := base64.StdEncoding.DecodeString(string(text))
	if err != nil {
		return err
	}
	return p.UnmarshalBinary(b)
}
197879
func (z *Big) UnmarshalText(data []byte) error {
	return z.scan(bytes.NewReader(data))
}