// Copyright 2021-2025 Zenauth Ltd.
// SPDX-License-Identifier: Apache-2.0

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        (unknown)
// source: cerbos/source/v1/source.proto

package sourcev1

import (
	v1 "github.com/cerbos/cerbos/api/genpb/cerbos/policy/v1"
	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 Error_Kind int32

const (
	Error_KIND_UNSPECIFIED      Error_Kind = 0
	Error_KIND_PARSE_ERROR      Error_Kind = 1
	Error_KIND_VALIDATION_ERROR Error_Kind = 2
)

// Enum value maps for Error_Kind.
var (
	Error_Kind_name = map[int32]string{
		0: "KIND_UNSPECIFIED",
		1: "KIND_PARSE_ERROR",
		2: "KIND_VALIDATION_ERROR",
	}
	Error_Kind_value = map[string]int32{
		"KIND_UNSPECIFIED":      0,
		"KIND_PARSE_ERROR":      1,
		"KIND_VALIDATION_ERROR": 2,
	}
)

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

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

func (Error_Kind) Descriptor() protoreflect.EnumDescriptor {
	return file_cerbos_source_v1_source_proto_enumTypes[0].Descriptor()
}

func (Error_Kind) Type() protoreflect.EnumType {
	return &file_cerbos_source_v1_source_proto_enumTypes[0]
}

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

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

type Position struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Line          uint32                 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`
	Column        uint32                 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`
	Path          string                 `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Position) ProtoMessage() {}

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

func (x *Position) GetLine() uint32 {
	if x != nil {
		return x.Line
	}
	return 0
}

func (x *Position) GetColumn() uint32 {
	if x != nil {
		return x.Column
	}
	return 0
}

func (x *Position) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

type Error struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Kind          Error_Kind             `protobuf:"varint,1,opt,name=kind,proto3,enum=cerbos.source.v1.Error_Kind" json:"kind,omitempty"`
	Position      *Position              `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"`
	Message       string                 `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Context       string                 `protobuf:"bytes,4,opt,name=context,proto3" json:"context,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Error) ProtoMessage() {}

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

func (x *Error) GetKind() Error_Kind {
	if x != nil {
		return x.Kind
	}
	return Error_KIND_UNSPECIFIED
}

func (x *Error) GetPosition() *Position {
	if x != nil {
		return x.Position
	}
	return nil
}

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

func (x *Error) GetContext() string {
	if x != nil {
		return x.Context
	}
	return ""
}

type StartPosition struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Line          uint32                 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`
	Column        uint32                 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`
	Offset        uint32                 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*StartPosition) ProtoMessage() {}

