// MarshalJSON converts the Errors into a valid JSON.
349131
func (es Errors) MarshalJSON() ([]byte, error) {
	errs := map[string]interface{}{}
	for key, err := range es {
		if ms, ok := err.(json.Marshaler); ok {
			errs[key] = ms
		} else {
			errs[key] = err.Error()
		}
	}
	return json.Marshal(errs)
}
306401
func (that *JSONNode) MarshalJSON() ([]byte, error) {
	var ret []byte
	var err error
	switch that.t {
	case TypeMap:
		ret, err = json.Marshal(that.m)
	case TypeArray:
		ret, err = json.Marshal(that.a)
	case TypeValue:
		ret, err = json.Marshal(that.v)
	default:
		ret, err = json.Marshal(nil)
	}
	if err != nil {
		return nil, err
	}
	return ret, err
}
115194
func (sa *StringArray) MarshalJSON() ([]byte, error) {
	if sa == nil || !sa.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(sa.StringArray)
}
568110
func (v MediumPayload) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonB0500db0EncodeGithubComFrancoispqtGojayBenchmarks(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1061427
func (o *Object) MarshalJSON() ([]byte, error) {
	ctx := _builtinJSON_stringifyContext{
		r: o.runtime,
	}
	ex := o.runtime.vm.try(func() {
		if !ctx.do(o) {
			ctx.buf.WriteString("null")
		}
	})
	if ex != nil {
		return nil, ex
	}
	return ctx.buf.Bytes(), nil
}
399790
func (v DSUser) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonCfe4e5f0EncodeGithubComFrancoispqtGojayBenchmarks1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
488682
func (s *SourceNetwork) MarshalJSON() ([]byte, error) {
	if s == nil {
		return []byte(""), nil
	}

	list := []string(*s)
	if len(list) == 0 || (len(list) == 1 && list[0] == "") {
		return []byte(`""`), nil
	}

	return json.Marshal(list)
}
532862
func (v Annotation) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat3(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
451454
func (u *Unstructured) MarshalJSON() ([]byte, error) {
	var buf bytes.Buffer
	err := UnstructuredJSONScheme.Encode(u, &buf)
	return buf.Bytes(), err
}
43390
func (h *Handle) MarshalJSON() ([]byte, error) {
	m := map[string]interface{}{
		"id": h.id,
	}

	b, err := h.ToByteArray()
	if err != nil {
		return nil, err
	}
	m["sequence"] = b
	return json.Marshal(m)
}
898834
func (t Any) MarshalJSON() ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"type": t.typeMarker(),
		"of":   []Type(t),
	})
}
791995
func (v Endpoint) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1141499
func (v SmallPayload) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson890029d8EncodeGithubComFrancoispqtGojayBenchmarks(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
85315
func (t *Array) MarshalJSON() ([]byte, error) {
	repr := map[string]interface{}{
		"type": t.typeMarker(),
	}
	if len(t.static) != 0 {
		repr["static"] = t.static
	}
	if t.dynamic != nil {
		repr["dynamic"] = t.dynamic
	}
	return json.Marshal(repr)
}
548109
func (b Buffer) MarshalJSON() ([]byte, error) {
	v, err := b.Base64Encode()
	if err != nil {
		return nil, errors.Wrap(err, "failed to encode to base64")
	}
	return json.Marshal(string(v))
}
952269
func (r ComponentStatus) MarshalJSON() ([]byte, error) {
	if s, ok := interface{}(r).(fmt.Stringer); ok {
		return json.Marshal(s.String())
	}
	s, ok := _ComponentStatusValueToName[r]
	if !ok {
		return nil, fmt.Errorf("invalid ComponentStatus: %d", r)
	}
	return json.Marshal(s)
}
1158982
func (p Browser) MarshalJSON() ([]byte, error) {
	aps := map[string]interface{}{"alert": p.Alert, "url-args": p.URLArgs}
	return json.Marshal(map[string]interface{}{"aps": aps})
}