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

package main

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

// DecodeMsg implements msgp.Decodable
func (z *CachedData) 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 "Packages":
			var zb0002 uint32
			zb0002, err = dc.ReadMapHeader()
			if err != nil {
				err = msgp.WrapError(err, "Packages")
				return
			}
			if z.Packages == nil {
				z.Packages = make(map[string]Package, zb0002)
			} else if len(z.Packages) > 0 {
				clear(z.Packages)
			}
			for zb0002 > 0 {
				zb0002--
				var za0001 string
				za0001, err = dc.ReadString()
				if err != nil {
					err = msgp.WrapError(err, "Packages")
					return
				}
				var za0002 Package
				err = za0002.DecodeMsg(dc)
				if err != nil {
					err = msgp.WrapError(err, "Packages", za0001)
					return
				}
				z.Packages[za0001] = za0002
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *CachedData) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 1
	// write "Packages"
	err = en.Append(0x81, 0xa8, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73)
	if err != nil {
		return
	}
	err = en.WriteMapHeader(uint32(len(z.Packages)))
	if err != nil {
		err = msgp.WrapError(err, "Packages")
		return
	}
	for za0001, za0002 := range z.Packages {
		err = en.WriteString(za0001)
		if err != nil {
			err = msgp.WrapError(err, "Packages")
			return
		}
		err = za0002.EncodeMsg(en)
		if err != nil {
			err = msgp.WrapError(err, "Packages", za0001)
			return
		}
	}
	return
}

// MarshalMsg implements msgp.Marshaler
func (z *CachedData) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 1
	// string "Packages"
	o = append(o, 0x81, 0xa8, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73)
	o = msgp.AppendMapHeader(o, uint32(len(z.Packages)))
	for za0001, za0002 := range z.Packages {
		o = msgp.AppendString(o, za0001)
		o, err = za0002.MarshalMsg(o)
		if err != nil {
			err = msgp.WrapError(err, "Packages", za0001)
			return
		}
	}
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *CachedData) 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 "Packages":
			var zb0002 uint32
			zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Packages")
				return
			}
			if z.Packages == nil {
				z.Packages = make(map[string]Package, zb0002)
			} else if len(z.Packages) > 0 {
				clear(z.Packages)
			}
			for zb0002 > 0 {
				var za0002 Package
				zb0002--
				var za0001 string
				za0001, bts, err = msgp.ReadStringBytes(bts)
				if err != nil {
					err = msgp.WrapError(err, "Packages")
					return
				}
				bts, err = za0002.UnmarshalMsg(bts)
				if err != nil {
					err = msgp.WrapError(err, "Packages", za0001)
					return
				}
				z.Packages[za0001] = za0002
			}
		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 *CachedData) Msgsize() (s int) {
	s = 1 + 9 + msgp.MapHeaderSize
	if z.Packages != nil {
		for za0001, za0002 := range z.Packages {
			_ = za0002
			s += msgp.StringPrefixSize + len(za0001) + za0002.Msgsize()
		}
	}
	return
}

