package mxgateway

import pb "gitea.dohertylan.com/dohertj2/mxaccessgw/clients/go/internal/generated"

// RawGatewayClient is the generated gRPC client interface exposed for callers
// that need direct contract access.
type RawGatewayClient = pb.MxAccessGatewayClient

// RawEventStream is the generated StreamEvents client stream.
type RawEventStream = pb.MxAccessGateway_StreamEventsClient

// Generated protobuf aliases keep raw contract access available from the public
// mxgateway package while generated code remains under internal/generated.
type (
	// OpenSessionRequest is the gateway OpenSession request message.
	OpenSessionRequest = pb.OpenSessionRequest
	// OpenSessionReply is the gateway OpenSession reply message.
	OpenSessionReply = pb.OpenSessionReply
	// CloseSessionRequest is the gateway CloseSession request message.
	CloseSessionRequest = pb.CloseSessionRequest
	// CloseSessionReply is the gateway CloseSession reply message.
	CloseSessionReply = pb.CloseSessionReply
	// StreamEventsRequest is the gateway StreamEvents request message.
	StreamEventsRequest = pb.StreamEventsRequest
	// MxCommandRequest carries one MXAccess command for Invoke.
	MxCommandRequest = pb.MxCommandRequest
	// MxCommandReply is the reply to an MXAccess command Invoke.
	MxCommandReply = pb.MxCommandReply
	// MxCommand is the discriminated union of MXAccess command payloads.
	MxCommand = pb.MxCommand
	// MxEvent is one ordered event delivered on a session event stream.
	MxEvent = pb.MxEvent
	// ReplayGap is the gateway sentinel payload signalling that a resumed event
	// stream skipped past the oldest event still retained in the replay ring.
	// RequestedAfterSequence is the after_worker_sequence the client resumed
	// from; OldestAvailableSequence is the oldest sequence the gateway can still
	// replay. See EventResult.ReplayGap for consumption guidance.
	ReplayGap = pb.ReplayGap
	// MxValue is the protobuf representation of an MXAccess value.
	MxValue = pb.MxValue
	// Value is an alias for MxValue retained for symmetry with other clients.
	Value = pb.MxValue
	// MxArray is the protobuf representation of an MXAccess array value.
	MxArray = pb.MxArray
	// MxSparseArray is the write-only protobuf type for default-fill partial
	// array writes. The gateway expands it to a full array before forwarding
	// to MXAccess: unmentioned indices receive the element type's default value
	// (boolean false, integer 0, float 0.0, string "", time = Unix epoch).
	MxSparseArray = pb.MxSparseArray
	// MxSparseElement is one index/value pair inside an MxSparseArray.
	MxSparseElement = pb.MxSparseElement
	// MxStatusProxy mirrors the MXAccess MXSTATUS_PROXY structure.
	MxStatusProxy = pb.MxStatusProxy
	// ProtocolStatus is the gateway-level status carried on every reply.
	ProtocolStatus = pb.ProtocolStatus
	// RegisterCommand is the payload of an MXAccess Register command.
	RegisterCommand = pb.RegisterCommand
	// UnregisterCommand is the payload of an MXAccess Unregister command.
	UnregisterCommand = pb.UnregisterCommand
	// AddItemCommand is the payload of an MXAccess AddItem command.
	AddItemCommand = pb.AddItemCommand
	// AddItem2Command is the payload of an MXAccess AddItem2 command.
	AddItem2Command = pb.AddItem2Command
	// RemoveItemCommand is the payload of an MXAccess RemoveItem command.
	RemoveItemCommand = pb.RemoveItemCommand
	// AdviseCommand is the payload of an MXAccess Advise command.
	AdviseCommand = pb.AdviseCommand
	// UnAdviseCommand is the payload of an MXAccess UnAdvise command.
	UnAdviseCommand = pb.UnAdviseCommand
	// AddItemBulkCommand is the payload of an AddItem bulk command.
	AddItemBulkCommand = pb.AddItemBulkCommand
	// AdviseItemBulkCommand is the payload of an Advise bulk command.
	AdviseItemBulkCommand = pb.AdviseItemBulkCommand
	// RemoveItemBulkCommand is the payload of a RemoveItem bulk command.
	RemoveItemBulkCommand = pb.RemoveItemBulkCommand
	// UnAdviseItemBulkCommand is the payload of an UnAdvise bulk command.
	UnAdviseItemBulkCommand = pb.UnAdviseItemBulkCommand
	// SubscribeBulkCommand combines AddItem and Advise for a list of tags.
	SubscribeBulkCommand = pb.SubscribeBulkCommand
	// UnsubscribeBulkCommand combines UnAdvise and RemoveItem for a list of items.
	UnsubscribeBulkCommand = pb.UnsubscribeBulkCommand
	// WriteCommand is the payload of an MXAccess Write command.
	WriteCommand = pb.WriteCommand
	// Write2Command is the payload of an MXAccess Write2 command.
	Write2Command = pb.Write2Command
	// WriteBulkCommand is the payload of a bulk Write command.
	WriteBulkCommand = pb.WriteBulkCommand
	// WriteBulkEntry is one entry inside a WriteBulkCommand.
	WriteBulkEntry = pb.WriteBulkEntry
	// Write2BulkCommand is the payload of a bulk Write2 (timestamped) command.
	Write2BulkCommand = pb.Write2BulkCommand
	// Write2BulkEntry is one entry inside a Write2BulkCommand.
	Write2BulkEntry = pb.Write2BulkEntry
	// WriteSecuredBulkCommand is the payload of a bulk WriteSecured command.
	WriteSecuredBulkCommand = pb.WriteSecuredBulkCommand
	// WriteSecuredBulkEntry is one entry inside a WriteSecuredBulkCommand.
	WriteSecuredBulkEntry = pb.WriteSecuredBulkEntry
	// WriteSecured2BulkCommand is the payload of a bulk WriteSecured2 (timestamped) command.
	WriteSecured2BulkCommand = pb.WriteSecured2BulkCommand
	// WriteSecured2BulkEntry is one entry inside a WriteSecured2BulkCommand.
	WriteSecured2BulkEntry = pb.WriteSecured2BulkEntry
	// ReadBulkCommand is the payload of a bulk Read snapshot command.
	ReadBulkCommand = pb.ReadBulkCommand
	// BulkWriteReply aggregates BulkWriteResult entries for a bulk write command.
	BulkWriteReply = pb.BulkWriteReply
	// BulkWriteResult is one entry in a bulk write reply list.
	BulkWriteResult = pb.BulkWriteResult
	// BulkReadReply aggregates BulkReadResult entries for a bulk read command.
	BulkReadReply = pb.BulkReadReply
	// BulkReadResult is one entry in a bulk read reply list.
	BulkReadResult = pb.BulkReadResult
	// RegisterReply carries the ServerHandle returned by Register.
	RegisterReply = pb.RegisterReply
	// AddItemReply carries the ItemHandle returned by AddItem.
	AddItemReply = pb.AddItemReply
	// AddItem2Reply carries the ItemHandle returned by AddItem2.
	AddItem2Reply = pb.AddItem2Reply
	// SubscribeResult is one entry in a bulk command result list.
	SubscribeResult = pb.SubscribeResult
	// BulkSubscribeReply aggregates SubscribeResult entries for a bulk command.
	BulkSubscribeReply = pb.BulkSubscribeReply
	// AcknowledgeAlarmRequest is the gateway AcknowledgeAlarm request message.
	AcknowledgeAlarmRequest = pb.AcknowledgeAlarmRequest
	// AcknowledgeAlarmReply is the gateway AcknowledgeAlarm reply message.
	AcknowledgeAlarmReply = pb.AcknowledgeAlarmReply
	// QueryActiveAlarmsRequest is the gateway QueryActiveAlarms request message.
	QueryActiveAlarmsRequest = pb.QueryActiveAlarmsRequest
	// StreamAlarmsRequest is the gateway StreamAlarms request message.
	StreamAlarmsRequest = pb.StreamAlarmsRequest
	// AlarmFeedMessage is one message on the StreamAlarms feed — an
	// active-alarm snapshot row, a snapshot-complete sentinel, or a transition.
	AlarmFeedMessage = pb.AlarmFeedMessage
	// ActiveAlarmSnapshot is one row in a ConditionRefresh stream.
	ActiveAlarmSnapshot = pb.ActiveAlarmSnapshot
	// OnAlarmTransitionEvent is the body carried by alarm-transition MxEvents.
	OnAlarmTransitionEvent = pb.OnAlarmTransitionEvent
)

