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

package webauthn

import (
	"github.com/go-webauthn/webauthn/protocol"
	"github.com/tinylib/msgp/msgp"
)

// DecodeMsg implements msgp.Decodable
func (z *Credential) 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
	}
	var zb0001Mask uint8 /* 3 bits */
	_ = zb0001Mask
	for zb0001 > 0 {
		zb0001--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "id":
			z.ID, err = dc.ReadBytes(z.ID)
			if err != nil {
				err = msgp.WrapError(err, "ID")
				return
			}
		case "pk":
			z.PublicKey, err = dc.ReadBytes(z.PublicKey)
			if err != nil {
				err = msgp.WrapError(err, "PublicKey")
				return
			}
		case "atttype":
			z.AttestationType, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "AttestationType")
				return
			}
			zb0001Mask |= 0x1
		case "attfmt":
			z.AttestationFormat, err = dc.ReadString()
			if err != nil {
				err = msgp.WrapError(err, "AttestationFormat")
				return
			}
			zb0001Mask |= 0x2
		case "t":
			var zb0002 uint32
			zb0002, err = dc.ReadArrayHeader()
			if err != nil {
				err = msgp.WrapError(err, "Transport")
				return
			}
			if cap(z.Transport) >= int(zb0002) {
				z.Transport = (z.Transport)[:zb0002]
			} else {
				z.Transport = make([]protocol.AuthenticatorTransport, zb0002)
			}
			for za0001 := range z.Transport {
				{
					var zb0003 string
					zb0003, err = dc.ReadString()
					if err != nil {
						err = msgp.WrapError(err, "Transport", za0001)
						return
					}
					z.Transport[za0001] = protocol.AuthenticatorTransport(zb0003)
				}
			}
			zb0001Mask |= 0x4
		case "flg":
			{
				var zb0004 byte
				zb0004, err = dc.ReadByte()
				if err != nil {
					err = msgp.WrapError(err, "Flags")
					return
				}
				z.Flags = CredentialFlagsFromMsgpByte(zb0004)
			}
		case "a":
			err = z.Authenticator.DecodeMsg(dc)
			if err != nil {
				err = msgp.WrapError(err, "Authenticator")
				return
			}
		case "att":
			err = z.Attestation.DecodeMsg(dc)
			if err != nil {
				err = msgp.WrapError(err, "Attestation")
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	// Clear omitted fields.
	if zb0001Mask != 0x7 {
		if (zb0001Mask & 0x1) == 0 {
			z.AttestationType = ""
		}
		if (zb0001Mask & 0x2) == 0 {
			z.AttestationFormat = ""
		}
		if (zb0001Mask & 0x4) == 0 {
			z.Transport = nil
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *Credential) EncodeMsg(en *msgp.Writer) (err error) {
	// check for omitted fields
	zb0001Len := uint32(8)
	var zb0001Mask uint8 /* 8 bits */
	_ = zb0001Mask
	if z.AttestationType == "" {
		zb0001Len--
		zb0001Mask |= 0x4
	}
	if z.AttestationFormat == "" {
		zb0001Len--
		zb0001Mask |= 0x8
	}
	if z.Transport == nil {
		zb0001Len--
		zb0001Mask |= 0x10
	}
	// variable map header, size zb0001Len
	err = en.Append(0x80 | uint8(zb0001Len))
	if err != nil {
		return
	}

	// skip if no fields are to be emitted
	if zb0001Len != 0 {
		// write "id"
		err = en.Append(0xa2, 0x69, 0x64)
		if err != nil {
			return
		}
		err = en.WriteBytes(z.ID)
		if err != nil {
			err = msgp.WrapError(err, "ID")
			return
		}
		// write "pk"
		err = en.Append(0xa2, 0x70, 0x6b)
		if err != nil {
			return
		}
		err = en.WriteBytes(z.PublicKey)
		if err != nil {
			err = msgp.WrapError(err, "PublicKey")
			return
		}
		if (zb0001Mask & 0x4) == 0 { // if not omitted
			// write "atttype"
			err = en.Append(0xa7, 0x61, 0x74, 0x74, 0x74, 0x79, 0x70, 0x65)
			if err != nil {
				return
			}
			err = en.WriteString(z.AttestationType)
			if err != nil {
				err = msgp.WrapError(err, "AttestationType")
				return
			}
		}
		if (zb0001Mask & 0x8) == 0 { // if not omitted
			// write "attfmt"
			err = en.Append(0xa6, 0x61, 0x74, 0x74, 0x66, 0x6d, 0x74)
			if err != nil {
				return
			}
			err = en.WriteString(z.AttestationFormat)
			if err != nil {
				err = msgp.WrapError(err, "AttestationFormat")
				return
			}
		}
		if (zb0001Mask & 0x10) == 0 { // if not omitted
			// write "t"
			err = en.Append(0xa1, 0x74)
			if err != nil {
				return
			}
			err = en.WriteArrayHeader(uint32(len(z.Transport)))
			if err != nil {
				err = msgp.WrapError(err, "Transport")
				return
			}
			for za0001 := range z.Transport {
				err = en.WriteString(string(z.Transport[za0001]))
				if err != nil {
					err = msgp.WrapError(err, "Transport", za0001)
					return
				}
			}
		}
		// write "flg"
		err = en.Append(0xa3, 0x66, 0x6c, 0x67)
		if err != nil {
			return
		}
		err = en.WriteByte((CredentialFlags).MsgpByte(z.Flags))
		if err != nil {
			err = msgp.WrapError(err, "Flags")
			return
		}
		// write "a"
		err = en.Append(0xa1, 0x61)
		if err != nil {
			return
		}
		err = z.Authenticator.EncodeMsg(en)
		if err != nil {
			err = msgp.WrapError(err, "Authenticator")
			return
		}
		// write "att"
		err = en.Append(0xa3, 0x61, 0x74, 0x74)
		if err != nil {
			return
		}
		err = z.Attestation.EncodeMsg(en)
		if err != nil {
			err = msgp.WrapError(err, "Attestation")
			return
		}
	}
	return
}

// MarshalMsg implements msgp.Marshaler
func (z *Credential) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// check for omitted fields
	zb0001Len := uint32(8)
	var zb0001Mask uint8 /* 8 bits */
	_ = zb0001Mask
	if z.AttestationType == "" {
		zb0001Len--
		zb0001Mask |= 0x4
	}
	if z.AttestationFormat == "" {
		zb0001Len--
		zb0001Mask |= 0x8
	}
	if z.Transport == nil {
		zb0001Len--
		zb0001Mask |= 0x10
	}
	// variable map header, size zb0001Len
	o = append(o, 0x80|uint8(zb0001Len))

	// skip if no fields are to be emitted
	if zb0001Len != 0 {
		// string "id"
		o = append(o, 0xa2, 0x69, 0x64)
		o = msgp.AppendBytes(o, z.ID)
		// string "pk"
		o = append(o, 0xa2, 0x70, 0x6b)
		o = msgp.AppendBytes(o, z.PublicKey)
		if (zb0001Mask & 0x4) == 0 { // if not omitted
			// string "atttype"
			o = append(o, 0xa7, 0x61, 0x74, 0x74, 0x74, 0x79, 0x70, 0x65)
			o = msgp.AppendString(o, z.AttestationType)
		}
		if (zb0001Mask & 0x8) == 0 { // if not omitted
			// string "attfmt"
			o = append(o, 0xa6, 0x61, 0x74, 0x74, 0x66, 0x6d, 0x74)
			o = msgp.AppendString(o, z.AttestationFormat)
		}
		if (zb0001Mask & 0x10) == 0 { // if not omitted
			// string "t"
			o = append(o, 0xa1, 0x74)
			o = msgp.AppendArrayHeader(o, uint32(len(z.Transport)))
			for za0001 := range z.Transport {
				o = msgp.AppendString(o, string(z.Transport[za0001]))
			}
		}
		// string "flg"
		o = append(o, 0xa3, 0x66, 0x6c, 0x67)
		o = msgp.AppendByte(o, (CredentialFlags).MsgpByte(z.Flags))
		// string "a"
		o = append(o, 0xa1, 0x61)
		o, err = z.Authenticator.MarshalMsg(o)
		if err != nil {
			err = msgp.WrapError(err, "Authenticator")
			return
		}
		// string "att"
		o = append(o, 0xa3, 0x61, 0x74, 0x74)
		o, err = z.Attestation.MarshalMsg(o)
		if err != nil {
			err = msgp.WrapError(err, "Attestation")
			return
		}
	}
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *Credential) 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
	}
	var zb0001Mask uint8 /* 3 bits */
	_ = zb0001Mask
	for zb0001 > 0 {
		zb0001--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "id":
			z.ID, bts, err = msgp.ReadBytesBytes(bts, z.ID)
			if err != nil {
				err = msgp.WrapError(err, "ID")
				return
			}
		case "pk":
			z.PublicKey, bts, err = msgp.ReadBytesBytes(bts, z.PublicKey)
			if err != nil {
				err = msgp.WrapError(err, "PublicKey")
				return
			}
		case "atttype":
			z.AttestationType, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "AttestationType")
				return
			}
			zb0001Mask |= 0x1
		case "attfmt":
			z.AttestationFormat, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "AttestationFormat")
				return
			}
			zb0001Mask |= 0x2
		case "t":
			var zb0002 uint32
			zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "Transport")
				return
			}
			if cap(z.Transport) >= int(zb0002) {
				z.Transport = (z.Transport)[:zb0002]
			} else {
				z.Transport = make([]protocol.AuthenticatorTransport, zb0002)
			}
			for za0001 := range z.Transport {
				{
					var zb0003 string
					zb0003, bts, err = msgp.ReadStringBytes(bts)
					if err != nil {
						err = msgp.WrapError(err, "Transport", za0001)
						return
					}
					z.Transport[za0001] = protocol.AuthenticatorTransport(zb0003)
				}
			}
			zb0001Mask |= 0x4
		case "flg":
			{
				var zb0004 byte
				zb0004, bts, err = msgp.ReadByteBytes(bts)
				if err != nil {
					err = msgp.WrapError(err, "Flags")
					return
				}
				z.Flags = CredentialFlagsFromMsgpByte(zb0004)
			}
		case "a":
			bts, err = z.Authenticator.UnmarshalMsg(bts)
			if err != nil {
				err = msgp.WrapError(err, "Authenticator")
				return
			}
		case "att":
			bts, err = z.Attestation.UnmarshalMsg(bts)
			if err != nil {
				err = msgp.WrapError(err, "Attestation")
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	// Clear omitted fields.
	if zb0001Mask != 0x7 {
		if (zb0001Mask & 0x1) == 0 {
			z.AttestationType = ""
		}
		if (zb0001Mask & 0x2) == 0 {
			z.AttestationFormat = ""
		}
		if (zb0001Mask & 0x4) == 0 {
			z.Transport = nil
		}
	}
	o = bts
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Credential) Msgsize() (s int) {
	s = 1 + 3 + msgp.BytesPrefixSize + len(z.ID) + 3 + msgp.BytesPrefixSize + len(z.PublicKey) + 8 + msgp.StringPrefixSize + len(z.AttestationType) + 7 + msgp.StringPrefixSize + len(z.AttestationFormat) + 2 + msgp.ArrayHeaderSize
	for za0001 := range z.Transport {
		s += msgp.StringPrefixSize + len(string(z.Transport[za0001]))
	}
	s += 4 + msgp.ByteSize + 2 + z.Authenticator.Msgsize() + 4 + z.Attestation.Msgsize()
	return
}