// DecodeMsg implements msgp.Decodable
func (z *Package) 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 "Name":
			z.Name, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Name")
				return
			}
		case "Description":
			z.Description, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Description")
				return
			}
		case "Repository":
			z.Repository, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Repository")
				return
			}
		case "Version":
			z.Version, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Version")
				return
			}
		case "Installed":
			z.Installed, err = dc.ReadBool()
			if err != nil {
				err = msgp.WrapError(err, "Installed")
				return
			}
		case "FullInfo":
			z.FullInfo, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "FullInfo")
				return
			}
		case "URL":
			z.URL, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "URL")
				return
			}
		case "URLPath":
			z.URLPath, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "URLPath")
				return
			}
		case "Maintainer":
			z.Maintainer, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Maintainer")
				return
			}
		case "Submitter":
			z.Submitter, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "Submitter")
				return
			}
		case "NumVotes":
			z.NumVotes, err = dc.ReadInt()
			if err != nil {
				err = msgp.WrapError(err, "NumVotes")
				return
			}
		case "Popularity":
			z.Popularity, err = dc.ReadFloat64()
			if err != nil {
				err = msgp.WrapError(err, "Popularity")
				return
			}
		case "FirstSubmitted":
			z.FirstSubmitted, err = dc.ReadInt64()
			if err != nil {
				err = msgp.WrapError(err, "FirstSubmitted")
				return
			}
		case "LastModified":
			z.LastModified, err = dc.ReadInt64()
			if err != nil {
				err = msgp.WrapError(err, "LastModified")
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *Package) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 14
	// write "Name"
	err = en.Append(0x8e, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return
	}
	err = en.WriteString(z.Name)
	if err != nil {
		err = msgp.WrapError(err, "Name")
		return
	}
	// write "Description"
	err = en.Append(0xab, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e)
	if err != nil {
		return
	}
	err = en.WriteString(z.Description)
	if err != nil {
		err = msgp.WrapError(err, "Description")
		return
	}
	// write "Repository"
	err = en.Append(0xaa, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79)
	if err != nil {
		return
	}
	err = en.WriteString(z.Repository)
	if err != nil {
		err = msgp.WrapError(err, "Repository")
		return
	}
	// write "Version"
	err = en.Append(0xa7, 0x56, 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 "Installed"
	err = en.Append(0xa9, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64)
	if err != nil {
		return
	}
	err = en.WriteBool(z.Installed)
	if err != nil {
		err = msgp.WrapError(err, "Installed")
		return
	}
	// write "FullInfo"
	err = en.Append(0xa8, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f)
	if err != nil {
		return
	}
	err = en.WriteString(z.FullInfo)
	if err != nil {
		err = msgp.WrapError(err, "FullInfo")
		return
	}
	// write "URL"
	err = en.Append(0xa3, 0x55, 0x52, 0x4c)
	if err != nil {
		return
	}
	err = en.WriteString(z.URL)
	if err != nil {
		err = msgp.WrapError(err, "URL")
		return
	}
	// write "URLPath"
	err = en.Append(0xa7, 0x55, 0x52, 0x4c, 0x50, 0x61, 0x74, 0x68)
	if err != nil {
		return
	}
	err = en.WriteString(z.URLPath)
	if err != nil {
		err = msgp.WrapError(err, "URLPath")
		return
	}
	// write "Maintainer"
	err = en.Append(0xaa, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72)
	if err != nil {
		return
	}
	err = en.WriteString(z.Maintainer)
	if err != nil {
		err = msgp.WrapError(err, "Maintainer")
		return
	}
	// write "Submitter"
	err = en.Append(0xa9, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72)
	if err != nil {
		return
	}
	err = en.WriteString(z.Submitter)
	if err != nil {
		err = msgp.WrapError(err, "Submitter")
		return
	}
	// write "NumVotes"
	err = en.Append(0xa8, 0x4e, 0x75, 0x6d, 0x56, 0x6f, 0x74, 0x65, 0x73)
	if err != nil {
		return
	}
	err = en.WriteInt(z.NumVotes)
	if err != nil {
		err = msgp.WrapError(err, "NumVotes")
		return
	}
	// write "Popularity"
	err = en.Append(0xaa, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79)
	if err != nil {
		return
	}
	err = en.WriteFloat64(z.Popularity)
	if err != nil {
		err = msgp.WrapError(err, "Popularity")
		return
	}
	// write "FirstSubmitted"
	err = en.Append(0xae, 0x46, 0x69, 0x72, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64)
	if err != nil {
		return
	}
	err = en.WriteInt64(z.FirstSubmitted)
	if err != nil {
		err = msgp.WrapError(err, "FirstSubmitted")
		return
	}
	// write "LastModified"
	err = en.Append(0xac, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64)
	if err != nil {
		return
	}
	err = en.WriteInt64(z.LastModified)
	if err != nil {
		err = msgp.WrapError(err, "LastModified")
		return
	}
	return
}

