// MarshalJSON returns the res and err as the fake response.
425078
func (r *Response) MarshalJSON() ([]byte, error) {
	return []byte(r.res), r.err
}
865624
func (v Generic) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents11(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
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
}
951072
func MarshalJSON(errobj error) ([]byte, error) {
	errjson, err := newJSON(1, errobj)
	if errjson == nil || err != nil {
		return []byte(""), err
	}
	return json.Marshal(errjson)
}
811172
func (r *telegrafResponse) MarshalJSON() ([]byte, error) {
	// telegrafPluginEncode is the helper struct for json encoding.
	type telegrafPluginEncode struct {
		// Name of the telegraf plugin, exp "docker"
		Name    string         `json:"name"`
		Type    plugins.Type   `json:"type"`
		Comment string         `json:"comment"`
		Config  plugins.Config `json:"config"`
	}

	// telegrafConfigEncode is the helper struct for json encoding.
	type telegrafConfigEncode struct {
		ID             platform.ID                  `json:"id"`
		OrganizationID platform.ID                  `json:"organizationID,omitempty"`
		Name           string                       `json:"name"`
		Description    string                       `json:"description"`
		Agent          platform.TelegrafAgentConfig `json:"agent"`
		Plugins        []telegrafPluginEncode       `json:"plugins"`
		Labels         []platform.Label             `json:"labels"`
		Links          telegrafLinks                `json:"links"`
	}

	tce := new(telegrafConfigEncode)
	*tce = telegrafConfigEncode{
		ID:             r.ID,
		OrganizationID: r.OrganizationID,
		Name:           r.Name,
		Description:    r.Description,
		Agent:          r.Agent,
		Plugins:        make([]telegrafPluginEncode, len(r.Plugins)),
		Labels:         r.Labels,
		Links:          r.Links,
	}

	for k, p := range r.Plugins {
		tce.Plugins[k] = telegrafPluginEncode{
			Name:    p.Config.PluginName(),
			Type:    p.Config.Type(),
			Comment: p.Comment,
			Config:  p.Config,
		}
	}

	return json.Marshal(tce)
}
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)
}
792590
func (r replicationFactor) MarshalJSON() ([]byte, error) {
	var replicationFactor interface{}

	if int(r) == ReplicationFactorSatellite {
		replicationFactor = replicationFactorSatelliteString
	} else {
		replicationFactor = int(r)
	}

	return json.Marshal(replicationFactor)
}
635197
func (b *Bool) MarshalJSON() ([]byte, error) {
	if b == nil || !b.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(b.Bool)
}
486285
func (v Stored) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1243208
func (m *VerifyMessageRequest) MarshalJSON() ([]byte, error) {
	return json.Marshal(struct {
		APIKey    string `json:"api_key"`
		APISecret string `json:"api_secret"`
		VerifyMessageRequest
	}{
		APIKey:               m.apiKey,
		APISecret:            m.apiSecret,
		VerifyMessageRequest: *m,
	})
}
1141499
func (v SmallPayload) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson890029d8EncodeGithubComFrancoispqtGojayBenchmarks(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
794591
func (a *Address) MarshalJSON() (out []byte, err error) {
	return []byte(`"` + a.String() + `"`), nil
}
304827
func (r Raw) MarshalJSON() ([]byte, error) {
	if r == nil {
		return []byte("null"), nil
	}
	return r, nil
}
1222215
func (v Uint64) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	v.MarshalEasyJSON(&w)
	return w.Buffer.BuildBytes(), w.Error
}
1301393
func (v eventReceivedMessageFromTarget) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonC5ff9ce6EncodeGithubComChromedpChromedp(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1153159
func (r *Request) MarshalJSON() (rawData []byte, err error) {
	var signatureString, dataString string
	if r.Signature != nil {
		signatureString = hexutil.Encode(r.Signature[:])
	}
	if r.data != nil {
		dataString = hexutil.Encode(r.data)
	}

	requestJSON := &updateRequestJSON{
		ID:              r.ID,
		ProtocolVersion: r.Header.Version,
		Data:            dataString,
		Signature:       signatureString,
	}

	return json.Marshal(requestJSON)
}
1203687
func (e Enclosure) MarshalJSON() ([]byte, error) {
	ge := &struct {
		URL    string `json:"url"`
		Length int64  `json:"length"`
		Type   string `json:"type"`
	}{
		URL:    e.URL,
		Length: e.Length,
		Type:   e.Type,
	}
	return json.Marshal(ge)
}