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

package pushv1

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)
)

// GatewaySubscribeRequest opens a push subscription. gateway_client_id
// uniquely identifies the gateway instance; backend tracks one
// subscription per id and replaces an existing one on reconnect. cursor
// is the last consumed PushEvent.cursor; backend resumes from the next
// event when the cursor is still inside the freshness-window ring, or
// from a fresh point otherwise.
type GatewaySubscribeRequest struct {
	state           protoimpl.MessageState `protogen:"open.v1"`
	GatewayClientId string                 `protobuf:"bytes,1,opt,name=gateway_client_id,json=gatewayClientId,proto3" json:"gateway_client_id,omitempty"`
	Cursor          string                 `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*GatewaySubscribeRequest) ProtoMessage() {}

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

func (x *GatewaySubscribeRequest) GetGatewayClientId() string {
	if x != nil {
		return x.GatewayClientId
	}
	return ""
}

func (x *GatewaySubscribeRequest) GetCursor() string {
	if x != nil {
		return x.Cursor
	}
	return ""
}

// PushEvent is one server-pushed frame. Exactly one of the kind oneof
// fields is set. cursor is a monotonically increasing string assigned by
// backend at publish time; gateway persists the last cursor it processed
// so it can resume after reconnect.
type PushEvent struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Kind:
	//
	//	*PushEvent_ClientEvent
	//	*PushEvent_SessionInvalidation
	Kind          isPushEvent_Kind `protobuf_oneof:"kind"`
	Cursor        string           `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*PushEvent) ProtoMessage() {}

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

func (x *PushEvent) GetKind() isPushEvent_Kind {
	if x != nil {
		return x.Kind
	}
	return nil
}

func (x *PushEvent) GetClientEvent() *ClientEvent {
	if x != nil {
		if x, ok := x.Kind.(*PushEvent_ClientEvent); ok {
			return x.ClientEvent
		}
	}
	return nil
}

func (x *PushEvent) GetSessionInvalidation() *SessionInvalidation {
	if x != nil {
		if x, ok := x.Kind.(*PushEvent_SessionInvalidation); ok {
			return x.SessionInvalidation
		}
	}
	return nil
}

func (x *PushEvent) GetCursor() string {
	if x != nil {
		return x.Cursor
	}
	return ""
}

type isPushEvent_Kind interface {
	isPushEvent_Kind()
}

type PushEvent_ClientEvent struct {
	ClientEvent *ClientEvent `protobuf:"bytes,1,opt,name=client_event,json=clientEvent,proto3,oneof"`
}

type PushEvent_SessionInvalidation struct {
	SessionInvalidation *SessionInvalidation `protobuf:"bytes,2,opt,name=session_invalidation,json=sessionInvalidation,proto3,oneof"`
}

func (*PushEvent_ClientEvent) isPushEvent_Kind() {}

func (*PushEvent_SessionInvalidation) isPushEvent_Kind() {}