// MarshalMsg implements msgp.Marshaler
func (z *Package) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 14
	// string "Name"
	o = append(o, 0x8e, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
	o = msgp.AppendString(o, z.Name)
	// string "Description"
	o = append(o, 0xab, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e)
	o = msgp.AppendString(o, z.Description)
	// string "Repository"
	o = append(o, 0xaa, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79)
	o = msgp.AppendString(o, z.Repository)
	// string "Version"
	o = append(o, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
	o = msgp.AppendString(o, z.Version)
	// string "Installed"
	o = append(o, 0xa9, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64)
	o = msgp.AppendBool(o, z.Installed)
	// string "FullInfo"
	o = append(o, 0xa8, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f)
	o = msgp.AppendString(o, z.FullInfo)
	// string "URL"
	o = append(o, 0xa3, 0x55, 0x52, 0x4c)
	o = msgp.AppendString(o, z.URL)
	// string "URLPath"
	o = append(o, 0xa7, 0x55, 0x52, 0x4c, 0x50, 0x61, 0x74, 0x68)
	o = msgp.AppendString(o, z.URLPath)
	// string "Maintainer"
	o = append(o, 0xaa, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72)
	o = msgp.AppendString(o, z.Maintainer)
	// string "Submitter"
	o = append(o, 0xa9, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72)
	o = msgp.AppendString(o, z.Submitter)
	// string "NumVotes"
	o = append(o, 0xa8, 0x4e, 0x75, 0x6d, 0x56, 0x6f, 0x74, 0x65, 0x73)
	o = msgp.AppendInt(o, z.NumVotes)
	// string "Popularity"
	o = append(o, 0xaa, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79)
	o = msgp.AppendFloat64(o, z.Popularity)
	// string "FirstSubmitted"
	o = append(o, 0xae, 0x46, 0x69, 0x72, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64)
	o = msgp.AppendInt64(o, z.FirstSubmitted)
	// string "LastModified"
	o = append(o, 0xac, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64)
	o = msgp.AppendInt64(o, z.LastModified)
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *Package) 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 "Name":
			z.Name, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Name")
				return
			}
		case "Description":
			z.Description, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Description")
				return
			}
		case "Repository":
			z.Repository, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Repository")
				return
			}
		case "Version":
			z.Version, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Version")
				return
			}
		case "Installed":
			z.Installed, bts, err = msgp.ReadBoolBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Installed")
				return
			}
		case "FullInfo":
			z.FullInfo, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "FullInfo")
				return
			}
		case "URL":
			z.URL, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "URL")
				return
			}
		case "URLPath":
			z.URLPath, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "URLPath")
				return
			}
		case "Maintainer":
			z.Maintainer, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Maintainer")
				return
			}
		case "Submitter":
			z.Submitter, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Submitter")
				return
			}
		case "NumVotes":
			z.NumVotes, bts, err = msgp.ReadIntBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "NumVotes")
				return
			}
		case "Popularity":
			z.Popularity, bts, err = msgp.ReadFloat64Bytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Popularity")
				return
			}
		case "FirstSubmitted":
			z.FirstSubmitted, bts, err = msgp.ReadInt64Bytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "FirstSubmitted")
				return
			}
		case "LastModified":
			z.LastModified, bts, err = msgp.ReadInt64Bytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "LastModified")
				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 *Package) Msgsize() (s int) {
	s = 1 + 5 + msgp.StringPrefixSize + len(z.Name) + 12 + msgp.StringPrefixSize + len(z.Description) + 11 + msgp.StringPrefixSize + len(z.Repository) + 8 + msgp.StringPrefixSize + len(z.Version) + 10 + msgp.BoolSize + 9 + msgp.StringPrefixSize + len(z.FullInfo) + 4 + msgp.StringPrefixSize + len(z.URL) + 8 + msgp.StringPrefixSize + len(z.URLPath) + 11 + msgp.StringPrefixSize + len(z.Maintainer) + 10 + msgp.StringPrefixSize + len(z.Submitter) + 9 + msgp.IntSize + 11 + msgp.Float64Size + 15 + msgp.Int64Size + 13 + msgp.Int64Size
	return
}
