// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.

package traceformat

import (
	json "encoding/json"

	easyjson "github.com/mailru/easyjson"
	jlexer "github.com/mailru/easyjson/jlexer"
	jwriter "github.com/mailru/easyjson/jwriter"
	trace "github.com/signalfx/golib/v3/trace"
)

// suppress unused package warning
var (
	_ *json.RawMessage
	_ *jlexer.Lexer
	_ *jwriter.Writer
	_ easyjson.Marshaler
)

func easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat(in *jlexer.Lexer, out *Trace) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		in.Skip()
		*out = nil
	} else {
		in.Delim('[')
		if *out == nil {
			if !in.IsDelim(']') {
				*out = make(Trace, 0, 8)
			} else {
				*out = Trace{}
			}
		} else {
			*out = (*out)[:0]
		}
		for !in.IsDelim(']') {
			var v1 *trace.Span
			if in.IsNull() {
				in.Skip()
				v1 = nil
			} else {
				if v1 == nil {
					v1 = new(trace.Span)
				}
				easyjson72863a49DecodeGithubComSignalfxGolibTrace(in, &*v1)
			}
			*out = append(*out, v1)
			in.WantComma()
		}
		in.Delim(']')
	}
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat(out *jwriter.Writer, in Trace) {
	if in == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
		out.RawString("null")
	} else {
		out.RawByte('[')
		for v2, v3 := range in {
			if v2 > 0 {
				out.RawByte(',')
			}
			if v3 == nil {
				out.RawString("null")
			} else {
				easyjson72863a49EncodeGithubComSignalfxGolibTrace(out, *v3)
			}
		}
		out.RawByte(']')
	}
}

// MarshalJSON supports json.Marshaler interface
func (v Trace) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Trace) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat(w, v)
}

