// MarshalJSON implements json.Marshaler for Header.
545864
func (h Header) MarshalJSON() ([]byte, error) {
	if len(h) == 0 {
		return nil, nil
	}
	b, err := json.Marshal(map[string]interface{}(h))
	if err != nil {
		return nil, err
	}
	return EncodeEscape(b), nil
}
791995
func (v Endpoint) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
72268
func (cmp *TimestampLessThan) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Variable          string
		TimestampLessThan string
	}{
		Variable:          cmp.Variable,
		TimestampLessThan: cmp.Value.Format(time.RFC3339),
	})
}
1211119
func (h Header) MarshalJSON() ([]byte, error) {
	return mergeMarshal(h.EssentialHeader, h.PrivateParams)
}
850532
func (v Complained) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents15(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
690858
func (namespaces TemplateFuncsNamespaces) MarshalJSON() ([]byte, error) {
	var buf bytes.Buffer

	buf.WriteString("{")

	for i, ns := range namespaces {
		if i != 0 {
			buf.WriteString(",")
		}
		b, err := ns.toJSON()
		if err != nil {
			return nil, err
		}
		buf.Write(b)
	}

	buf.WriteString("}")

	return buf.Bytes(), nil
}
55068
func (v *IntString) MarshalJSON() ([]byte, error) {
	if v.Valid {
		strVal := strconv.FormatInt(v.Value, 10)
		return []byte(strVal), nil
	}

	return []byte(`"null"`), nil
}
605865
func (v JSONWriteFormat) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxMetricproxyProtocolCollectdFormat(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
486285
func (v Stored) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
323622
func (t String) MarshalJSON() ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"type": t.typeMarker(),
	})
}
1192280
func (v ListUploaded) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents8(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
898834
func (t Any) MarshalJSON() ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"type": t.typeMarker(),
		"of":   []Type(t),
	})
}
863293
func (m *marshalableError) MarshalJSON() ([]byte, error) {
	return json.Marshal(m.err.Error())
}
1222215
func (v Uint64) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	v.MarshalEasyJSON(&w)
	return w.Buffer.BuildBytes(), w.Error
}
1101929
func (s Strings) MarshalJSON() ([]byte, error) {
	if len(s) == 1 {
		return json.Marshal(s[0])
	}
	return json.Marshal([]string(s))
}
832110
func (m Type) MarshalJSON() ([]byte, error) {
	type Alias Type
	return json.Marshal(&struct {
		Type   string `json:"type"`
		String string `json:"string"`
		Alias
	}{
		Type:   m.Type(),
		String: m.String(),
		Alias:  (Alias)(m),
	})
}
1090055
func (e EncodedHeader) MarshalJSON() ([]byte, error) {
	buf, err := e.Base64Encode()
	if err != nil {
		return nil, errors.Wrap(err, "failed to base64 encode encoded header")
	}
	return json.Marshal(string(buf))
}