// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.8
// 	protoc        (unknown)
// source: authzed/api/v1/watch_service.proto

package v1

import (
	_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	structpb "google.golang.org/protobuf/types/known/structpb"
	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 WatchKind int32

const (
	WatchKind_WATCH_KIND_UNSPECIFIED                  WatchKind = 0 // Default, just relationship updates (for backwards compatibility)
	WatchKind_WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES WatchKind = 1
	WatchKind_WATCH_KIND_INCLUDE_SCHEMA_UPDATES       WatchKind = 2
	WatchKind_WATCH_KIND_INCLUDE_CHECKPOINTS          WatchKind = 3
)

// Enum value maps for WatchKind.
var (
	WatchKind_name = map[int32]string{
		0: "WATCH_KIND_UNSPECIFIED",
		1: "WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES",
		2: "WATCH_KIND_INCLUDE_SCHEMA_UPDATES",
		3: "WATCH_KIND_INCLUDE_CHECKPOINTS",
	}
	WatchKind_value = map[string]int32{
		"WATCH_KIND_UNSPECIFIED":                  0,
		"WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES": 1,
		"WATCH_KIND_INCLUDE_SCHEMA_UPDATES":       2,
		"WATCH_KIND_INCLUDE_CHECKPOINTS":          3,
	}
)

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

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

func (WatchKind) Descriptor() protoreflect.EnumDescriptor {
	return file_authzed_api_v1_watch_service_proto_enumTypes[0].Descriptor()
}

func (WatchKind) Type() protoreflect.EnumType {
	return &file_authzed_api_v1_watch_service_proto_enumTypes[0]
}

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

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

// WatchRequest specifies what mutations to watch for, and an optional start snapshot for when to start
// watching.
type WatchRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// optional_object_types is a filter of resource object types to watch for relationship changes.
	// If specified, only changes to the specified object types will be returned and
	// optional_relationship_filters cannot be used.
	OptionalObjectTypes []string `protobuf:"bytes,1,rep,name=optional_object_types,json=optionalObjectTypes,proto3" json:"optional_object_types,omitempty"`
	// optional_start_cursor is the ZedToken holding the point-in-time at
	// which to start watching for changes.
	// If not specified, the watch will begin at the current head revision
	// of the datastore, returning any updates that occur after the caller
	// makes the request.
	// Note that if this cursor references a point-in-time containing data
	// that has been garbage collected, an error will be returned.
	OptionalStartCursor *ZedToken `protobuf:"bytes,2,opt,name=optional_start_cursor,json=optionalStartCursor,proto3" json:"optional_start_cursor,omitempty"`
	// optional_relationship_filters, if specified, indicates the
	// filter(s) to apply to each relationship to be returned by watch.
	// The relationship will be returned as long as at least one filter matches,
	// this allows clients to match relationships on multiple filters on a single watch call.
	// If specified, optional_object_types cannot be used.
	OptionalRelationshipFilters []*RelationshipFilter `protobuf:"bytes,3,rep,name=optional_relationship_filters,json=optionalRelationshipFilters,proto3" json:"optional_relationship_filters,omitempty"`
	// optional_update_kinds, if specified, indicates what kinds of mutations to include.
	OptionalUpdateKinds []WatchKind `protobuf:"varint,4,rep,packed,name=optional_update_kinds,json=optionalUpdateKinds,proto3,enum=authzed.api.v1.WatchKind" json:"optional_update_kinds,omitempty"`
	unknownFields       protoimpl.UnknownFields
	sizeCache           protoimpl.SizeCache
}

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

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

func (*WatchRequest) ProtoMessage() {}

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

func (x *WatchRequest) GetOptionalObjectTypes() []string {
	if x != nil {
		return x.OptionalObjectTypes
	}
	return nil
}

func (x *WatchRequest) GetOptionalStartCursor() *ZedToken {
	if x != nil {
		return x.OptionalStartCursor
	}
	return nil
}

func (x *WatchRequest) GetOptionalRelationshipFilters() []*RelationshipFilter {
	if x != nil {
		return x.OptionalRelationshipFilters
	}
	return nil
}

func (x *WatchRequest) GetOptionalUpdateKinds() []WatchKind {
	if x != nil {
		return x.OptionalUpdateKinds
	}
	return nil
}

