// UnmarshalJSON sets timestamp to parsed JSON data
19459
func (timestamp *Timestamp) UnmarshalJSON(data []byte) error {
	t, err := time.Parse(timestampFormat, string(data))
	if err != nil {
		return err
	}

	*timestamp = Timestamp(t)
	return nil
}
415211
func (s *Date) UnmarshalJSON(b []byte) error {
	timestamp, err := strconv.ParseFloat(string(b), 64)
	if err != nil {
		return err
	}
	s.Time = time.Unix(int64(timestamp), 0)
	return nil
}
641157
func (it *ISO6801Time) UnmarshalJSON(data []byte) error {
	str := string(data)

	if str == "\"\"" || len(data) == 0 {
		return nil
	}
	var t time.Time
	var err error
	if str[0] == '"' {
		t, err = time.ParseInLocation(jsonFormatISO8601, str, time.UTC)
		if err != nil {
			t, err = time.ParseInLocation(jsonFormatISO8601withoutSeconds, str, time.UTC)
		}
	} else {
		var i int64
		i, err = strconv.ParseInt(str, 10, 64)
		if err == nil {
			t = time.Unix(i/1000, i%1000)
		}
	}
	if err == nil {
		*it = ISO6801Time(t)
	}
	return err
}
180150
func (key *Key) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return err
	}

	parsedKey, err := parseKey(s)
	if err != nil {
		return err
	}

	*key = parsedKey
	return nil
}
1369600
func (t *TimeSinceEpoch) UnmarshalJSON(data []byte) error {
	*t = 0
	if len(data) == 0 {
		return nil
	}
	var f float64
	if err := json.Unmarshal(data, &f); err != nil {
		return errors.New("network.TimeSinceEpoch: " + err.Error())
	}
	*t = TimeSinceEpoch(f)
	return nil
}
1078756
func (date *Date) UnmarshalJSON(text []byte) error {
	if string(text) == "null" {
		// Nulls are converted to zero times
		var zero Date
		*date = zero
		return nil
	}
	b := bytes.NewBuffer(text)
	dec := json.NewDecoder(b)
	var s string
	if err := dec.Decode(&s); err != nil {
		return err
	}
	value, err := time.Parse(ISO8601Date, s)
	if err != nil {
		return err
	}
	date.Time = value
	return nil
}
734330
func (d *Duration) UnmarshalJSON(b []byte) error {
	dur, err := readDuration(string(b))
	*d = Duration(dur)
	return err
}
434240
func (d *Date) UnmarshalJSON(b []byte) error {
	tm, err := time.Parse("\"2006-01-02\"", string(b))
	if err != nil {
		return json.Unmarshal(b, (*time.Time)(d))
	}
	*d = Date(tm)
	return nil
}
587268
func (s *ProbeDetailsDTO) UnmarshalJSON(b []byte) (err error) {
	s.data = b
	return nil
}
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
}
1084217
func (ia *Int64Array) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		ia.Valid = false
		return nil
	}
	if data == nil {
		ia.Int64Array, ia.Valid = nil, false
		return nil
	}
	ia.Valid = true
	return json.Unmarshal(data, &ia.Int64Array)
}
1248478
func (pTypeDef *TimestampTest) UnmarshalJSON(b []byte) error {
	var r rawTimestampTest
	err := json.Unmarshal(b, &r)
	if err == nil {
		o := TimestampTest(r)
		*pTypeDef = o
		err = pTypeDef.Validate()
	}
	return err
}
1197964
func (vd *VolumeSnapshotDataList) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotDataListCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshotDataList(tmp)
	*vd = tmp2
	return nil
}
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
}
360076
func (t *JSONTime) UnmarshalJSON(data []byte) error {
	ts, err := strconv.ParseInt(string(data), 10, 64)
	if err != nil {
		return err
	}
	*t = JSONTime(time.Unix(0, ts*1000))
	return nil
}
1286385
func (i *Int64) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		i.Valid = false
		return nil
	}
	if err := json.Unmarshal(data, &i.Int64); err != nil {
		return err
	}
	i.Valid = true
	return nil
}
724977
func (t *TimeAPI) UnmarshalJSON(data []byte) error {
	if t == nil {
		return fmt.Errorf("TimeAPI: UnmarshalJSON on nil pointer")
	}
	var ts int64
	if err := json.Unmarshal(data, &ts); err != nil {
		return err
	}
	*t = NewTimeAPIFromUNIX(ts)
	return nil
}