// MarshalJSON converts the Meta struct into a JSON representation.
434084
func (m Meta) MarshalJSON() ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"version":      m.Version,
		"created":      m.Created.Format("2006-01-02T15:04:05.000Z"),
		"lastModified": m.LastModified.Format("2006-01-02T15:04:05.000Z"),
	})
}
1101929
func (s Strings) MarshalJSON() ([]byte, error) {
	if len(s) == 1 {
		return json.Marshal(s[0])
	}
	return json.Marshal([]string(s))
}
1133745
func (c *ConfigTree) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Root *node `json:"root"`
	}{
		Root: c.root,
	})
}
161807
func (s Sample) MarshalJSON() ([]byte, error) {
	v := struct {
		Metric Metric     `json:"metric"`
		Value  SamplePair `json:"value"`
	}{
		Metric: s.Metric,
		Value: SamplePair{
			Timestamp: s.Timestamp,
			Value:     s.Value,
		},
	}

	return json.Marshal(&v)
}
1105825
func (functions Functions) MarshalJSON() ([]byte, error) {
	nm := make(map[name]map[Key]ValueSet)

	for _, f := range functions {
		if _, ok := nm[f.name()]; ok {
			for k, v := range f.toMap() {
				nm[f.name()][k] = v
			}
		} else {
			nm[f.name()] = f.toMap()
		}
	}

	return json.Marshal(nm)
}
1343879
func (re Unknown) MarshalJSON() ([]byte, error) {
	if re.RawJSON == nil {
		return []byte("null"), nil
	}
	return re.RawJSON, nil
}
504045
func (s Services) MarshalJSON() ([]byte, error) {
	data, err := s.MarshalYAML()
	if err != nil {
		return nil, err
	}
	return json.MarshalIndent(data, "", "  ")
}
645043
func (key Key) MarshalJSON() ([]byte, error) {
	if !key.IsValid() {
		return nil, fmt.Errorf("unknown key %v", key)
	}

	return json.Marshal(string(key))
}
387807
func (timestamp Timestamp) MarshalJSON() ([]byte, error) {
	return []byte(time.Time(timestamp).UTC().Format(timestampFormat)), nil
}
1141499
func (v SmallPayload) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson890029d8EncodeGithubComFrancoispqtGojayBenchmarks(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
809653
func (s String) MarshalJSON() ([]byte, error) {
	return json.Marshal([]interface{}{s.Timestamp, s.Value})
}
522415
func MarshalJSON(v interface{}) ([]byte, error) {
	val, _, err := marshalValue(reflect.ValueOf(v), reflect.StructField{
		Tag: `json:",wrapper"`,
	})
	if err != nil {
		return nil, err
	}
	return json.Marshal(val)
}
299368
func (sf *ScalarFunction) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf("\"%s\"", sf)), nil
}
654233
func (v Stats) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonE3ab7953EncodeGithubComCloudfoundryCommunityFirehoseToSyslogStats(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
995464
func marshalJSON(obj runtime.Object) ([]byte, error) {
	j, err := kopscodecs.ToVersionedJSON(obj)
	if err != nil {
		return nil, fmt.Errorf("error marshaling json: %v", err)
	}
	return j, nil
}
132157
func (s *RecursiveSchema) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf(`"%s"`, s.Actual.GetName())), nil
}
478804
func (e JSONError) MarshalJSON() ([]byte, error) {
	if e.error == nil {
		return []byte("null"), nil
	}
	return json.Marshal(e.Error())
}