From f861a8b3b82f02fd64e8504e8481388a047480c5 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 26 Apr 2026 20:22:24 -0400 Subject: [PATCH] Issue #45: scaffold Python package --- clients/python/README.md | 57 +++++ clients/python/generate-proto.ps1 | 22 ++ clients/python/pyproject.toml | 33 +++ clients/python/src/mxgateway/__init__.py | 5 + .../src/mxgateway/generated/__init__.py | 29 +++ .../generated/mxaccess_gateway_pb2.py | 171 +++++++++++++ .../generated/mxaccess_gateway_pb2_grpc.py | 229 ++++++++++++++++++ .../generated/mxaccess_worker_pb2.py | 66 +++++ .../generated/mxaccess_worker_pb2_grpc.py | 24 ++ clients/python/src/mxgateway/version.py | 3 + clients/python/src/mxgateway_cli/__init__.py | 1 + clients/python/src/mxgateway_cli/__main__.py | 6 + clients/python/src/mxgateway_cli/commands.py | 29 +++ clients/python/tests/test_cli.py | 21 ++ .../python/tests/test_generated_imports.py | 30 +++ docs/client-proto-generation.md | 6 + 16 files changed, 732 insertions(+) create mode 100644 clients/python/README.md create mode 100644 clients/python/generate-proto.ps1 create mode 100644 clients/python/pyproject.toml create mode 100644 clients/python/src/mxgateway/__init__.py create mode 100644 clients/python/src/mxgateway/generated/__init__.py create mode 100644 clients/python/src/mxgateway/generated/mxaccess_gateway_pb2.py create mode 100644 clients/python/src/mxgateway/generated/mxaccess_gateway_pb2_grpc.py create mode 100644 clients/python/src/mxgateway/generated/mxaccess_worker_pb2.py create mode 100644 clients/python/src/mxgateway/generated/mxaccess_worker_pb2_grpc.py create mode 100644 clients/python/src/mxgateway/version.py create mode 100644 clients/python/src/mxgateway_cli/__init__.py create mode 100644 clients/python/src/mxgateway_cli/__main__.py create mode 100644 clients/python/src/mxgateway_cli/commands.py create mode 100644 clients/python/tests/test_cli.py create mode 100644 clients/python/tests/test_generated_imports.py diff --git a/clients/python/README.md b/clients/python/README.md new file mode 100644 index 0000000..ba8cd5e --- /dev/null +++ b/clients/python/README.md @@ -0,0 +1,57 @@ +# Python Client + +The Python client package contains generated MXAccess Gateway protobuf +bindings, the `mxgateway` package scaffold, and the `mxgw-py` test CLI +scaffold. The package uses the shared proto inputs documented in +`../../docs/client-proto-generation.md` so gateway and client contracts stay in +sync. + +## Layout + +```text +clients/python/ + pyproject.toml + generate-proto.ps1 + src/mxgateway/ + src/mxgateway/generated/ + src/mxgateway_cli/ + tests/ +``` + +`src/mxgateway/generated` contains code produced by `grpc_tools.protoc`. Do not +edit generated files by hand. + +## Regenerating Protobuf Bindings + +Run generation after the shared `.proto` files or the Python output path +changes: + +```powershell +./generate-proto.ps1 +``` + +The script uses the Python tool path recorded in +`../../docs/toolchain-links.md`. + +## Build And Test + +Run the Python checks from `clients/python`: + +```powershell +python -m pip install -e ".[dev]" +python -m pytest +python -m pip wheel . --no-deps --wheel-dir "$env:TEMP\mxgateway-python-wheel" +``` + +The scaffold tests import the generated gateway and worker stubs and exercise +the deterministic CLI version output. + +## CLI + +The scaffold CLI exposes version information: + +```powershell +mxgw-py version --json +``` + +Additional commands are implemented with the async client/session wrapper work. diff --git a/clients/python/generate-proto.ps1 b/clients/python/generate-proto.ps1 new file mode 100644 index 0000000..3eccd51 --- /dev/null +++ b/clients/python/generate-proto.ps1 @@ -0,0 +1,22 @@ +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') +$protoRoot = Join-Path $repoRoot 'src\MxGateway.Contracts\Protos' +$outputRoot = Join-Path $PSScriptRoot 'src\mxgateway\generated' +$python = 'C:\Users\dohertj2\AppData\Local\Programs\Python\Python312\python.exe' + +if (-not (Test-Path $python)) { + throw "Python was not found at $python. See docs/toolchain-links.md." +} + +New-Item -ItemType Directory -Path $outputRoot -Force | Out-Null +Get-ChildItem -Path (Join-Path $outputRoot '*_pb2.py') -File | Remove-Item +Get-ChildItem -Path (Join-Path $outputRoot '*_pb2_grpc.py') -File | Remove-Item + +& $python -m grpc_tools.protoc ` + "-I$protoRoot" ` + "--python_out=$outputRoot" ` + "--grpc_python_out=$outputRoot" ` + mxaccess_gateway.proto ` + mxaccess_worker.proto diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml new file mode 100644 index 0000000..3bc0d8d --- /dev/null +++ b/clients/python/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["setuptools>=69", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "mxaccess-gateway-client" +version = "0.1.0" +description = "Async Python client scaffold for MXAccess Gateway." +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "click>=8.3,<9", + "grpcio>=1.80,<2", + "protobuf>=6.33,<7", +] + +[project.optional-dependencies] +dev = [ + "grpcio-tools>=1.80,<2", + "pytest>=9,<10", + "pytest-asyncio>=1.3,<2", +] + +[project.scripts] +mxgw-py = "mxgateway_cli.commands:main" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.pytest.ini_options] +addopts = "-ra" +pythonpath = ["src"] +testpaths = ["tests"] diff --git a/clients/python/src/mxgateway/__init__.py b/clients/python/src/mxgateway/__init__.py new file mode 100644 index 0000000..44c6096 --- /dev/null +++ b/clients/python/src/mxgateway/__init__.py @@ -0,0 +1,5 @@ +"""MXAccess Gateway Python client package.""" + +from .version import __version__ + +__all__ = ["__version__"] diff --git a/clients/python/src/mxgateway/generated/__init__.py b/clients/python/src/mxgateway/generated/__init__.py new file mode 100644 index 0000000..f601f29 --- /dev/null +++ b/clients/python/src/mxgateway/generated/__init__.py @@ -0,0 +1,29 @@ +"""Generated protobuf and gRPC modules for MXAccess Gateway. + +The Python protobuf generator emits absolute imports between generated modules. +This package initializer registers package-local aliases so callers can import +the generated stubs through `mxgateway.generated` without moving the modules to +the top-level import namespace. +""" + +from importlib import import_module +import sys + +mxaccess_gateway_pb2 = import_module(f"{__name__}.mxaccess_gateway_pb2") +sys.modules.setdefault("mxaccess_gateway_pb2", mxaccess_gateway_pb2) + +mxaccess_gateway_pb2_grpc = import_module(f"{__name__}.mxaccess_gateway_pb2_grpc") +sys.modules.setdefault("mxaccess_gateway_pb2_grpc", mxaccess_gateway_pb2_grpc) + +mxaccess_worker_pb2 = import_module(f"{__name__}.mxaccess_worker_pb2") +sys.modules.setdefault("mxaccess_worker_pb2", mxaccess_worker_pb2) + +mxaccess_worker_pb2_grpc = import_module(f"{__name__}.mxaccess_worker_pb2_grpc") +sys.modules.setdefault("mxaccess_worker_pb2_grpc", mxaccess_worker_pb2_grpc) + +__all__ = [ + "mxaccess_gateway_pb2", + "mxaccess_gateway_pb2_grpc", + "mxaccess_worker_pb2", + "mxaccess_worker_pb2_grpc", +] diff --git a/clients/python/src/mxgateway/generated/mxaccess_gateway_pb2.py b/clients/python/src/mxgateway/generated/mxaccess_gateway_pb2.py new file mode 100644 index 0000000..782411a --- /dev/null +++ b/clients/python/src/mxgateway/generated/mxaccess_gateway_pb2.py @@ -0,0 +1,171 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: mxaccess_gateway.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'mxaccess_gateway.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16mxaccess_gateway.proto\x12\x13mxaccess_gateway.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9f\x01\n\x12OpenSessionRequest\x12\x19\n\x11requested_backend\x18\x01 \x01(\t\x12\x1b\n\x13\x63lient_session_name\x18\x02 \x01(\t\x12\x1d\n\x15\x63lient_correlation_id\x18\x03 \x01(\t\x12\x32\n\x0f\x63ommand_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xaa\x02\n\x10OpenSessionReply\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x14\n\x0c\x62\x61\x63kend_name\x18\x02 \x01(\t\x12\x19\n\x11worker_process_id\x18\x03 \x01(\x05\x12\x1f\n\x17worker_protocol_version\x18\x04 \x01(\r\x12\x14\n\x0c\x63\x61pabilities\x18\x05 \x03(\t\x12:\n\x17\x64\x65\x66\x61ult_command_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x0fprotocol_status\x18\x07 \x01(\x0b\x32#.mxaccess_gateway.v1.ProtocolStatus\x12 \n\x18gateway_protocol_version\x18\x08 \x01(\r\"H\n\x13\x43loseSessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x1d\n\x15\x63lient_correlation_id\x18\x02 \x01(\t\"\x9d\x01\n\x11\x43loseSessionReply\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x36\n\x0b\x66inal_state\x18\x02 \x01(\x0e\x32!.mxaccess_gateway.v1.SessionState\x12<\n\x0fprotocol_status\x18\x03 \x01(\x0b\x32#.mxaccess_gateway.v1.ProtocolStatus\"H\n\x13StreamEventsRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x1d\n\x15\x61\x66ter_worker_sequence\x18\x02 \x01(\x04\"v\n\x10MxCommandRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x1d\n\x15\x63lient_correlation_id\x18\x02 \x01(\t\x12/\n\x07\x63ommand\x18\x03 \x01(\x0b\x32\x1e.mxaccess_gateway.v1.MxCommand\"\xa2\x0c\n\tMxCommand\x12\x30\n\x04kind\x18\x01 \x01(\x0e\x32\".mxaccess_gateway.v1.MxCommandKind\x12\x38\n\x08register\x18\n \x01(\x0b\x32$.mxaccess_gateway.v1.RegisterCommandH\x00\x12<\n\nunregister\x18\x0b \x01(\x0b\x32&.mxaccess_gateway.v1.UnregisterCommandH\x00\x12\x37\n\x08\x61\x64\x64_item\x18\x0c \x01(\x0b\x32#.mxaccess_gateway.v1.AddItemCommandH\x00\x12\x39\n\tadd_item2\x18\r \x01(\x0b\x32$.mxaccess_gateway.v1.AddItem2CommandH\x00\x12=\n\x0bremove_item\x18\x0e \x01(\x0b\x32&.mxaccess_gateway.v1.RemoveItemCommandH\x00\x12\x34\n\x06\x61\x64vise\x18\x0f \x01(\x0b\x32\".mxaccess_gateway.v1.AdviseCommandH\x00\x12\x39\n\tun_advise\x18\x10 \x01(\x0b\x32$.mxaccess_gateway.v1.UnAdviseCommandH\x00\x12K\n\x12\x61\x64vise_supervisory\x18\x11 \x01(\x0b\x32-.mxaccess_gateway.v1.AdviseSupervisoryCommandH\x00\x12H\n\x11\x61\x64\x64_buffered_item\x18\x12 \x01(\x0b\x32+.mxaccess_gateway.v1.AddBufferedItemCommandH\x00\x12]\n\x1cset_buffered_update_interval\x18\x13 \x01(\x0b\x32\x35.mxaccess_gateway.v1.SetBufferedUpdateIntervalCommandH\x00\x12\x36\n\x07suspend\x18\x14 \x01(\x0b\x32#.mxaccess_gateway.v1.SuspendCommandH\x00\x12\x38\n\x08\x61\x63tivate\x18\x15 \x01(\x0b\x32$.mxaccess_gateway.v1.ActivateCommandH\x00\x12\x32\n\x05write\x18\x16 \x01(\x0b\x32!.mxaccess_gateway.v1.WriteCommandH\x00\x12\x34\n\x06write2\x18\x17 \x01(\x0b\x32\".mxaccess_gateway.v1.Write2CommandH\x00\x12\x41\n\rwrite_secured\x18\x18 \x01(\x0b\x32(.mxaccess_gateway.v1.WriteSecuredCommandH\x00\x12\x43\n\x0ewrite_secured2\x18\x19 \x01(\x0b\x32).mxaccess_gateway.v1.WriteSecured2CommandH\x00\x12I\n\x11\x61uthenticate_user\x18\x1a \x01(\x0b\x32,.mxaccess_gateway.v1.AuthenticateUserCommandH\x00\x12M\n\x14\x61rchestra_user_to_id\x18\x1b \x01(\x0b\x32-.mxaccess_gateway.v1.ArchestrAUserToIdCommandH\x00\x12\x30\n\x04ping\x18\x64 \x01(\x0b\x32 .mxaccess_gateway.v1.PingCommandH\x00\x12H\n\x11get_session_state\x18\x65 \x01(\x0b\x32+.mxaccess_gateway.v1.GetSessionStateCommandH\x00\x12\x44\n\x0fget_worker_info\x18\x66 \x01(\x0b\x32).mxaccess_gateway.v1.GetWorkerInfoCommandH\x00\x12?\n\x0c\x64rain_events\x18g \x01(\x0b\x32\'.mxaccess_gateway.v1.DrainEventsCommandH\x00\x12\x45\n\x0fshutdown_worker\x18h \x01(\x0b\x32*.mxaccess_gateway.v1.ShutdownWorkerCommandH\x00\x42\t\n\x07payload\"&\n\x0fRegisterCommand\x12\x13\n\x0b\x63lient_name\x18\x01 \x01(\t\"*\n\x11UnregisterCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\"@\n\x0e\x41\x64\x64ItemCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x17\n\x0fitem_definition\x18\x02 \x01(\t\"W\n\x0f\x41\x64\x64Item2Command\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x17\n\x0fitem_definition\x18\x02 \x01(\t\x12\x14\n\x0citem_context\x18\x03 \x01(\t\"?\n\x11RemoveItemCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\";\n\rAdviseCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\"=\n\x0fUnAdviseCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\"F\n\x18\x41\x64viseSupervisoryCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\"^\n\x16\x41\x64\x64\x42ufferedItemCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x17\n\x0fitem_definition\x18\x02 \x01(\t\x12\x14\n\x0citem_context\x18\x03 \x01(\t\"_\n SetBufferedUpdateIntervalCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12$\n\x1cupdate_interval_milliseconds\x18\x02 \x01(\x05\"<\n\x0eSuspendCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\"=\n\x0f\x41\x63tivateCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\"x\n\x0cWriteCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\x12+\n\x05value\x18\x03 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\x12\x0f\n\x07user_id\x18\x04 \x01(\x05\"\xb0\x01\n\rWrite2Command\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\x12+\n\x05value\x18\x03 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\x12\x35\n\x0ftimestamp_value\x18\x04 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\x12\x0f\n\x07user_id\x18\x05 \x01(\x05\"\xa1\x01\n\x13WriteSecuredCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\x12\x17\n\x0f\x63urrent_user_id\x18\x03 \x01(\x05\x12\x18\n\x10verifier_user_id\x18\x04 \x01(\x05\x12+\n\x05value\x18\x05 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\"\xd9\x01\n\x14WriteSecured2Command\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x02 \x01(\x05\x12\x17\n\x0f\x63urrent_user_id\x18\x03 \x01(\x05\x12\x18\n\x10verifier_user_id\x18\x04 \x01(\x05\x12+\n\x05value\x18\x05 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\x12\x35\n\x0ftimestamp_value\x18\x06 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\"c\n\x17\x41uthenticateUserCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x13\n\x0bverify_user\x18\x02 \x01(\t\x12\x1c\n\x14verify_user_password\x18\x03 \x01(\t\"G\n\x18\x41rchestrAUserToIdCommand\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\x12\x14\n\x0cuser_id_guid\x18\x02 \x01(\t\"\x1e\n\x0bPingCommand\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x18\n\x16GetSessionStateCommand\"\x16\n\x14GetWorkerInfoCommand\"(\n\x12\x44rainEventsCommand\x12\x12\n\nmax_events\x18\x01 \x01(\r\"H\n\x15ShutdownWorkerCommand\x12/\n\x0cgrace_period\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x90\x08\n\x0eMxCommandReply\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x02 \x01(\t\x12\x30\n\x04kind\x18\x03 \x01(\x0e\x32\".mxaccess_gateway.v1.MxCommandKind\x12<\n\x0fprotocol_status\x18\x04 \x01(\x0b\x32#.mxaccess_gateway.v1.ProtocolStatus\x12\x14\n\x07hresult\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x32\n\x0creturn_value\x18\x06 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\x12\x34\n\x08statuses\x18\x07 \x03(\x0b\x32\".mxaccess_gateway.v1.MxStatusProxy\x12\x1a\n\x12\x64iagnostic_message\x18\x08 \x01(\t\x12\x36\n\x08register\x18\x14 \x01(\x0b\x32\".mxaccess_gateway.v1.RegisterReplyH\x00\x12\x35\n\x08\x61\x64\x64_item\x18\x15 \x01(\x0b\x32!.mxaccess_gateway.v1.AddItemReplyH\x00\x12\x37\n\tadd_item2\x18\x16 \x01(\x0b\x32\".mxaccess_gateway.v1.AddItem2ReplyH\x00\x12\x46\n\x11\x61\x64\x64_buffered_item\x18\x17 \x01(\x0b\x32).mxaccess_gateway.v1.AddBufferedItemReplyH\x00\x12\x34\n\x07suspend\x18\x18 \x01(\x0b\x32!.mxaccess_gateway.v1.SuspendReplyH\x00\x12\x36\n\x08\x61\x63tivate\x18\x19 \x01(\x0b\x32\".mxaccess_gateway.v1.ActivateReplyH\x00\x12G\n\x11\x61uthenticate_user\x18\x1a \x01(\x0b\x32*.mxaccess_gateway.v1.AuthenticateUserReplyH\x00\x12K\n\x14\x61rchestra_user_to_id\x18\x1b \x01(\x0b\x32+.mxaccess_gateway.v1.ArchestrAUserToIdReplyH\x00\x12?\n\rsession_state\x18\x64 \x01(\x0b\x32&.mxaccess_gateway.v1.SessionStateReplyH\x00\x12;\n\x0bworker_info\x18\x65 \x01(\x0b\x32$.mxaccess_gateway.v1.WorkerInfoReplyH\x00\x12=\n\x0c\x64rain_events\x18\x66 \x01(\x0b\x32%.mxaccess_gateway.v1.DrainEventsReplyH\x00\x42\t\n\x07payloadB\n\n\x08_hresult\"&\n\rRegisterReply\x12\x15\n\rserver_handle\x18\x01 \x01(\x05\"#\n\x0c\x41\x64\x64ItemReply\x12\x13\n\x0bitem_handle\x18\x01 \x01(\x05\"$\n\rAddItem2Reply\x12\x13\n\x0bitem_handle\x18\x01 \x01(\x05\"+\n\x14\x41\x64\x64\x42ufferedItemReply\x12\x13\n\x0bitem_handle\x18\x01 \x01(\x05\"B\n\x0cSuspendReply\x12\x32\n\x06status\x18\x01 \x01(\x0b\x32\".mxaccess_gateway.v1.MxStatusProxy\"C\n\rActivateReply\x12\x32\n\x06status\x18\x01 \x01(\x0b\x32\".mxaccess_gateway.v1.MxStatusProxy\"(\n\x15\x41uthenticateUserReply\x12\x0f\n\x07user_id\x18\x01 \x01(\x05\")\n\x16\x41rchestrAUserToIdReply\x12\x0f\n\x07user_id\x18\x01 \x01(\x05\"E\n\x11SessionStateReply\x12\x30\n\x05state\x18\x01 \x01(\x0e\x32!.mxaccess_gateway.v1.SessionState\"u\n\x0fWorkerInfoReply\x12\x19\n\x11worker_process_id\x18\x01 \x01(\x05\x12\x16\n\x0eworker_version\x18\x02 \x01(\t\x12\x17\n\x0fmxaccess_progid\x18\x03 \x01(\t\x12\x16\n\x0emxaccess_clsid\x18\x04 \x01(\t\"@\n\x10\x44rainEventsReply\x12,\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1c.mxaccess_gateway.v1.MxEvent\"\x9b\x06\n\x07MxEvent\x12\x32\n\x06\x66\x61mily\x18\x01 \x01(\x0e\x32\".mxaccess_gateway.v1.MxEventFamily\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x15\n\rserver_handle\x18\x03 \x01(\x05\x12\x13\n\x0bitem_handle\x18\x04 \x01(\x05\x12+\n\x05value\x18\x05 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxValue\x12\x0f\n\x07quality\x18\x06 \x01(\x05\x12\x34\n\x10source_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x08statuses\x18\x08 \x03(\x0b\x32\".mxaccess_gateway.v1.MxStatusProxy\x12\x17\n\x0fworker_sequence\x18\t \x01(\x04\x12\x34\n\x10worker_timestamp\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12=\n\x19gateway_receive_timestamp\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x07hresult\x18\x0c \x01(\x05H\x01\x88\x01\x01\x12\x12\n\nraw_status\x18\r \x01(\t\x12@\n\x0eon_data_change\x18\x14 \x01(\x0b\x32&.mxaccess_gateway.v1.OnDataChangeEventH\x00\x12\x46\n\x11on_write_complete\x18\x15 \x01(\x0b\x32).mxaccess_gateway.v1.OnWriteCompleteEventH\x00\x12I\n\x12operation_complete\x18\x16 \x01(\x0b\x32+.mxaccess_gateway.v1.OperationCompleteEventH\x00\x12Q\n\x17on_buffered_data_change\x18\x17 \x01(\x0b\x32..mxaccess_gateway.v1.OnBufferedDataChangeEventH\x00\x42\x06\n\x04\x62odyB\n\n\x08_hresult\"\x13\n\x11OnDataChangeEvent\"\x16\n\x14OnWriteCompleteEvent\"\x18\n\x16OperationCompleteEvent\"\xd4\x01\n\x19OnBufferedDataChangeEvent\x12\x32\n\tdata_type\x18\x01 \x01(\x0e\x32\x1f.mxaccess_gateway.v1.MxDataType\x12\x34\n\x0equality_values\x18\x02 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxArray\x12\x36\n\x10timestamp_values\x18\x03 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxArray\x12\x15\n\rraw_data_type\x18\x04 \x01(\x05\"\xeb\x01\n\rMxStatusProxy\x12\x0f\n\x07success\x18\x01 \x01(\x05\x12\x37\n\x08\x63\x61tegory\x18\x02 \x01(\x0e\x32%.mxaccess_gateway.v1.MxStatusCategory\x12\x38\n\x0b\x64\x65tected_by\x18\x03 \x01(\x0e\x32#.mxaccess_gateway.v1.MxStatusSource\x12\x0e\n\x06\x64\x65tail\x18\x04 \x01(\x05\x12\x14\n\x0craw_category\x18\x05 \x01(\x05\x12\x17\n\x0fraw_detected_by\x18\x06 \x01(\x05\x12\x17\n\x0f\x64iagnostic_text\x18\x07 \x01(\t\"\xa7\x03\n\x07MxValue\x12\x32\n\tdata_type\x18\x01 \x01(\x0e\x32\x1f.mxaccess_gateway.v1.MxDataType\x12\x14\n\x0cvariant_type\x18\x02 \x01(\t\x12\x0f\n\x07is_null\x18\x03 \x01(\x08\x12\x16\n\x0eraw_diagnostic\x18\x04 \x01(\t\x12\x15\n\rraw_data_type\x18\x05 \x01(\x05\x12\x14\n\nbool_value\x18\n \x01(\x08H\x00\x12\x15\n\x0bint32_value\x18\x0b \x01(\x05H\x00\x12\x15\n\x0bint64_value\x18\x0c \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\r \x01(\x02H\x00\x12\x16\n\x0c\x64ouble_value\x18\x0e \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x0f \x01(\tH\x00\x12\x35\n\x0ftimestamp_value\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x33\n\x0b\x61rray_value\x18\x11 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxArrayH\x00\x12\x13\n\traw_value\x18\x12 \x01(\x0cH\x00\x42\x06\n\x04kind\"\xfe\x04\n\x07MxArray\x12:\n\x11\x65lement_data_type\x18\x01 \x01(\x0e\x32\x1f.mxaccess_gateway.v1.MxDataType\x12\x14\n\x0cvariant_type\x18\x02 \x01(\t\x12\x12\n\ndimensions\x18\x03 \x03(\r\x12\x16\n\x0eraw_diagnostic\x18\x04 \x01(\t\x12\x1d\n\x15raw_element_data_type\x18\x05 \x01(\x05\x12\x35\n\x0b\x62ool_values\x18\n \x01(\x0b\x32\x1e.mxaccess_gateway.v1.BoolArrayH\x00\x12\x37\n\x0cint32_values\x18\x0b \x01(\x0b\x32\x1f.mxaccess_gateway.v1.Int32ArrayH\x00\x12\x37\n\x0cint64_values\x18\x0c \x01(\x0b\x32\x1f.mxaccess_gateway.v1.Int64ArrayH\x00\x12\x37\n\x0c\x66loat_values\x18\r \x01(\x0b\x32\x1f.mxaccess_gateway.v1.FloatArrayH\x00\x12\x39\n\rdouble_values\x18\x0e \x01(\x0b\x32 .mxaccess_gateway.v1.DoubleArrayH\x00\x12\x39\n\rstring_values\x18\x0f \x01(\x0b\x32 .mxaccess_gateway.v1.StringArrayH\x00\x12?\n\x10timestamp_values\x18\x10 \x01(\x0b\x32#.mxaccess_gateway.v1.TimestampArrayH\x00\x12\x33\n\nraw_values\x18\x11 \x01(\x0b\x32\x1d.mxaccess_gateway.v1.RawArrayH\x00\x42\x08\n\x06values\"\x1b\n\tBoolArray\x12\x0e\n\x06values\x18\x01 \x03(\x08\"\x1c\n\nInt32Array\x12\x0e\n\x06values\x18\x01 \x03(\x05\"\x1c\n\nInt64Array\x12\x0e\n\x06values\x18\x01 \x03(\x03\"\x1c\n\nFloatArray\x12\x0e\n\x06values\x18\x01 \x03(\x02\"\x1d\n\x0b\x44oubleArray\x12\x0e\n\x06values\x18\x01 \x03(\x01\"\x1d\n\x0bStringArray\x12\x0e\n\x06values\x18\x01 \x03(\t\"<\n\x0eTimestampArray\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\"\x1a\n\x08RawArray\x12\x0e\n\x06values\x18\x01 \x03(\x0c\"X\n\x0eProtocolStatus\x12\x35\n\x04\x63ode\x18\x01 \x01(\x0e\x32\'.mxaccess_gateway.v1.ProtocolStatusCode\x12\x0f\n\x07message\x18\x02 \x01(\t*\xbf\x06\n\rMxCommandKind\x12\x1f\n\x1bMX_COMMAND_KIND_UNSPECIFIED\x10\x00\x12\x1c\n\x18MX_COMMAND_KIND_REGISTER\x10\x01\x12\x1e\n\x1aMX_COMMAND_KIND_UNREGISTER\x10\x02\x12\x1c\n\x18MX_COMMAND_KIND_ADD_ITEM\x10\x03\x12\x1d\n\x19MX_COMMAND_KIND_ADD_ITEM2\x10\x04\x12\x1f\n\x1bMX_COMMAND_KIND_REMOVE_ITEM\x10\x05\x12\x1a\n\x16MX_COMMAND_KIND_ADVISE\x10\x06\x12\x1d\n\x19MX_COMMAND_KIND_UN_ADVISE\x10\x07\x12&\n\"MX_COMMAND_KIND_ADVISE_SUPERVISORY\x10\x08\x12%\n!MX_COMMAND_KIND_ADD_BUFFERED_ITEM\x10\t\x12\x30\n,MX_COMMAND_KIND_SET_BUFFERED_UPDATE_INTERVAL\x10\n\x12\x1b\n\x17MX_COMMAND_KIND_SUSPEND\x10\x0b\x12\x1c\n\x18MX_COMMAND_KIND_ACTIVATE\x10\x0c\x12\x19\n\x15MX_COMMAND_KIND_WRITE\x10\r\x12\x1a\n\x16MX_COMMAND_KIND_WRITE2\x10\x0e\x12!\n\x1dMX_COMMAND_KIND_WRITE_SECURED\x10\x0f\x12\"\n\x1eMX_COMMAND_KIND_WRITE_SECURED2\x10\x10\x12%\n!MX_COMMAND_KIND_AUTHENTICATE_USER\x10\x11\x12(\n$MX_COMMAND_KIND_ARCHESTRA_USER_TO_ID\x10\x12\x12\x18\n\x14MX_COMMAND_KIND_PING\x10\x64\x12%\n!MX_COMMAND_KIND_GET_SESSION_STATE\x10\x65\x12#\n\x1fMX_COMMAND_KIND_GET_WORKER_INFO\x10\x66\x12 \n\x1cMX_COMMAND_KIND_DRAIN_EVENTS\x10g\x12#\n\x1fMX_COMMAND_KIND_SHUTDOWN_WORKER\x10h*\xd0\x01\n\rMxEventFamily\x12\x1f\n\x1bMX_EVENT_FAMILY_UNSPECIFIED\x10\x00\x12\"\n\x1eMX_EVENT_FAMILY_ON_DATA_CHANGE\x10\x01\x12%\n!MX_EVENT_FAMILY_ON_WRITE_COMPLETE\x10\x02\x12&\n\"MX_EVENT_FAMILY_OPERATION_COMPLETE\x10\x03\x12+\n\'MX_EVENT_FAMILY_ON_BUFFERED_DATA_CHANGE\x10\x04*\xa5\x03\n\x10MxStatusCategory\x12\"\n\x1eMX_STATUS_CATEGORY_UNSPECIFIED\x10\x00\x12\x1e\n\x1aMX_STATUS_CATEGORY_UNKNOWN\x10\x01\x12\x19\n\x15MX_STATUS_CATEGORY_OK\x10\x02\x12\x1e\n\x1aMX_STATUS_CATEGORY_PENDING\x10\x03\x12\x1e\n\x1aMX_STATUS_CATEGORY_WARNING\x10\x04\x12*\n&MX_STATUS_CATEGORY_COMMUNICATION_ERROR\x10\x05\x12*\n&MX_STATUS_CATEGORY_CONFIGURATION_ERROR\x10\x06\x12(\n$MX_STATUS_CATEGORY_OPERATIONAL_ERROR\x10\x07\x12%\n!MX_STATUS_CATEGORY_SECURITY_ERROR\x10\x08\x12%\n!MX_STATUS_CATEGORY_SOFTWARE_ERROR\x10\t\x12\"\n\x1eMX_STATUS_CATEGORY_OTHER_ERROR\x10\n*\xca\x02\n\x0eMxStatusSource\x12 \n\x1cMX_STATUS_SOURCE_UNSPECIFIED\x10\x00\x12\x1c\n\x18MX_STATUS_SOURCE_UNKNOWN\x10\x01\x12#\n\x1fMX_STATUS_SOURCE_REQUESTING_LMX\x10\x02\x12#\n\x1fMX_STATUS_SOURCE_RESPONDING_LMX\x10\x03\x12#\n\x1fMX_STATUS_SOURCE_REQUESTING_NMX\x10\x04\x12#\n\x1fMX_STATUS_SOURCE_RESPONDING_NMX\x10\x05\x12\x31\n-MX_STATUS_SOURCE_REQUESTING_AUTOMATION_OBJECT\x10\x06\x12\x31\n-MX_STATUS_SOURCE_RESPONDING_AUTOMATION_OBJECT\x10\x07*\xdd\x04\n\nMxDataType\x12\x1c\n\x18MX_DATA_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14MX_DATA_TYPE_UNKNOWN\x10\x01\x12\x18\n\x14MX_DATA_TYPE_NO_DATA\x10\x02\x12\x18\n\x14MX_DATA_TYPE_BOOLEAN\x10\x03\x12\x18\n\x14MX_DATA_TYPE_INTEGER\x10\x04\x12\x16\n\x12MX_DATA_TYPE_FLOAT\x10\x05\x12\x17\n\x13MX_DATA_TYPE_DOUBLE\x10\x06\x12\x17\n\x13MX_DATA_TYPE_STRING\x10\x07\x12\x15\n\x11MX_DATA_TYPE_TIME\x10\x08\x12\x1d\n\x19MX_DATA_TYPE_ELAPSED_TIME\x10\t\x12\x1f\n\x1bMX_DATA_TYPE_REFERENCE_TYPE\x10\n\x12\x1c\n\x18MX_DATA_TYPE_STATUS_TYPE\x10\x0b\x12\x15\n\x11MX_DATA_TYPE_ENUM\x10\x0c\x12-\n)MX_DATA_TYPE_SECURITY_CLASSIFICATION_ENUM\x10\r\x12\"\n\x1eMX_DATA_TYPE_DATA_QUALITY_TYPE\x10\x0e\x12\x1f\n\x1bMX_DATA_TYPE_QUALIFIED_ENUM\x10\x0f\x12!\n\x1dMX_DATA_TYPE_QUALIFIED_STRUCT\x10\x10\x12)\n%MX_DATA_TYPE_INTERNATIONALIZED_STRING\x10\x11\x12\x1b\n\x17MX_DATA_TYPE_BIG_STRING\x10\x12\x12\x14\n\x10MX_DATA_TYPE_END\x10\x13*\xa3\x03\n\x12ProtocolStatusCode\x12$\n PROTOCOL_STATUS_CODE_UNSPECIFIED\x10\x00\x12\x1b\n\x17PROTOCOL_STATUS_CODE_OK\x10\x01\x12(\n$PROTOCOL_STATUS_CODE_INVALID_REQUEST\x10\x02\x12*\n&PROTOCOL_STATUS_CODE_SESSION_NOT_FOUND\x10\x03\x12*\n&PROTOCOL_STATUS_CODE_SESSION_NOT_READY\x10\x04\x12+\n\'PROTOCOL_STATUS_CODE_WORKER_UNAVAILABLE\x10\x05\x12 \n\x1cPROTOCOL_STATUS_CODE_TIMEOUT\x10\x06\x12!\n\x1dPROTOCOL_STATUS_CODE_CANCELED\x10\x07\x12+\n\'PROTOCOL_STATUS_CODE_PROTOCOL_VIOLATION\x10\x08\x12)\n%PROTOCOL_STATUS_CODE_MXACCESS_FAILURE\x10\t*\xbf\x02\n\x0cSessionState\x12\x1d\n\x19SESSION_STATE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SESSION_STATE_CREATING\x10\x01\x12!\n\x1dSESSION_STATE_STARTING_WORKER\x10\x02\x12\"\n\x1eSESSION_STATE_WAITING_FOR_PIPE\x10\x03\x12\x1d\n\x19SESSION_STATE_HANDSHAKING\x10\x04\x12%\n!SESSION_STATE_INITIALIZING_WORKER\x10\x05\x12\x17\n\x13SESSION_STATE_READY\x10\x06\x12\x19\n\x15SESSION_STATE_CLOSING\x10\x07\x12\x18\n\x14SESSION_STATE_CLOSED\x10\x08\x12\x19\n\x15SESSION_STATE_FAULTED\x10\t2\x82\x03\n\x0fMxAccessGateway\x12]\n\x0bOpenSession\x12\'.mxaccess_gateway.v1.OpenSessionRequest\x1a%.mxaccess_gateway.v1.OpenSessionReply\x12`\n\x0c\x43loseSession\x12(.mxaccess_gateway.v1.CloseSessionRequest\x1a&.mxaccess_gateway.v1.CloseSessionReply\x12T\n\x06Invoke\x12%.mxaccess_gateway.v1.MxCommandRequest\x1a#.mxaccess_gateway.v1.MxCommandReply\x12X\n\x0cStreamEvents\x12(.mxaccess_gateway.v1.StreamEventsRequest\x1a\x1c.mxaccess_gateway.v1.MxEvent0\x01\x42\x1c\xaa\x02\x19MxGateway.Contracts.Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mxaccess_gateway_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\252\002\031MxGateway.Contracts.Proto' + _globals['_MXCOMMANDKIND']._serialized_start=8883 + _globals['_MXCOMMANDKIND']._serialized_end=9714 + _globals['_MXEVENTFAMILY']._serialized_start=9717 + _globals['_MXEVENTFAMILY']._serialized_end=9925 + _globals['_MXSTATUSCATEGORY']._serialized_start=9928 + _globals['_MXSTATUSCATEGORY']._serialized_end=10349 + _globals['_MXSTATUSSOURCE']._serialized_start=10352 + _globals['_MXSTATUSSOURCE']._serialized_end=10682 + _globals['_MXDATATYPE']._serialized_start=10685 + _globals['_MXDATATYPE']._serialized_end=11290 + _globals['_PROTOCOLSTATUSCODE']._serialized_start=11293 + _globals['_PROTOCOLSTATUSCODE']._serialized_end=11712 + _globals['_SESSIONSTATE']._serialized_start=11715 + _globals['_SESSIONSTATE']._serialized_end=12034 + _globals['_OPENSESSIONREQUEST']._serialized_start=113 + _globals['_OPENSESSIONREQUEST']._serialized_end=272 + _globals['_OPENSESSIONREPLY']._serialized_start=275 + _globals['_OPENSESSIONREPLY']._serialized_end=573 + _globals['_CLOSESESSIONREQUEST']._serialized_start=575 + _globals['_CLOSESESSIONREQUEST']._serialized_end=647 + _globals['_CLOSESESSIONREPLY']._serialized_start=650 + _globals['_CLOSESESSIONREPLY']._serialized_end=807 + _globals['_STREAMEVENTSREQUEST']._serialized_start=809 + _globals['_STREAMEVENTSREQUEST']._serialized_end=881 + _globals['_MXCOMMANDREQUEST']._serialized_start=883 + _globals['_MXCOMMANDREQUEST']._serialized_end=1001 + _globals['_MXCOMMAND']._serialized_start=1004 + _globals['_MXCOMMAND']._serialized_end=2574 + _globals['_REGISTERCOMMAND']._serialized_start=2576 + _globals['_REGISTERCOMMAND']._serialized_end=2614 + _globals['_UNREGISTERCOMMAND']._serialized_start=2616 + _globals['_UNREGISTERCOMMAND']._serialized_end=2658 + _globals['_ADDITEMCOMMAND']._serialized_start=2660 + _globals['_ADDITEMCOMMAND']._serialized_end=2724 + _globals['_ADDITEM2COMMAND']._serialized_start=2726 + _globals['_ADDITEM2COMMAND']._serialized_end=2813 + _globals['_REMOVEITEMCOMMAND']._serialized_start=2815 + _globals['_REMOVEITEMCOMMAND']._serialized_end=2878 + _globals['_ADVISECOMMAND']._serialized_start=2880 + _globals['_ADVISECOMMAND']._serialized_end=2939 + _globals['_UNADVISECOMMAND']._serialized_start=2941 + _globals['_UNADVISECOMMAND']._serialized_end=3002 + _globals['_ADVISESUPERVISORYCOMMAND']._serialized_start=3004 + _globals['_ADVISESUPERVISORYCOMMAND']._serialized_end=3074 + _globals['_ADDBUFFEREDITEMCOMMAND']._serialized_start=3076 + _globals['_ADDBUFFEREDITEMCOMMAND']._serialized_end=3170 + _globals['_SETBUFFEREDUPDATEINTERVALCOMMAND']._serialized_start=3172 + _globals['_SETBUFFEREDUPDATEINTERVALCOMMAND']._serialized_end=3267 + _globals['_SUSPENDCOMMAND']._serialized_start=3269 + _globals['_SUSPENDCOMMAND']._serialized_end=3329 + _globals['_ACTIVATECOMMAND']._serialized_start=3331 + _globals['_ACTIVATECOMMAND']._serialized_end=3392 + _globals['_WRITECOMMAND']._serialized_start=3394 + _globals['_WRITECOMMAND']._serialized_end=3514 + _globals['_WRITE2COMMAND']._serialized_start=3517 + _globals['_WRITE2COMMAND']._serialized_end=3693 + _globals['_WRITESECUREDCOMMAND']._serialized_start=3696 + _globals['_WRITESECUREDCOMMAND']._serialized_end=3857 + _globals['_WRITESECURED2COMMAND']._serialized_start=3860 + _globals['_WRITESECURED2COMMAND']._serialized_end=4077 + _globals['_AUTHENTICATEUSERCOMMAND']._serialized_start=4079 + _globals['_AUTHENTICATEUSERCOMMAND']._serialized_end=4178 + _globals['_ARCHESTRAUSERTOIDCOMMAND']._serialized_start=4180 + _globals['_ARCHESTRAUSERTOIDCOMMAND']._serialized_end=4251 + _globals['_PINGCOMMAND']._serialized_start=4253 + _globals['_PINGCOMMAND']._serialized_end=4283 + _globals['_GETSESSIONSTATECOMMAND']._serialized_start=4285 + _globals['_GETSESSIONSTATECOMMAND']._serialized_end=4309 + _globals['_GETWORKERINFOCOMMAND']._serialized_start=4311 + _globals['_GETWORKERINFOCOMMAND']._serialized_end=4333 + _globals['_DRAINEVENTSCOMMAND']._serialized_start=4335 + _globals['_DRAINEVENTSCOMMAND']._serialized_end=4375 + _globals['_SHUTDOWNWORKERCOMMAND']._serialized_start=4377 + _globals['_SHUTDOWNWORKERCOMMAND']._serialized_end=4449 + _globals['_MXCOMMANDREPLY']._serialized_start=4452 + _globals['_MXCOMMANDREPLY']._serialized_end=5492 + _globals['_REGISTERREPLY']._serialized_start=5494 + _globals['_REGISTERREPLY']._serialized_end=5532 + _globals['_ADDITEMREPLY']._serialized_start=5534 + _globals['_ADDITEMREPLY']._serialized_end=5569 + _globals['_ADDITEM2REPLY']._serialized_start=5571 + _globals['_ADDITEM2REPLY']._serialized_end=5607 + _globals['_ADDBUFFEREDITEMREPLY']._serialized_start=5609 + _globals['_ADDBUFFEREDITEMREPLY']._serialized_end=5652 + _globals['_SUSPENDREPLY']._serialized_start=5654 + _globals['_SUSPENDREPLY']._serialized_end=5720 + _globals['_ACTIVATEREPLY']._serialized_start=5722 + _globals['_ACTIVATEREPLY']._serialized_end=5789 + _globals['_AUTHENTICATEUSERREPLY']._serialized_start=5791 + _globals['_AUTHENTICATEUSERREPLY']._serialized_end=5831 + _globals['_ARCHESTRAUSERTOIDREPLY']._serialized_start=5833 + _globals['_ARCHESTRAUSERTOIDREPLY']._serialized_end=5874 + _globals['_SESSIONSTATEREPLY']._serialized_start=5876 + _globals['_SESSIONSTATEREPLY']._serialized_end=5945 + _globals['_WORKERINFOREPLY']._serialized_start=5947 + _globals['_WORKERINFOREPLY']._serialized_end=6064 + _globals['_DRAINEVENTSREPLY']._serialized_start=6066 + _globals['_DRAINEVENTSREPLY']._serialized_end=6130 + _globals['_MXEVENT']._serialized_start=6133 + _globals['_MXEVENT']._serialized_end=6928 + _globals['_ONDATACHANGEEVENT']._serialized_start=6930 + _globals['_ONDATACHANGEEVENT']._serialized_end=6949 + _globals['_ONWRITECOMPLETEEVENT']._serialized_start=6951 + _globals['_ONWRITECOMPLETEEVENT']._serialized_end=6973 + _globals['_OPERATIONCOMPLETEEVENT']._serialized_start=6975 + _globals['_OPERATIONCOMPLETEEVENT']._serialized_end=6999 + _globals['_ONBUFFEREDDATACHANGEEVENT']._serialized_start=7002 + _globals['_ONBUFFEREDDATACHANGEEVENT']._serialized_end=7214 + _globals['_MXSTATUSPROXY']._serialized_start=7217 + _globals['_MXSTATUSPROXY']._serialized_end=7452 + _globals['_MXVALUE']._serialized_start=7455 + _globals['_MXVALUE']._serialized_end=7878 + _globals['_MXARRAY']._serialized_start=7881 + _globals['_MXARRAY']._serialized_end=8519 + _globals['_BOOLARRAY']._serialized_start=8521 + _globals['_BOOLARRAY']._serialized_end=8548 + _globals['_INT32ARRAY']._serialized_start=8550 + _globals['_INT32ARRAY']._serialized_end=8578 + _globals['_INT64ARRAY']._serialized_start=8580 + _globals['_INT64ARRAY']._serialized_end=8608 + _globals['_FLOATARRAY']._serialized_start=8610 + _globals['_FLOATARRAY']._serialized_end=8638 + _globals['_DOUBLEARRAY']._serialized_start=8640 + _globals['_DOUBLEARRAY']._serialized_end=8669 + _globals['_STRINGARRAY']._serialized_start=8671 + _globals['_STRINGARRAY']._serialized_end=8700 + _globals['_TIMESTAMPARRAY']._serialized_start=8702 + _globals['_TIMESTAMPARRAY']._serialized_end=8762 + _globals['_RAWARRAY']._serialized_start=8764 + _globals['_RAWARRAY']._serialized_end=8790 + _globals['_PROTOCOLSTATUS']._serialized_start=8792 + _globals['_PROTOCOLSTATUS']._serialized_end=8880 + _globals['_MXACCESSGATEWAY']._serialized_start=12037 + _globals['_MXACCESSGATEWAY']._serialized_end=12423 +# @@protoc_insertion_point(module_scope) diff --git a/clients/python/src/mxgateway/generated/mxaccess_gateway_pb2_grpc.py b/clients/python/src/mxgateway/generated/mxaccess_gateway_pb2_grpc.py new file mode 100644 index 0000000..aa4185c --- /dev/null +++ b/clients/python/src/mxgateway/generated/mxaccess_gateway_pb2_grpc.py @@ -0,0 +1,229 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +import mxaccess_gateway_pb2 as mxaccess__gateway__pb2 + +GRPC_GENERATED_VERSION = '1.80.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in mxaccess_gateway_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class MxAccessGatewayStub(object): + """Public client API for MXAccess sessions hosted by the gateway. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.OpenSession = channel.unary_unary( + '/mxaccess_gateway.v1.MxAccessGateway/OpenSession', + request_serializer=mxaccess__gateway__pb2.OpenSessionRequest.SerializeToString, + response_deserializer=mxaccess__gateway__pb2.OpenSessionReply.FromString, + _registered_method=True) + self.CloseSession = channel.unary_unary( + '/mxaccess_gateway.v1.MxAccessGateway/CloseSession', + request_serializer=mxaccess__gateway__pb2.CloseSessionRequest.SerializeToString, + response_deserializer=mxaccess__gateway__pb2.CloseSessionReply.FromString, + _registered_method=True) + self.Invoke = channel.unary_unary( + '/mxaccess_gateway.v1.MxAccessGateway/Invoke', + request_serializer=mxaccess__gateway__pb2.MxCommandRequest.SerializeToString, + response_deserializer=mxaccess__gateway__pb2.MxCommandReply.FromString, + _registered_method=True) + self.StreamEvents = channel.unary_stream( + '/mxaccess_gateway.v1.MxAccessGateway/StreamEvents', + request_serializer=mxaccess__gateway__pb2.StreamEventsRequest.SerializeToString, + response_deserializer=mxaccess__gateway__pb2.MxEvent.FromString, + _registered_method=True) + + +class MxAccessGatewayServicer(object): + """Public client API for MXAccess sessions hosted by the gateway. + """ + + def OpenSession(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CloseSession(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Invoke(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StreamEvents(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_MxAccessGatewayServicer_to_server(servicer, server): + rpc_method_handlers = { + 'OpenSession': grpc.unary_unary_rpc_method_handler( + servicer.OpenSession, + request_deserializer=mxaccess__gateway__pb2.OpenSessionRequest.FromString, + response_serializer=mxaccess__gateway__pb2.OpenSessionReply.SerializeToString, + ), + 'CloseSession': grpc.unary_unary_rpc_method_handler( + servicer.CloseSession, + request_deserializer=mxaccess__gateway__pb2.CloseSessionRequest.FromString, + response_serializer=mxaccess__gateway__pb2.CloseSessionReply.SerializeToString, + ), + 'Invoke': grpc.unary_unary_rpc_method_handler( + servicer.Invoke, + request_deserializer=mxaccess__gateway__pb2.MxCommandRequest.FromString, + response_serializer=mxaccess__gateway__pb2.MxCommandReply.SerializeToString, + ), + 'StreamEvents': grpc.unary_stream_rpc_method_handler( + servicer.StreamEvents, + request_deserializer=mxaccess__gateway__pb2.StreamEventsRequest.FromString, + response_serializer=mxaccess__gateway__pb2.MxEvent.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'mxaccess_gateway.v1.MxAccessGateway', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('mxaccess_gateway.v1.MxAccessGateway', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class MxAccessGateway(object): + """Public client API for MXAccess sessions hosted by the gateway. + """ + + @staticmethod + def OpenSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/mxaccess_gateway.v1.MxAccessGateway/OpenSession', + mxaccess__gateway__pb2.OpenSessionRequest.SerializeToString, + mxaccess__gateway__pb2.OpenSessionReply.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CloseSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/mxaccess_gateway.v1.MxAccessGateway/CloseSession', + mxaccess__gateway__pb2.CloseSessionRequest.SerializeToString, + mxaccess__gateway__pb2.CloseSessionReply.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Invoke(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/mxaccess_gateway.v1.MxAccessGateway/Invoke', + mxaccess__gateway__pb2.MxCommandRequest.SerializeToString, + mxaccess__gateway__pb2.MxCommandReply.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StreamEvents(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/mxaccess_gateway.v1.MxAccessGateway/StreamEvents', + mxaccess__gateway__pb2.StreamEventsRequest.SerializeToString, + mxaccess__gateway__pb2.MxEvent.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/clients/python/src/mxgateway/generated/mxaccess_worker_pb2.py b/clients/python/src/mxgateway/generated/mxaccess_worker_pb2.py new file mode 100644 index 0000000..a9c9f70 --- /dev/null +++ b/clients/python/src/mxgateway/generated/mxaccess_worker_pb2.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: mxaccess_worker.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'mxaccess_worker.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +import mxaccess_gateway_pb2 as mxaccess__gateway__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15mxaccess_worker.proto\x12\x12mxaccess_worker.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16mxaccess_gateway.proto\"\x95\x06\n\x0eWorkerEnvelope\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x10\n\x08sequence\x18\x03 \x01(\x04\x12\x16\n\x0e\x63orrelation_id\x18\x04 \x01(\t\x12\x39\n\rgateway_hello\x18\n \x01(\x0b\x32 .mxaccess_worker.v1.GatewayHelloH\x00\x12\x37\n\x0cworker_hello\x18\x0b \x01(\x0b\x32\x1f.mxaccess_worker.v1.WorkerHelloH\x00\x12\x37\n\x0cworker_ready\x18\x0c \x01(\x0b\x32\x1f.mxaccess_worker.v1.WorkerReadyH\x00\x12;\n\x0eworker_command\x18\r \x01(\x0b\x32!.mxaccess_worker.v1.WorkerCommandH\x00\x12\x46\n\x14worker_command_reply\x18\x0e \x01(\x0b\x32&.mxaccess_worker.v1.WorkerCommandReplyH\x00\x12\x39\n\rworker_cancel\x18\x0f \x01(\x0b\x32 .mxaccess_worker.v1.WorkerCancelH\x00\x12=\n\x0fworker_shutdown\x18\x10 \x01(\x0b\x32\".mxaccess_worker.v1.WorkerShutdownH\x00\x12\x44\n\x13worker_shutdown_ack\x18\x11 \x01(\x0b\x32%.mxaccess_worker.v1.WorkerShutdownAckH\x00\x12\x37\n\x0cworker_event\x18\x12 \x01(\x0b\x32\x1f.mxaccess_worker.v1.WorkerEventH\x00\x12?\n\x10worker_heartbeat\x18\x13 \x01(\x0b\x32#.mxaccess_worker.v1.WorkerHeartbeatH\x00\x12\x37\n\x0cworker_fault\x18\x14 \x01(\x0b\x32\x1f.mxaccess_worker.v1.WorkerFaultH\x00\x42\x06\n\x04\x62ody\"Z\n\x0cGatewayHello\x12\"\n\x1asupported_protocol_version\x18\x01 \x01(\r\x12\r\n\x05nonce\x18\x02 \x01(\t\x12\x17\n\x0fgateway_version\x18\x03 \x01(\t\"i\n\x0bWorkerHello\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\r\n\x05nonce\x18\x02 \x01(\t\x12\x19\n\x11worker_process_id\x18\x03 \x01(\x05\x12\x16\n\x0eworker_version\x18\x04 \x01(\t\"\x8e\x01\n\x0bWorkerReady\x12\x19\n\x11worker_process_id\x18\x01 \x01(\x05\x12\x17\n\x0fmxaccess_progid\x18\x02 \x01(\t\x12\x16\n\x0emxaccess_clsid\x18\x03 \x01(\t\x12\x33\n\x0fready_timestamp\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"w\n\rWorkerCommand\x12/\n\x07\x63ommand\x18\x01 \x01(\x0b\x32\x1e.mxaccess_gateway.v1.MxCommand\x12\x35\n\x11\x65nqueue_timestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x81\x01\n\x12WorkerCommandReply\x12\x32\n\x05reply\x18\x01 \x01(\x0b\x32#.mxaccess_gateway.v1.MxCommandReply\x12\x37\n\x13\x63ompleted_timestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x1e\n\x0cWorkerCancel\x12\x0e\n\x06reason\x18\x01 \x01(\t\"Q\n\x0eWorkerShutdown\x12/\n\x0cgrace_period\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0e\n\x06reason\x18\x02 \x01(\t\"H\n\x11WorkerShutdownAck\x12\x33\n\x06status\x18\x01 \x01(\x0b\x32#.mxaccess_gateway.v1.ProtocolStatus\":\n\x0bWorkerEvent\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x1c.mxaccess_gateway.v1.MxEvent\"\xa5\x02\n\x0fWorkerHeartbeat\x12\x19\n\x11worker_process_id\x18\x01 \x01(\x05\x12.\n\x05state\x18\x02 \x01(\x0e\x32\x1f.mxaccess_worker.v1.WorkerState\x12?\n\x1blast_sta_activity_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1d\n\x15pending_command_count\x18\x04 \x01(\r\x12\"\n\x1aoutbound_event_queue_depth\x18\x05 \x01(\r\x12\x1b\n\x13last_event_sequence\x18\x06 \x01(\x04\x12&\n\x1e\x63urrent_command_correlation_id\x18\x07 \x01(\t\"\xf4\x01\n\x0bWorkerFault\x12\x39\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32\'.mxaccess_worker.v1.WorkerFaultCategory\x12\x16\n\x0e\x63ommand_method\x18\x02 \x01(\t\x12\x14\n\x07hresult\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x16\n\x0e\x65xception_type\x18\x04 \x01(\t\x12\x1a\n\x12\x64iagnostic_message\x18\x05 \x01(\t\x12<\n\x0fprotocol_status\x18\x06 \x01(\x0b\x32#.mxaccess_gateway.v1.ProtocolStatusB\n\n\x08_hresult*\x97\x02\n\x0bWorkerState\x12\x1c\n\x18WORKER_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15WORKER_STATE_STARTING\x10\x01\x12\x1c\n\x18WORKER_STATE_HANDSHAKING\x10\x02\x12!\n\x1dWORKER_STATE_INITIALIZING_STA\x10\x03\x12\x16\n\x12WORKER_STATE_READY\x10\x04\x12\"\n\x1eWORKER_STATE_EXECUTING_COMMAND\x10\x05\x12\x1e\n\x1aWORKER_STATE_SHUTTING_DOWN\x10\x06\x12\x18\n\x14WORKER_STATE_STOPPED\x10\x07\x12\x18\n\x14WORKER_STATE_FAULTED\x10\x08*\xc7\x04\n\x13WorkerFaultCategory\x12%\n!WORKER_FAULT_CATEGORY_UNSPECIFIED\x10\x00\x12+\n\'WORKER_FAULT_CATEGORY_INVALID_ARGUMENTS\x10\x01\x12\x37\n3WORKER_FAULT_CATEGORY_GATEWAY_AUTHENTICATION_FAILED\x10\x02\x12+\n\'WORKER_FAULT_CATEGORY_PROTOCOL_MISMATCH\x10\x03\x12,\n(WORKER_FAULT_CATEGORY_PROTOCOL_VIOLATION\x10\x04\x12+\n\'WORKER_FAULT_CATEGORY_PIPE_DISCONNECTED\x10\x05\x12\x32\n.WORKER_FAULT_CATEGORY_MXACCESS_CREATION_FAILED\x10\x06\x12\x31\n-WORKER_FAULT_CATEGORY_MXACCESS_COMMAND_FAILED\x10\x07\x12:\n6WORKER_FAULT_CATEGORY_MXACCESS_EVENT_CONVERSION_FAILED\x10\x08\x12\"\n\x1eWORKER_FAULT_CATEGORY_STA_HUNG\x10\t\x12(\n$WORKER_FAULT_CATEGORY_QUEUE_OVERFLOW\x10\n\x12*\n&WORKER_FAULT_CATEGORY_SHUTDOWN_TIMEOUT\x10\x0b\x42\x1c\xaa\x02\x19MxGateway.Contracts.Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mxaccess_worker_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\252\002\031MxGateway.Contracts.Proto' + _globals['_WORKERSTATE']._serialized_start=2316 + _globals['_WORKERSTATE']._serialized_end=2595 + _globals['_WORKERFAULTCATEGORY']._serialized_start=2598 + _globals['_WORKERFAULTCATEGORY']._serialized_end=3181 + _globals['_WORKERENVELOPE']._serialized_start=135 + _globals['_WORKERENVELOPE']._serialized_end=924 + _globals['_GATEWAYHELLO']._serialized_start=926 + _globals['_GATEWAYHELLO']._serialized_end=1016 + _globals['_WORKERHELLO']._serialized_start=1018 + _globals['_WORKERHELLO']._serialized_end=1123 + _globals['_WORKERREADY']._serialized_start=1126 + _globals['_WORKERREADY']._serialized_end=1268 + _globals['_WORKERCOMMAND']._serialized_start=1270 + _globals['_WORKERCOMMAND']._serialized_end=1389 + _globals['_WORKERCOMMANDREPLY']._serialized_start=1392 + _globals['_WORKERCOMMANDREPLY']._serialized_end=1521 + _globals['_WORKERCANCEL']._serialized_start=1523 + _globals['_WORKERCANCEL']._serialized_end=1553 + _globals['_WORKERSHUTDOWN']._serialized_start=1555 + _globals['_WORKERSHUTDOWN']._serialized_end=1636 + _globals['_WORKERSHUTDOWNACK']._serialized_start=1638 + _globals['_WORKERSHUTDOWNACK']._serialized_end=1710 + _globals['_WORKEREVENT']._serialized_start=1712 + _globals['_WORKEREVENT']._serialized_end=1770 + _globals['_WORKERHEARTBEAT']._serialized_start=1773 + _globals['_WORKERHEARTBEAT']._serialized_end=2066 + _globals['_WORKERFAULT']._serialized_start=2069 + _globals['_WORKERFAULT']._serialized_end=2313 +# @@protoc_insertion_point(module_scope) diff --git a/clients/python/src/mxgateway/generated/mxaccess_worker_pb2_grpc.py b/clients/python/src/mxgateway/generated/mxaccess_worker_pb2_grpc.py new file mode 100644 index 0000000..bcb786b --- /dev/null +++ b/clients/python/src/mxgateway/generated/mxaccess_worker_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.80.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in mxaccess_worker_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/clients/python/src/mxgateway/version.py b/clients/python/src/mxgateway/version.py new file mode 100644 index 0000000..788ea2a --- /dev/null +++ b/clients/python/src/mxgateway/version.py @@ -0,0 +1,3 @@ +"""Package version information.""" + +__version__ = "0.1.0" diff --git a/clients/python/src/mxgateway_cli/__init__.py b/clients/python/src/mxgateway_cli/__init__.py new file mode 100644 index 0000000..2fb0c83 --- /dev/null +++ b/clients/python/src/mxgateway_cli/__init__.py @@ -0,0 +1 @@ +"""Command-line entry points for the MXAccess Gateway Python client.""" diff --git a/clients/python/src/mxgateway_cli/__main__.py b/clients/python/src/mxgateway_cli/__main__.py new file mode 100644 index 0000000..ed4aa9f --- /dev/null +++ b/clients/python/src/mxgateway_cli/__main__.py @@ -0,0 +1,6 @@ +"""Module execution entry point for `python -m mxgateway_cli`.""" + +from .commands import main + +if __name__ == "__main__": + main() diff --git a/clients/python/src/mxgateway_cli/commands.py b/clients/python/src/mxgateway_cli/commands.py new file mode 100644 index 0000000..dbd70af --- /dev/null +++ b/clients/python/src/mxgateway_cli/commands.py @@ -0,0 +1,29 @@ +"""CLI scaffold for the MXAccess Gateway Python client.""" + +import json + +import click + +from mxgateway import __version__ + + +@click.group() +def main() -> None: + """MXAccess Gateway Python test CLI.""" + + +@main.command() +@click.option("--json", "output_json", is_flag=True, help="Emit JSON output.") +def version(output_json: bool) -> None: + """Print client package version information.""" + payload = { + "client": "mxgw-py", + "package": "mxaccess-gateway-client", + "version": __version__, + } + + if output_json: + click.echo(json.dumps(payload, sort_keys=True)) + return + + click.echo(f"mxgw-py {__version__}") diff --git a/clients/python/tests/test_cli.py b/clients/python/tests/test_cli.py new file mode 100644 index 0000000..9af78bf --- /dev/null +++ b/clients/python/tests/test_cli.py @@ -0,0 +1,21 @@ +"""Tests for the Python CLI scaffold.""" + +import json + +from click.testing import CliRunner + +from mxgateway import __version__ +from mxgateway_cli.commands import main + + +def test_version_json_is_deterministic() -> None: + runner = CliRunner() + + result = runner.invoke(main, ["version", "--json"]) + + assert result.exit_code == 0 + assert json.loads(result.output) == { + "client": "mxgw-py", + "package": "mxaccess-gateway-client", + "version": __version__, + } diff --git a/clients/python/tests/test_generated_imports.py b/clients/python/tests/test_generated_imports.py new file mode 100644 index 0000000..476efe7 --- /dev/null +++ b/clients/python/tests/test_generated_imports.py @@ -0,0 +1,30 @@ +"""Tests for generated protobuf and gRPC module importability.""" + +from mxgateway.generated import mxaccess_gateway_pb2 +from mxgateway.generated import mxaccess_gateway_pb2_grpc +from mxgateway.generated import mxaccess_worker_pb2 + + +def test_gateway_messages_import() -> None: + request = mxaccess_gateway_pb2.OpenSessionRequest( + client_session_name="pytest", + client_correlation_id="test-correlation", + ) + + assert request.client_session_name == "pytest" + assert hasattr(mxaccess_gateway_pb2_grpc, "MxAccessGatewayStub") + + +def test_worker_messages_import_gateway_types() -> None: + envelope = mxaccess_worker_pb2.WorkerEnvelope( + protocol_version=1, + session_id="test-session", + worker_command=mxaccess_worker_pb2.WorkerCommand( + command=mxaccess_gateway_pb2.MxCommand( + kind=mxaccess_gateway_pb2.MX_COMMAND_KIND_PING, + ping=mxaccess_gateway_pb2.PingCommand(message="hello"), + ), + ), + ) + + assert envelope.worker_command.command.ping.message == "hello" diff --git a/docs/client-proto-generation.md b/docs/client-proto-generation.md index 0345a91..b4e40e8 100644 --- a/docs/client-proto-generation.md +++ b/docs/client-proto-generation.md @@ -131,6 +131,12 @@ Python clients should use `grpc_tools.protoc` and write generated modules under `clients/python/src/mxgateway/generated` so imports stay separate from handwritten async wrappers. +The Python scaffold provides a repo-local generation script: + +```powershell +clients/python/generate-proto.ps1 +``` + Java clients should use the Gradle protobuf plugin and write generated sources under `clients/java/src/main/generated`. The Java client scaffold owns the Gradle plugin versions and source-set wiring. -- 2.52.0