func (x *StartPosition) ProtoReflect() protoreflect.Message {
	mi := &file_cerbos_source_v1_source_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 StartPosition.ProtoReflect.Descriptor instead.
func (*StartPosition) Descriptor() ([]byte, []int) {
	return file_cerbos_source_v1_source_proto_rawDescGZIP(), []int{2}
}

func (x *StartPosition) GetLine() uint32 {
	if x != nil {
		return x.Line
	}
	return 0
}

func (x *StartPosition) GetColumn() uint32 {
	if x != nil {
		return x.Column
	}
	return 0
}

func (x *StartPosition) GetOffset() uint32 {
	if x != nil {
		return x.Offset
	}
	return 0
}

type SourceContext struct {
	state          protoimpl.MessageState `protogen:"open.v1"`
	StartPosition  *StartPosition         `protobuf:"bytes,1,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"`
	FieldPositions map[string]*Position   `protobuf:"bytes,2,rep,name=field_positions,json=fieldPositions,proto3" json:"field_positions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Errors         []*Error               `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"`
	unknownFields  protoimpl.UnknownFields
	sizeCache      protoimpl.SizeCache
}

func (x *SourceContext) Reset() {
	*x = SourceContext{}
	mi := &file_cerbos_source_v1_source_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*SourceContext) ProtoMessage() {}

func (x *SourceContext) ProtoReflect() protoreflect.Message {
	mi := &file_cerbos_source_v1_source_proto_msgTypes[3]
	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 SourceContext.ProtoReflect.Descriptor instead.
func (*SourceContext) Descriptor() ([]byte, []int) {
	return file_cerbos_source_v1_source_proto_rawDescGZIP(), []int{3}
}

func (x *SourceContext) GetStartPosition() *StartPosition {
	if x != nil {
		return x.StartPosition
	}
	return nil
}

func (x *SourceContext) GetFieldPositions() map[string]*Position {
	if x != nil {
		return x.FieldPositions
	}
	return nil
}

func (x *SourceContext) GetErrors() []*Error {
	if x != nil {
		return x.Errors
	}
	return nil
}

type PolicyWrapper struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Id            uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Key           string                 `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Policy        *v1.Policy             `protobuf:"bytes,3,opt,name=policy,proto3" json:"policy,omitempty"`
	Kind          v1.Kind                `protobuf:"varint,4,opt,name=kind,proto3,enum=cerbos.policy.v1.Kind" json:"kind,omitempty"`
	Name          string                 `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	Version       string                 `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
	Scope         string                 `protobuf:"bytes,7,opt,name=scope,proto3" json:"scope,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *PolicyWrapper) Reset() {
	*x = PolicyWrapper{}
	mi := &file_cerbos_source_v1_source_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*PolicyWrapper) ProtoMessage() {}

func (x *PolicyWrapper) ProtoReflect() protoreflect.Message {
	mi := &file_cerbos_source_v1_source_proto_msgTypes[4]
	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 PolicyWrapper.ProtoReflect.Descriptor instead.
func (*PolicyWrapper) Descriptor() ([]byte, []int) {
	return file_cerbos_source_v1_source_proto_rawDescGZIP(), []int{4}
}

func (x *PolicyWrapper) GetId() uint64 {
	if x != nil {
		return x.Id
	}
	return 0
}

func (x *PolicyWrapper) GetKey() string {
	if x != nil {
		return x.Key
	}
	return ""
}

func (x *PolicyWrapper) GetPolicy() *v1.Policy {
	if x != nil {
		return x.Policy
	}
	return nil
}

func (x *PolicyWrapper) GetKind() v1.Kind {
	if x != nil {
		return x.Kind
	}
	return v1.Kind(0)
}

func (x *PolicyWrapper) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *PolicyWrapper) GetVersion() string {
	if x != nil {
		return x.Version
	}
	return ""
}

func (x *PolicyWrapper) GetScope() string {
	if x != nil {
		return x.Scope
	}
	return ""
}

var File_cerbos_source_v1_source_proto protoreflect.FileDescriptor

const file_cerbos_source_v1_source_proto_rawDesc = "" +
	"\n" +
	"\x1dcerbos/source/v1/source.proto\x12\x10cerbos.source.v1\x1a\x1dcerbos/policy/v1/policy.proto\"J\n" +
	"\bPosition\x12\x12\n" +
	"\x04line\x18\x01 \x01(\rR\x04line\x12\x16\n" +
	"\x06column\x18\x02 \x01(\rR\x06column\x12\x12\n" +
	"\x04path\x18\x03 \x01(\tR\x04path\"\xf4\x01\n" +
	"\x05Error\x120\n" +
	"\x04kind\x18\x01 \x01(\x0e2\x1c.cerbos.source.v1.Error.KindR\x04kind\x126\n" +
	"\bposition\x18\x02 \x01(\v2\x1a.cerbos.source.v1.PositionR\bposition\x12\x18\n" +
	"\amessage\x18\x03 \x01(\tR\amessage\x12\x18\n" +
	"\acontext\x18\x04 \x01(\tR\acontext\"M\n" +
	"\x04Kind\x12\x14\n" +
	"\x10KIND_UNSPECIFIED\x10\x00\x12\x14\n" +
	"\x10KIND_PARSE_ERROR\x10\x01\x12\x19\n" +
	"\x15KIND_VALIDATION_ERROR\x10\x02\"S\n" +
	"\rStartPosition\x12\x12\n" +
	"\x04line\x18\x01 \x01(\rR\x04line\x12\x16\n" +
	"\x06column\x18\x02 \x01(\rR\x06column\x12\x16\n" +
	"\x06offset\x18\x03 \x01(\rR\x06offset\"\xc5\x02\n" +
	"\rSourceContext\x12F\n" +
	"\x0estart_position\x18\x01 \x01(\v2\x1f.cerbos.source.v1.StartPositionR\rstartPosition\x12\\\n" +
	"\x0ffield_positions\x18\x02 \x03(\v23.cerbos.source.v1.SourceContext.FieldPositionsEntryR\x0efieldPositions\x12/\n" +
	"\x06errors\x18\x03 \x03(\v2\x17.cerbos.source.v1.ErrorR\x06errors\x1a]\n" +
	"\x13FieldPositionsEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
	"\x05value\x18\x02 \x01(\v2\x1a.cerbos.source.v1.PositionR\x05value:\x028\x01\"\xd3\x01\n" +
	"\rPolicyWrapper\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\x04R\x02id\x12\x10\n" +
	"\x03key\x18\x02 \x01(\tR\x03key\x120\n" +
	"\x06policy\x18\x03 \x01(\v2\x18.cerbos.policy.v1.PolicyR\x06policy\x12*\n" +
	"\x04kind\x18\x04 \x01(\x0e2\x16.cerbos.policy.v1.KindR\x04kind\x12\x12\n" +
	"\x04name\x18\x05 \x01(\tR\x04name\x12\x18\n" +
	"\aversion\x18\x06 \x01(\tR\aversion\x12\x14\n" +
	"\x05scope\x18\a \x01(\tR\x05scopeB>Z<github.com/cerbos/cerbos/api/genpb/cerbos/source/v1;sourcev1b\x06proto3"

var (
	file_cerbos_source_v1_source_proto_rawDescOnce sync.Once
	file_cerbos_source_v1_source_proto_rawDescData []byte
)

func file_cerbos_source_v1_source_proto_rawDescGZIP() []byte {
	file_cerbos_source_v1_source_proto_rawDescOnce.Do(func() {
		file_cerbos_source_v1_source_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cerbos_source_v1_source_proto_rawDesc), len(file_cerbos_source_v1_source_proto_rawDesc)))
	})
	return file_cerbos_source_v1_source_proto_rawDescData
}