// WatchResponse contains all mutation events in ascending timestamp order,
// from the requested start snapshot to a snapshot
// encoded in the watch response. The client can use the snapshot to resume
// watching where the previous watch response left off.
type WatchResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// updates are the RelationshipUpdate events that have occurred since the
	// last watch response.
	Updates []*RelationshipUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"`
	// changes_through is the ZedToken that represents the point in time
	// that the watch response is current through. This token can be used
	// in a subsequent WatchRequest to resume watching from this point.
	ChangesThrough *ZedToken `protobuf:"bytes,2,opt,name=changes_through,json=changesThrough,proto3" json:"changes_through,omitempty"`
	// optional_transaction_metadata is an optional field that returns the transaction metadata
	// given to SpiceDB during the transaction that produced the changes in this response.
	// This field may not exist if no transaction metadata was provided, or if multiple pieces
	// of metadata were found during the transaction (in which case it is ambiguous which to return).
	OptionalTransactionMetadata *structpb.Struct `protobuf:"bytes,3,opt,name=optional_transaction_metadata,json=optionalTransactionMetadata,proto3" json:"optional_transaction_metadata,omitempty"`
	// schema_updated, if true, indicates that the schema was changed in this revision.
	SchemaUpdated bool `protobuf:"varint,4,opt,name=schema_updated,json=schemaUpdated,proto3" json:"schema_updated,omitempty"`
	// is_checkpoint, if true, indicates that a checkpoint was reached.
	// A checkpoint indicates that the server guarantees that the client
	// will not observe any changes at a revision below or equal to the revision in this response.
	IsCheckpoint bool `protobuf:"varint,5,opt,name=is_checkpoint,json=isCheckpoint,proto3" json:"is_checkpoint,omitempty"`
	// full_revision_metadata contains all transaction metadata given to SpiceDB during the
	// revision that produced the changes in this response. Some datastores (such as CockroachDB)
	// can "merge" multiple transactions into a single revision (if the changes occurred concurrently),
	// so this field is a list of all transaction metadata seen during the revision.
	FullRevisionMetadata []*structpb.Struct `protobuf:"bytes,6,rep,name=full_revision_metadata,json=fullRevisionMetadata,proto3" json:"full_revision_metadata,omitempty"`
	unknownFields        protoimpl.UnknownFields
	sizeCache            protoimpl.SizeCache
}

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

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

func (*WatchResponse) ProtoMessage() {}

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

func (x *WatchResponse) GetUpdates() []*RelationshipUpdate {
	if x != nil {
		return x.Updates
	}
	return nil
}

func (x *WatchResponse) GetChangesThrough() *ZedToken {
	if x != nil {
		return x.ChangesThrough
	}
	return nil
}

func (x *WatchResponse) GetOptionalTransactionMetadata() *structpb.Struct {
	if x != nil {
		return x.OptionalTransactionMetadata
	}
	return nil
}

func (x *WatchResponse) GetSchemaUpdated() bool {
	if x != nil {
		return x.SchemaUpdated
	}
	return false
}

func (x *WatchResponse) GetIsCheckpoint() bool {
	if x != nil {
		return x.IsCheckpoint
	}
	return false
}

func (x *WatchResponse) GetFullRevisionMetadata() []*structpb.Struct {
	if x != nil {
		return x.FullRevisionMetadata
	}
	return nil
}

var File_authzed_api_v1_watch_service_proto protoreflect.FileDescriptor

const file_authzed_api_v1_watch_service_proto_rawDesc = "" +
	"\n" +
	"\"authzed/api/v1/watch_service.proto\x12\x0eauthzed.api.v1\x1a\x19authzed/api/v1/core.proto\x1a'authzed/api/v1/permission_service.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x17validate/validate.proto\"\xe9\x03\n" +
	"\fWatchRequest\x12\xd3\x01\n" +
	"\x15optional_object_types\x18\x01 \x03(\tB\x9e\x01\xfaBL\x92\x01I\b\x00\"ErC(\x80\x012>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$\xbaHL\x92\x01I\b\x00\"ErC(\x80\x012>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$R\x13optionalObjectTypes\x12L\n" +
	"\x15optional_start_cursor\x18\x02 \x01(\v2\x18.authzed.api.v1.ZedTokenR\x13optionalStartCursor\x12f\n" +
	"\x1doptional_relationship_filters\x18\x03 \x03(\v2\".authzed.api.v1.RelationshipFilterR\x1boptionalRelationshipFilters\x12M\n" +
	"\x15optional_update_kinds\x18\x04 \x03(\x0e2\x19.authzed.api.v1.WatchKindR\x13optionalUpdateKinds\"\x88\x03\n" +
	"\rWatchResponse\x12<\n" +
	"\aupdates\x18\x01 \x03(\v2\".authzed.api.v1.RelationshipUpdateR\aupdates\x12A\n" +
	"\x0fchanges_through\x18\x02 \x01(\v2\x18.authzed.api.v1.ZedTokenR\x0echangesThrough\x12[\n" +
	"\x1doptional_transaction_metadata\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x1boptionalTransactionMetadata\x12%\n" +
	"\x0eschema_updated\x18\x04 \x01(\bR\rschemaUpdated\x12#\n" +
	"\ris_checkpoint\x18\x05 \x01(\bR\fisCheckpoint\x12M\n" +
	"\x16full_revision_metadata\x18\x06 \x03(\v2\x17.google.protobuf.StructR\x14fullRevisionMetadata*\x9f\x01\n" +
	"\tWatchKind\x12\x1a\n" +
	"\x16WATCH_KIND_UNSPECIFIED\x10\x00\x12+\n" +
	"'WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES\x10\x01\x12%\n" +
	"!WATCH_KIND_INCLUDE_SCHEMA_UPDATES\x10\x02\x12\"\n" +
	"\x1eWATCH_KIND_INCLUDE_CHECKPOINTS\x10\x032v\n" +
	"\fWatchService\x12f\n" +
	"\x05Watch\x12\x1c.authzed.api.v1.WatchRequest\x1a\x1d.authzed.api.v1.WatchResponse\"\x1e\x92A\a\n" +
	"\x05Watch\x82\xd3\xe4\x93\x02\x0e:\x01*\"\t/v1/watch0\x01BJ\n" +
	"\x12com.authzed.api.v1P\x01Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3"

