// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v5.29.3
// source: errors.proto

package common

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

// Common error codes that can be used across services
type ErrorCode int32

const (
	ErrorCode_ERROR_CODE_UNSPECIFIED  ErrorCode = 0
	ErrorCode_INVALID_REQUEST         ErrorCode = 1
	ErrorCode_INVALID_PARAMETER       ErrorCode = 2
	ErrorCode_INTERNAL_ERROR          ErrorCode = 3
	ErrorCode_RANGE_TOO_LARGE         ErrorCode = 4
	ErrorCode_RANGE_OUTSIDE_AVAILABLE ErrorCode = 5
	ErrorCode_RATE_LIMITED            ErrorCode = 6
	ErrorCode_TIMEOUT_ERROR           ErrorCode = 7
	ErrorCode_UNSUPPORTED_METHOD      ErrorCode = 8
	ErrorCode_UNSUPPORTED_BLOCK_TAG   ErrorCode = 9
	ErrorCode_DATA_NOT_FOUND          ErrorCode = 10
)

// Enum value maps for ErrorCode.
var (
	ErrorCode_name = map[int32]string{
		0:  "ERROR_CODE_UNSPECIFIED",
		1:  "INVALID_REQUEST",
		2:  "INVALID_PARAMETER",
		3:  "INTERNAL_ERROR",
		4:  "RANGE_TOO_LARGE",
		5:  "RANGE_OUTSIDE_AVAILABLE",
		6:  "RATE_LIMITED",
		7:  "TIMEOUT_ERROR",
		8:  "UNSUPPORTED_METHOD",
		9:  "UNSUPPORTED_BLOCK_TAG",
		10: "DATA_NOT_FOUND",
	}
	ErrorCode_value = map[string]int32{
		"ERROR_CODE_UNSPECIFIED":  0,
		"INVALID_REQUEST":         1,
		"INVALID_PARAMETER":       2,
		"INTERNAL_ERROR":          3,
		"RANGE_TOO_LARGE":         4,
		"RANGE_OUTSIDE_AVAILABLE": 5,
		"RATE_LIMITED":            6,
		"TIMEOUT_ERROR":           7,
		"UNSUPPORTED_METHOD":      8,
		"UNSUPPORTED_BLOCK_TAG":   9,
		"DATA_NOT_FOUND":          10,
	}
)

func (x ErrorCode) Enum() *ErrorCode {
	p := new(ErrorCode)
	*p = x
	return p
}

func (x ErrorCode) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor {
	return file_errors_proto_enumTypes[0].Descriptor()
}

func (ErrorCode) Type() protoreflect.EnumType {
	return &file_errors_proto_enumTypes[0]
}

func (x ErrorCode) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ErrorCode.Descriptor instead.
func (ErrorCode) EnumDescriptor() ([]byte, []int) {
	return file_errors_proto_rawDescGZIP(), []int{0}
}

// ErrorDetails provides structured error information that can be attached to gRPC status
type ErrorDetails struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Error code for programmatic handling
	Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=bds.common.ErrorCode" json:"code,omitempty"`
	// Human-readable error message
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// Optional nested cause error
	Cause *ErrorDetails `protobuf:"bytes,3,opt,name=cause,proto3" json:"cause,omitempty"`
	// Additional context as key-value pairs
	Details map[string]string `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// For complex details that need structured data
	Metadata      []*anypb.Any `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ErrorDetails) ProtoMessage() {}

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

func (x *ErrorDetails) GetCode() ErrorCode {
	if x != nil {
		return x.Code
	}
	return ErrorCode_ERROR_CODE_UNSPECIFIED
}

func (x *ErrorDetails) GetMessage() string {
	if x != nil {
		return x.Message
	}
	return ""
}

func (x *ErrorDetails) GetCause() *ErrorDetails {
	if x != nil {
		return x.Cause
	}
	return nil
}

func (x *ErrorDetails) GetDetails() map[string]string {
	if x != nil {
		return x.Details
	}
	return nil
}

func (x *ErrorDetails) GetMetadata() []*anypb.Any {
	if x != nil {
		return x.Metadata
	}
	return nil
}