// DecodeMsg implements msgp.Decodable
func (z *CredentialAttestation) 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
	}
	var zb0001Mask uint8 /* 5 bits */
	_ = zb0001Mask
	for zb0001 > 0 {
		zb0001--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "cdj":
			z.ClientDataJSON, err = dc.ReadBytes(z.ClientDataJSON)
			if err != nil {
				err = msgp.WrapError(err, "ClientDataJSON")
				return
			}
			zb0001Mask |= 0x1
		case "cdh":
			z.ClientDataHash, err = dc.ReadBytes(z.ClientDataHash)
			if err != nil {
				err = msgp.WrapError(err, "ClientDataHash")
				return
			}
			zb0001Mask |= 0x2
		case "data":
			z.AuthenticatorData, err = dc.ReadBytes(z.AuthenticatorData)
			if err != nil {
				err = msgp.WrapError(err, "AuthenticatorData")
				return
			}
			zb0001Mask |= 0x4
		case "alg":
			z.PublicKeyAlgorithm, err = dc.ReadInt64()
			if err != nil {
				err = msgp.WrapError(err, "PublicKeyAlgorithm")
				return
			}
			zb0001Mask |= 0x8
		case "obj":
			z.Object, err = dc.ReadBytes(z.Object)
			if err != nil {
				err = msgp.WrapError(err, "Object")
				return
			}
			zb0001Mask |= 0x10
		default:
			err = dc.Skip()
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	// Clear omitted fields.
	if zb0001Mask != 0x1f {
		if (zb0001Mask & 0x1) == 0 {
			z.ClientDataJSON = nil
		}
		if (zb0001Mask & 0x2) == 0 {
			z.ClientDataHash = nil
		}
		if (zb0001Mask & 0x4) == 0 {
			z.AuthenticatorData = nil
		}
		if (zb0001Mask & 0x8) == 0 {
			z.PublicKeyAlgorithm = 0
		}
		if (zb0001Mask & 0x10) == 0 {
			z.Object = nil
		}
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z *CredentialAttestation) EncodeMsg(en *msgp.Writer) (err error) {
	// check for omitted fields
	zb0001Len := uint32(5)
	var zb0001Mask uint8 /* 5 bits */
	_ = zb0001Mask
	if z.ClientDataJSON == nil {
		zb0001Len--
		zb0001Mask |= 0x1
	}
	if z.ClientDataHash == nil {
		zb0001Len--
		zb0001Mask |= 0x2
	}
	if z.AuthenticatorData == nil {
		zb0001Len--
		zb0001Mask |= 0x4
	}
	if z.PublicKeyAlgorithm == 0 {
		zb0001Len--
		zb0001Mask |= 0x8
	}
	if z.Object == nil {
		zb0001Len--
		zb0001Mask |= 0x10
	}
	// variable map header, size zb0001Len
	err = en.Append(0x80 | uint8(zb0001Len))
	if err != nil {
		return
	}

	// skip if no fields are to be emitted
	if zb0001Len != 0 {
		if (zb0001Mask & 0x1) == 0 { // if not omitted
			// write "cdj"
			err = en.Append(0xa3, 0x63, 0x64, 0x6a)
			if err != nil {
				return
			}
			err = en.WriteBytes(z.ClientDataJSON)
			if err != nil {
				err = msgp.WrapError(err, "ClientDataJSON")
				return
			}
		}
		if (zb0001Mask & 0x2) == 0 { // if not omitted
			// write "cdh"
			err = en.Append(0xa3, 0x63, 0x64, 0x68)
			if err != nil {
				return
			}
			err = en.WriteBytes(z.ClientDataHash)
			if err != nil {
				err = msgp.WrapError(err, "ClientDataHash")
				return
			}
		}
		if (zb0001Mask & 0x4) == 0 { // if not omitted
			// write "data"
			err = en.Append(0xa4, 0x64, 0x61, 0x74, 0x61)
			if err != nil {
				return
			}
			err = en.WriteBytes(z.AuthenticatorData)
			if err != nil {
				err = msgp.WrapError(err, "AuthenticatorData")
				return
			}
		}
		if (zb0001Mask & 0x8) == 0 { // if not omitted
			// write "alg"
			err = en.Append(0xa3, 0x61, 0x6c, 0x67)
			if err != nil {
				return
			}
			err = en.WriteInt64(z.PublicKeyAlgorithm)
			if err != nil {
				err = msgp.WrapError(err, "PublicKeyAlgorithm")
				return
			}
		}
		if (zb0001Mask & 0x10) == 0 { // if not omitted
			// write "obj"
			err = en.Append(0xa3, 0x6f, 0x62, 0x6a)
			if err != nil {
				return
			}
			err = en.WriteBytes(z.Object)
			if err != nil {
				err = msgp.WrapError(err, "Object")
				return
			}
		}
	}
	return
}

// MarshalMsg implements msgp.Marshaler
func (z *CredentialAttestation) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// check for omitted fields
	zb0001Len := uint32(5)
	var zb0001Mask uint8 /* 5 bits */
	_ = zb0001Mask
	if z.ClientDataJSON == nil {
		zb0001Len--
		zb0001Mask |= 0x1
	}
	if z.ClientDataHash == nil {
		zb0001Len--
		zb0001Mask |= 0x2
	}
	if z.AuthenticatorData == nil {
		zb0001Len--
		zb0001Mask |= 0x4
	}
	if z.PublicKeyAlgorithm == 0 {
		zb0001Len--
		zb0001Mask |= 0x8
	}
	if z.Object == nil {
		zb0001Len--
		zb0001Mask |= 0x10
	}
	// variable map header, size zb0001Len
	o = append(o, 0x80|uint8(zb0001Len))

	// skip if no fields are to be emitted
	if zb0001Len != 0 {
		if (zb0001Mask & 0x1) == 0 { // if not omitted
			// string "cdj"
			o = append(o, 0xa3, 0x63, 0x64, 0x6a)
			o = msgp.AppendBytes(o, z.ClientDataJSON)
		}
		if (zb0001Mask & 0x2) == 0 { // if not omitted
			// string "cdh"
			o = append(o, 0xa3, 0x63, 0x64, 0x68)
			o = msgp.AppendBytes(o, z.ClientDataHash)
		}
		if (zb0001Mask & 0x4) == 0 { // if not omitted
			// string "data"
			o = append(o, 0xa4, 0x64, 0x61, 0x74, 0x61)
			o = msgp.AppendBytes(o, z.AuthenticatorData)
		}
		if (zb0001Mask & 0x8) == 0 { // if not omitted
			// string "alg"
			o = append(o, 0xa3, 0x61, 0x6c, 0x67)
			o = msgp.AppendInt64(o, z.PublicKeyAlgorithm)
		}
		if (zb0001Mask & 0x10) == 0 { // if not omitted
			// string "obj"
			o = append(o, 0xa3, 0x6f, 0x62, 0x6a)
			o = msgp.AppendBytes(o, z.Object)
		}
	}
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *CredentialAttestation) 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
	}
	var zb0001Mask uint8 /* 5 bits */
	_ = zb0001Mask
	for zb0001 > 0 {
		zb0001--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "cdj":
			z.ClientDataJSON, bts, err = msgp.ReadBytesBytes(bts, z.ClientDataJSON)
			if err != nil {
				err = msgp.WrapError(err, "ClientDataJSON")
				return
			}
			zb0001Mask |= 0x1
		case "cdh":
			z.ClientDataHash, bts, err = msgp.ReadBytesBytes(bts, z.ClientDataHash)
			if err != nil {
				err = msgp.WrapError(err, "ClientDataHash")
				return
			}
			zb0001Mask |= 0x2
		case "data":
			z.AuthenticatorData, bts, err = msgp.ReadBytesBytes(bts, z.AuthenticatorData)
			if err != nil {
				err = msgp.WrapError(err, "AuthenticatorData")
				return
			}
			zb0001Mask |= 0x4
		case "alg":
			z.PublicKeyAlgorithm, bts, err = msgp.ReadInt64Bytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "PublicKeyAlgorithm")
				return
			}
			zb0001Mask |= 0x8
		case "obj":
			z.Object, bts, err = msgp.ReadBytesBytes(bts, z.Object)
			if err != nil {
				err = msgp.WrapError(err, "Object")
				return
			}
			zb0001Mask |= 0x10
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	// Clear omitted fields.
	if zb0001Mask != 0x1f {
		if (zb0001Mask & 0x1) == 0 {
			z.ClientDataJSON = nil
		}
		if (zb0001Mask & 0x2) == 0 {
			z.ClientDataHash = nil
		}
		if (zb0001Mask & 0x4) == 0 {
			z.AuthenticatorData = nil
		}
		if (zb0001Mask & 0x8) == 0 {
			z.PublicKeyAlgorithm = 0
		}
		if (zb0001Mask & 0x10) == 0 {
			z.Object = nil
		}
	}
	o = bts
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *CredentialAttestation) Msgsize() (s int) {
	s = 1 + 4 + msgp.BytesPrefixSize + len(z.ClientDataJSON) + 4 + msgp.BytesPrefixSize + len(z.ClientDataHash) + 5 + msgp.BytesPrefixSize + len(z.AuthenticatorData) + 4 + msgp.Int64Size + 4 + msgp.BytesPrefixSize + len(z.Object)
	return
}

