// 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/castore/protos/rpc_directory.proto

package castorev1

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	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)
)

type GetDirectoryRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to ByWhat:
	//
	//	*GetDirectoryRequest_Digest
	ByWhat isGetDirectoryRequest_ByWhat `protobuf_oneof:"by_what"`
	// If set to true, recursively resolve all child Directory messages.
	// Directory messages SHOULD be streamed in a recursive breadth-first walk,
	// but other orders are also fine, as long as Directory messages are only
	// sent after they are referred to from previously sent Directory messages.
	Recursive     bool `protobuf:"varint,2,opt,name=recursive,proto3" json:"recursive,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*GetDirectoryRequest) ProtoMessage() {}

func (x *GetDirectoryRequest) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_directory_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 GetDirectoryRequest.ProtoReflect.Descriptor instead.
func (*GetDirectoryRequest) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_directory_proto_rawDescGZIP(), []int{0}
}

func (x *GetDirectoryRequest) GetByWhat() isGetDirectoryRequest_ByWhat {
	if x != nil {
		return x.ByWhat
	}
	return nil
}

func (x *GetDirectoryRequest) GetDigest() []byte {
	if x != nil {
		if x, ok := x.ByWhat.(*GetDirectoryRequest_Digest); ok {
			return x.Digest
		}
	}
	return nil
}

func (x *GetDirectoryRequest) GetRecursive() bool {
	if x != nil {
		return x.Recursive
	}
	return false
}

type isGetDirectoryRequest_ByWhat interface {
	isGetDirectoryRequest_ByWhat()
}

type GetDirectoryRequest_Digest struct {
	// The blake3 hash of the (root) Directory message, serialized in
	// protobuf canonical form.
	// Keep in mind this can be a subtree of another root.
	Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3,oneof"`
}

func (*GetDirectoryRequest_Digest) isGetDirectoryRequest_ByWhat() {}

type PutDirectoryResponse struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	RootDigest    []byte                 `protobuf:"bytes,1,opt,name=root_digest,json=rootDigest,proto3" json:"root_digest,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*PutDirectoryResponse) ProtoMessage() {}

func (x *PutDirectoryResponse) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_directory_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 PutDirectoryResponse.ProtoReflect.Descriptor instead.
func (*PutDirectoryResponse) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_directory_proto_rawDescGZIP(), []int{1}
}

func (x *PutDirectoryResponse) GetRootDigest() []byte {
	if x != nil {
		return x.RootDigest
	}
	return nil
}

var File_snix_castore_protos_rpc_directory_proto protoreflect.FileDescriptor

const file_snix_castore_protos_rpc_directory_proto_rawDesc = "" +
	"\n" +
	"'snix/castore/protos/rpc_directory.proto\x12\x0fsnix.castore.v1\x1a!snix/castore/protos/castore.proto\"X\n" +
	"\x13GetDirectoryRequest\x12\x18\n" +
	"\x06digest\x18\x01 \x01(\fH\x00R\x06digest\x12\x1c\n" +
	"\trecursive\x18\x02 \x01(\bR\trecursiveB\t\n" +
	"\aby_what\"7\n" +
	"\x14PutDirectoryResponse\x12\x1f\n" +
	"\vroot_digest\x18\x01 \x01(\fR\n" +
	"rootDigest2\xa9\x01\n" +
	"\x10DirectoryService\x12I\n" +
	"\x03Get\x12$.snix.castore.v1.GetDirectoryRequest\x1a\x1a.snix.castore.v1.Directory0\x01\x12J\n" +
	"\x03Put\x12\x1a.snix.castore.v1.Directory\x1a%.snix.castore.v1.PutDirectoryResponse(\x01B\"Z snix.dev/castore/proto;castorev1b\x06proto3"

var (
	file_snix_castore_protos_rpc_directory_proto_rawDescOnce sync.Once
	file_snix_castore_protos_rpc_directory_proto_rawDescData []byte
)

func file_snix_castore_protos_rpc_directory_proto_rawDescGZIP() []byte {
	file_snix_castore_protos_rpc_directory_proto_rawDescOnce.Do(func() {
		file_snix_castore_protos_rpc_directory_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_snix_castore_protos_rpc_directory_proto_rawDesc), len(file_snix_castore_protos_rpc_directory_proto_rawDesc)))
	})
	return file_snix_castore_protos_rpc_directory_proto_rawDescData
}

var file_snix_castore_protos_rpc_directory_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_snix_castore_protos_rpc_directory_proto_goTypes = []any{
	(*GetDirectoryRequest)(nil),  // 0: snix.castore.v1.GetDirectoryRequest
	(*PutDirectoryResponse)(nil), // 1: snix.castore.v1.PutDirectoryResponse
	(*Directory)(nil),            // 2: snix.castore.v1.Directory
}
var file_snix_castore_protos_rpc_directory_proto_depIdxs = []int32{
	0, // 0: snix.castore.v1.DirectoryService.Get:input_type -> snix.castore.v1.GetDirectoryRequest
	2, // 1: snix.castore.v1.DirectoryService.Put:input_type -> snix.castore.v1.Directory
	2, // 2: snix.castore.v1.DirectoryService.Get:output_type -> snix.castore.v1.Directory
	1, // 3: snix.castore.v1.DirectoryService.Put:output_type -> snix.castore.v1.PutDirectoryResponse
	2, // [2:4] is the sub-list for method output_type
	0, // [0:2] 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_castore_protos_rpc_directory_proto_init() }
func file_snix_castore_protos_rpc_directory_proto_init() {
	if File_snix_castore_protos_rpc_directory_proto != nil {
		return
	}
	file_snix_castore_protos_castore_proto_init()
	file_snix_castore_protos_rpc_directory_proto_msgTypes[0].OneofWrappers = []any{
		(*GetDirectoryRequest_Digest)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_snix_castore_protos_rpc_directory_proto_rawDesc), len(file_snix_castore_protos_rpc_directory_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_snix_castore_protos_rpc_directory_proto_goTypes,
		DependencyIndexes: file_snix_castore_protos_rpc_directory_proto_depIdxs,
		MessageInfos:      file_snix_castore_protos_rpc_directory_proto_msgTypes,
	}.Build()
	File_snix_castore_protos_rpc_directory_proto = out.File
	file_snix_castore_protos_rpc_directory_proto_goTypes = nil
	file_snix_castore_protos_rpc_directory_proto_depIdxs = nil
}
