// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: provenance/registry/v1/registry.proto

package types

import (
	fmt "fmt"
	_ "github.com/cosmos/cosmos-proto"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/proto"
	io "io"
	math "math"
	math_bits "math/bits"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

// RegistryRole defines the different types of roles that can be assigned to addresses.
// These roles determine the permissions and capabilities that an address has within the registry system.
type RegistryRole int32

const (
	// REGISTRY_ROLE_UNSPECIFIED indicates no role is assigned.
	// This is the default state for addresses that have not been granted any specific permissions.
	RegistryRole_REGISTRY_ROLE_UNSPECIFIED RegistryRole = 0
	// REGISTRY_ROLE_SERVICER indicates the address has servicer privileges.
	// Servicers are responsible for maintaining and servicing the underlying assets.
	RegistryRole_REGISTRY_ROLE_SERVICER RegistryRole = 1
	// REGISTRY_ROLE_SUBSERVICER indicates the address has subservicer privileges.
	// Subservicers assist servicers in their duties and may have limited administrative capabilities.
	RegistryRole_REGISTRY_ROLE_SUBSERVICER RegistryRole = 2
	// REGISTRY_ROLE_CONTROLLER indicates the address has controller privileges.
	// Controllers have administrative control over the registry entries and can modify roles.
	RegistryRole_REGISTRY_ROLE_CONTROLLER RegistryRole = 3
	// REGISTRY_ROLE_CUSTODIAN indicates the address has custodian privileges.
	// Custodians are responsible for holding and safeguarding the underlying assets.
	RegistryRole_REGISTRY_ROLE_CUSTODIAN RegistryRole = 4
	// REGISTRY_ROLE_BORROWER indicates the address has borrower privileges.
	// Borrowers can borrow against the underlying assets within defined parameters.
	RegistryRole_REGISTRY_ROLE_BORROWER RegistryRole = 5
	// REGISTRY_ROLE_ORIGINATOR indicates the address has originator privileges.
	// Originators are responsible for creating and originating the underlying assets.
	RegistryRole_REGISTRY_ROLE_ORIGINATOR RegistryRole = 6
)

var RegistryRole_name = map[int32]string{
	0: "REGISTRY_ROLE_UNSPECIFIED",
	1: "REGISTRY_ROLE_SERVICER",
	2: "REGISTRY_ROLE_SUBSERVICER",
	3: "REGISTRY_ROLE_CONTROLLER",
	4: "REGISTRY_ROLE_CUSTODIAN",
	5: "REGISTRY_ROLE_BORROWER",
	6: "REGISTRY_ROLE_ORIGINATOR",
}

var RegistryRole_value = map[string]int32{
	"REGISTRY_ROLE_UNSPECIFIED": 0,
	"REGISTRY_ROLE_SERVICER":    1,
	"REGISTRY_ROLE_SUBSERVICER": 2,
	"REGISTRY_ROLE_CONTROLLER":  3,
	"REGISTRY_ROLE_CUSTODIAN":   4,
	"REGISTRY_ROLE_BORROWER":    5,
	"REGISTRY_ROLE_ORIGINATOR":  6,
}

func (x RegistryRole) String() string {
	return proto.EnumName(RegistryRole_name, int32(x))
}

func (RegistryRole) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_2fa7a0b4d34d0208, []int{0}
}

// RegistryKey represents a unique identifier for registry entries.
// It links registry entries to specific NFT assets and their associated asset classes.
type RegistryKey struct {
	// Identifier for the nft that this ledger is linked to.
	// This could be a `x/metadata` scope id or an `x/nft` nft id.
	// In order to create a ledger for an NFT, the NFT class must be registered in the ledger module as a LedgerClass.
	NftId string `protobuf:"bytes,1,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty"`
	// asset_class_id is the Scope Specification ID or NFT Class ID.
	// This identifies the class or specification that the NFT belongs to.
	// If it is a Scope Specification, the address is used, e.g."scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m".
	// Otherwise, it is the NFT Class ID, e.g. "heloc-loan-class".
	AssetClassId string `protobuf:"bytes,2,opt,name=asset_class_id,json=assetClassId,proto3" json:"asset_class_id,omitempty"`
}

func (m *RegistryKey) Reset()      { *m = RegistryKey{} }
func (*RegistryKey) ProtoMessage() {}
func (*RegistryKey) Descriptor() ([]byte, []int) {
	return fileDescriptor_2fa7a0b4d34d0208, []int{0}
}
func (m *RegistryKey) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *RegistryKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_RegistryKey.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *RegistryKey) XXX_Merge(src proto.Message) {
	xxx_messageInfo_RegistryKey.Merge(m, src)
}
func (m *RegistryKey) XXX_Size() int {
	return m.Size()
}
func (m *RegistryKey) XXX_DiscardUnknown() {
	xxx_messageInfo_RegistryKey.DiscardUnknown(m)
}

