// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC3339 date-time
// (i.e., 2006-01-02T15:04:05Z).
766550
func (t *Time) UnmarshalJSON(data []byte) (err error) {
	timeFormat := azureUtcFormatJSON
	match, err := regexp.Match(tzOffsetRegex, data)
	if err != nil {
		return err
	} else if match {
		timeFormat = rfc3339JSON
	}
	t.Time, err = ParseTime(timeFormat, string(data))
	return err
}
587268
func (s *ProbeDetailsDTO) UnmarshalJSON(b []byte) (err error) {
	s.data = b
	return nil
}
526254
func (v *EventSendFormatV2) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson3b0ebf6aDecodeGithubComSignalfxGatewayProtocolSignalfxFormat6(&r, v)
	return r.Error()
}
449031
func (d *Duration) UnmarshalJSON(text []byte) error {
	if v, err := strconv.ParseInt(string(text), 10, 64); err == nil {
		*d = Duration(time.Duration(v))
		return nil
	}

	// We use json unmarshal on value because we have the quoted version
	var value string
	err := json.Unmarshal(text, &value)
	if err != nil {
		return err
	}
	v, err := time.ParseDuration(value)
	*d = Duration(v)
	return err
}
524460
func (d *Date) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return fmt.Errorf("date should be a string, got %s", data)
	}
	t, err := time.Parse("2006-01-02", s)
	if err != nil {
		return fmt.Errorf("invalid date: %v", err)
	}
	d.Time = t
	return nil
}
948159
func (r *Raw) UnmarshalJSON(data []byte) error {
	if r == nil {
		return errors.New("Raw: UnmarshalJSON on nil pointer")
	}
	*r = append((*r)[0:0], data...)
	return nil
}
548492
func (u *Unstructured) UnmarshalJSON(b []byte) error {
	_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
	return err
}
1318164
func (u *Union) UnmarshalJSON(b []byte) error {
	var mixed interface{}

	json.Unmarshal(b, &mixed)

	switch mixed.(type) {
	case []interface{}:
		for _, value := range mixed.([]interface{}) {
			bytes, _ := json.Marshal(value)
			schedule, err := ScheduleUnmarshalJSON(bytes)
			if err != nil {
				return err
			}
			*u = append(*u, schedule)
		}
	default:
		return fmt.Errorf("union must be a slice")
	}

	return nil
}
791036
func UnmarshalDate(s string) (time.Time, error) {
	year, month, day, err := parseDateParts(s)
	if err != nil {
		return time.Time{}, err
	}
	return time.Date(year, time.Month(month), day, 0, 0, 0, 0, localLoc), nil
}
905062
func (im *Info) UnmarshalJSON(b []byte) error {
	type InfoAlias Info
	unencode := struct {
		InfoAlias
		CreatedAt   string `json:",omitempty"`
		LastFetched string `json:",omitempty"`
	}{}
	json.Unmarshal(b, &unencode)
	*im = Info(unencode.InfoAlias)

	var err error
	if err = decodeTime(unencode.CreatedAt, &im.CreatedAt); err == nil {
		err = decodeTime(unencode.LastFetched, &im.LastFetched)
	}
	return err
}
1045328
func UnmarshalDateTimeTz(s string) (result time.Time, err error) {
	dateStr, timeStr, zoneStr, err := splitCompleteDateTimeZone(s)
	if err != nil {
		return
	}

	year, month, day, err := parseDateParts(dateStr)
	if err != nil {
		return
	}

	var hour, minute, second int
	var location *time.Location = localLoc
	if len(timeStr) != 0 {
		hour, minute, second, err = parseTimeParts(timeStr)
		if err != nil {
			return
		}
		if len(zoneStr) != 0 {
			var offset int
			offset, err = parseTimezone(zoneStr)
			if offset == 0 {
				location = time.UTC
			} else {
				location = time.FixedZone("", offset)
			}
		}
	}

	result = time.Date(year, time.Month(month), day, hour, minute, second, 0, location)
	return
}
988953
func (o *ValidUntilOption) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		o.value = time.Time{}
		return nil
	}
	return json.Unmarshal(data, &o.value)
}
799626
func (t *Unix) UnmarshalJSON(in []byte) (err error) {
	secs, err := strconv.ParseInt(string(in), 10, 64)
	if err != nil {
		return err
	}

	*t = Unix(time.Unix(secs, 0))
	return nil
}
898827
func (d *Datapoint) UnmarshalJSON(b []byte) error {
	dp := datapointJSON{}
	err := json.Unmarshal(b, &dp)
	if err != nil {
		return err
	}

	*d = Datapoint(dp.datapoint)
	d.Timestamp = FromUnixMilli(dp.Ts)

	return nil
}
1300452
func (n *NullDate) UnmarshalJSON(p []byte) error {
	if bytes.Equal(p, nullText) {
		n.Valid = false
		n.Date = Date{}
		return nil
	}
	var d Date
	if err := d.UnmarshalJSON(p); err != nil {
		return err
	}
	n.Valid = true
	n.Date = d
	return nil
}
801365
func (ts *Timestamp) UnmarshalJSON(input []byte) error {
	strInput := strings.Trim(string(input), `"`)
	newTime, err := time.Parse("2006-01-02 15:04:05.000000000", strInput)
	if err != nil {
		return err
	}

	ts.Time = newTime
	return nil
}
198038
func (u *UpdateTime) UnmarshalJSON(b []byte) error {
	s := strings.Trim(string(b), "\"")
	if s == "none" {
		*u = UpdateTime{&time.Time{}}
		return nil
	}
	t, err := time.Parse("2006-01-02T15:04:05", s)
	if err != nil {
		return err
	}
	*u = UpdateTime{&t}
	return nil
}