// Code generated by github.com/tinylib/msgp DO NOT EDIT.

package tracer

import (
	"github.com/tinylib/msgp/msgp"
)

// DecodeMsg implements msgp.Decodable
func (z *Metadata) DecodeMsg(dc *msgp.Reader) (err error) {
	var field []byte
	_ = field
	var zb0001 uint32
	zb0001, err = dc.ReadMapHeader()
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	for zb0001 > 0 {
		zb0001--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "schema_version":
			z.SchemaVersion, err = dc.ReadUint8()
			if err != nil {
				err = msgp.WrapError(err, "SchemaVersion")
				return
			}
		case "runtime_id":
			z.RuntimeID, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "RuntimeID")
				return
			}
		case "tracer_language":
			z.Language, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Language")
				return
			}
		case "tracer_version":
			z.Version, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Version")
				return
			}
		case "hostname":
			z.Hostname, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Hostname")
				return
			}
		case "service_name":
			z.ServiceName, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "ServiceName")
				return
			}
		case "service_env":
			z.ServiceEnvironment, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "ServiceEnvironment")
				return
			}
		case "service_version":
			z.ServiceVersion, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "ServiceVersion")
				return
			}
		case "process_tags":
			z.ProcessTags, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "ProcessTags")
				return
			}
		case "container_id":
			z.ContainerID, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "ContainerID")
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *Metadata) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 10
	// write "schema_version"
	err = en.Append(0x8a, 0xae, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	if err != nil {
		return
	}
	err = en.WriteUint8(z.SchemaVersion)
	if err != nil {
		err = msgp.WrapError(err, "SchemaVersion")
		return
	}
	// write "runtime_id"
	err = en.Append(0xaa, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x64)
	if err != nil {
		return
	}
	err = en.WriteString(z.RuntimeID)
	if err != nil {
		err = msgp.WrapError(err, "RuntimeID")
		return
	}
	// write "tracer_language"
	err = en.Append(0xaf, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65)
	if err != nil {
		return
	}
	err = en.WriteString(z.Language)
	if err != nil {
		err = msgp.WrapError(err, "Language")
		return
	}
	// write "tracer_version"
	err = en.Append(0xae, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	if err != nil {
		return
	}
	err = en.WriteString(z.Version)
	if err != nil {
		err = msgp.WrapError(err, "Version")
		return
	}
	// write "hostname"
	err = en.Append(0xa8, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65)
	if err != nil {
		return
	}
	err = en.WriteString(z.Hostname)
	if err != nil {
		err = msgp.WrapError(err, "Hostname")
		return
	}
	// write "service_name"
	err = en.Append(0xac, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65)
	if err != nil {
		return
	}
	err = en.WriteString(z.ServiceName)
	if err != nil {
		err = msgp.WrapError(err, "ServiceName")
		return
	}
	// write "service_env"
	err = en.Append(0xab, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x76)
	if err != nil {
		return
	}
	err = en.WriteString(z.ServiceEnvironment)
	if err != nil {
		err = msgp.WrapError(err, "ServiceEnvironment")
		return
	}
	// write "service_version"
	err = en.Append(0xaf, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	if err != nil {
		return
	}
	err = en.WriteString(z.ServiceVersion)
	if err != nil {
		err = msgp.WrapError(err, "ServiceVersion")
		return
	}
	// write "process_tags"
	err = en.Append(0xac, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x61, 0x67, 0x73)
	if err != nil {
		return
	}
	err = en.WriteString(z.ProcessTags)
	if err != nil {
		err = msgp.WrapError(err, "ProcessTags")
		return
	}
	// write "container_id"
	err = en.Append(0xac, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64)
	if err != nil {
		return
	}
	err = en.WriteString(z.ContainerID)
	if err != nil {
		err = msgp.WrapError(err, "ContainerID")
		return
	}
	return
}

// MarshalMsg implements msgp.Marshaler
func (z *Metadata) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 10
	// string "schema_version"
	o = append(o, 0x8a, 0xae, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	o = msgp.AppendUint8(o, z.SchemaVersion)
	// string "runtime_id"
	o = append(o, 0xaa, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x64)
	o = msgp.AppendString(o, z.RuntimeID)
	// string "tracer_language"
	o = append(o, 0xaf, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65)
	o = msgp.AppendString(o, z.Language)
	// string "tracer_version"
	o = append(o, 0xae, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	o = msgp.AppendString(o, z.Version)
	// string "hostname"
	o = append(o, 0xa8, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65)
	o = msgp.AppendString(o, z.Hostname)
	// string "service_name"
	o = append(o, 0xac, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65)
	o = msgp.AppendString(o, z.ServiceName)
	// string "service_env"
	o = append(o, 0xab, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x76)
	o = msgp.AppendString(o, z.ServiceEnvironment)
	// string "service_version"
	o = append(o, 0xaf, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	o = msgp.AppendString(o, z.ServiceVersion)
	// string "process_tags"
	o = append(o, 0xac, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x61, 0x67, 0x73)
	o = msgp.AppendString(o, z.ProcessTags)
	// string "container_id"
	o = append(o, 0xac, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64)
	o = msgp.AppendString(o, z.ContainerID)
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *Metadata) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var zb0001 uint32
	zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	for zb0001 > 0 {
		zb0001--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "schema_version":
			z.SchemaVersion, bts, err = msgp.ReadUint8Bytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "SchemaVersion")
				return
			}
		case "runtime_id":
			z.RuntimeID, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "RuntimeID")
				return
			}
		case "tracer_language":
			z.Language, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Language")
				return
			}
		case "tracer_version":
			z.Version, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Version")
				return
			}
		case "hostname":
			z.Hostname, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Hostname")
				return
			}
		case "service_name":
			z.ServiceName, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ServiceName")
				return
			}
		case "service_env":
			z.ServiceEnvironment, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ServiceEnvironment")
				return
			}
		case "service_version":
			z.ServiceVersion, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ServiceVersion")
				return
			}
		case "process_tags":
			z.ProcessTags, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ProcessTags")
				return
			}
		case "container_id":
			z.ContainerID, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ContainerID")
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	o = bts
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Metadata) Msgsize() (s int) {
	s = 1 + 15 + msgp.Uint8Size + 11 + msgp.StringPrefixSize + len(z.RuntimeID) + 16 + msgp.StringPrefixSize + len(z.Language) + 15 + msgp.StringPrefixSize + len(z.Version) + 9 + msgp.StringPrefixSize + len(z.Hostname) + 13 + msgp.StringPrefixSize + len(z.ServiceName) + 12 + msgp.StringPrefixSize + len(z.ServiceEnvironment) + 16 + msgp.StringPrefixSize + len(z.ServiceVersion) + 13 + msgp.StringPrefixSize + len(z.ProcessTags) + 13 + msgp.StringPrefixSize + len(z.ContainerID)
	return
}