var File_errors_proto protoreflect.FileDescriptor

const file_errors_proto_rawDesc = "" +
	"\n" +
	"\ferrors.proto\x12\n" +
	"bds.common\x1a\x19google/protobuf/any.proto\"\xb2\x02\n" +
	"\fErrorDetails\x12)\n" +
	"\x04code\x18\x01 \x01(\x0e2\x15.bds.common.ErrorCodeR\x04code\x12\x18\n" +
	"\amessage\x18\x02 \x01(\tR\amessage\x12.\n" +
	"\x05cause\x18\x03 \x01(\v2\x18.bds.common.ErrorDetailsR\x05cause\x12?\n" +
	"\adetails\x18\x04 \x03(\v2%.bds.common.ErrorDetails.DetailsEntryR\adetails\x120\n" +
	"\bmetadata\x18\x05 \x03(\v2\x14.google.protobuf.AnyR\bmetadata\x1a:\n" +
	"\fDetailsEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\x85\x02\n" +
	"\tErrorCode\x12\x1a\n" +
	"\x16ERROR_CODE_UNSPECIFIED\x10\x00\x12\x13\n" +
	"\x0fINVALID_REQUEST\x10\x01\x12\x15\n" +
	"\x11INVALID_PARAMETER\x10\x02\x12\x12\n" +
	"\x0eINTERNAL_ERROR\x10\x03\x12\x13\n" +
	"\x0fRANGE_TOO_LARGE\x10\x04\x12\x1b\n" +
	"\x17RANGE_OUTSIDE_AVAILABLE\x10\x05\x12\x10\n" +
	"\fRATE_LIMITED\x10\x06\x12\x11\n" +
	"\rTIMEOUT_ERROR\x10\a\x12\x16\n" +
	"\x12UNSUPPORTED_METHOD\x10\b\x12\x19\n" +
	"\x15UNSUPPORTED_BLOCK_TAG\x10\t\x12\x12\n" +
	"\x0eDATA_NOT_FOUND\x10\n" +
	"B7Z5github.com/blockchain-data-standards/manifesto/commonb\x06proto3"

var (
	file_errors_proto_rawDescOnce sync.Once
	file_errors_proto_rawDescData []byte
)

func file_errors_proto_rawDescGZIP() []byte {
	file_errors_proto_rawDescOnce.Do(func() {
		file_errors_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_errors_proto_rawDesc), len(file_errors_proto_rawDesc)))
	})
	return file_errors_proto_rawDescData
}

var file_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_errors_proto_goTypes = []any{
	(ErrorCode)(0),       // 0: bds.common.ErrorCode
	(*ErrorDetails)(nil), // 1: bds.common.ErrorDetails
	nil,                  // 2: bds.common.ErrorDetails.DetailsEntry
	(*anypb.Any)(nil),    // 3: google.protobuf.Any
}
var file_errors_proto_depIdxs = []int32{
	0, // 0: bds.common.ErrorDetails.code:type_name -> bds.common.ErrorCode
	1, // 1: bds.common.ErrorDetails.cause:type_name -> bds.common.ErrorDetails
	2, // 2: bds.common.ErrorDetails.details:type_name -> bds.common.ErrorDetails.DetailsEntry
	3, // 3: bds.common.ErrorDetails.metadata:type_name -> google.protobuf.Any
	4, // [4:4] is the sub-list for method output_type
	4, // [4:4] is the sub-list for method input_type
	4, // [4:4] is the sub-list for extension type_name
	4, // [4:4] is the sub-list for extension extendee
	0, // [0:4] is the sub-list for field type_name
}

func init() { file_errors_proto_init() }
func file_errors_proto_init() {
	if File_errors_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_errors_proto_rawDesc), len(file_errors_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_errors_proto_goTypes,
		DependencyIndexes: file_errors_proto_depIdxs,
		EnumInfos:         file_errors_proto_enumTypes,
		MessageInfos:      file_errors_proto_msgTypes,
	}.Build()
	File_errors_proto = out.File
	file_errors_proto_goTypes = nil
	file_errors_proto_depIdxs = nil
}