var file_cerbos_source_v1_source_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_cerbos_source_v1_source_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_cerbos_source_v1_source_proto_goTypes = []any{
	(Error_Kind)(0),       // 0: cerbos.source.v1.Error.Kind
	(*Position)(nil),      // 1: cerbos.source.v1.Position
	(*Error)(nil),         // 2: cerbos.source.v1.Error
	(*StartPosition)(nil), // 3: cerbos.source.v1.StartPosition
	(*SourceContext)(nil), // 4: cerbos.source.v1.SourceContext
	(*PolicyWrapper)(nil), // 5: cerbos.source.v1.PolicyWrapper
	nil,                   // 6: cerbos.source.v1.SourceContext.FieldPositionsEntry
	(*v1.Policy)(nil),     // 7: cerbos.policy.v1.Policy
	(v1.Kind)(0),          // 8: cerbos.policy.v1.Kind
}
var file_cerbos_source_v1_source_proto_depIdxs = []int32{
	0, // 0: cerbos.source.v1.Error.kind:type_name -> cerbos.source.v1.Error.Kind
	1, // 1: cerbos.source.v1.Error.position:type_name -> cerbos.source.v1.Position
	3, // 2: cerbos.source.v1.SourceContext.start_position:type_name -> cerbos.source.v1.StartPosition
	6, // 3: cerbos.source.v1.SourceContext.field_positions:type_name -> cerbos.source.v1.SourceContext.FieldPositionsEntry
	2, // 4: cerbos.source.v1.SourceContext.errors:type_name -> cerbos.source.v1.Error
	7, // 5: cerbos.source.v1.PolicyWrapper.policy:type_name -> cerbos.policy.v1.Policy
	8, // 6: cerbos.source.v1.PolicyWrapper.kind:type_name -> cerbos.policy.v1.Kind
	1, // 7: cerbos.source.v1.SourceContext.FieldPositionsEntry.value:type_name -> cerbos.source.v1.Position
	8, // [8:8] is the sub-list for method output_type
	8, // [8:8] is the sub-list for method input_type
	8, // [8:8] is the sub-list for extension type_name
	8, // [8:8] is the sub-list for extension extendee
	0, // [0:8] is the sub-list for field type_name
}

func init() { file_cerbos_source_v1_source_proto_init() }
func file_cerbos_source_v1_source_proto_init() {
	if File_cerbos_source_v1_source_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_cerbos_source_v1_source_proto_rawDesc), len(file_cerbos_source_v1_source_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   6,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_cerbos_source_v1_source_proto_goTypes,
		DependencyIndexes: file_cerbos_source_v1_source_proto_depIdxs,
		EnumInfos:         file_cerbos_source_v1_source_proto_enumTypes,
		MessageInfos:      file_cerbos_source_v1_source_proto_msgTypes,
	}.Build()
	File_cerbos_source_v1_source_proto = out.File
	file_cerbos_source_v1_source_proto_goTypes = nil
	file_cerbos_source_v1_source_proto_depIdxs = nil
}