var xxx_messageInfo_RegistryKey proto.InternalMessageInfo

func (m *RegistryKey) GetNftId() string {
	if m != nil {
		return m.NftId
	}
	return ""
}

func (m *RegistryKey) GetAssetClassId() string {
	if m != nil {
		return m.AssetClassId
	}
	return ""
}

// RegistryEntry represents a single entry in the registry, mapping a blockchain address to its roles.
// Each entry contains the key information and the roles assigned to various addresses.
type RegistryEntry struct {
	// key ties the registry entry to an asset class and NFT id.
	// This provides the unique identifier for the registry entry.
	Key *RegistryKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// roles is a list of roles and addresses that can perform that role.
	// Each role entry contains a role type and the addresses authorized for that role.
	Roles []RolesEntry `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles"`
}

func (m *RegistryEntry) Reset()         { *m = RegistryEntry{} }
func (m *RegistryEntry) String() string { return proto.CompactTextString(m) }
func (*RegistryEntry) ProtoMessage()    {}
func (*RegistryEntry) Descriptor() ([]byte, []int) {
	return fileDescriptor_2fa7a0b4d34d0208, []int{1}
}
func (m *RegistryEntry) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *RegistryEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_RegistryEntry.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *RegistryEntry) XXX_Merge(src proto.Message) {
	xxx_messageInfo_RegistryEntry.Merge(m, src)
}
func (m *RegistryEntry) XXX_Size() int {
	return m.Size()
}
func (m *RegistryEntry) XXX_DiscardUnknown() {
	xxx_messageInfo_RegistryEntry.DiscardUnknown(m)
}

var xxx_messageInfo_RegistryEntry proto.InternalMessageInfo

func (m *RegistryEntry) GetKey() *RegistryKey {
	if m != nil {
		return m.Key
	}
	return nil
}

func (m *RegistryEntry) GetRoles() []RolesEntry {
	if m != nil {
		return m.Roles
	}
	return nil
}

// RolesEntry represents a mapping between a role and the addresses that can perform that role.
// This allows multiple addresses to be assigned the same role for a given registry entry.
type RolesEntry struct {
	// role is the type of role being assigned.
	Role RegistryRole `protobuf:"varint,1,opt,name=role,proto3,enum=provenance.registry.v1.RegistryRole" json:"role,omitempty"`
	// addresses is the list of blockchain addresses that can perform this role.
	// These addresses have the permissions associated with the specified role.
	Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"`
}

func (m *RolesEntry) Reset()         { *m = RolesEntry{} }
func (m *RolesEntry) String() string { return proto.CompactTextString(m) }
func (*RolesEntry) ProtoMessage()    {}
func (*RolesEntry) Descriptor() ([]byte, []int) {
	return fileDescriptor_2fa7a0b4d34d0208, []int{2}
}
func (m *RolesEntry) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *RolesEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_RolesEntry.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *RolesEntry) XXX_Merge(src proto.Message) {
	xxx_messageInfo_RolesEntry.Merge(m, src)
}
func (m *RolesEntry) XXX_Size() int {
	return m.Size()
}
func (m *RolesEntry) XXX_DiscardUnknown() {
	xxx_messageInfo_RolesEntry.DiscardUnknown(m)
}

var xxx_messageInfo_RolesEntry proto.InternalMessageInfo

func (m *RolesEntry) GetRole() RegistryRole {
	if m != nil {
		return m.Role
	}
	return RegistryRole_REGISTRY_ROLE_UNSPECIFIED
}

func (m *RolesEntry) GetAddresses() []string {
	if m != nil {
		return m.Addresses
	}
	return nil
}

func init() {
	proto.RegisterEnum("provenance.registry.v1.RegistryRole", RegistryRole_name, RegistryRole_value)
	proto.RegisterType((*RegistryKey)(nil), "provenance.registry.v1.RegistryKey")
	proto.RegisterType((*RegistryEntry)(nil), "provenance.registry.v1.RegistryEntry")
	proto.RegisterType((*RolesEntry)(nil), "provenance.registry.v1.RolesEntry")
}

func init() {
	proto.RegisterFile("provenance/registry/v1/registry.proto", fileDescriptor_2fa7a0b4d34d0208)
}