// AlarmTransitionKind discriminates raise / acknowledge / clear / retrigger
// transitions on an OnAlarmTransitionEvent.
type AlarmTransitionKind = pb.AlarmTransitionKind

// AlarmConditionState reports the current state of an active alarm in a
// ConditionRefresh snapshot.
type AlarmConditionState = pb.AlarmConditionState

// QueryActiveAlarmsClient is the generated server-streaming client for the
// QueryActiveAlarms RPC.
type QueryActiveAlarmsClient = pb.MxAccessGateway_QueryActiveAlarmsClient

// StreamAlarmsClient is the generated server-streaming client for the
// StreamAlarms RPC.
type StreamAlarmsClient = pb.MxAccessGateway_StreamAlarmsClient

// Enumerations from the generated contract re-exported for client callers.
type (
	// MxCommandKind discriminates which MXAccess command an MxCommand carries.
	MxCommandKind = pb.MxCommandKind
	// MxDataType is the MXAccess data type tag on values and arrays.
	MxDataType = pb.MxDataType
	// MxEventFamily groups MXAccess events by source category.
	MxEventFamily = pb.MxEventFamily
	// MxStatusCategory classifies MXSTATUS_PROXY entries.
	MxStatusCategory = pb.MxStatusCategory
	// MxStatusSource identifies the originator of a status entry.
	MxStatusSource = pb.MxStatusSource
	// ProtocolStatusCode enumerates gateway-level status codes.
	ProtocolStatusCode = pb.ProtocolStatusCode
	// SessionState enumerates gateway session lifecycle states.
	SessionState = pb.SessionState
)