var (
	file_authzed_api_v1_watch_service_proto_rawDescOnce sync.Once
	file_authzed_api_v1_watch_service_proto_rawDescData []byte
)

func file_authzed_api_v1_watch_service_proto_rawDescGZIP() []byte {
	file_authzed_api_v1_watch_service_proto_rawDescOnce.Do(func() {
		file_authzed_api_v1_watch_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_authzed_api_v1_watch_service_proto_rawDesc), len(file_authzed_api_v1_watch_service_proto_rawDesc)))
	})
	return file_authzed_api_v1_watch_service_proto_rawDescData
}

var file_authzed_api_v1_watch_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_authzed_api_v1_watch_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_authzed_api_v1_watch_service_proto_goTypes = []any{
	(WatchKind)(0),             // 0: authzed.api.v1.WatchKind
	(*WatchRequest)(nil),       // 1: authzed.api.v1.WatchRequest
	(*WatchResponse)(nil),      // 2: authzed.api.v1.WatchResponse
	(*ZedToken)(nil),           // 3: authzed.api.v1.ZedToken
	(*RelationshipFilter)(nil), // 4: authzed.api.v1.RelationshipFilter
	(*RelationshipUpdate)(nil), // 5: authzed.api.v1.RelationshipUpdate
	(*structpb.Struct)(nil),    // 6: google.protobuf.Struct
}
var file_authzed_api_v1_watch_service_proto_depIdxs = []int32{
	3, // 0: authzed.api.v1.WatchRequest.optional_start_cursor:type_name -> authzed.api.v1.ZedToken
	4, // 1: authzed.api.v1.WatchRequest.optional_relationship_filters:type_name -> authzed.api.v1.RelationshipFilter
	0, // 2: authzed.api.v1.WatchRequest.optional_update_kinds:type_name -> authzed.api.v1.WatchKind
	5, // 3: authzed.api.v1.WatchResponse.updates:type_name -> authzed.api.v1.RelationshipUpdate
	3, // 4: authzed.api.v1.WatchResponse.changes_through:type_name -> authzed.api.v1.ZedToken
	6, // 5: authzed.api.v1.WatchResponse.optional_transaction_metadata:type_name -> google.protobuf.Struct
	6, // 6: authzed.api.v1.WatchResponse.full_revision_metadata:type_name -> google.protobuf.Struct
	1, // 7: authzed.api.v1.WatchService.Watch:input_type -> authzed.api.v1.WatchRequest
	2, // 8: authzed.api.v1.WatchService.Watch:output_type -> authzed.api.v1.WatchResponse
	8, // [8:9] is the sub-list for method output_type
	7, // [7:8] is the sub-list for method input_type
	7, // [7:7] is the sub-list for extension type_name
	7, // [7:7] is the sub-list for extension extendee
	0, // [0:7] is the sub-list for field type_name
}

func init() { file_authzed_api_v1_watch_service_proto_init() }
func file_authzed_api_v1_watch_service_proto_init() {
	if File_authzed_api_v1_watch_service_proto != nil {
		return
	}
	file_authzed_api_v1_core_proto_init()
	file_authzed_api_v1_permission_service_proto_init()
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_authzed_api_v1_watch_service_proto_rawDesc), len(file_authzed_api_v1_watch_service_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_authzed_api_v1_watch_service_proto_goTypes,
		DependencyIndexes: file_authzed_api_v1_watch_service_proto_depIdxs,
		EnumInfos:         file_authzed_api_v1_watch_service_proto_enumTypes,
		MessageInfos:      file_authzed_api_v1_watch_service_proto_msgTypes,
	}.Build()
	File_authzed_api_v1_watch_service_proto = out.File
	file_authzed_api_v1_watch_service_proto_goTypes = nil
	file_authzed_api_v1_watch_service_proto_depIdxs = nil
}