// UnmarshalJSON supports json.Unmarshaler interface
func (v *Trace) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat(&r, v)
	return r.Error()
}

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Trace) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat(l, v)
}
func easyjson72863a49DecodeGithubComSignalfxGolibTrace(in *jlexer.Lexer, out *trace.Span) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "traceId":
			out.TraceID = string(in.String())
		case "name":
			if in.IsNull() {
				in.Skip()
				out.Name = nil
			} else {
				if out.Name == nil {
					out.Name = new(string)
				}
				*out.Name = string(in.String())
			}
		case "parentId":
			if in.IsNull() {
				in.Skip()
				out.ParentID = nil
			} else {
				if out.ParentID == nil {
					out.ParentID = new(string)
				}
				*out.ParentID = string(in.String())
			}
		case "id":
			out.ID = string(in.String())
		case "kind":
			if in.IsNull() {
				in.Skip()
				out.Kind = nil
			} else {
				if out.Kind == nil {
					out.Kind = new(string)
				}
				*out.Kind = string(in.String())
			}
		case "timestamp":
			if in.IsNull() {
				in.Skip()
				out.Timestamp = nil
			} else {
				if out.Timestamp == nil {
					out.Timestamp = new(int64)
				}
				*out.Timestamp = int64(in.Int64())
			}
		case "duration":
			if in.IsNull() {
				in.Skip()
				out.Duration = nil
			} else {
				if out.Duration == nil {
					out.Duration = new(int64)
				}
				*out.Duration = int64(in.Int64())
			}
		case "debug":
			if in.IsNull() {
				in.Skip()
				out.Debug = nil
			} else {
				if out.Debug == nil {
					out.Debug = new(bool)
				}
				*out.Debug = bool(in.Bool())
			}
		case "shared":
			if in.IsNull() {
				in.Skip()
				out.Shared = nil
			} else {
				if out.Shared == nil {
					out.Shared = new(bool)
				}
				*out.Shared = bool(in.Bool())
			}
		case "localEndpoint":
			if in.IsNull() {
				in.Skip()
				out.LocalEndpoint = nil
			} else {
				if out.LocalEndpoint == nil {
					out.LocalEndpoint = new(trace.Endpoint)
				}
				easyjson72863a49DecodeGithubComSignalfxGolibTrace1(in, &*out.LocalEndpoint)
			}
		case "remoteEndpoint":
			if in.IsNull() {
				in.Skip()
				out.RemoteEndpoint = nil
			} else {
				if out.RemoteEndpoint == nil {
					out.RemoteEndpoint = new(trace.Endpoint)
				}
				easyjson72863a49DecodeGithubComSignalfxGolibTrace1(in, &*out.RemoteEndpoint)
			}
		case "annotations":
			if in.IsNull() {
				in.Skip()
				out.Annotations = nil
			} else {
				in.Delim('[')
				if out.Annotations == nil {
					if !in.IsDelim(']') {
						out.Annotations = make([]*trace.Annotation, 0, 8)
					} else {
						out.Annotations = []*trace.Annotation{}
					}
				} else {
					out.Annotations = (out.Annotations)[:0]
				}
				for !in.IsDelim(']') {
					var v4 *trace.Annotation
					if in.IsNull() {
						in.Skip()
						v4 = nil
					} else {
						if v4 == nil {
							v4 = new(trace.Annotation)
						}
						easyjson72863a49DecodeGithubComSignalfxGolibTrace2(in, &*v4)
					}
					out.Annotations = append(out.Annotations, v4)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "tags":
			if in.IsNull() {
				in.Skip()
			} else {
				in.Delim('{')
				if !in.IsDelim('}') {
					out.Tags = make(map[string]string)
				} else {
					out.Tags = nil
				}
				for !in.IsDelim('}') {
					key := string(in.String())
					in.WantColon()
					var v5 string
					v5 = string(in.String())
					(out.Tags)[key] = v5
					in.WantComma()
				}
				in.Delim('}')
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTrace(out *jwriter.Writer, in trace.Span) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"traceId\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.TraceID))
	}
	if in.Name != nil {
		const prefix string = ",\"name\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Name))
	}
	if in.ParentID != nil {
		const prefix string = ",\"parentId\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.ParentID))
	}
	{
		const prefix string = ",\"id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ID))
	}
	if in.Kind != nil {
		const prefix string = ",\"kind\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Kind))
	}
	if in.Timestamp != nil {
		const prefix string = ",\"timestamp\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int64(int64(*in.Timestamp))
	}
	if in.Duration != nil {
		const prefix string = ",\"duration\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int64(int64(*in.Duration))
	}
	if in.Debug != nil {
		const prefix string = ",\"debug\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(*in.Debug))
	}
	if in.Shared != nil {
		const prefix string = ",\"shared\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(*in.Shared))
	}
	if in.LocalEndpoint != nil {
		const prefix string = ",\"localEndpoint\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		easyjson72863a49EncodeGithubComSignalfxGolibTrace1(out, *in.LocalEndpoint)
	}
	if in.RemoteEndpoint != nil {
		const prefix string = ",\"remoteEndpoint\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		easyjson72863a49EncodeGithubComSignalfxGolibTrace1(out, *in.RemoteEndpoint)
	}
	if len(in.Annotations) != 0 {
		const prefix string = ",\"annotations\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v6, v7 := range in.Annotations {
				if v6 > 0 {
					out.RawByte(',')
				}
				if v7 == nil {
					out.RawString("null")
				} else {
					easyjson72863a49EncodeGithubComSignalfxGolibTrace2(out, *v7)
				}
			}
			out.RawByte(']')
		}
	}
	if len(in.Tags) != 0 {
		const prefix string = ",\"tags\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('{')
			v8First := true
			for v8Name, v8Value := range in.Tags {
				if v8First {
					v8First = false
				} else {
					out.RawByte(',')
				}
				out.String(string(v8Name))
				out.RawByte(':')
				out.String(string(v8Value))
			}
			out.RawByte('}')
		}
	}
	out.RawByte('}')
}
func easyjson72863a49DecodeGithubComSignalfxGolibTrace2(in *jlexer.Lexer, out *trace.Annotation) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "timestamp":
			if in.IsNull() {
				in.Skip()
				out.Timestamp = nil
			} else {
				if out.Timestamp == nil {
					out.Timestamp = new(int64)
				}
				*out.Timestamp = int64(in.Int64())
			}
		case "value":
			if in.IsNull() {
				in.Skip()
				out.Value = nil
			} else {
				if out.Value == nil {
					out.Value = new(string)
				}
				*out.Value = string(in.String())
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTrace2(out *jwriter.Writer, in trace.Annotation) {
	out.RawByte('{')
	first := true
	_ = first
	if in.Timestamp != nil {
		const prefix string = ",\"timestamp\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int64(int64(*in.Timestamp))
	}
	if in.Value != nil {
		const prefix string = ",\"value\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Value))
	}
	out.RawByte('}')
}
func easyjson72863a49DecodeGithubComSignalfxGolibTrace1(in *jlexer.Lexer, out *trace.Endpoint) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "serviceName":
			if in.IsNull() {
				in.Skip()
				out.ServiceName = nil
			} else {
				if out.ServiceName == nil {
					out.ServiceName = new(string)
				}
				*out.ServiceName = string(in.String())
			}
		case "ipv4":
			if in.IsNull() {
				in.Skip()
				out.Ipv4 = nil
			} else {
				if out.Ipv4 == nil {
					out.Ipv4 = new(string)
				}
				*out.Ipv4 = string(in.String())
			}
		case "ipv6":
			if in.IsNull() {
				in.Skip()
				out.Ipv6 = nil
			} else {
				if out.Ipv6 == nil {
					out.Ipv6 = new(string)
				}
				*out.Ipv6 = string(in.String())
			}
		case "port":
			if in.IsNull() {
				in.Skip()
				out.Port = nil
			} else {
				if out.Port == nil {
					out.Port = new(int32)
				}
				*out.Port = int32(in.Int32())
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTrace1(out *jwriter.Writer, in trace.Endpoint) {
	out.RawByte('{')
	first := true
	_ = first
	if in.ServiceName != nil {
		const prefix string = ",\"serviceName\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.ServiceName))
	}
	if in.Ipv4 != nil {
		const prefix string = ",\"ipv4\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Ipv4))
	}
	if in.Ipv6 != nil {
		const prefix string = ",\"ipv6\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Ipv6))
	}
	if in.Port != nil {
		const prefix string = ",\"port\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(*in.Port))
	}
	out.RawByte('}')
}
func easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat1(in *jlexer.Lexer, out *Span) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "traceId":
			out.TraceID = string(in.String())
		case "name":
			if in.IsNull() {
				in.Skip()
				out.Name = nil
			} else {
				if out.Name == nil {
					out.Name = new(string)
				}
				*out.Name = string(in.String())
			}
		case "parentId":
			if in.IsNull() {
				in.Skip()
				out.ParentID = nil
			} else {
				if out.ParentID == nil {
					out.ParentID = new(string)
				}
				*out.ParentID = string(in.String())
			}
		case "id":
			out.ID = string(in.String())
		case "kind":
			if in.IsNull() {
				in.Skip()
				out.Kind = nil
			} else {
				if out.Kind == nil {
					out.Kind = new(string)
				}
				*out.Kind = string(in.String())
			}
		case "timestamp":
			if in.IsNull() {
				in.Skip()
				out.Timestamp = nil
			} else {
				if out.Timestamp == nil {
					out.Timestamp = new(int64)
				}
				*out.Timestamp = int64(in.Int64())
			}
		case "duration":
			if in.IsNull() {
				in.Skip()
				out.Duration = nil
			} else {
				if out.Duration == nil {
					out.Duration = new(int64)
				}
				*out.Duration = int64(in.Int64())
			}
		case "debug":
			if in.IsNull() {
				in.Skip()
				out.Debug = nil
			} else {
				if out.Debug == nil {
					out.Debug = new(bool)
				}
				*out.Debug = bool(in.Bool())
			}
		case "shared":
			if in.IsNull() {
				in.Skip()
				out.Shared = nil
			} else {
				if out.Shared == nil {
					out.Shared = new(bool)
				}
				*out.Shared = bool(in.Bool())
			}
		case "localEndpoint":
			if in.IsNull() {
				in.Skip()
				out.LocalEndpoint = nil
			} else {
				if out.LocalEndpoint == nil {
					out.LocalEndpoint = new(trace.Endpoint)
				}
				easyjson72863a49DecodeGithubComSignalfxGolibTrace1(in, &*out.LocalEndpoint)
			}
		case "remoteEndpoint":
			if in.IsNull() {
				in.Skip()
				out.RemoteEndpoint = nil
			} else {
				if out.RemoteEndpoint == nil {
					out.RemoteEndpoint = new(trace.Endpoint)
				}
				easyjson72863a49DecodeGithubComSignalfxGolibTrace1(in, &*out.RemoteEndpoint)
			}
		case "annotations":
			if in.IsNull() {
				in.Skip()
				out.Annotations = nil
			} else {
				in.Delim('[')
				if out.Annotations == nil {
					if !in.IsDelim(']') {
						out.Annotations = make([]*trace.Annotation, 0, 8)
					} else {
						out.Annotations = []*trace.Annotation{}
					}
				} else {
					out.Annotations = (out.Annotations)[:0]
				}
				for !in.IsDelim(']') {
					var v9 *trace.Annotation
					if in.IsNull() {
						in.Skip()
						v9 = nil
					} else {
						if v9 == nil {
							v9 = new(trace.Annotation)
						}
						easyjson72863a49DecodeGithubComSignalfxGolibTrace2(in, &*v9)
					}
					out.Annotations = append(out.Annotations, v9)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "tags":
			if in.IsNull() {
				in.Skip()
			} else {
				in.Delim('{')
				if !in.IsDelim('}') {
					out.Tags = make(map[string]string)
				} else {
					out.Tags = nil
				}
				for !in.IsDelim('}') {
					key := string(in.String())
					in.WantColon()
					var v10 string
					v10 = string(in.String())
					(out.Tags)[key] = v10
					in.WantComma()
				}
				in.Delim('}')
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat1(out *jwriter.Writer, in Span) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"traceId\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.TraceID))
	}
	if in.Name != nil {
		const prefix string = ",\"name\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Name))
	}
	if in.ParentID != nil {
		const prefix string = ",\"parentId\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.ParentID))
	}
	{
		const prefix string = ",\"id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ID))
	}
	if in.Kind != nil {
		const prefix string = ",\"kind\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Kind))
	}
	if in.Timestamp != nil {
		const prefix string = ",\"timestamp\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int64(int64(*in.Timestamp))
	}
	if in.Duration != nil {
		const prefix string = ",\"duration\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int64(int64(*in.Duration))
	}
	if in.Debug != nil {
		const prefix string = ",\"debug\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(*in.Debug))
	}
	if in.Shared != nil {
		const prefix string = ",\"shared\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(*in.Shared))
	}
	if in.LocalEndpoint != nil {
		const prefix string = ",\"localEndpoint\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		easyjson72863a49EncodeGithubComSignalfxGolibTrace1(out, *in.LocalEndpoint)
	}
	if in.RemoteEndpoint != nil {
		const prefix string = ",\"remoteEndpoint\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		easyjson72863a49EncodeGithubComSignalfxGolibTrace1(out, *in.RemoteEndpoint)
	}
	if len(in.Annotations) != 0 {
		const prefix string = ",\"annotations\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v11, v12 := range in.Annotations {
				if v11 > 0 {
					out.RawByte(',')
				}
				if v12 == nil {
					out.RawString("null")
				} else {
					easyjson72863a49EncodeGithubComSignalfxGolibTrace2(out, *v12)
				}
			}
			out.RawByte(']')
		}
	}
	if len(in.Tags) != 0 {
		const prefix string = ",\"tags\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('{')
			v13First := true
			for v13Name, v13Value := range in.Tags {
				if v13First {
					v13First = false
				} else {
					out.RawByte(',')
				}
				out.String(string(v13Name))
				out.RawByte(':')
				out.String(string(v13Value))
			}
			out.RawByte('}')
		}
	}
	out.RawByte('}')
}

