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

package runtimev1

import (
	v1 "github.com/pingcap-inc/nexuscrm-contract/wire-go/gen/common/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 CreateDefaultValueKind int32

const (
	CreateDefaultValueKind_CREATE_DEFAULT_VALUE_KIND_UNSPECIFIED CreateDefaultValueKind = 0
	CreateDefaultValueKind_CREATE_DEFAULT_VALUE_KIND_INTEGER     CreateDefaultValueKind = 1
	CreateDefaultValueKind_CREATE_DEFAULT_VALUE_KIND_REFERENCE   CreateDefaultValueKind = 2
)

// Enum value maps for CreateDefaultValueKind.
var (
	CreateDefaultValueKind_name = map[int32]string{
		0: "CREATE_DEFAULT_VALUE_KIND_UNSPECIFIED",
		1: "CREATE_DEFAULT_VALUE_KIND_INTEGER",
		2: "CREATE_DEFAULT_VALUE_KIND_REFERENCE",
	}
	CreateDefaultValueKind_value = map[string]int32{
		"CREATE_DEFAULT_VALUE_KIND_UNSPECIFIED": 0,
		"CREATE_DEFAULT_VALUE_KIND_INTEGER":     1,
		"CREATE_DEFAULT_VALUE_KIND_REFERENCE":   2,
	}
)

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

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

func (CreateDefaultValueKind) Descriptor() protoreflect.EnumDescriptor {
	return file_runtime_v1_record_defaults_proto_enumTypes[0].Descriptor()
}

func (CreateDefaultValueKind) Type() protoreflect.EnumType {
	return &file_runtime_v1_record_defaults_proto_enumTypes[0]
}

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

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

type CreateDefaultProvenance int32

const (
	CreateDefaultProvenance_CREATE_DEFAULT_PROVENANCE_UNSPECIFIED          CreateDefaultProvenance = 0
	CreateDefaultProvenance_CREATE_DEFAULT_PROVENANCE_SIBLING_MAX_PLUS_ONE CreateDefaultProvenance = 1
	CreateDefaultProvenance_CREATE_DEFAULT_PROVENANCE_CURRENT_PRINCIPAL    CreateDefaultProvenance = 2
)

// Enum value maps for CreateDefaultProvenance.
var (
	CreateDefaultProvenance_name = map[int32]string{
		0: "CREATE_DEFAULT_PROVENANCE_UNSPECIFIED",
		1: "CREATE_DEFAULT_PROVENANCE_SIBLING_MAX_PLUS_ONE",
		2: "CREATE_DEFAULT_PROVENANCE_CURRENT_PRINCIPAL",
	}
	CreateDefaultProvenance_value = map[string]int32{
		"CREATE_DEFAULT_PROVENANCE_UNSPECIFIED":          0,
		"CREATE_DEFAULT_PROVENANCE_SIBLING_MAX_PLUS_ONE": 1,
		"CREATE_DEFAULT_PROVENANCE_CURRENT_PRINCIPAL":    2,
	}
)

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

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

func (CreateDefaultProvenance) Descriptor() protoreflect.EnumDescriptor {
	return file_runtime_v1_record_defaults_proto_enumTypes[1].Descriptor()
}

func (CreateDefaultProvenance) Type() protoreflect.EnumType {
	return &file_runtime_v1_record_defaults_proto_enumTypes[1]
}

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

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

// Identity and authority are authenticated transport context. Parent context
// is optional as a pair; Runtime resolves configured target fields itself.
type PreviewCreateDefaultsRequest struct {
	state              protoimpl.MessageState `protogen:"open.v1"`
	ObjectId           string                 `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	ParentFieldId      *string                `protobuf:"bytes,2,opt,name=parent_field_id,json=parentFieldId,proto3,oneof" json:"parent_field_id,omitempty"`
	ParentRecordId     *string                `protobuf:"bytes,3,opt,name=parent_record_id,json=parentRecordId,proto3,oneof" json:"parent_record_id,omitempty"`
	MinCatalogRevision *uint64                `protobuf:"varint,4,opt,name=min_catalog_revision,json=minCatalogRevision,proto3,oneof" json:"min_catalog_revision,omitempty"`
	unknownFields      protoimpl.UnknownFields
	sizeCache          protoimpl.SizeCache
}

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

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

func (*PreviewCreateDefaultsRequest) ProtoMessage() {}

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

func (x *PreviewCreateDefaultsRequest) GetObjectId() string {
	if x != nil {
		return x.ObjectId
	}
	return ""
}

func (x *PreviewCreateDefaultsRequest) GetParentFieldId() string {
	if x != nil && x.ParentFieldId != nil {
		return *x.ParentFieldId
	}
	return ""
}

func (x *PreviewCreateDefaultsRequest) GetParentRecordId() string {
	if x != nil && x.ParentRecordId != nil {
		return *x.ParentRecordId
	}
	return ""
}

func (x *PreviewCreateDefaultsRequest) GetMinCatalogRevision() uint64 {
	if x != nil && x.MinCatalogRevision != nil {
		return *x.MinCatalogRevision
	}
	return 0
}

type CreateDefaultField struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	Name  string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Kind  CreateDefaultValueKind `protobuf:"varint,2,opt,name=kind,proto3,enum=nexuscrm.runtime.v1.CreateDefaultValueKind" json:"kind,omitempty"`
	// Types that are valid to be assigned to Value:
	//
	//	*CreateDefaultField_IntegerValue
	//	*CreateDefaultField_ReferenceValue
	Value         isCreateDefaultField_Value `protobuf_oneof:"value"`
	DisplayValue  *string                    `protobuf:"bytes,5,opt,name=display_value,json=displayValue,proto3,oneof" json:"display_value,omitempty"`
	Provenance    CreateDefaultProvenance    `protobuf:"varint,6,opt,name=provenance,proto3,enum=nexuscrm.runtime.v1.CreateDefaultProvenance" json:"provenance,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*CreateDefaultField) ProtoMessage() {}

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

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

func (x *CreateDefaultField) GetKind() CreateDefaultValueKind {
	if x != nil {
		return x.Kind
	}
	return CreateDefaultValueKind_CREATE_DEFAULT_VALUE_KIND_UNSPECIFIED
}

func (x *CreateDefaultField) GetValue() isCreateDefaultField_Value {
	if x != nil {
		return x.Value
	}
	return nil
}

func (x *CreateDefaultField) GetIntegerValue() int64 {
	if x != nil {
		if x, ok := x.Value.(*CreateDefaultField_IntegerValue); ok {
			return x.IntegerValue
		}
	}
	return 0
}

func (x *CreateDefaultField) GetReferenceValue() string {
	if x != nil {
		if x, ok := x.Value.(*CreateDefaultField_ReferenceValue); ok {
			return x.ReferenceValue
		}
	}
	return ""
}

func (x *CreateDefaultField) GetDisplayValue() string {
	if x != nil && x.DisplayValue != nil {
		return *x.DisplayValue
	}
	return ""
}

func (x *CreateDefaultField) GetProvenance() CreateDefaultProvenance {
	if x != nil {
		return x.Provenance
	}
	return CreateDefaultProvenance_CREATE_DEFAULT_PROVENANCE_UNSPECIFIED
}

type isCreateDefaultField_Value interface {
	isCreateDefaultField_Value()
}

type CreateDefaultField_IntegerValue struct {
	IntegerValue int64 `protobuf:"zigzag64,3,opt,name=integer_value,json=integerValue,proto3,oneof"`
}

type CreateDefaultField_ReferenceValue struct {
	ReferenceValue string `protobuf:"bytes,4,opt,name=reference_value,json=referenceValue,proto3,oneof"`
}

func (*CreateDefaultField_IntegerValue) isCreateDefaultField_Value() {}

func (*CreateDefaultField_ReferenceValue) isCreateDefaultField_Value() {}

type PreviewCreateDefaultsResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Unique canonical fields ordered by ascending bytewise UTF-8 API name.
	Fields        []*CreateDefaultField   `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"`
	Receipts      *v1.ConsistencyReceipts `protobuf:"bytes,2,opt,name=receipts,proto3" json:"receipts,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*PreviewCreateDefaultsResponse) ProtoMessage() {}

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

func (x *PreviewCreateDefaultsResponse) GetFields() []*CreateDefaultField {
	if x != nil {
		return x.Fields
	}
	return nil
}

func (x *PreviewCreateDefaultsResponse) GetReceipts() *v1.ConsistencyReceipts {
	if x != nil {
		return x.Receipts
	}
	return nil
}

var File_runtime_v1_record_defaults_proto protoreflect.FileDescriptor

const file_runtime_v1_record_defaults_proto_rawDesc = "" +
	"\n" +
	" runtime/v1/record_defaults.proto\x12\x13nexuscrm.runtime.v1\x1a\x16common/v1/common.proto\"\x90\x02\n" +
	"\x1cPreviewCreateDefaultsRequest\x12\x1b\n" +
	"\tobject_id\x18\x01 \x01(\tR\bobjectId\x12+\n" +
	"\x0fparent_field_id\x18\x02 \x01(\tH\x00R\rparentFieldId\x88\x01\x01\x12-\n" +
	"\x10parent_record_id\x18\x03 \x01(\tH\x01R\x0eparentRecordId\x88\x01\x01\x125\n" +
	"\x14min_catalog_revision\x18\x04 \x01(\x04H\x02R\x12minCatalogRevision\x88\x01\x01B\x12\n" +
	"\x10_parent_field_idB\x13\n" +
	"\x11_parent_record_idB\x17\n" +
	"\x15_min_catalog_revision\"\xce\x02\n" +
	"\x12CreateDefaultField\x12\x12\n" +
	"\x04name\x18\x01 \x01(\tR\x04name\x12?\n" +
	"\x04kind\x18\x02 \x01(\x0e2+.nexuscrm.runtime.v1.CreateDefaultValueKindR\x04kind\x12%\n" +
	"\rinteger_value\x18\x03 \x01(\x12H\x00R\fintegerValue\x12)\n" +
	"\x0freference_value\x18\x04 \x01(\tH\x00R\x0ereferenceValue\x12(\n" +
	"\rdisplay_value\x18\x05 \x01(\tH\x01R\fdisplayValue\x88\x01\x01\x12L\n" +
	"\n" +
	"provenance\x18\x06 \x01(\x0e2,.nexuscrm.runtime.v1.CreateDefaultProvenanceR\n" +
	"provenanceB\a\n" +
	"\x05valueB\x10\n" +
	"\x0e_display_value\"\xa5\x01\n" +
	"\x1dPreviewCreateDefaultsResponse\x12?\n" +
	"\x06fields\x18\x01 \x03(\v2'.nexuscrm.runtime.v1.CreateDefaultFieldR\x06fields\x12C\n" +
	"\breceipts\x18\x02 \x01(\v2'.nexuscrm.common.v1.ConsistencyReceiptsR\breceipts*\x93\x01\n" +
	"\x16CreateDefaultValueKind\x12)\n" +
	"%CREATE_DEFAULT_VALUE_KIND_UNSPECIFIED\x10\x00\x12%\n" +
	"!CREATE_DEFAULT_VALUE_KIND_INTEGER\x10\x01\x12'\n" +
	"#CREATE_DEFAULT_VALUE_KIND_REFERENCE\x10\x02*\xa9\x01\n" +
	"\x17CreateDefaultProvenance\x12)\n" +
	"%CREATE_DEFAULT_PROVENANCE_UNSPECIFIED\x10\x00\x122\n" +
	".CREATE_DEFAULT_PROVENANCE_SIBLING_MAX_PLUS_ONE\x10\x01\x12/\n" +
	"+CREATE_DEFAULT_PROVENANCE_CURRENT_PRINCIPAL\x10\x022\xa3\x01\n" +
	"!RecordCreateDefaultPreviewService\x12~\n" +
	"\x15PreviewCreateDefaults\x121.nexuscrm.runtime.v1.PreviewCreateDefaultsRequest\x1a2.nexuscrm.runtime.v1.PreviewCreateDefaultsResponseBKZIgithub.com/pingcap-inc/nexuscrm-contract/wire-go/gen/runtime/v1;runtimev1b\x06proto3"

var (
	file_runtime_v1_record_defaults_proto_rawDescOnce sync.Once
	file_runtime_v1_record_defaults_proto_rawDescData []byte
)

func file_runtime_v1_record_defaults_proto_rawDescGZIP() []byte {
	file_runtime_v1_record_defaults_proto_rawDescOnce.Do(func() {
		file_runtime_v1_record_defaults_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_runtime_v1_record_defaults_proto_rawDesc), len(file_runtime_v1_record_defaults_proto_rawDesc)))
	})
	return file_runtime_v1_record_defaults_proto_rawDescData
}

var file_runtime_v1_record_defaults_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_runtime_v1_record_defaults_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_runtime_v1_record_defaults_proto_goTypes = []any{
	(CreateDefaultValueKind)(0),           // 0: nexuscrm.runtime.v1.CreateDefaultValueKind
	(CreateDefaultProvenance)(0),          // 1: nexuscrm.runtime.v1.CreateDefaultProvenance
	(*PreviewCreateDefaultsRequest)(nil),  // 2: nexuscrm.runtime.v1.PreviewCreateDefaultsRequest
	(*CreateDefaultField)(nil),            // 3: nexuscrm.runtime.v1.CreateDefaultField
	(*PreviewCreateDefaultsResponse)(nil), // 4: nexuscrm.runtime.v1.PreviewCreateDefaultsResponse
	(*v1.ConsistencyReceipts)(nil),        // 5: nexuscrm.common.v1.ConsistencyReceipts
}
var file_runtime_v1_record_defaults_proto_depIdxs = []int32{
	0, // 0: nexuscrm.runtime.v1.CreateDefaultField.kind:type_name -> nexuscrm.runtime.v1.CreateDefaultValueKind
	1, // 1: nexuscrm.runtime.v1.CreateDefaultField.provenance:type_name -> nexuscrm.runtime.v1.CreateDefaultProvenance
	3, // 2: nexuscrm.runtime.v1.PreviewCreateDefaultsResponse.fields:type_name -> nexuscrm.runtime.v1.CreateDefaultField
	5, // 3: nexuscrm.runtime.v1.PreviewCreateDefaultsResponse.receipts:type_name -> nexuscrm.common.v1.ConsistencyReceipts
	2, // 4: nexuscrm.runtime.v1.RecordCreateDefaultPreviewService.PreviewCreateDefaults:input_type -> nexuscrm.runtime.v1.PreviewCreateDefaultsRequest
	4, // 5: nexuscrm.runtime.v1.RecordCreateDefaultPreviewService.PreviewCreateDefaults:output_type -> nexuscrm.runtime.v1.PreviewCreateDefaultsResponse
	5, // [5:6] is the sub-list for method output_type
	4, // [4:5] 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_runtime_v1_record_defaults_proto_init() }
func file_runtime_v1_record_defaults_proto_init() {
	if File_runtime_v1_record_defaults_proto != nil {
		return
	}
	file_runtime_v1_record_defaults_proto_msgTypes[0].OneofWrappers = []any{}
	file_runtime_v1_record_defaults_proto_msgTypes[1].OneofWrappers = []any{
		(*CreateDefaultField_IntegerValue)(nil),
		(*CreateDefaultField_ReferenceValue)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_runtime_v1_record_defaults_proto_rawDesc), len(file_runtime_v1_record_defaults_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_runtime_v1_record_defaults_proto_goTypes,
		DependencyIndexes: file_runtime_v1_record_defaults_proto_depIdxs,
		EnumInfos:         file_runtime_v1_record_defaults_proto_enumTypes,
		MessageInfos:      file_runtime_v1_record_defaults_proto_msgTypes,
	}.Build()
	File_runtime_v1_record_defaults_proto = out.File
	file_runtime_v1_record_defaults_proto_goTypes = nil
	file_runtime_v1_record_defaults_proto_depIdxs = nil
}
