// UnmarshalJSON decodes JSON data and initializes an AggregationStatsMetric structure.
480089
func (a *AggregationStatsMetric) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["count"]; ok && v != nil {
		json.Unmarshal(v, &a.Count)
	}
	if v, ok := aggs["min"]; ok && v != nil {
		json.Unmarshal(v, &a.Min)
	}
	if v, ok := aggs["max"]; ok && v != nil {
		json.Unmarshal(v, &a.Max)
	}
	if v, ok := aggs["avg"]; ok && v != nil {
		json.Unmarshal(v, &a.Avg)
	}
	if v, ok := aggs["sum"]; ok && v != nil {
		json.Unmarshal(v, &a.Sum)
	}
	if v, ok := aggs["meta"]; ok && v != nil {
		json.Unmarshal(v, &a.Meta)
	}
	a.Aggregations = aggs
	return nil
}
306013
func (a *AggregationBucketRangeItem) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["key"]; ok && v != nil {
		json.Unmarshal(v, &a.Key)
	}
	if v, ok := aggs["doc_count"]; ok && v != nil {
		json.Unmarshal(v, &a.DocCount)
	}
	if v, ok := aggs["from"]; ok && v != nil {
		json.Unmarshal(v, &a.From)
	}
	if v, ok := aggs["from_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.FromAsString)
	}
	if v, ok := aggs["to"]; ok && v != nil {
		json.Unmarshal(v, &a.To)
	}
	if v, ok := aggs["to_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.ToAsString)
	}
	a.Aggregations = aggs
	return nil
}
13588
func (h *Histogram) UnmarshalJSON(b []byte) error {
	var s string
	if err := json.Unmarshal(b, &s); err != nil {
		return err
	}
	data, err := base64.StdEncoding.DecodeString(s)
	if err != nil {
		return err
	}
	h, err = Deserialize(bytes.NewBuffer(data))
	return err
}
1164123
func (j *Json) UnmarshalJSON(p []byte) error {
	dec := json.NewDecoder(bytes.NewBuffer(p))
	dec.UseNumber()
	return dec.Decode(&j.data)
}
1289074
func (a *AggregationBucketHistogramItem) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["key"]; ok && v != nil {
		json.Unmarshal(v, &a.Key)
	}
	if v, ok := aggs["key_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.KeyAsString)
	}
	if v, ok := aggs["doc_count"]; ok && v != nil {
		json.Unmarshal(v, &a.DocCount)
	}
	a.Aggregations = aggs
	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)
}
764813
func (a *AggregationBucketKeyItem) UnmarshalJSON(data []byte) error {
	var aggs map[string]*json.RawMessage
	dec := json.NewDecoder(bytes.NewReader(data))
	dec.UseNumber()
	if err := dec.Decode(&aggs); err != nil {
		return err
	}
	if v, ok := aggs["key"]; ok && v != nil {
		json.Unmarshal(*v, &a.Key)
		json.Unmarshal(*v, &a.KeyNumber)
	}
	if v, ok := aggs["doc_count"]; ok && v != nil {
		json.Unmarshal(*v, &a.DocCount)
	}
	a.Aggregations = aggs
	return nil
}
209612
func (v *App) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson633f8c25DecodeGithubComCloudfoundryCommunityFirehoseToSyslogCaching(&r, v)
	return r.Error()
}
873043
func (g *GUID) UnmarshalJSON(data []byte) error {
	g2, err := FromString(strings.Trim(string(data), "\""))
	if err != nil {
		return err
	}
	*g = *g2
	return nil
}
548492
func (u *Unstructured) UnmarshalJSON(b []byte) error {
	_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
	return err
}
1022281
func (ts *Timestamp) UnmarshalJSON(b []byte) error {
	var j string
	err := json.Unmarshal(b, &j)
	if err == nil {
		tsp, err := TimestampParse(string(j))
		if err == nil {
			*ts = tsp
		}
	}
	return err
}
391100
func (a *AggregationPipelineStatsMetric) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["count"]; ok && v != nil {
		json.Unmarshal(v, &a.Count)
	}
	if v, ok := aggs["count_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.CountAsString)
	}
	if v, ok := aggs["min"]; ok && v != nil {
		json.Unmarshal(v, &a.Min)
	}
	if v, ok := aggs["min_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.MinAsString)
	}
	if v, ok := aggs["max"]; ok && v != nil {
		json.Unmarshal(v, &a.Max)
	}
	if v, ok := aggs["max_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.MaxAsString)
	}
	if v, ok := aggs["avg"]; ok && v != nil {
		json.Unmarshal(v, &a.Avg)
	}
	if v, ok := aggs["avg_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.AvgAsString)
	}
	if v, ok := aggs["sum"]; ok && v != nil {
		json.Unmarshal(v, &a.Sum)
	}
	if v, ok := aggs["sum_as_string"]; ok && v != nil {
		json.Unmarshal(v, &a.SumAsString)
	}
	if v, ok := aggs["meta"]; ok && v != nil {
		json.Unmarshal(v, &a.Meta)
	}
	a.Aggregations = aggs
	return nil
}
231896
func (v *eventReceivedMessageFromTarget) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonC5ff9ce6DecodeGithubComChromedpChromedp(&r, v)
	return r.Error()
}
907222
func (k *Key) UnmarshalJSON(data []byte) error {
	var key string
	if err := json.Unmarshal(data, &key); err != nil {
		return err
	}
	*k = NewKey(key)
	return nil
}
172051
func (s *Sample) UnmarshalJSON(b []byte) error {
	v := struct {
		Metric Metric     `json:"metric"`
		Value  SamplePair `json:"value"`
	}{
		Metric: s.Metric,
		Value: SamplePair{
			Timestamp: s.Timestamp,
			Value:     s.Value,
		},
	}

	if err := json.Unmarshal(b, &v); err != nil {
		return err
	}

	s.Metric = v.Metric
	s.Timestamp = v.Value.Timestamp
	s.Value = v.Value.Value

	return nil
}
416835
func (v *VolumeSnapshot) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshot(tmp)
	*v = tmp2
	return nil
}
773632
func (o *Instance) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realInstance
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = Instance(r)
	return nil
}