// MarshalJSON supports json.Marshaler interface
func (v Span) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Span) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat1(w, v)
}

// UnmarshalJSON supports json.Unmarshaler interface
func (v *Span) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat1(&r, v)
	return r.Error()
}

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Span) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat1(l, v)
}
func easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat2(in *jlexer.Lexer, out *Endpoint) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "serviceName":
			if in.IsNull() {
				in.Skip()
				out.ServiceName = nil
			} else {
				if out.ServiceName == nil {
					out.ServiceName = new(string)
				}
				*out.ServiceName = string(in.String())
			}
		case "ipv4":
			if in.IsNull() {
				in.Skip()
				out.Ipv4 = nil
			} else {
				if out.Ipv4 == nil {
					out.Ipv4 = new(string)
				}
				*out.Ipv4 = string(in.String())
			}
		case "ipv6":
			if in.IsNull() {
				in.Skip()
				out.Ipv6 = nil
			} else {
				if out.Ipv6 == nil {
					out.Ipv6 = new(string)
				}
				*out.Ipv6 = string(in.String())
			}
		case "port":
			if in.IsNull() {
				in.Skip()
				out.Port = nil
			} else {
				if out.Port == nil {
					out.Port = new(int32)
				}
				*out.Port = int32(in.Int32())
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat2(out *jwriter.Writer, in Endpoint) {
	out.RawByte('{')
	first := true
	_ = first
	if in.ServiceName != nil {
		const prefix string = ",\"serviceName\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.ServiceName))
	}
	if in.Ipv4 != nil {
		const prefix string = ",\"ipv4\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Ipv4))
	}
	if in.Ipv6 != nil {
		const prefix string = ",\"ipv6\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Ipv6))
	}
	if in.Port != nil {
		const prefix string = ",\"port\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(*in.Port))
	}
	out.RawByte('}')
}

// MarshalJSON supports json.Marshaler interface
func (v Endpoint) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Endpoint) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat2(w, v)
}

