// MarshalJSON returns the JSON encoding of the metric aggregation
323544
func (a *MetricAggregation) MarshalJSON() ([]byte, error) {
	root := map[string]interface{}{
		"field": a.Field,
	}

	for k, v := range a.Settings {
		if k != "" && v != nil {
			root[k] = v
		}
	}

	return json.Marshal(root)
}
238482
func (t Time) MarshalJSON() ([]byte, error) {
	var seconds, nanos int64
	if t.Seconds != nil {
		seconds = *t.Seconds
	}
	if t.Nanos != nil {
		nanos = int64(*t.Nanos)
	}
	return json.Marshal(time.Unix(seconds, nanos))
}
1127764
func (b *Bound) MarshalJSON() ([]byte, error) {
	return json.Marshal([2]*Point{b.sw, b.ne})
}
113600
func (c *Constant) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf("\"%s\"", c)), nil
}
395493
func (v Subscriber) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson639f989aEncodeCodeCloudfoundryOrgGorouterMbus1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
304827
func (r Raw) MarshalJSON() ([]byte, error) {
	if r == nil {
		return []byte("null"), nil
	}
	return r, nil
}
266742
func (b *BytesResource) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(b.data))
}
810998
func (ia *Int64Array) MarshalJSON() ([]byte, error) {
	if ia == nil || !ia.Valid {
		return []byte("null"), nil
	}
	return json.Marshal(ia.Int64Array)
}
501918
func (a *aggContainer) MarshalJSON() ([]byte, error) {
	root := map[string]interface{}{
		a.Type: a.Aggregation,
	}

	if len(a.Aggs) > 0 {
		root["aggs"] = a.Aggs
	}

	return json.Marshal(root)
}
791995
func (v Endpoint) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
499878
func (v RegistryMessage) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson639f989aEncodeCodeCloudfoundryOrgGorouterMbus2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
609770
func (jt Time) MarshalJSON() ([]byte, error) {
	return json.Marshal(jt.UTC().Format(time.RFC3339Nano))
}
159090
func (d *Duration) MarshalJSON() ([]byte, error) {
	return json.Marshal(time.Duration(*d))
}
794610
func (r StatusIndicator) MarshalJSON() ([]byte, error) {
	if s, ok := interface{}(r).(fmt.Stringer); ok {
		return json.Marshal(s.String())
	}
	s, ok := _StatusIndicatorValueToName[r]
	if !ok {
		return nil, fmt.Errorf("invalid StatusIndicator: %d", r)
	}
	return json.Marshal(s)
}
809653
func (s String) MarshalJSON() ([]byte, error) {
	return json.Marshal([]interface{}{s.Timestamp, s.Value})
}
1036865
func (p Protected) MarshalJSON() ([]byte, error) {
	b, err := json.Marshal(map[string]interface{}(p))
	if err != nil {
		return nil, err
	}
	return EncodeEscape(b), nil
}
654233
func (v Stats) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonE3ab7953EncodeGithubComCloudfoundryCommunityFirehoseToSyslogStats(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}