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

package types

import (
	context "context"
	fmt "fmt"
	query "github.com/cosmos/cosmos-sdk/types/query"
	_ "github.com/cosmos/gogoproto/gogoproto"
	grpc1 "github.com/cosmos/gogoproto/grpc"
	proto "github.com/cosmos/gogoproto/proto"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	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

// QueryGetRegistryRequest is the request type for the Query/GetRegistry RPC method.
// It contains the key information needed to retrieve a specific registry entry.
type QueryGetRegistryRequest struct {
	// key is the registry key to query.
	// This contains the NFT ID and asset class ID that uniquely identify the registry entry.
	Key *RegistryKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}

func (m *QueryGetRegistryRequest) Reset()         { *m = QueryGetRegistryRequest{} }
func (m *QueryGetRegistryRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetRegistryRequest) ProtoMessage()    {}
func (*QueryGetRegistryRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_c166c561e401a2eb, []int{0}
}
func (m *QueryGetRegistryRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryGetRegistryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryGetRegistryRequest.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 *QueryGetRegistryRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryGetRegistryRequest.Merge(m, src)
}
func (m *QueryGetRegistryRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryGetRegistryRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryGetRegistryRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryGetRegistryRequest proto.InternalMessageInfo

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

// QueryGetRegistryResponse is the response type for the Query/GetRegistry RPC method.
// It contains the complete registry entry for the requested key.
type QueryGetRegistryResponse struct {
	// registry is the registry entry for the requested key.
	// This includes all roles and addresses associated with the specified NFT and asset class.
	Registry RegistryEntry `protobuf:"bytes,1,opt,name=registry,proto3" json:"registry"`
}

func (m *QueryGetRegistryResponse) Reset()         { *m = QueryGetRegistryResponse{} }
func (m *QueryGetRegistryResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetRegistryResponse) ProtoMessage()    {}
func (*QueryGetRegistryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_c166c561e401a2eb, []int{1}
}
func (m *QueryGetRegistryResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryGetRegistryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryGetRegistryResponse.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 *QueryGetRegistryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryGetRegistryResponse.Merge(m, src)
}
func (m *QueryGetRegistryResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryGetRegistryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryGetRegistryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryGetRegistryResponse proto.InternalMessageInfo

func (m *QueryGetRegistryResponse) GetRegistry() RegistryEntry {
	if m != nil {
		return m.Registry
	}
	return RegistryEntry{}
}

// QueryGetRegistriesRequest is the paginated request type for the Query/GetRegistries RPC method.
type QueryGetRegistriesRequest struct {
	// asset_class_id is the Scope Specification ID or NFT Class ID.
	// This identifies the class or specification that the NFTs belong to.
	AssetClassId string `protobuf:"bytes,1,opt,name=asset_class_id,json=assetClassId,proto3" json:"asset_class_id,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (m *QueryGetRegistriesRequest) Reset()         { *m = QueryGetRegistriesRequest{} }
func (m *QueryGetRegistriesRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetRegistriesRequest) ProtoMessage()    {}
func (*QueryGetRegistriesRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_c166c561e401a2eb, []int{2}
}
func (m *QueryGetRegistriesRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryGetRegistriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryGetRegistriesRequest.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 *QueryGetRegistriesRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryGetRegistriesRequest.Merge(m, src)
}
func (m *QueryGetRegistriesRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryGetRegistriesRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryGetRegistriesRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryGetRegistriesRequest proto.InternalMessageInfo

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

func (m *QueryGetRegistriesRequest) GetPagination() *query.PageRequest {
	if m != nil {
		return m.Pagination
	}
	return nil
}

// QueryGetRegistriesResponse is the paginated response type for the Query/GetRegistries RPC method.
// It contains the complete registry entry for the requested key.
type QueryGetRegistriesResponse struct {
	// registries is the collection of registry entries.
	// This includes all roles and addresses associated with the specified NFT and asset class.
	Registries []RegistryEntry `protobuf:"bytes,1,rep,name=registries,proto3" json:"registries"`
	// pagination is the pagination details for this response.
	Pagination *query.PageResponse `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (m *QueryGetRegistriesResponse) Reset()         { *m = QueryGetRegistriesResponse{} }
func (m *QueryGetRegistriesResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetRegistriesResponse) ProtoMessage()    {}
func (*QueryGetRegistriesResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_c166c561e401a2eb, []int{3}
}
func (m *QueryGetRegistriesResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryGetRegistriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryGetRegistriesResponse.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 *QueryGetRegistriesResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryGetRegistriesResponse.Merge(m, src)
}
func (m *QueryGetRegistriesResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryGetRegistriesResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryGetRegistriesResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryGetRegistriesResponse proto.InternalMessageInfo

func (m *QueryGetRegistriesResponse) GetRegistries() []RegistryEntry {
	if m != nil {
		return m.Registries
	}
	return nil
}

func (m *QueryGetRegistriesResponse) GetPagination() *query.PageResponse {
	if m != nil {
		return m.Pagination
	}
	return nil
}

// QueryHasRoleRequest is the request type for the Query/HasRole RPC method.
// It contains the information needed to verify if an address has a specific role.
type QueryHasRoleRequest struct {
	// key is the registry key to query.
	// This identifies the specific registry entry to check.
	Key *RegistryKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// address is the blockchain address to check for the role.
	// This is the address whose role permissions are being verified.
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// role is the specific role to check for.
	// This determines which role permission is being verified.
	Role RegistryRole `protobuf:"varint,3,opt,name=role,proto3,enum=provenance.registry.v1.RegistryRole" json:"role,omitempty"`
}

func (m *QueryHasRoleRequest) Reset()         { *m = QueryHasRoleRequest{} }
func (m *QueryHasRoleRequest) String() string { return proto.CompactTextString(m) }
func (*QueryHasRoleRequest) ProtoMessage()    {}
func (*QueryHasRoleRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_c166c561e401a2eb, []int{4}
}
func (m *QueryHasRoleRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryHasRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryHasRoleRequest.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 *QueryHasRoleRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryHasRoleRequest.Merge(m, src)
}
func (m *QueryHasRoleRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryHasRoleRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryHasRoleRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryHasRoleRequest proto.InternalMessageInfo

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

func (m *QueryHasRoleRequest) GetAddress() string {
	if m != nil {
		return m.Address
	}
	return ""
}

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

// QueryHasRoleResponse is the response type for the Query/HasRole RPC method.
// It provides a boolean result indicating whether the address has the specified role.
type QueryHasRoleResponse struct {
	// has_role is true if the address has the specified role for the given key.
	// This boolean value indicates whether the role verification was successful.
	HasRole bool `protobuf:"varint,1,opt,name=has_role,json=hasRole,proto3" json:"has_role,omitempty"`
}

func (m *QueryHasRoleResponse) Reset()         { *m = QueryHasRoleResponse{} }
func (m *QueryHasRoleResponse) String() string { return proto.CompactTextString(m) }
func (*QueryHasRoleResponse) ProtoMessage()    {}
func (*QueryHasRoleResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_c166c561e401a2eb, []int{5}
}
func (m *QueryHasRoleResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryHasRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryHasRoleResponse.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 *QueryHasRoleResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryHasRoleResponse.Merge(m, src)
}
func (m *QueryHasRoleResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryHasRoleResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryHasRoleResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryHasRoleResponse proto.InternalMessageInfo

func (m *QueryHasRoleResponse) GetHasRole() bool {
	if m != nil {
		return m.HasRole
	}
	return false
}

func init() {
	proto.RegisterType((*QueryGetRegistryRequest)(nil), "provenance.registry.v1.QueryGetRegistryRequest")
	proto.RegisterType((*QueryGetRegistryResponse)(nil), "provenance.registry.v1.QueryGetRegistryResponse")
	proto.RegisterType((*QueryGetRegistriesRequest)(nil), "provenance.registry.v1.QueryGetRegistriesRequest")
	proto.RegisterType((*QueryGetRegistriesResponse)(nil), "provenance.registry.v1.QueryGetRegistriesResponse")
	proto.RegisterType((*QueryHasRoleRequest)(nil), "provenance.registry.v1.QueryHasRoleRequest")
	proto.RegisterType((*QueryHasRoleResponse)(nil), "provenance.registry.v1.QueryHasRoleResponse")
}

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

var fileDescriptor_c166c561e401a2eb = []byte{
	// 605 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x3d, 0x6f, 0xd3, 0x40,
	0x18, 0xc7, 0x73, 0x6d, 0xa1, 0xe5, 0x0a, 0x1d, 0x8e, 0x0a, 0x5c, 0x0b, 0x99, 0xc8, 0xb4, 0x50,
	0xf1, 0xe2, 0xc3, 0x01, 0x24, 0xe6, 0xf0, 0x12, 0xa0, 0x4b, 0x30, 0x62, 0x81, 0x21, 0xba, 0x38,
	0x87, 0x63, 0x25, 0xf5, 0xb9, 0xbe, 0x4b, 0x84, 0x15, 0x65, 0x61, 0x63, 0x43, 0xe2, 0x0b, 0xf4,
	0x0b, 0xb0, 0x30, 0xb3, 0xb0, 0x75, 0xac, 0xc4, 0xc2, 0x84, 0x50, 0xc2, 0x07, 0x41, 0x3e, 0x9f,
	0xf3, 0x02, 0x09, 0x4e, 0xc5, 0xe6, 0x7b, 0xee, 0xf9, 0x3f, 0xcf, 0xef, 0x79, 0x39, 0x43, 0x33,
	0x8c, 0x58, 0x97, 0x06, 0x24, 0x70, 0x29, 0x8e, 0xa8, 0xe7, 0x73, 0x11, 0xc5, 0xb8, 0x6b, 0xe3,
	0x83, 0x0e, 0x8d, 0x62, 0x2b, 0x8c, 0x98, 0x60, 0xe8, 0xc2, 0xd8, 0xc7, 0xca, 0x7c, 0xac, 0xae,
	0xad, 0x5f, 0x77, 0x19, 0xdf, 0x67, 0x1c, 0xd7, 0x09, 0xa7, 0xa9, 0x00, 0x77, 0xed, 0x3a, 0x15,
	0xc4, 0xc6, 0x21, 0xf1, 0xfc, 0x80, 0x08, 0x9f, 0x05, 0x69, 0x0c, 0x7d, 0xd3, 0x63, 0x1e, 0x93,
	0x9f, 0x38, 0xf9, 0x52, 0xd6, 0x4b, 0x1e, 0x63, 0x5e, 0x9b, 0x62, 0x12, 0xfa, 0x98, 0x04, 0x01,
	0x13, 0x52, 0xc2, 0xd5, 0xed, 0xce, 0x1c, 0xb6, 0x11, 0x83, 0x74, 0x33, 0xab, 0xf0, 0xe2, 0xf3,
	0x24, 0x79, 0x85, 0x0a, 0x47, 0xdd, 0x38, 0xf4, 0xa0, 0x43, 0xb9, 0x40, 0xf7, 0xe0, 0x72, 0x8b,
	0xc6, 0x1a, 0x28, 0x82, 0xdd, 0xf5, 0xd2, 0x15, 0x6b, 0x76, 0x1d, 0x56, 0xa6, 0xda, 0xa3, 0xb1,
	0x93, 0xf8, 0x9b, 0x2e, 0xd4, 0xfe, 0x8e, 0xc8, 0x43, 0x16, 0x70, 0x8a, 0x2a, 0x70, 0x2d, 0xd3,
	0xaa, 0xb8, 0x3b, 0x79, 0x71, 0x1f, 0x05, 0x22, 0x8a, 0xcb, 0x2b, 0x47, 0x3f, 0x2e, 0x17, 0x9c,
	0x91, 0xd8, 0x7c, 0x0f, 0xe0, 0xd6, 0x1f, 0x59, 0x7c, 0xca, 0x33, 0xf2, 0x6d, 0xb8, 0x41, 0x38,
	0xa7, 0xa2, 0xe6, 0xb6, 0x09, 0xe7, 0x35, 0xbf, 0x21, 0x93, 0x9d, 0x71, 0xce, 0x4a, 0xeb, 0x83,
	0xc4, 0xf8, 0xb4, 0x81, 0x1e, 0x43, 0x38, 0xee, 0xb4, 0xe6, 0x4a, 0x9c, 0xab, 0x56, 0x3a, 0x16,
	0x2b, 0x19, 0x8b, 0x95, 0xce, 0x51, 0x8d, 0xc5, 0xaa, 0x12, 0x8f, 0xaa, 0x0c, 0xce, 0x84, 0xd2,
	0xfc, 0x0c, 0xa0, 0x3e, 0x8b, 0x45, 0xd5, 0xbc, 0x07, 0x61, 0x34, 0xb2, 0x6a, 0xa0, 0xb8, 0x7c,
	0xd2, 0xaa, 0x27, 0xe4, 0xa8, 0x32, 0x83, 0xf9, 0x5a, 0x2e, 0x73, 0x4a, 0x32, 0x05, 0x7d, 0x08,
	0xe0, 0x79, 0x09, 0xfd, 0x84, 0x70, 0x87, 0xb5, 0xe9, 0xff, 0x0d, 0x1d, 0x69, 0x70, 0x95, 0x34,
	0x1a, 0x11, 0xe5, 0x5c, 0x5b, 0x92, 0xad, 0xce, 0x8e, 0xe8, 0x3e, 0x5c, 0x89, 0x58, 0x9b, 0x6a,
	0xcb, 0x45, 0xb0, 0xbb, 0x51, 0xda, 0xce, 0x8b, 0x28, 0x59, 0xa4, 0xc2, 0xb4, 0xe1, 0xe6, 0x34,
	0xa1, 0x6a, 0xe8, 0x16, 0x5c, 0x6b, 0x12, 0x5e, 0x93, 0x51, 0x13, 0xce, 0x35, 0x67, 0xb5, 0x99,
	0xba, 0x94, 0x3e, 0xad, 0xc0, 0x53, 0x52, 0x83, 0xbe, 0x00, 0xb8, 0x3e, 0xb1, 0x81, 0x08, 0xcf,
	0x4b, 0x3c, 0x67, 0xfb, 0xf5, 0xdb, 0x8b, 0x0b, 0x52, 0x2e, 0xf3, 0xd9, 0xbb, 0x6f, 0xbf, 0x3e,
	0x2e, 0x3d, 0x44, 0x65, 0x9c, 0xf3, 0xf4, 0x70, 0xaf, 0x45, 0x63, 0x6b, 0x7a, 0x43, 0xfb, 0xa9,
	0x31, 0x78, 0x23, 0x92, 0x03, 0x3a, 0x04, 0xf0, 0xdc, 0xd4, 0x3a, 0x21, 0x7b, 0x41, 0x9e, 0xf1,
	0x33, 0xd0, 0x4b, 0x27, 0x91, 0xa8, 0x22, 0x76, 0x65, 0x11, 0x26, 0x2a, 0xe6, 0x15, 0x81, 0xbe,
	0x02, 0xb8, 0xaa, 0x46, 0x83, 0x6e, 0xfc, 0x33, 0xd3, 0xf4, 0x8a, 0xe9, 0x37, 0x17, 0x73, 0x56,
	0x40, 0xaf, 0x25, 0xd0, 0x4b, 0xf4, 0x62, 0x1e, 0x50, 0xb6, 0x0b, 0xf9, 0x5d, 0xc5, 0x3d, 0xb5,
	0x94, 0x7d, 0xdc, 0x4b, 0x14, 0xfd, 0x72, 0xeb, 0x68, 0x60, 0x80, 0xe3, 0x81, 0x01, 0x7e, 0x0e,
	0x0c, 0xf0, 0x61, 0x68, 0x14, 0x8e, 0x87, 0x46, 0xe1, 0xfb, 0xd0, 0x28, 0xc0, 0x2d, 0x9f, 0xcd,
	0xc1, 0xac, 0x82, 0x57, 0x77, 0x3d, 0x5f, 0x34, 0x3b, 0x75, 0xcb, 0x65, 0xfb, 0x13, 0x54, 0xb7,
	0x7c, 0x36, 0xc9, 0xf8, 0x76, 0x4c, 0x29, 0xe2, 0x90, 0xf2, 0xfa, 0x69, 0xf9, 0xc7, 0xbd, 0xf3,
	0x3b, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x7a, 0x07, 0x40, 0x36, 0x06, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
	// GetRegistry returns the registry entry for a given key.
	// This method retrieves the complete registry entry including all roles and addresses.
	GetRegistry(ctx context.Context, in *QueryGetRegistryRequest, opts ...grpc.CallOption) (*QueryGetRegistryResponse, error)
	// GetRegistries returns all registry entries, optionally filtered by asset class ID.
	// This method retrieves the complete registry entries including all roles and addresses.
	GetRegistries(ctx context.Context, in *QueryGetRegistriesRequest, opts ...grpc.CallOption) (*QueryGetRegistriesResponse, error)
	// HasRole returns true if the address has the specified role for the given key.
	HasRole(ctx context.Context, in *QueryHasRoleRequest, opts ...grpc.CallOption) (*QueryHasRoleResponse, error)
}

type queryClient struct {
	cc grpc1.ClientConn
}

func NewQueryClient(cc grpc1.ClientConn) QueryClient {
	return &queryClient{cc}
}

func (c *queryClient) GetRegistry(ctx context.Context, in *QueryGetRegistryRequest, opts ...grpc.CallOption) (*QueryGetRegistryResponse, error) {
	out := new(QueryGetRegistryResponse)
	err := c.cc.Invoke(ctx, "/provenance.registry.v1.Query/GetRegistry", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *queryClient) GetRegistries(ctx context.Context, in *QueryGetRegistriesRequest, opts ...grpc.CallOption) (*QueryGetRegistriesResponse, error) {
	out := new(QueryGetRegistriesResponse)
	err := c.cc.Invoke(ctx, "/provenance.registry.v1.Query/GetRegistries", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *queryClient) HasRole(ctx context.Context, in *QueryHasRoleRequest, opts ...grpc.CallOption) (*QueryHasRoleResponse, error) {
	out := new(QueryHasRoleResponse)
	err := c.cc.Invoke(ctx, "/provenance.registry.v1.Query/HasRole", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// QueryServer is the server API for Query service.
type QueryServer interface {
	// GetRegistry returns the registry entry for a given key.
	// This method retrieves the complete registry entry including all roles and addresses.
	GetRegistry(context.Context, *QueryGetRegistryRequest) (*QueryGetRegistryResponse, error)
	// GetRegistries returns all registry entries, optionally filtered by asset class ID.
	// This method retrieves the complete registry entries including all roles and addresses.
	GetRegistries(context.Context, *QueryGetRegistriesRequest) (*QueryGetRegistriesResponse, error)
	// HasRole returns true if the address has the specified role for the given key.
	HasRole(context.Context, *QueryHasRoleRequest) (*QueryHasRoleResponse, error)
}

// UnimplementedQueryServer can be embedded to have forward compatible implementations.
type UnimplementedQueryServer struct {
}

func (*UnimplementedQueryServer) GetRegistry(ctx context.Context, req *QueryGetRegistryRequest) (*QueryGetRegistryResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetRegistry not implemented")
}
func (*UnimplementedQueryServer) GetRegistries(ctx context.Context, req *QueryGetRegistriesRequest) (*QueryGetRegistriesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetRegistries not implemented")
}
func (*UnimplementedQueryServer) HasRole(ctx context.Context, req *QueryHasRoleRequest) (*QueryHasRoleResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method HasRole not implemented")
}

func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
	s.RegisterService(&_Query_serviceDesc, srv)
}

func _Query_GetRegistry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryGetRegistryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).GetRegistry(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/provenance.registry.v1.Query/GetRegistry",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).GetRegistry(ctx, req.(*QueryGetRegistryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Query_GetRegistries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryGetRegistriesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).GetRegistries(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/provenance.registry.v1.Query/GetRegistries",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).GetRegistries(ctx, req.(*QueryGetRegistriesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Query_HasRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryHasRoleRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).HasRole(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/provenance.registry.v1.Query/HasRole",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).HasRole(ctx, req.(*QueryHasRoleRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var Query_serviceDesc = _Query_serviceDesc
var _Query_serviceDesc = grpc.ServiceDesc{
	ServiceName: "provenance.registry.v1.Query",
	HandlerType: (*QueryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetRegistry",
			Handler:    _Query_GetRegistry_Handler,
		},
		{
			MethodName: "GetRegistries",
			Handler:    _Query_GetRegistries_Handler,
		},
		{
			MethodName: "HasRole",
			Handler:    _Query_HasRole_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "provenance/registry/v1/query.proto",
}

func (m *QueryGetRegistryRequest) 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 *QueryGetRegistryRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryGetRegistryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Key != nil {
		{
			size, err := m.Key.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryGetRegistryResponse) 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 *QueryGetRegistryResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryGetRegistryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Registry.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintQuery(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

func (m *QueryGetRegistriesRequest) 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 *QueryGetRegistriesRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryGetRegistriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Pagination != nil {
		{
			size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x6
		i--
		dAtA[i] = 0x9a
	}
	if len(m.AssetClassId) > 0 {
		i -= len(m.AssetClassId)
		copy(dAtA[i:], m.AssetClassId)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetClassId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryGetRegistriesResponse) 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 *QueryGetRegistriesResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryGetRegistriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Pagination != nil {
		{
			size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x6
		i--
		dAtA[i] = 0x9a
	}
	if len(m.Registries) > 0 {
		for iNdEx := len(m.Registries) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.Registries[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintQuery(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func (m *QueryHasRoleRequest) 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 *QueryHasRoleRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryHasRoleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Role != 0 {
		i = encodeVarintQuery(dAtA, i, uint64(m.Role))
		i--
		dAtA[i] = 0x18
	}
	if len(m.Address) > 0 {
		i -= len(m.Address)
		copy(dAtA[i:], m.Address)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.Address)))
		i--
		dAtA[i] = 0x12
	}
	if m.Key != nil {
		{
			size, err := m.Key.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryHasRoleResponse) 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 *QueryHasRoleResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryHasRoleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.HasRole {
		i--
		if m.HasRole {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
	offset -= sovQuery(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *QueryGetRegistryRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Key != nil {
		l = m.Key.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryGetRegistryResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Registry.Size()
	n += 1 + l + sovQuery(uint64(l))
	return n
}

func (m *QueryGetRegistriesRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.AssetClassId)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	if m.Pagination != nil {
		l = m.Pagination.Size()
		n += 2 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryGetRegistriesResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.Registries) > 0 {
		for _, e := range m.Registries {
			l = e.Size()
			n += 1 + l + sovQuery(uint64(l))
		}
	}
	if m.Pagination != nil {
		l = m.Pagination.Size()
		n += 2 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryHasRoleRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Key != nil {
		l = m.Key.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	l = len(m.Address)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	if m.Role != 0 {
		n += 1 + sovQuery(uint64(m.Role))
	}
	return n
}

func (m *QueryHasRoleResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.HasRole {
		n += 2
	}
	return n
}

func sovQuery(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozQuery(x uint64) (n int) {
	return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *QueryGetRegistryRequest) 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 ErrIntOverflowQuery
			}
			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: QueryGetRegistryRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryGetRegistryRequest: 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 ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			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
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryGetRegistryResponse) 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 ErrIntOverflowQuery
			}
			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: QueryGetRegistryResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryGetRegistryResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Registry", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Registry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryGetRegistriesRequest) 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 ErrIntOverflowQuery
			}
			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: QueryGetRegistriesRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryGetRegistriesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			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 ErrIntOverflowQuery
				}
				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 ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.AssetClassId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 99:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Pagination == nil {
				m.Pagination = &query.PageRequest{}
			}
			if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryGetRegistriesResponse) 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 ErrIntOverflowQuery
			}
			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: QueryGetRegistriesResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryGetRegistriesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Registries", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Registries = append(m.Registries, RegistryEntry{})
			if err := m.Registries[len(m.Registries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 99:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Pagination == nil {
				m.Pagination = &query.PageResponse{}
			}
			if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryHasRoleRequest) 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 ErrIntOverflowQuery
			}
			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: QueryHasRoleRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryHasRoleRequest: 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 ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			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 Address", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				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 ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Address = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			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 ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Role |= RegistryRole(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryHasRoleResponse) 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 ErrIntOverflowQuery
			}
			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: QueryHasRoleResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryHasRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field HasRole", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.HasRole = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipQuery(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, ErrIntOverflowQuery
			}
			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, ErrIntOverflowQuery
				}
				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, ErrIntOverflowQuery
				}
				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, ErrInvalidLengthQuery
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupQuery
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthQuery
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