// UnmarshalJSON supports json.Unmarshaler interface
func (v *Endpoint) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat2(&r, v)
	return r.Error()
}

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Endpoint) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat2(l, v)
}
func easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat3(in *jlexer.Lexer, out *Annotation) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "timestamp":
			if in.IsNull() {
				in.Skip()
				out.Timestamp = nil
			} else {
				if out.Timestamp == nil {
					out.Timestamp = new(int64)
				}
				*out.Timestamp = int64(in.Int64())
			}
		case "value":
			if in.IsNull() {
				in.Skip()
				out.Value = nil
			} else {
				if out.Value == nil {
					out.Value = new(string)
				}
				*out.Value = string(in.String())
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat3(out *jwriter.Writer, in Annotation) {
	out.RawByte('{')
	first := true
	_ = first
	if in.Timestamp != nil {
		const prefix string = ",\"timestamp\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int64(int64(*in.Timestamp))
	}
	if in.Value != nil {
		const prefix string = ",\"value\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(*in.Value))
	}
	out.RawByte('}')
}

// MarshalJSON supports json.Marshaler interface
func (v Annotation) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat3(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Annotation) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat3(w, v)
}

// UnmarshalJSON supports json.Unmarshaler interface
func (v *Annotation) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat3(&r, v)
	return r.Error()
}

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Annotation) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat3(l, v)
}
