// MarshalJSON recursively marshals the stack of Err.
517043
func (e *Error) MarshalJSON() (result []byte, err error) {
	ee := errEncode{
		Code: e.Code,
		Msg:  e.Msg,
		Op:   e.Op,
	}
	if e.Err != nil {
		if _, ok := e.Err.(*Error); ok {
			_, err := e.Err.(*Error).MarshalJSON()
			if err != nil {
				return result, err
			}
			ee.Err = e.Err
		} else {
			ee.Err = e.Err.Error()
		}
	}
	return json.Marshal(ee)
}
402086
func (c *ConfigPolicy) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Config *ctree.ConfigTree `json:"config"`
	}{
		Config: c.config,
	})
}
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))
}
318810
func (step *CallFlowHangupStep) MarshalJSON() ([]byte, error) {
	data := jsonCallFlowHangupStep{}
	data.CallFlowStepBase = step.CallFlowStepBase
	data.Action = "hangup"
	return json.Marshal(data)
}
486285
func (v Stored) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
413851
func (s *Sources) MarshalJSON() ([]byte, error) {
	srcs := make([]Source, len(s.Sources))
	for i, src := range s.Sources {
		srcs[i] = Source{src}
	}
	return json.Marshal(srcs)
}
508831
func (e encodable) MarshalJSON() ([]byte, error) {
	return Encode(e.E, e.obj)
}
1051093
func (u *Uint64) MarshalJSON() ([]byte, error) {
	if u == nil || !u.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(u.Uint64)
}
478804
func (e JSONError) MarshalJSON() ([]byte, error) {
	if e.error == nil {
		return []byte("null"), nil
	}
	return json.Marshal(e.Error())
}
1103541
func (notOperation *Not) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Not  Comparison
		Next string
	}{
		Not:  notOperation.Comparison,
		Next: notOperation.Next.Name(),
	})
}
451454
func (u *Unstructured) MarshalJSON() ([]byte, error) {
	var buf bytes.Buffer
	err := UnstructuredJSONScheme.Encode(u, &buf)
	return buf.Bytes(), err
}
899549
func (v ClientInfo) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents8(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
132157
func (s *RecursiveSchema) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf(`"%s"`, s.Actual.GetName())), nil
}
1192280
func (v ListUploaded) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents8(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
74338
func (iem IndexErrMap) MarshalJSON() ([]byte, error) {
	tmp := make(map[string]string, len(iem))
	for k, v := range iem {
		tmp[k] = v.Error()
	}
	return json.Marshal(tmp)
}
442697
func (e *goof) MarshalJSON() ([]byte, error) {

	if len(e.Fields()) == 0 {
		return json.Marshal(e.msg)
	}

	m := e.Fields()

	if e.includeMsgInJSON && e.msg != "" {
		m["msg"] = e.msg
	}

	return json.Marshal(m)
}
1041492
func (step *CallFlowFetchStep) MarshalJSON() ([]byte, error) {
	data := jsonCallFlowFetchStep{}
	data.CallFlowStepBase = step.CallFlowStepBase
	data.Action = "fetchCallFlow"
	data.Options.URL = step.URL
	return json.Marshal(data)
}