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

package coverage

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

// DecodeMsg implements msgp.Decodable
func (z *ciTestCovPayload) 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 "version":
			z.Version, err = dc.ReadInt32()
			if err != nil {
				err = msgp.WrapError(err, "Version")
				return
			}
		case "coverages":
			err = z.Coverages.DecodeMsg(dc)
			if err != nil {
				err = msgp.WrapError(err, "Coverages")
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *ciTestCovPayload) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 2
	// write "version"
	err = en.Append(0x82, 0xa7, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	if err != nil {
		return
	}
	err = en.WriteInt32(z.Version)
	if err != nil {
		err = msgp.WrapError(err, "Version")
		return
	}
	// write "coverages"
	err = en.Append(0xa9, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x73)
	if err != nil {
		return
	}
	err = z.Coverages.EncodeMsg(en)
	if err != nil {
		err = msgp.WrapError(err, "Coverages")
		return
	}
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *ciTestCovPayload) Msgsize() (s int) {
	s = 1 + 8 + msgp.Int32Size + 10 + z.Coverages.Msgsize()
	return
}

// DecodeMsg implements msgp.Decodable
func (z *ciTestCoverageData) 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 "test_session_id":
			z.SessionID, err = dc.ReadUint64()
			if err != nil {
				err = msgp.WrapError(err, "SessionID")
				return
			}
		case "test_suite_id":
			z.SuiteID, err = dc.ReadUint64()
			if err != nil {
				err = msgp.WrapError(err, "SuiteID")
				return
			}
		case "span_id":
			z.SpanID, err = dc.ReadUint64()
			if err != nil {
				err = msgp.WrapError(err, "SpanID")
				return
			}
		case "files":
			var zb0002 uint32
			zb0002, err = dc.ReadArrayHeader()
			if err != nil {
				err = msgp.WrapError(err, "Files")
				return
			}
			if cap(z.Files) >= int(zb0002) {
				z.Files = (z.Files)[:zb0002]
			} else {
				z.Files = make([]*ciTestCoverageFile, zb0002)
			}
			for za0001 := range z.Files {
				if dc.IsNil() {
					err = dc.ReadNil()
					if err != nil {
						err = msgp.WrapError(err, "Files", za0001)
						return
					}
					z.Files[za0001] = nil
				} else {
					if z.Files[za0001] == nil {
						z.Files[za0001] = new(ciTestCoverageFile)
					}
					var zb0003 uint32
					zb0003, err = dc.ReadMapHeader()
					if err != nil {
						err = msgp.WrapError(err, "Files", za0001)
						return
					}
					for zb0003 > 0 {
						zb0003--
						field, err = dc.ReadMapKeyPtr()
						if err != nil {
							err = msgp.WrapError(err, "Files", za0001)
							return
						}
						switch msgp.UnsafeString(field) {
						case "filename":
							z.Files[za0001].FileName, err = dc.ReadString()
							if err != nil {
								err = msgp.WrapError(err, "Files", za0001, "FileName")
								return
							}
						default:
							err = dc.Skip()
							if err != nil {
								err = msgp.WrapError(err, "Files", za0001)
								return
							}
						}
					}
				}
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *ciTestCoverageData) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 4
	// write "test_session_id"
	err = en.Append(0x84, 0xaf, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64)
	if err != nil {
		return
	}
	err = en.WriteUint64(z.SessionID)
	if err != nil {
		err = msgp.WrapError(err, "SessionID")
		return
	}
	// write "test_suite_id"
	err = en.Append(0xad, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x75, 0x69, 0x74, 0x65, 0x5f, 0x69, 0x64)
	if err != nil {
		return
	}
	err = en.WriteUint64(z.SuiteID)
	if err != nil {
		err = msgp.WrapError(err, "SuiteID")
		return
	}
	// write "span_id"
	err = en.Append(0xa7, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64)
	if err != nil {
		return
	}
	err = en.WriteUint64(z.SpanID)
	if err != nil {
		err = msgp.WrapError(err, "SpanID")
		return
	}
	// write "files"
	err = en.Append(0xa5, 0x66, 0x69, 0x6c, 0x65, 0x73)
	if err != nil {
		return
	}
	err = en.WriteArrayHeader(uint32(len(z.Files)))
	if err != nil {
		err = msgp.WrapError(err, "Files")
		return
	}
	for za0001 := range z.Files {
		if z.Files[za0001] == nil {
			err = en.WriteNil()
			if err != nil {
				return
			}
		} else {
			// map header, size 1
			// write "filename"
			err = en.Append(0x81, 0xa8, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65)
			if err != nil {
				return
			}
			err = en.WriteString(z.Files[za0001].FileName)
			if err != nil {
				err = msgp.WrapError(err, "Files", za0001, "FileName")
				return
			}
		}
	}
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *ciTestCoverageData) Msgsize() (s int) {
	s = 1 + 16 + msgp.Uint64Size + 14 + msgp.Uint64Size + 8 + msgp.Uint64Size + 6 + msgp.ArrayHeaderSize
	for za0001 := range z.Files {
		if z.Files[za0001] == nil {
			s += msgp.NilSize
		} else {
			s += 1 + 9 + msgp.StringPrefixSize + len(z.Files[za0001].FileName)
		}
	}
	return
}

