// SPDX-License-Identifier: MIT
// Copyright © 2022 The Tvix Authors
// Copyright © 2025 The Snix Project

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: snix/store/protos/rpc_pathinfo.proto

package storev1

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	proto "snix.dev/castore/proto"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// The parameters that can be used to lookup a (single) PathInfo object.
// Currently, only a lookup by output hash is supported.
type GetPathInfoRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to ByWhat:
	//
	//	*GetPathInfoRequest_ByOutputHash
	ByWhat        isGetPathInfoRequest_ByWhat `protobuf_oneof:"by_what"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *GetPathInfoRequest) Reset() {
	*x = GetPathInfoRequest{}
	mi := &file_snix_store_protos_rpc_pathinfo_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *GetPathInfoRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*GetPathInfoRequest) ProtoMessage() {}

func (x *GetPathInfoRequest) ProtoReflect() protoreflect.Message {
	mi := &file_snix_store_protos_rpc_pathinfo_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use GetPathInfoRequest.ProtoReflect.Descriptor instead.
func (*GetPathInfoRequest) Descriptor() ([]byte, []int) {
	return file_snix_store_protos_rpc_pathinfo_proto_rawDescGZIP(), []int{0}
}

func (x *GetPathInfoRequest) GetByWhat() isGetPathInfoRequest_ByWhat {
	if x != nil {
		return x.ByWhat
	}
	return nil
}

func (x *GetPathInfoRequest) GetByOutputHash() []byte {
	if x != nil {
		if x, ok := x.ByWhat.(*GetPathInfoRequest_ByOutputHash); ok {
			return x.ByOutputHash
		}
	}
	return nil
}

type isGetPathInfoRequest_ByWhat interface {
	isGetPathInfoRequest_ByWhat()
}

type GetPathInfoRequest_ByOutputHash struct {
	// The output hash of a nix path (20 bytes).
	// This is the nixbase32-decoded portion of a Nix output path, so to substitute
	// /nix/store/xm35nga2g20mz5sm5l6n8v3bdm86yj83-cowsay-3.04
	// this field would contain nixbase32dec("xm35nga2g20mz5sm5l6n8v3bdm86yj83").
	ByOutputHash []byte `protobuf:"bytes,1,opt,name=by_output_hash,json=byOutputHash,proto3,oneof"`
}

func (*GetPathInfoRequest_ByOutputHash) isGetPathInfoRequest_ByWhat() {}

// The parameters that can be used to lookup (multiple) PathInfo objects.
// Currently no filtering is possible, all objects are returned.
type ListPathInfoRequest struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *ListPathInfoRequest) Reset() {
	*x = ListPathInfoRequest{}
	mi := &file_snix_store_protos_rpc_pathinfo_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *ListPathInfoRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ListPathInfoRequest) ProtoMessage() {}

func (x *ListPathInfoRequest) ProtoReflect() protoreflect.Message {
	mi := &file_snix_store_protos_rpc_pathinfo_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ListPathInfoRequest.ProtoReflect.Descriptor instead.
func (*ListPathInfoRequest) Descriptor() ([]byte, []int) {
	return file_snix_store_protos_rpc_pathinfo_proto_rawDescGZIP(), []int{1}
}

// CalculateNARResponse is the response returned by the CalculateNAR request.
//
// It contains the size of the NAR representation (in bytes), and the sha56
// digest.
type CalculateNARResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// This size of the NAR file, in bytes.
	NarSize uint64 `protobuf:"varint,1,opt,name=nar_size,json=narSize,proto3" json:"nar_size,omitempty"`
	// The sha256 of the NAR file representation.
	NarSha256     []byte `protobuf:"bytes,2,opt,name=nar_sha256,json=narSha256,proto3" json:"nar_sha256,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *CalculateNARResponse) Reset() {
	*x = CalculateNARResponse{}
	mi := &file_snix_store_protos_rpc_pathinfo_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *CalculateNARResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CalculateNARResponse) ProtoMessage() {}