// MXAccess command kind, data type, and protocol status constants surfaced
// from the generated contract.
const (
	// CommandKindRegister selects the MXAccess Register command.
	CommandKindRegister = pb.MxCommandKind_MX_COMMAND_KIND_REGISTER
	// CommandKindUnregister selects the MXAccess Unregister command.
	CommandKindUnregister = pb.MxCommandKind_MX_COMMAND_KIND_UNREGISTER
	// CommandKindAddItem selects the MXAccess AddItem command.
	CommandKindAddItem = pb.MxCommandKind_MX_COMMAND_KIND_ADD_ITEM
	// CommandKindAddItem2 selects the MXAccess AddItem2 command.
	CommandKindAddItem2 = pb.MxCommandKind_MX_COMMAND_KIND_ADD_ITEM2
	// CommandKindRemoveItem selects the MXAccess RemoveItem command.
	CommandKindRemoveItem = pb.MxCommandKind_MX_COMMAND_KIND_REMOVE_ITEM
	// CommandKindAdvise selects the MXAccess Advise command.
	CommandKindAdvise = pb.MxCommandKind_MX_COMMAND_KIND_ADVISE
	// CommandKindUnAdvise selects the MXAccess UnAdvise command.
	CommandKindUnAdvise = pb.MxCommandKind_MX_COMMAND_KIND_UN_ADVISE
	// CommandKindAddItemBulk selects the AddItem bulk command.
	CommandKindAddItemBulk = pb.MxCommandKind_MX_COMMAND_KIND_ADD_ITEM_BULK
	// CommandKindAdviseItemBulk selects the Advise bulk command.
	CommandKindAdviseItemBulk = pb.MxCommandKind_MX_COMMAND_KIND_ADVISE_ITEM_BULK
	// CommandKindRemoveItemBulk selects the RemoveItem bulk command.
	CommandKindRemoveItemBulk = pb.MxCommandKind_MX_COMMAND_KIND_REMOVE_ITEM_BULK
	// CommandKindUnAdviseItemBulk selects the UnAdvise bulk command.
	CommandKindUnAdviseItemBulk = pb.MxCommandKind_MX_COMMAND_KIND_UN_ADVISE_ITEM_BULK
	// CommandKindSubscribeBulk selects the AddItem+Advise combined bulk command.
	CommandKindSubscribeBulk = pb.MxCommandKind_MX_COMMAND_KIND_SUBSCRIBE_BULK
	// CommandKindUnsubscribeBulk selects the UnAdvise+RemoveItem combined bulk command.
	CommandKindUnsubscribeBulk = pb.MxCommandKind_MX_COMMAND_KIND_UNSUBSCRIBE_BULK
	// CommandKindWrite selects the MXAccess Write command.
	CommandKindWrite = pb.MxCommandKind_MX_COMMAND_KIND_WRITE
	// CommandKindWrite2 selects the MXAccess Write2 command.
	CommandKindWrite2 = pb.MxCommandKind_MX_COMMAND_KIND_WRITE2

	// DataTypeUnknown denotes an unrecognized MXAccess data type.
	DataTypeUnknown = pb.MxDataType_MX_DATA_TYPE_UNKNOWN
	// DataTypeBoolean denotes an MXAccess Boolean value.
	DataTypeBoolean = pb.MxDataType_MX_DATA_TYPE_BOOLEAN
	// DataTypeInteger denotes an MXAccess Integer value.
	DataTypeInteger = pb.MxDataType_MX_DATA_TYPE_INTEGER
	// DataTypeFloat denotes an MXAccess Float (single precision) value.
	DataTypeFloat = pb.MxDataType_MX_DATA_TYPE_FLOAT
	// DataTypeDouble denotes an MXAccess Double (double precision) value.
	DataTypeDouble = pb.MxDataType_MX_DATA_TYPE_DOUBLE
	// DataTypeString denotes an MXAccess String value.
	DataTypeString = pb.MxDataType_MX_DATA_TYPE_STRING
	// DataTypeTime denotes an MXAccess timestamp value.
	DataTypeTime = pb.MxDataType_MX_DATA_TYPE_TIME

	// ProtocolStatusOK indicates the gateway processed the request successfully.
	ProtocolStatusOK = pb.ProtocolStatusCode_PROTOCOL_STATUS_CODE_OK
	// ProtocolStatusMxAccessFailure indicates the worker reported an MXAccess failure.
	ProtocolStatusMxAccessFailure = pb.ProtocolStatusCode_PROTOCOL_STATUS_CODE_MXACCESS_FAILURE
)