// DecodeMsg implements msgp.Decodable
func (z *ciTestCoverageFile) 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 "filename":
			z.FileName, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "FileName")
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z ciTestCoverageFile) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 1
	// write "filename"
	err = en.Append(0x81, 0xa8, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65)
	if err != nil {
		return
	}
	err = en.WriteString(z.FileName)
	if err != nil {
		err = msgp.WrapError(err, "FileName")
		return
	}
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z ciTestCoverageFile) Msgsize() (s int) {
	s = 1 + 9 + msgp.StringPrefixSize + len(z.FileName)
	return
}

// DecodeMsg implements msgp.Decodable
func (z *ciTestCoveragePayloads) DecodeMsg(dc *msgp.Reader) (err error) {
	var zb0002 uint32
	zb0002, err = dc.ReadArrayHeader()
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	if cap((*z)) >= int(zb0002) {
		(*z) = (*z)[:zb0002]
	} else {
		(*z) = make(ciTestCoveragePayloads, zb0002)
	}
	for zb0001 := range *z {
		if dc.IsNil() {
			err = dc.ReadNil()
			if err != nil {
				err = msgp.WrapError(err, zb0001)
				return
			}
			(*z)[zb0001] = nil
		} else {
			if (*z)[zb0001] == nil {
				(*z)[zb0001] = new(ciTestCovPayload)
			}
			var field []byte
			_ = field
			var zb0003 uint32
			zb0003, err = dc.ReadMapHeader()
			if err != nil {
				err = msgp.WrapError(err, zb0001)
				return
			}
			for zb0003 > 0 {
				zb0003--
				field, err = dc.ReadMapKeyPtr()
				if err != nil {
					err = msgp.WrapError(err, zb0001)
					return
				}
				switch msgp.UnsafeString(field) {
				case "version":
					(*z)[zb0001].Version, err = dc.ReadInt32()
					if err != nil {
						err = msgp.WrapError(err, zb0001, "Version")
						return
					}
				case "coverages":
					err = (*z)[zb0001].Coverages.DecodeMsg(dc)
					if err != nil {
						err = msgp.WrapError(err, zb0001, "Coverages")
						return
					}
				default:
					err = dc.Skip()
					if err != nil {
						err = msgp.WrapError(err, zb0001)
						return
					}
				}
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z ciTestCoveragePayloads) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	for zb0004 := range z {
		if z[zb0004] == nil {
			err = en.WriteNil()
			if err != nil {
				return
			}
		} else {
			// map header, size 2
			// write "version"
			err = en.Append(0x82, 0xa7, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
			if err != nil {
				return
			}
			err = en.WriteInt32(z[zb0004].Version)
			if err != nil {
				err = msgp.WrapError(err, zb0004, "Version")
				return
			}
			// write "coverages"
			err = en.Append(0xa9, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x73)
			if err != nil {
				return
			}
			err = z[zb0004].Coverages.EncodeMsg(en)
			if err != nil {
				err = msgp.WrapError(err, zb0004, "Coverages")
				return
			}
		}
	}
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z ciTestCoveragePayloads) Msgsize() (s int) {
	s = msgp.ArrayHeaderSize
	for zb0004 := range z {
		if z[zb0004] == nil {
			s += msgp.NilSize
		} else {
			s += 1 + 8 + msgp.Int32Size + 10 + z[zb0004].Coverages.Msgsize()
		}
	}
	return
}

// DecodeMsg implements msgp.Decodable
func (z *ciTestCoverages) DecodeMsg(dc *msgp.Reader) (err error) {
	var zb0002 uint32
	zb0002, err = dc.ReadArrayHeader()
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	if cap((*z)) >= int(zb0002) {
		(*z) = (*z)[:zb0002]
	} else {
		(*z) = make(ciTestCoverages, zb0002)
	}
	for zb0001 := range *z {
		if dc.IsNil() {
			err = dc.ReadNil()
			if err != nil {
				err = msgp.WrapError(err, zb0001)
				return
			}
			(*z)[zb0001] = nil
		} else {
			if (*z)[zb0001] == nil {
				(*z)[zb0001] = new(ciTestCoverageData)
			}
			err = (*z)[zb0001].DecodeMsg(dc)
			if err != nil {
				err = msgp.WrapError(err, zb0001)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z ciTestCoverages) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteArrayHeader(uint32(len(z)))
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	for zb0003 := range z {
		if z[zb0003] == nil {
			err = en.WriteNil()
			if err != nil {
				return
			}
		} else {
			err = z[zb0003].EncodeMsg(en)
			if err != nil {
				err = msgp.WrapError(err, zb0003)
				return
			}
		}
	}
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z ciTestCoverages) Msgsize() (s int) {
	s = msgp.ArrayHeaderSize
	for zb0003 := range z {
		if z[zb0003] == nil {
			s += msgp.NilSize
		} else {
			s += z[zb0003].Msgsize()
		}
	}
	return
}