func (x *CalculateNARResponse) ProtoReflect() protoreflect.Message {
	mi := &file_snix_store_protos_rpc_pathinfo_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use CalculateNARResponse.ProtoReflect.Descriptor instead.
func (*CalculateNARResponse) Descriptor() ([]byte, []int) {
	return file_snix_store_protos_rpc_pathinfo_proto_rawDescGZIP(), []int{2}
}

func (x *CalculateNARResponse) GetNarSize() uint64 {
	if x != nil {
		return x.NarSize
	}
	return 0
}

func (x *CalculateNARResponse) GetNarSha256() []byte {
	if x != nil {
		return x.NarSha256
	}
	return nil
}

var File_snix_store_protos_rpc_pathinfo_proto protoreflect.FileDescriptor

const file_snix_store_protos_rpc_pathinfo_proto_rawDesc = "" +
	"\n" +
	"$snix/store/protos/rpc_pathinfo.proto\x12\rsnix.store.v1\x1a!snix/castore/protos/castore.proto\x1a snix/store/protos/pathinfo.proto\"G\n" +
	"\x12GetPathInfoRequest\x12&\n" +
	"\x0eby_output_hash\x18\x01 \x01(\fH\x00R\fbyOutputHashB\t\n" +
	"\aby_what\"\x15\n" +
	"\x13ListPathInfoRequest\"P\n" +
	"\x14CalculateNARResponse\x12\x19\n" +
	"\bnar_size\x18\x01 \x01(\x04R\anarSize\x12\x1d\n" +
	"\n" +
	"nar_sha256\x18\x02 \x01(\fR\tnarSha2562\xa1\x02\n" +
	"\x0fPathInfoService\x12A\n" +
	"\x03Get\x12!.snix.store.v1.GetPathInfoRequest\x1a\x17.snix.store.v1.PathInfo\x127\n" +
	"\x03Put\x12\x17.snix.store.v1.PathInfo\x1a\x17.snix.store.v1.PathInfo\x12K\n" +
	"\fCalculateNAR\x12\x16.snix.castore.v1.Entry\x1a#.snix.store.v1.CalculateNARResponse\x12E\n" +
	"\x04List\x12\".snix.store.v1.ListPathInfoRequest\x1a\x17.snix.store.v1.PathInfo0\x01B\x1eZ\x1csnix.dev/store/proto;storev1b\x06proto3"

var (
	file_snix_store_protos_rpc_pathinfo_proto_rawDescOnce sync.Once
	file_snix_store_protos_rpc_pathinfo_proto_rawDescData []byte
)

func file_snix_store_protos_rpc_pathinfo_proto_rawDescGZIP() []byte {
	file_snix_store_protos_rpc_pathinfo_proto_rawDescOnce.Do(func() {
		file_snix_store_protos_rpc_pathinfo_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_snix_store_protos_rpc_pathinfo_proto_rawDesc), len(file_snix_store_protos_rpc_pathinfo_proto_rawDesc)))
	})
	return file_snix_store_protos_rpc_pathinfo_proto_rawDescData
}

var file_snix_store_protos_rpc_pathinfo_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_snix_store_protos_rpc_pathinfo_proto_goTypes = []any{
	(*GetPathInfoRequest)(nil),   // 0: snix.store.v1.GetPathInfoRequest
	(*ListPathInfoRequest)(nil),  // 1: snix.store.v1.ListPathInfoRequest
	(*CalculateNARResponse)(nil), // 2: snix.store.v1.CalculateNARResponse
	(*PathInfo)(nil),             // 3: snix.store.v1.PathInfo
	(*proto.Entry)(nil),          // 4: snix.castore.v1.Entry
}
var file_snix_store_protos_rpc_pathinfo_proto_depIdxs = []int32{
	0, // 0: snix.store.v1.PathInfoService.Get:input_type -> snix.store.v1.GetPathInfoRequest
	3, // 1: snix.store.v1.PathInfoService.Put:input_type -> snix.store.v1.PathInfo
	4, // 2: snix.store.v1.PathInfoService.CalculateNAR:input_type -> snix.castore.v1.Entry
	1, // 3: snix.store.v1.PathInfoService.List:input_type -> snix.store.v1.ListPathInfoRequest
	3, // 4: snix.store.v1.PathInfoService.Get:output_type -> snix.store.v1.PathInfo
	3, // 5: snix.store.v1.PathInfoService.Put:output_type -> snix.store.v1.PathInfo
	2, // 6: snix.store.v1.PathInfoService.CalculateNAR:output_type -> snix.store.v1.CalculateNARResponse
	3, // 7: snix.store.v1.PathInfoService.List:output_type -> snix.store.v1.PathInfo
	4, // [4:8] is the sub-list for method output_type
	0, // [0:4] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_snix_store_protos_rpc_pathinfo_proto_init() }
func file_snix_store_protos_rpc_pathinfo_proto_init() {
	if File_snix_store_protos_rpc_pathinfo_proto != nil {
		return
	}
	file_snix_store_protos_pathinfo_proto_init()
	file_snix_store_protos_rpc_pathinfo_proto_msgTypes[0].OneofWrappers = []any{
		(*GetPathInfoRequest_ByOutputHash)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_snix_store_protos_rpc_pathinfo_proto_rawDesc), len(file_snix_store_protos_rpc_pathinfo_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_snix_store_protos_rpc_pathinfo_proto_goTypes,
		DependencyIndexes: file_snix_store_protos_rpc_pathinfo_proto_depIdxs,
		MessageInfos:      file_snix_store_protos_rpc_pathinfo_proto_msgTypes,
	}.Build()
	File_snix_store_protos_rpc_pathinfo_proto = out.File
	file_snix_store_protos_rpc_pathinfo_proto_goTypes = nil
	file_snix_store_protos_rpc_pathinfo_proto_depIdxs = nil
}
