// UnmarshalJSON decodes JSON data and initializes an AggregationValueMetric structure.
173262
func (a *AggregationValueMetric) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["value"]; ok && v != nil {
		json.Unmarshal(v, &a.Value)
	}
	if v, ok := aggs["meta"]; ok && v != nil {
		json.Unmarshal(v, &a.Meta)
	}
	a.Aggregations = aggs
	return nil
}
86845
func (u *UUID) UnmarshalJSON(b []byte) error {
	var s string
	if err := json.Unmarshal(b, &s); err != nil {
		return err
	}

	new, err := ParseUUID(s)
	if err == nil {
		u.UUID = new.UUID
	}
	return err
}
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
}
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
}
91051
func (t *Tag) UnmarshalJSON(data []byte) error {
	var tag [2]string
	if err := json.Unmarshal(data, &tag); err != nil {
		return err
	}
	*t = Tag{tag[0], tag[1]}
	return nil
}
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
}
204258
func (a *AggregationGeoCentroidMetric) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["location"]; ok && v != nil {
		json.Unmarshal(v, &a.Location)
	}
	if v, ok := aggs["meta"]; ok && v != nil {
		json.Unmarshal(v, &a.Meta)
	}
	if v, ok := aggs["count"]; ok && v != nil {
		json.Unmarshal(v, &a.Count)
	}
	a.Aggregations = aggs
	return nil
}
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
}
548492
func (u *Unstructured) UnmarshalJSON(b []byte) error {
	_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
	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)
}
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
}
931443
func (v *Opened) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents5(&r, v)
	return r.Error()
}
329235
func (v *bulkIndexRequestCommand) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson9de0fcbfDecodeGithubComOlivereElastic1(&r, v)
	return r.Error()
}
501633
func (l *ElasticLoadBalancingV2TargetGroupTargetGroupAttributeList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := ElasticLoadBalancingV2TargetGroupTargetGroupAttribute{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = ElasticLoadBalancingV2TargetGroupTargetGroupAttributeList{item}
		return nil
	}
	list := []ElasticLoadBalancingV2TargetGroupTargetGroupAttribute{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = ElasticLoadBalancingV2TargetGroupTargetGroupAttributeList(list)
		return nil
	}
	return err
}
421643
func (p *SetCollectionPropertiesOptions) UnmarshalJSON(d []byte) error {
	var internal setCollectionPropertiesOptionsInternal
	if err := json.Unmarshal(d, &internal); err != nil {
		return err
	}

	p.fromInternal(&internal)
	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)
}
587268
func (s *ProbeDetailsDTO) UnmarshalJSON(b []byte) (err error) {
	s.data = b
	return nil
}