// UnmarshalJSON reconstitutes the Date from a JSON string conforming to RFC3339 full-date (i.e.,
// 2006-01-02).
357676
func (d *Date) UnmarshalJSON(data []byte) (err error) {
	d.Time, err = time.Parse(fullDateJSON, string(data))
	return err
}
1258263
func (t *Timestamp) UnmarshalJSON(b []byte) error {
	timestamp, err := strconv.ParseInt(string(b), 10, 64)
	if err != nil {
		return err
	}

	if timestamp < 0 {
		return errors.New("timestamp can not be negative")
	}
	fmt.Println("timestamp", timestamp)

	sec := timestamp / 1000
	nsec := timestamp % 1000 * 1000 * 1000
	// nt := Timestamp(time.Unix(sec, nsec).Local())
	var tZero time.Time

	p := (unsafe.Pointer(t))
	tsec := (*int64)(p)
	*tsec = sec - tZero.Unix()

	secPtr := uintptr(p)
	nsecPtr := secPtr + uintptr(unsafe.Sizeof(int64(0)))
	tnsec := (*int32)(unsafe.Pointer(nsecPtr))
	*tnsec = int32(nsec)
	// locPtr := nsecPtr + uintptr(unsafe.Sizeof(int32(0)))
	// tloc := (*time.Location)(unsafe.Pointer(locPtr))
	// tloc = time.Local

	return nil
}
802978
func (t *TraceV1Pretty) UnmarshalJSON(b []byte) error {
	var s []string
	if err := json.Unmarshal(b, &s); err != nil {
		return err
	}
	*t = TraceV1Pretty(s)
	return nil
}
282199
func (r *rawBase64) UnmarshalJSON(b []byte) error {
	if len(b) > 1 && b[0] == '"' && b[len(b)-1] == '"' {
		b = b[1 : len(b)-1]
	}
	*r = rawBase64(b)
	return nil
}
1101964
func (v *Generic) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents11(&r, v)
	return r.Error()
}
931443
func (v *Opened) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents5(&r, v)
	return r.Error()
}
705730
func (j *JSONText) UnmarshalJSON(data []byte) error {
	if j == nil {
		return errors.New("JSONText: UnmarshalJSON on nil pointer")
	}
	*j = append((*j)[0:0], data...)
	return nil
}
978038
func (v *ClientInfo) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents8(&r, v)
	return r.Error()
}
336752
func (r *Request) UnmarshalJSON(rawData []byte) error {
	var requestJSON updateRequestJSON
	if err := json.Unmarshal(rawData, &requestJSON); err != nil {
		return err
	}
	return r.fromJSON(&requestJSON)
}
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
}
612090
func (t *Time) UnmarshalJSON(b []byte) error {
	if len(b) == 4 && string(b) == "null" {
		t.Time = time.Time{}
		return nil
	}

	var str string
	json.Unmarshal(b, &str)

	pt, err := time.Parse(time.RFC3339, str)
	if err != nil {
		return err
	}

	t.Time = pt.Local()
	return nil
}
357591
func (c *ConfigPolicyNode) UnmarshalJSON(data []byte) error {
	m := map[string]interface{}{}
	decoder := json.NewDecoder(bytes.NewReader(data))
	if err := decoder.Decode(&m); err != nil {
		return err
	}
	if rs, ok := m["rules"]; ok {
		if rules, ok := rs.(map[string]interface{}); ok {
			addRulesToConfigPolicyNode(rules, c)
		}
	}
	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
}
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
}
1370880
func (t *TimeRFC1123) UnmarshalJSON(data []byte) (err error) {
	t.Time, err = ParseTime(rfc1123JSON, string(data))
	if err != nil {
		return err
	}
	return nil
}
259031
func (sa *StringArray) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		sa.Valid = false
		return nil
	}
	if data == nil {
		sa.StringArray, sa.Valid = nil, false
		return nil
	}

	sa.Valid = true

	return json.Unmarshal(data, &sa.StringArray)
}
13329
func (t *Time) UnmarshalJSON(data []byte) error {
	var value time.Time
	if err := value.UnmarshalJSON(data); err != nil {
		return err
	}
	*t = Time(value.UTC())
	return nil
}