// ClientEvent carries an opaque payload destined for one user_id and
// optionally one device_session_id (empty means fan-out to every active
// session of user_id). kind is the notification catalog kind from
// README §10. payload is the JSON encoding of the producer's payload
// map; gateway forwards the bytes inside the signed envelope without
// re-interpreting them.
//
// event_id, request_id and trace_id are correlation identifiers that
// gateway carries verbatim into the signed client envelope. event_id is
// stable per logical client-facing event (typically the route id of the
// notification route that produced the event). request_id and trace_id
// are optional and may be empty when the producer has no upstream
// correlation to attach.
type ClientEvent struct {
	state           protoimpl.MessageState `protogen:"open.v1"`
	UserId          string                 `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	DeviceSessionId string                 `protobuf:"bytes,2,opt,name=device_session_id,json=deviceSessionId,proto3" json:"device_session_id,omitempty"`
	Kind            string                 `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"`
	Payload         []byte                 `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	EventId         string                 `protobuf:"bytes,5,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	RequestId       string                 `protobuf:"bytes,6,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	TraceId         string                 `protobuf:"bytes,7,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*ClientEvent) ProtoMessage() {}

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

func (x *ClientEvent) GetUserId() string {
	if x != nil {
		return x.UserId
	}
	return ""
}

func (x *ClientEvent) GetDeviceSessionId() string {
	if x != nil {
		return x.DeviceSessionId
	}
	return ""
}

func (x *ClientEvent) GetKind() string {
	if x != nil {
		return x.Kind
	}
	return ""
}

func (x *ClientEvent) GetPayload() []byte {
	if x != nil {
		return x.Payload
	}
	return nil
}

func (x *ClientEvent) GetEventId() string {
	if x != nil {
		return x.EventId
	}
	return ""
}

func (x *ClientEvent) GetRequestId() string {
	if x != nil {
		return x.RequestId
	}
	return ""
}

func (x *ClientEvent) GetTraceId() string {
	if x != nil {
		return x.TraceId
	}
	return ""
}

// SessionInvalidation tells gateway to drop active subscriptions and
// reject in-flight authenticated requests bound to the affected
// sessions. user_id is always set; device_session_id narrows the
// invalidation to a single session, empty means revoke every session of
// user_id. reason is a free-form code logged by both sides.
type SessionInvalidation struct {
	state           protoimpl.MessageState `protogen:"open.v1"`
	DeviceSessionId string                 `protobuf:"bytes,1,opt,name=device_session_id,json=deviceSessionId,proto3" json:"device_session_id,omitempty"`
	UserId          string                 `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Reason          string                 `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*SessionInvalidation) ProtoMessage() {}

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

func (x *SessionInvalidation) GetDeviceSessionId() string {
	if x != nil {
		return x.DeviceSessionId
	}
	return ""
}

func (x *SessionInvalidation) GetUserId() string {
	if x != nil {
		return x.UserId
	}
	return ""
}

func (x *SessionInvalidation) GetReason() string {
	if x != nil {
		return x.Reason
	}
	return ""
}

var File_push_v1_push_proto protoreflect.FileDescriptor

const file_push_v1_push_proto_rawDesc = "" +
	"\n" +
	"\x12push/v1/push.proto\x12\x16galaxy.backend.push.v1\"]\n" +
	"\x17GatewaySubscribeRequest\x12*\n" +
	"\x11gateway_client_id\x18\x01 \x01(\tR\x0fgatewayClientId\x12\x16\n" +
	"\x06cursor\x18\x02 \x01(\tR\x06cursor\"\xd7\x01\n" +
	"\tPushEvent\x12H\n" +
	"\fclient_event\x18\x01 \x01(\v2#.galaxy.backend.push.v1.ClientEventH\x00R\vclientEvent\x12`\n" +
	"\x14session_invalidation\x18\x02 \x01(\v2+.galaxy.backend.push.v1.SessionInvalidationH\x00R\x13sessionInvalidation\x12\x16\n" +
	"\x06cursor\x18\x03 \x01(\tR\x06cursorB\x06\n" +
	"\x04kind\"\xd5\x01\n" +
	"\vClientEvent\x12\x17\n" +
	"\auser_id\x18\x01 \x01(\tR\x06userId\x12*\n" +
	"\x11device_session_id\x18\x02 \x01(\tR\x0fdeviceSessionId\x12\x12\n" +
	"\x04kind\x18\x03 \x01(\tR\x04kind\x12\x18\n" +
	"\apayload\x18\x04 \x01(\fR\apayload\x12\x19\n" +
	"\bevent_id\x18\x05 \x01(\tR\aeventId\x12\x1d\n" +
	"\n" +
	"request_id\x18\x06 \x01(\tR\trequestId\x12\x19\n" +
	"\btrace_id\x18\a \x01(\tR\atraceId\"r\n" +
	"\x13SessionInvalidation\x12*\n" +
	"\x11device_session_id\x18\x01 \x01(\tR\x0fdeviceSessionId\x12\x17\n" +
	"\auser_id\x18\x02 \x01(\tR\x06userId\x12\x16\n" +
	"\x06reason\x18\x03 \x01(\tR\x06reason2m\n" +
	"\x04Push\x12e\n" +
	"\rSubscribePush\x12/.galaxy.backend.push.v1.GatewaySubscribeRequest\x1a!.galaxy.backend.push.v1.PushEvent0\x01B%Z#galaxy/backend/proto/push/v1;pushv1b\x06proto3"

var (
	file_push_v1_push_proto_rawDescOnce sync.Once
	file_push_v1_push_proto_rawDescData []byte
)

func file_push_v1_push_proto_rawDescGZIP() []byte {
	file_push_v1_push_proto_rawDescOnce.Do(func() {
		file_push_v1_push_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_push_v1_push_proto_rawDesc), len(file_push_v1_push_proto_rawDesc)))
	})
	return file_push_v1_push_proto_rawDescData
}

var file_push_v1_push_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_push_v1_push_proto_goTypes = []any{
	(*GatewaySubscribeRequest)(nil), // 0: galaxy.backend.push.v1.GatewaySubscribeRequest
	(*PushEvent)(nil),               // 1: galaxy.backend.push.v1.PushEvent
	(*ClientEvent)(nil),             // 2: galaxy.backend.push.v1.ClientEvent
	(*SessionInvalidation)(nil),     // 3: galaxy.backend.push.v1.SessionInvalidation
}
var file_push_v1_push_proto_depIdxs = []int32{
	2, // 0: galaxy.backend.push.v1.PushEvent.client_event:type_name -> galaxy.backend.push.v1.ClientEvent
	3, // 1: galaxy.backend.push.v1.PushEvent.session_invalidation:type_name -> galaxy.backend.push.v1.SessionInvalidation
	0, // 2: galaxy.backend.push.v1.Push.SubscribePush:input_type -> galaxy.backend.push.v1.GatewaySubscribeRequest
	1, // 3: galaxy.backend.push.v1.Push.SubscribePush:output_type -> galaxy.backend.push.v1.PushEvent
	3, // [3:4] is the sub-list for method output_type
	2, // [2:3] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_push_v1_push_proto_init() }
func file_push_v1_push_proto_init() {
	if File_push_v1_push_proto != nil {
		return
	}
	file_push_v1_push_proto_msgTypes[1].OneofWrappers = []any{
		(*PushEvent_ClientEvent)(nil),
		(*PushEvent_SessionInvalidation)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_push_v1_push_proto_rawDesc), len(file_push_v1_push_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_push_v1_push_proto_goTypes,
		DependencyIndexes: file_push_v1_push_proto_depIdxs,
		MessageInfos:      file_push_v1_push_proto_msgTypes,
	}.Build()
	File_push_v1_push_proto = out.File
	file_push_v1_push_proto_goTypes = nil
	file_push_v1_push_proto_depIdxs = nil
}