var fileDescriptor_2fa7a0b4d34d0208 = []byte{
	// 476 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0x6e, 0xd3, 0x40,
	0x14, 0x85, 0xed, 0xfc, 0x49, 0x99, 0x94, 0xca, 0x1a, 0x95, 0x92, 0x04, 0x70, 0xab, 0x50, 0xa4,
	0x0a, 0xa9, 0xb6, 0x1a, 0x7e, 0x84, 0x58, 0x20, 0xc5, 0xa9, 0xa9, 0x46, 0x44, 0x71, 0x74, 0x9d,
	0x80, 0x60, 0x63, 0xa5, 0xf1, 0xd4, 0x58, 0x6d, 0x3d, 0x91, 0x67, 0x88, 0xf0, 0x86, 0x25, 0x6b,
	0x96, 0x2c, 0x79, 0x08, 0x1e, 0xa2, 0xcb, 0x8a, 0x15, 0x1b, 0x10, 0x4a, 0x5e, 0x04, 0xd9, 0x0e,
	0x71, 0x4a, 0xa8, 0xba, 0x9b, 0xb9, 0xdf, 0x39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 0x8d, 0x29, 0x3f, 0x2a, 0x25, 0xeb, 0xfa, 0xf0, 0x4f, 0x00,
	0x00, 0x00, 0xff, 0xff, 0x4f, 0x36, 0x83, 0x50, 0x20, 0x03, 0x00, 0x00,
}

func (m *RegistryKey) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *RegistryKey) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *RegistryKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.AssetClassId) > 0 {
		i -= len(m.AssetClassId)
		copy(dAtA[i:], m.AssetClassId)
		i = encodeVarintRegistry(dAtA, i, uint64(len(m.AssetClassId)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.NftId) > 0 {
		i -= len(m.NftId)
		copy(dAtA[i:], m.NftId)
		i = encodeVarintRegistry(dAtA, i, uint64(len(m.NftId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *RegistryEntry) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *RegistryEntry) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *RegistryEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Roles) > 0 {
		for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.Roles[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintRegistry(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x12
		}
	}
	if m.Key != nil {
		{
			size, err := m.Key.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintRegistry(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *RolesEntry) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *RolesEntry) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *RolesEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Addresses) > 0 {
		for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.Addresses[iNdEx])
			copy(dAtA[i:], m.Addresses[iNdEx])
			i = encodeVarintRegistry(dAtA, i, uint64(len(m.Addresses[iNdEx])))
			i--
			dAtA[i] = 0x12
		}
	}
	if m.Role != 0 {
		i = encodeVarintRegistry(dAtA, i, uint64(m.Role))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func encodeVarintRegistry(dAtA []byte, offset int, v uint64) int {
	offset -= sovRegistry(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *RegistryKey) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.NftId)
	if l > 0 {
		n += 1 + l + sovRegistry(uint64(l))
	}
	l = len(m.AssetClassId)
	if l > 0 {
		n += 1 + l + sovRegistry(uint64(l))
	}
	return n
}

func (m *RegistryEntry) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Key != nil {
		l = m.Key.Size()
		n += 1 + l + sovRegistry(uint64(l))
	}
	if len(m.Roles) > 0 {
		for _, e := range m.Roles {
			l = e.Size()
			n += 1 + l + sovRegistry(uint64(l))
		}
	}
	return n
}

func (m *RolesEntry) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Role != 0 {
		n += 1 + sovRegistry(uint64(m.Role))
	}
	if len(m.Addresses) > 0 {
		for _, s := range m.Addresses {
			l = len(s)
			n += 1 + l + sovRegistry(uint64(l))
		}
	}
	return n
}

func sovRegistry(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozRegistry(x uint64) (n int) {
	return sovRegistry(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *RegistryKey) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowRegistry
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: RegistryKey: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: RegistryKey: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field NftId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthRegistry
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthRegistry
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.NftId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field AssetClassId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthRegistry
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthRegistry
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.AssetClassId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipRegistry(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthRegistry
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *RegistryEntry) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowRegistry
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: RegistryEntry: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: RegistryEntry: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthRegistry
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthRegistry
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Key == nil {
				m.Key = &RegistryKey{}
			}
			if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthRegistry
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthRegistry
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Roles = append(m.Roles, RolesEntry{})
			if err := m.Roles[len(m.Roles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipRegistry(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthRegistry
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *RolesEntry) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowRegistry
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: RolesEntry: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: RolesEntry: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
			}
			m.Role = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Role |= RegistryRole(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthRegistry
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthRegistry
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipRegistry(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthRegistry
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipRegistry(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowRegistry
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowRegistry
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthRegistry
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupRegistry
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthRegistry
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthRegistry        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRegistry          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRegistry = fmt.Errorf("proto: unexpected end of group")
)
