code: 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
  }
docs: // UnmarshalJSON decodes JSON data and initializes an AggregationPipelineStatsMetric structure.