// DecodeMsg implements msgp.Decodable
func (z *CredentialFlags) DecodeMsg(dc *msgp.Reader) (err error) {
	{
		var zb0001 byte
		zb0001, err = dc.ReadByte()
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		(*z) = CredentialFlagsFromMsgpByte(zb0001)
	}
	return
}

// EncodeMsg implements msgp.Encodable
func (z CredentialFlags) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteByte((CredentialFlags).MsgpByte(z))
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	return
}

// MarshalMsg implements msgp.Marshaler
func (z CredentialFlags) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	o = msgp.AppendByte(o, (CredentialFlags).MsgpByte(z))
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *CredentialFlags) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var zb0001 byte
		zb0001, bts, err = msgp.ReadByteBytes(bts)
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		(*z) = CredentialFlagsFromMsgpByte(zb0001)
	}
	o = bts
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z CredentialFlags) Msgsize() (s int) {
	s = msgp.ByteSize
	return
}

// DecodeMsg implements msgp.Decodable
func (z *Credentials) 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(Credentials, zb0002)
	}
	for zb0001 := range *z {
		err = (*z)[zb0001].DecodeMsg(dc)
		if err != nil {
			err = msgp.WrapError(err, zb0001)
			return
		}
	}
	return
}

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

// MarshalMsg implements msgp.Marshaler
func (z Credentials) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	o = msgp.AppendArrayHeader(o, uint32(len(z)))
	for zb0003 := range z {
		o, err = z[zb0003].MarshalMsg(o)
		if err != nil {
			err = msgp.WrapError(err, zb0003)
			return
		}
	}
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *Credentials) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var zb0002 uint32
	zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	if cap((*z)) >= int(zb0002) {
		(*z) = (*z)[:zb0002]
	} else {
		(*z) = make(Credentials, zb0002)
	}
	for zb0001 := range *z {
		bts, err = (*z)[zb0001].UnmarshalMsg(bts)
		if err != nil {
			err = msgp.WrapError(err, zb0001)
			return
		}
	}
	o = bts
	return
}

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