// MarshalJSON serializes the Route into a JSON representation.
// It's used for testing and diagnostics.
320417
func (route *Route) MarshalJSON() ([]byte, error) {
	var vindexName string
	if route.Vindex != nil {
		vindexName = route.Vindex.String()
	}
	marshalRoute := struct {
		Opcode                  RouteOpcode
		Keyspace                *vindexes.Keyspace   `json:",omitempty"`
		Query                   string               `json:",omitempty"`
		FieldQuery              string               `json:",omitempty"`
		Vindex                  string               `json:",omitempty"`
		Values                  []sqltypes.PlanValue `json:",omitempty"`
		OrderBy                 []OrderbyParams      `json:",omitempty"`
		TruncateColumnCount     int                  `json:",omitempty"`
		QueryTimeout            int                  `json:",omitempty"`
		ScatterErrorsAsWarnings bool                 `json:",omitempty"`
	}{
		Opcode:                  route.Opcode,
		Keyspace:                route.Keyspace,
		Query:                   route.Query,
		FieldQuery:              route.FieldQuery,
		Vindex:                  vindexName,
		Values:                  route.Values,
		OrderBy:                 route.OrderBy,
		TruncateColumnCount:     route.TruncateColumnCount,
		QueryTimeout:            route.QueryTimeout,
		ScatterErrorsAsWarnings: route.ScatterErrorsAsWarnings,
	}
	return jsonutil.MarshalNoEscape(marshalRoute)
}
918180
func (v Failed) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents12(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
304827
func (r Raw) MarshalJSON() ([]byte, error) {
	if r == nil {
		return []byte("null"), nil
	}
	return r, nil
}
79400
func (s *ProbeDetailsDTO) MarshalJSON() ([]byte, error) {
	var err error
	if s.Detail != nil {
		return json.Marshal(s.Detail)
	}
	if len(s.data) != 0 {
		return s.data, err
	}
	return json.Marshal(nil)
}
115194
func (sa *StringArray) MarshalJSON() ([]byte, error) {
	if sa == nil || !sa.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(sa.StringArray)
}
1343879
func (re Unknown) MarshalJSON() ([]byte, error) {
	if re.RawJSON == nil {
		return []byte("null"), nil
	}
	return re.RawJSON, nil
}
478804
func (e JSONError) MarshalJSON() ([]byte, error) {
	if e.error == nil {
		return []byte("null"), nil
	}
	return json.Marshal(e.Error())
}
810998
func (ia *Int64Array) MarshalJSON() ([]byte, error) {
	if ia == nil || !ia.Valid {
		return []byte("null"), nil
	}
	return json.Marshal(ia.Int64Array)
}
64820
func (r *AddressRange) MarshalJSON() ([]byte, error) {
	m := map[string]interface{}{
		"Sub":   r.Sub.String(),
		"Start": r.Start,
		"End":   r.End,
	}
	return json.Marshal(m)
}
609770
func (jt Time) MarshalJSON() ([]byte, error) {
	return json.Marshal(jt.UTC().Format(time.RFC3339Nano))
}
1241785
func (p StreamPath) MarshalJSON() ([]byte, error) {
	v := string(p)
	return json.Marshal(&v)
}
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)
}
512997
func (v Delivered) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents14(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
937417
func (ip IP4) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf(`"%s"`, ip)), nil
}
251645
func (args Args) MarshalJSON() ([]byte, error) {
	if len(args.fields) == 0 {
		return []byte{}, nil
	}
	return json.Marshal(args.fields)
}
679140
func (n IP4Net) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf(`"%s"`, n)), nil
}
504045
func (s Services) MarshalJSON() ([]byte, error) {
	data, err := s.MarshalYAML()
	if err != nil {
		return nil, err
	}
	return json.MarshalIndent(data, "", "  ")
}