diff --git a/Component-DataConnectionLayer.md b/Component-DataConnectionLayer.md index 1a5033a..713ffe2 100644 --- a/Component-DataConnectionLayer.md +++ b/Component-DataConnectionLayer.md @@ -39,29 +39,29 @@ Additional protocols can be added by implementing this interface. ### Concrete Type Mappings -| IDataConnection | OPC UA SDK | LmxProxy SDK (`LmxProxyClient`) | +| IDataConnection | OPC UA SDK | LmxProxy (`RealLmxProxyClient`) | |---|---|---| -| `Connect()` | OPC UA session establishment | `ConnectAsync()` → gRPC `ConnectRequest`, server returns `SessionId` | -| `Disconnect()` | Close OPC UA session | `DisconnectAsync()` → gRPC `DisconnectRequest` | -| `Subscribe(tagPath, callback)` | OPC UA Monitored Items | `SubscribeAsync(addresses, onUpdate)` → server-streaming gRPC (`IAsyncEnumerable`) | -| `Unsubscribe(id)` | Remove Monitored Item | `ISubscription.DisposeAsync()` (cancels streaming RPC) | -| `Read(tagPath)` | OPC UA Read | `ReadAsync(address)` → `Vtq` | -| `ReadBatch(tagPaths)` | OPC UA Read (multiple nodes) | `ReadBatchAsync(addresses)` → `IDictionary` | -| `Write(tagPath, value)` | OPC UA Write | `WriteAsync(address, value)` | -| `WriteBatch(values)` | OPC UA Write (multiple nodes) | `WriteBatchAsync(values)` | -| `WriteBatchAndWait(...)` | OPC UA Write + poll for confirmation | `WriteBatchAndWaitAsync(values, flagAddress, flagValue, responseAddress, responseValue, timeout)` | -| `Status` | OPC UA session state | `IsConnected` property + keep-alive heartbeat (30-second interval via `GetConnectionStateAsync`) | +| `Connect()` | OPC UA session establishment | gRPC `Connect` RPC with `x-api-key` metadata header, server returns `SessionId` | +| `Disconnect()` | Close OPC UA session | gRPC `Disconnect` RPC | +| `Subscribe(tagPath, callback)` | OPC UA Monitored Items | gRPC `Subscribe` server-streaming RPC (`stream VtqMessage`), cancelled via `CancellationTokenSource` | +| `Unsubscribe(id)` | Remove Monitored Item | Cancel the `CancellationTokenSource` for that subscription (stops streaming RPC) | +| `Read(tagPath)` | OPC UA Read | gRPC `Read` RPC → `VtqMessage` → `LmxVtq` | +| `ReadBatch(tagPaths)` | OPC UA Read (multiple nodes) | gRPC `ReadBatch` RPC → `repeated VtqMessage` → `IDictionary` | +| `Write(tagPath, value)` | OPC UA Write | gRPC `Write` RPC (throws on failure) | +| `WriteBatch(values)` | OPC UA Write (multiple nodes) | gRPC `WriteBatch` RPC (throws on failure) | +| `WriteBatchAndWait(...)` | OPC UA Write + poll for confirmation | `WriteBatch` + poll `Read` at 100ms intervals until response value matches or timeout | +| `Status` | OPC UA session state | `IsConnected` — true when `SessionId` is non-empty | ### Common Value Type Both protocols produce the same value tuple consumed by Instance Actors. Before the first value update arrives from the DCL, data-sourced attributes are held at **uncertain** quality by the Instance Actor (see Site Runtime — Initialization): -| Concept | ScadaLink Design | LmxProxy SDK (`Vtq`) | -|---|---|---| -| Value container | `{value, quality, timestamp}` | `Vtq(Value, Timestamp, Quality)` — readonly record struct | -| Quality | good / bad / uncertain | `Quality` enum (byte, OPC UA compatible: Good=0xC0, Bad=0x00, Uncertain=0x40) | -| Timestamp | UTC | `DateTime` (UTC) | -| Value type | object | `object?` (parsed: double, bool, string) | +| Concept | ScadaLink Design | LmxProxy Wire Format | Local Type | +|---|---|---|---| +| Value container | `TagValue(Value, Quality, Timestamp)` | `VtqMessage { Tag, Value, TimestampUtcTicks, Quality }` | `LmxVtq(Value, TimestampUtc, Quality)` — readonly record struct | +| Quality | `QualityCode` enum: Good / Bad / Uncertain | String: `"Good"` / `"Uncertain"` / `"Bad"` | `LmxQuality` enum: Good / Uncertain / Bad | +| Timestamp | `DateTimeOffset` (UTC) | `int64` (DateTime.Ticks, UTC) | `DateTime` (UTC) | +| Value type | `object?` | `string` (parsed by client to double, bool, or string) | `object?` | ## Supported Protocols @@ -71,31 +71,31 @@ Both protocols produce the same value tuple consumed by Instance Actors. Before ### LmxProxy (Custom Protocol) -LmxProxy is a gRPC-based protocol for communicating with LMX data servers. An existing client SDK (`LmxProxyClient` NuGet package) provides a production-ready implementation. +LmxProxy is a gRPC-based protocol for communicating with LMX data servers. The DCL includes its own proto-generated gRPC client (`RealLmxProxyClient`) — no external SDK dependency. **Transport & Connection**: -- gRPC over HTTP/2, using protobuf-net code-first contracts (service: `scada.ScadaService`). -- Default port: **5050**. -- Session-based: `ConnectAsync` returns a `SessionId` used for all subsequent operations. -- Keep-alive: 30-second heartbeat via `GetConnectionStateAsync`. On failure, the client marks itself disconnected and disposes subscriptions. +- gRPC over HTTP/2, using proto-generated client stubs from `scada.proto` (service: `scada.ScadaService`). Pre-generated C# files are checked into `Adapters/LmxProxyGrpc/` to avoid running `protoc` in Docker (ARM64 compatibility). +- Default port: **50051**. +- Session-based: `Connect` RPC returns a `SessionId` used for all subsequent operations. +- Keep-alive: Managed by the LmxProxy server's session timeout. The DCL reconnect cycle handles session loss. **Authentication & TLS**: -- API key-based authentication (sent in `ConnectRequest`). -- Full TLS support: TLS 1.2/1.3, mutual TLS (client cert + key in PEM), custom CA trust, self-signed cert allowance for dev. +- API key-based authentication sent as `x-api-key` gRPC metadata header on every call. The server's `ApiKeyInterceptor` validates the header before the request reaches the service method. The API key is also included in the `ConnectRequest` body for session-level validation. +- Plain HTTP/2 (no TLS) for current deployments. The server supports TLS when configured. **Subscriptions**: -- Server-streaming gRPC (`IAsyncEnumerable`). -- Configurable sampling interval (default: 1000ms; 0 = on-change). -- Wire format: `VtqMessage { Tag, Value (string), TimestampUtcTicks (long), Quality (string: "Good"/"Uncertain"/"Bad") }`. -- Subscription disposed via `ISubscription.DisposeAsync()`. +- Server-streaming gRPC (`Subscribe` RPC returns `stream VtqMessage`). +- Configurable sampling interval (default: 0 = on-change). +- Wire format: `VtqMessage { tag, value (string), timestamp_utc_ticks (int64), quality (string: "Good"/"Uncertain"/"Bad") }`. +- Subscription lifetime managed by `CancellationTokenSource` — cancellation stops the streaming RPC. -**Additional Capabilities (beyond IDataConnection)**: -- Built-in retry policy via Polly: exponential backoff (base delay × 2^attempt), configurable max attempts (default: 3), applied to reads. Transient errors: `Unavailable`, `DeadlineExceeded`, `ResourceExhausted`, `Aborted`. -- Operation metrics: count, errors, p95/p99 latency (ring buffer of last 1000 samples per operation). -- Correlation ID propagation for distributed tracing (configurable header name). -- DI integration: `AddLmxProxyClient(IConfiguration)` binds to `"LmxProxy"` config section in `appsettings.json`. +**Client Implementation** (`RealLmxProxyClient`): +- Uses `Google.Protobuf` + `Grpc.Net.Client` (standard proto-generated stubs, no protobuf-net runtime IL emit). +- `ILmxProxyClientFactory` creates instances configured with host, port, and API key. +- Value conversion: string values from `VtqMessage` are parsed to `double`, `bool`, or left as `string`. +- Quality mapping: `"Good"` → `LmxQuality.Good`, `"Uncertain"` → `LmxQuality.Uncertain`, else `LmxQuality.Bad`. -**SDK Reference**: The client SDK source is at `LmxProxyClient` in the ScadaBridge repository. The DCL's LmxProxy adapter wraps this SDK behind the `IDataConnection` interface. +**Proto Source**: The `.proto` file originates from the LmxProxy server repository (`lmx/Proxy/Grpc/Protos/scada.proto` in ScadaBridge). The C# stubs are pre-generated and stored at `Adapters/LmxProxyGrpc/`. ## Subscription Management @@ -130,14 +130,14 @@ Each data connection is managed by a dedicated connection actor that uses the Ak This pattern ensures no messages are lost during connection transitions and is the standard Akka.NET approach for actors with I/O lifecycle dependencies. -**LmxProxy-specific notes**: The LmxProxy connection actor holds the `SessionId` returned by `ConnectAsync` and passes it to all subsequent operations. On entering the **Connected** state, the actor starts the 30-second keep-alive timer. Subscriptions use server-streaming gRPC — the actor processes the `IAsyncEnumerable` stream and forwards updates to Instance Actors. On keep-alive failure, the actor transitions to **Reconnecting** and the client automatically disposes active subscriptions. +**LmxProxy-specific notes**: The `RealLmxProxyClient` holds the `SessionId` returned by the `Connect` RPC and includes it in all subsequent operations. The `LmxProxyDataConnection` adapter has no keep-alive timer — session liveness is handled by the DCL's existing reconnect cycle. Subscriptions use server-streaming gRPC — a background task reads from the `ResponseStream` and invokes the callback for each `VtqMessage`. On connection failure, the DCL actor transitions to **Reconnecting**, disposes the client (which cancels active subscriptions), and retries at the fixed interval. ## Connection Lifecycle & Reconnection The DCL manages connection lifecycle automatically: 1. **Connection drop detection**: When a connection to a data source is lost, the DCL immediately pushes a value update with quality `bad` for **every tag subscribed on that connection**. Instance Actors and their downstream consumers (alarms, scripts checking quality) see the staleness immediately. -2. **Auto-reconnect with fixed interval**: The DCL retries the connection at a configurable fixed interval (e.g., every 5 seconds). The retry interval is defined **per data connection**. This is consistent with the fixed-interval retry philosophy used throughout the system. **Note on LmxProxy**: The LmxProxy SDK includes its own retry policy (exponential backoff via Polly) for individual operations (reads). The DCL's fixed-interval reconnect owns **connection-level** recovery (re-establishing the gRPC session after a keep-alive failure or disconnect). The SDK's retry policy handles **operation-level** transient failures within an active session. These are complementary — the DCL does not disable the SDK's retry policy. +2. **Auto-reconnect with fixed interval**: The DCL retries the connection at a configurable fixed interval (e.g., every 5 seconds). The retry interval is defined **per data connection**. This is consistent with the fixed-interval retry philosophy used throughout the system. For LmxProxy, the DCL's reconnect cycle owns all recovery — re-establishing the gRPC channel and session after any connection failure. Individual gRPC operations (reads, writes) fail immediately to the caller on error; there is no operation-level retry within the adapter. 3. **Connection state transitions**: The DCL tracks each connection's state as `connected`, `disconnected`, or `reconnecting`. All transitions are logged to Site Event Logging. 4. **Transparent re-subscribe**: On successful reconnection, the DCL automatically re-establishes all previously active subscriptions for that connection. Instance Actors require no action — they simply see quality return to `good` as fresh values arrive from restored subscriptions. diff --git a/src/ScadaLink.DataConnectionLayer/Adapters/ILmxProxyClient.cs b/src/ScadaLink.DataConnectionLayer/Adapters/ILmxProxyClient.cs index 61608e0..c622499 100644 --- a/src/ScadaLink.DataConnectionLayer/Adapters/ILmxProxyClient.cs +++ b/src/ScadaLink.DataConnectionLayer/Adapters/ILmxProxyClient.cs @@ -1,120 +1,109 @@ namespace ScadaLink.DataConnectionLayer.Adapters; /// -/// WP-8: Abstraction over the LmxProxy SDK client for testability. -/// The actual LmxProxyClient SDK lives in a separate repo; this interface -/// defines the contract the adapter depends on. -/// -/// LmxProxy uses gRPC streaming for subscriptions and a session-based model -/// with keep-alive for connection management. +/// Quality enumeration mirroring the LmxProxy SDK's Quality type. +/// +public enum LmxQuality { Good, Uncertain, Bad } + +/// +/// Value-Timestamp-Quality record mirroring the LmxProxy SDK's Vtq type. +/// +public readonly record struct LmxVtq(object? Value, DateTime TimestampUtc, LmxQuality Quality); + +/// +/// Subscription handle returned by . +/// Disposing the subscription stops receiving updates. +/// +public interface ILmxSubscription : IAsyncDisposable { } + +/// +/// Abstraction over the LmxProxy SDK client for testability. +/// Mirrors the real ScadaBridge LmxProxyClient API: +/// - Session-based connection with automatic 30s keep-alive +/// - gRPC streaming for subscriptions +/// - Throws on write/read failures /// public interface ILmxProxyClient : IAsyncDisposable { - /// - /// Opens a session to the LmxProxy server. Returns a session ID. - /// - Task OpenSessionAsync(string host, int port, CancellationToken cancellationToken = default); - - /// - /// Closes the current session. - /// - Task CloseSessionAsync(CancellationToken cancellationToken = default); - - /// - /// Sends a keep-alive to maintain the session. - /// - Task SendKeepAliveAsync(CancellationToken cancellationToken = default); - bool IsConnected { get; } - string? SessionId { get; } - /// - /// Subscribes to tag value changes via gRPC streaming. Returns a subscription handle. - /// - Task SubscribeTagAsync( - string tagPath, - Action onValueChanged, + Task ConnectAsync(CancellationToken cancellationToken = default); + Task DisconnectAsync(); + + Task ReadAsync(string address, CancellationToken cancellationToken = default); + Task> ReadBatchAsync(IEnumerable addresses, CancellationToken cancellationToken = default); + + Task WriteAsync(string address, object value, CancellationToken cancellationToken = default); + Task WriteBatchAsync(IDictionary values, CancellationToken cancellationToken = default); + + Task SubscribeAsync( + IEnumerable addresses, + Action onUpdate, CancellationToken cancellationToken = default); - - Task UnsubscribeTagAsync(string subscriptionHandle, CancellationToken cancellationToken = default); - - Task<(object? Value, DateTime Timestamp, bool IsGood)> ReadTagAsync( - string tagPath, CancellationToken cancellationToken = default); - - Task WriteTagAsync(string tagPath, object? value, CancellationToken cancellationToken = default); } /// -/// Factory for creating ILmxProxyClient instances. +/// Factory for creating instances configured +/// with host, port, and optional API key. /// public interface ILmxProxyClientFactory { - ILmxProxyClient Create(); + ILmxProxyClient Create(string host, int port, string? apiKey); } /// -/// Default factory that creates stub LmxProxy clients. -/// In production, this would create real LmxProxy SDK client instances. +/// Default factory that creates stub LmxProxy clients for development/testing. /// public class DefaultLmxProxyClientFactory : ILmxProxyClientFactory { - public ILmxProxyClient Create() => new StubLmxProxyClient(); + public ILmxProxyClient Create(string host, int port, string? apiKey) => new StubLmxProxyClient(); } /// -/// Stub LmxProxy client for development/testing. +/// Stub LmxProxy client for development and unit testing. /// internal class StubLmxProxyClient : ILmxProxyClient { public bool IsConnected { get; private set; } - public string? SessionId { get; private set; } - public Task OpenSessionAsync(string host, int port, CancellationToken cancellationToken = default) + public Task ConnectAsync(CancellationToken cancellationToken = default) { - SessionId = Guid.NewGuid().ToString(); IsConnected = true; - return Task.FromResult(SessionId); + return Task.CompletedTask; } - public Task CloseSessionAsync(CancellationToken cancellationToken = default) + public Task DisconnectAsync() { IsConnected = false; - SessionId = null; return Task.CompletedTask; } - public Task SendKeepAliveAsync(CancellationToken cancellationToken = default) + public Task ReadAsync(string address, CancellationToken cancellationToken = default) + => Task.FromResult(new LmxVtq(null, DateTime.UtcNow, LmxQuality.Good)); + + public Task> ReadBatchAsync(IEnumerable addresses, CancellationToken cancellationToken = default) { - return Task.CompletedTask; + var results = addresses.ToDictionary(a => a, _ => new LmxVtq(null, DateTime.UtcNow, LmxQuality.Good)); + return Task.FromResult>(results); } - public Task SubscribeTagAsync( - string tagPath, Action onValueChanged, - CancellationToken cancellationToken = default) - { - return Task.FromResult(Guid.NewGuid().ToString()); - } + public Task WriteAsync(string address, object value, CancellationToken cancellationToken = default) + => Task.CompletedTask; - public Task UnsubscribeTagAsync(string subscriptionHandle, CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } + public Task WriteBatchAsync(IDictionary values, CancellationToken cancellationToken = default) + => Task.CompletedTask; - public Task<(object? Value, DateTime Timestamp, bool IsGood)> ReadTagAsync( - string tagPath, CancellationToken cancellationToken = default) - { - return Task.FromResult<(object?, DateTime, bool)>((null, DateTime.UtcNow, true)); - } - - public Task WriteTagAsync(string tagPath, object? value, CancellationToken cancellationToken = default) - { - return Task.FromResult(true); - } + public Task SubscribeAsync(IEnumerable addresses, Action onUpdate, CancellationToken cancellationToken = default) + => Task.FromResult(new StubLmxSubscription()); public ValueTask DisposeAsync() { IsConnected = false; - SessionId = null; return ValueTask.CompletedTask; } } + +internal class StubLmxSubscription : ILmxSubscription +{ + public ValueTask DisposeAsync() => ValueTask.CompletedTask; +} diff --git a/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyDataConnection.cs b/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyDataConnection.cs index a4d0222..cb785fe 100644 --- a/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyDataConnection.cs +++ b/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyDataConnection.cs @@ -5,13 +5,13 @@ using ScadaLink.Commons.Types.Enums; namespace ScadaLink.DataConnectionLayer.Adapters; /// -/// WP-8: LmxProxy adapter implementing IDataConnection. -/// Maps IDataConnection to LmxProxy SDK calls. +/// LmxProxy adapter implementing IDataConnection. +/// Maps IDataConnection operations to the LmxProxy SDK client. /// /// LmxProxy-specific behavior: -/// - Session-based connection with 30s keep-alive -/// - gRPC streaming for subscriptions -/// - SessionId management (required for all operations) +/// - Session-based connection with automatic 30s keep-alive (managed by SDK) +/// - gRPC streaming for subscriptions via ILmxSubscription handles +/// - API key authentication via x-api-key gRPC metadata header /// public class LmxProxyDataConnection : IDataConnection { @@ -19,11 +19,10 @@ public class LmxProxyDataConnection : IDataConnection private readonly ILogger _logger; private ILmxProxyClient? _client; private string _host = "localhost"; - private int _port = 5000; + private int _port = 50051; private ConnectionHealth _status = ConnectionHealth.Disconnected; - private Timer? _keepAliveTimer; - private readonly Dictionary _subscriptionHandles = new(); + private readonly Dictionary _subscriptions = new(); public LmxProxyDataConnection(ILmxProxyClientFactory clientFactory, ILogger logger) { @@ -38,82 +37,56 @@ public class LmxProxyDataConnection : IDataConnection _host = connectionDetails.TryGetValue("Host", out var host) ? host : "localhost"; if (connectionDetails.TryGetValue("Port", out var portStr) && int.TryParse(portStr, out var port)) _port = port; + connectionDetails.TryGetValue("ApiKey", out var apiKey); _status = ConnectionHealth.Connecting; - _client = _clientFactory.Create(); + _client = _clientFactory.Create(_host, _port, apiKey); - var sessionId = await _client.OpenSessionAsync(_host, _port, cancellationToken); + await _client.ConnectAsync(cancellationToken); _status = ConnectionHealth.Connected; - // Start 30s keep-alive timer per design spec - _keepAliveTimer = new Timer( - async _ => await SendKeepAliveAsync(), - null, - TimeSpan.FromSeconds(30), - TimeSpan.FromSeconds(30)); - - _logger.LogInformation("LmxProxy connected to {Host}:{Port}, sessionId={SessionId}", _host, _port, sessionId); + _logger.LogInformation("LmxProxy connected to {Host}:{Port}", _host, _port); } public async Task DisconnectAsync(CancellationToken cancellationToken = default) { - _keepAliveTimer?.Dispose(); - _keepAliveTimer = null; - if (_client != null) { - await _client.CloseSessionAsync(cancellationToken); + await _client.DisconnectAsync(); _status = ConnectionHealth.Disconnected; _logger.LogInformation("LmxProxy disconnected from {Host}:{Port}", _host, _port); } } - public async Task SubscribeAsync(string tagPath, SubscriptionCallback callback, CancellationToken cancellationToken = default) - { - EnsureConnected(); - - var handle = await _client!.SubscribeTagAsync( - tagPath, - (path, value, timestamp, isGood) => - { - var quality = isGood ? QualityCode.Good : QualityCode.Bad; - callback(path, new TagValue(value, quality, new DateTimeOffset(timestamp, TimeSpan.Zero))); - }, - cancellationToken); - - _subscriptionHandles[handle] = tagPath; - return handle; - } - - public async Task UnsubscribeAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - if (_client != null) - { - await _client.UnsubscribeTagAsync(subscriptionId, cancellationToken); - _subscriptionHandles.Remove(subscriptionId); - } - } - public async Task ReadAsync(string tagPath, CancellationToken cancellationToken = default) { EnsureConnected(); - var (value, timestamp, isGood) = await _client!.ReadTagAsync(tagPath, cancellationToken); - var quality = isGood ? QualityCode.Good : QualityCode.Bad; + var vtq = await _client!.ReadAsync(tagPath, cancellationToken); + var quality = MapQuality(vtq.Quality); + var tagValue = new TagValue(vtq.Value, quality, new DateTimeOffset(vtq.TimestampUtc, TimeSpan.Zero)); - if (!isGood) - return new ReadResult(false, null, "LmxProxy read returned bad quality"); - - return new ReadResult(true, new TagValue(value, quality, new DateTimeOffset(timestamp, TimeSpan.Zero)), null); + return vtq.Quality == LmxQuality.Bad + ? new ReadResult(false, tagValue, "LmxProxy read returned bad quality") + : new ReadResult(true, tagValue, null); } public async Task> ReadBatchAsync(IEnumerable tagPaths, CancellationToken cancellationToken = default) { + EnsureConnected(); + + var vtqs = await _client!.ReadBatchAsync(tagPaths, cancellationToken); var results = new Dictionary(); - foreach (var tagPath in tagPaths) + + foreach (var (tag, vtq) in vtqs) { - results[tagPath] = await ReadAsync(tagPath, cancellationToken); + var quality = MapQuality(vtq.Quality); + var tagValue = new TagValue(vtq.Value, quality, new DateTimeOffset(vtq.TimestampUtc, TimeSpan.Zero)); + results[tag] = vtq.Quality == LmxQuality.Bad + ? new ReadResult(false, tagValue, "LmxProxy read returned bad quality") + : new ReadResult(true, tagValue, null); } + return results; } @@ -121,20 +94,35 @@ public class LmxProxyDataConnection : IDataConnection { EnsureConnected(); - var success = await _client!.WriteTagAsync(tagPath, value, cancellationToken); - return success - ? new WriteResult(true, null) - : new WriteResult(false, "LmxProxy write failed"); + try + { + await _client!.WriteAsync(tagPath, value!, cancellationToken); + return new WriteResult(true, null); + } + catch (Exception ex) + { + return new WriteResult(false, ex.Message); + } } public async Task> WriteBatchAsync(IDictionary values, CancellationToken cancellationToken = default) { - var results = new Dictionary(); - foreach (var (tagPath, value) in values) + EnsureConnected(); + + try { - results[tagPath] = await WriteAsync(tagPath, value, cancellationToken); + var nonNullValues = values.Where(kv => kv.Value != null) + .ToDictionary(kv => kv.Key, kv => kv.Value!); + await _client!.WriteBatchAsync(nonNullValues, cancellationToken); + + return values.Keys.ToDictionary(k => k, _ => new WriteResult(true, null)) + as IReadOnlyDictionary; + } + catch (Exception ex) + { + return values.Keys.ToDictionary(k => k, _ => new WriteResult(false, ex.Message)) + as IReadOnlyDictionary; } - return results; } public async Task WriteBatchAndWaitAsync( @@ -162,10 +150,40 @@ public class LmxProxyDataConnection : IDataConnection return false; } + public async Task SubscribeAsync(string tagPath, SubscriptionCallback callback, CancellationToken cancellationToken = default) + { + EnsureConnected(); + + var subscription = await _client!.SubscribeAsync( + [tagPath], + (path, vtq) => + { + var quality = MapQuality(vtq.Quality); + callback(path, new TagValue(vtq.Value, quality, new DateTimeOffset(vtq.TimestampUtc, TimeSpan.Zero))); + }, + cancellationToken); + + var subscriptionId = Guid.NewGuid().ToString("N"); + _subscriptions[subscriptionId] = subscription; + return subscriptionId; + } + + public async Task UnsubscribeAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + if (_subscriptions.Remove(subscriptionId, out var subscription)) + { + await subscription.DisposeAsync(); + } + } + public async ValueTask DisposeAsync() { - _keepAliveTimer?.Dispose(); - _keepAliveTimer = null; + foreach (var subscription in _subscriptions.Values) + { + try { await subscription.DisposeAsync(); } + catch { /* best-effort cleanup */ } + } + _subscriptions.Clear(); if (_client != null) { @@ -181,16 +199,11 @@ public class LmxProxyDataConnection : IDataConnection throw new InvalidOperationException("LmxProxy client is not connected."); } - private async Task SendKeepAliveAsync() + private static QualityCode MapQuality(LmxQuality quality) => quality switch { - try - { - if (_client?.IsConnected == true) - await _client.SendKeepAliveAsync(); - } - catch (Exception ex) - { - _logger.LogWarning(ex, "LmxProxy keep-alive failed for {Host}:{Port}", _host, _port); - } - } + LmxQuality.Good => QualityCode.Good, + LmxQuality.Uncertain => QualityCode.Uncertain, + LmxQuality.Bad => QualityCode.Bad, + _ => QualityCode.Bad + }; } diff --git a/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyGrpc/Scada.cs b/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyGrpc/Scada.cs new file mode 100644 index 0000000..306e10d --- /dev/null +++ b/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyGrpc/Scada.cs @@ -0,0 +1,5739 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Adapters/Protos/scada.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc { + + /// Holder for reflection information generated from Adapters/Protos/scada.proto + public static partial class ScadaReflection { + + #region Descriptor + /// File descriptor for Adapters/Protos/scada.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ScadaReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChtBZGFwdGVycy9Qcm90b3Mvc2NhZGEucHJvdG8SBXNjYWRhIjQKDkNvbm5l", + "Y3RSZXF1ZXN0EhEKCWNsaWVudF9pZBgBIAEoCRIPCgdhcGlfa2V5GAIgASgJ", + "IkcKD0Nvbm5lY3RSZXNwb25zZRIPCgdzdWNjZXNzGAEgASgIEg8KB21lc3Nh", + "Z2UYAiABKAkSEgoKc2Vzc2lvbl9pZBgDIAEoCSInChFEaXNjb25uZWN0UmVx", + "dWVzdBISCgpzZXNzaW9uX2lkGAEgASgJIjYKEkRpc2Nvbm5lY3RSZXNwb25z", + "ZRIPCgdzdWNjZXNzGAEgASgIEg8KB21lc3NhZ2UYAiABKAkiLwoZR2V0Q29u", + "bmVjdGlvblN0YXRlUmVxdWVzdBISCgpzZXNzaW9uX2lkGAEgASgJImgKGkdl", + "dENvbm5lY3Rpb25TdGF0ZVJlc3BvbnNlEhQKDGlzX2Nvbm5lY3RlZBgBIAEo", + "CBIRCgljbGllbnRfaWQYAiABKAkSIQoZY29ubmVjdGVkX3NpbmNlX3V0Y190", + "aWNrcxgDIAEoAyJWCgpWdHFNZXNzYWdlEgsKA3RhZxgBIAEoCRINCgV2YWx1", + "ZRgCIAEoCRIbChN0aW1lc3RhbXBfdXRjX3RpY2tzGAMgASgDEg8KB3F1YWxp", + "dHkYBCABKAkiLgoLUmVhZFJlcXVlc3QSEgoKc2Vzc2lvbl9pZBgBIAEoCRIL", + "CgN0YWcYAiABKAkiUAoMUmVhZFJlc3BvbnNlEg8KB3N1Y2Nlc3MYASABKAgS", + "DwoHbWVzc2FnZRgCIAEoCRIeCgN2dHEYAyABKAsyES5zY2FkYS5WdHFNZXNz", + "YWdlIjQKEFJlYWRCYXRjaFJlcXVlc3QSEgoKc2Vzc2lvbl9pZBgBIAEoCRIM", + "CgR0YWdzGAIgAygJIlYKEVJlYWRCYXRjaFJlc3BvbnNlEg8KB3N1Y2Nlc3MY", + "ASABKAgSDwoHbWVzc2FnZRgCIAEoCRIfCgR2dHFzGAMgAygLMhEuc2NhZGEu", + "VnRxTWVzc2FnZSI+CgxXcml0ZVJlcXVlc3QSEgoKc2Vzc2lvbl9pZBgBIAEo", + "CRILCgN0YWcYAiABKAkSDQoFdmFsdWUYAyABKAkiMQoNV3JpdGVSZXNwb25z", + "ZRIPCgdzdWNjZXNzGAEgASgIEg8KB21lc3NhZ2UYAiABKAkiJwoJV3JpdGVJ", + "dGVtEgsKA3RhZxgBIAEoCRINCgV2YWx1ZRgCIAEoCSI8CgtXcml0ZVJlc3Vs", + "dBILCgN0YWcYASABKAkSDwoHc3VjY2VzcxgCIAEoCBIPCgdtZXNzYWdlGAMg", + "ASgJIkgKEVdyaXRlQmF0Y2hSZXF1ZXN0EhIKCnNlc3Npb25faWQYASABKAkS", + "HwoFaXRlbXMYAiADKAsyEC5zY2FkYS5Xcml0ZUl0ZW0iWwoSV3JpdGVCYXRj", + "aFJlc3BvbnNlEg8KB3N1Y2Nlc3MYASABKAgSDwoHbWVzc2FnZRgCIAEoCRIj", + "CgdyZXN1bHRzGAMgAygLMhIuc2NhZGEuV3JpdGVSZXN1bHQiowEKGFdyaXRl", + "QmF0Y2hBbmRXYWl0UmVxdWVzdBISCgpzZXNzaW9uX2lkGAEgASgJEh8KBWl0", + "ZW1zGAIgAygLMhAuc2NhZGEuV3JpdGVJdGVtEhAKCGZsYWdfdGFnGAMgASgJ", + "EhIKCmZsYWdfdmFsdWUYBCABKAkSEgoKdGltZW91dF9tcxgFIAEoBRIYChBw", + "b2xsX2ludGVydmFsX21zGAYgASgFIpIBChlXcml0ZUJhdGNoQW5kV2FpdFJl", + "c3BvbnNlEg8KB3N1Y2Nlc3MYASABKAgSDwoHbWVzc2FnZRgCIAEoCRIpCg13", + "cml0ZV9yZXN1bHRzGAMgAygLMhIuc2NhZGEuV3JpdGVSZXN1bHQSFAoMZmxh", + "Z19yZWFjaGVkGAQgASgIEhIKCmVsYXBzZWRfbXMYBSABKAUiSQoQU3Vic2Ny", + "aWJlUmVxdWVzdBISCgpzZXNzaW9uX2lkGAEgASgJEgwKBHRhZ3MYAiADKAkS", + "EwoLc2FtcGxpbmdfbXMYAyABKAUiJQoSQ2hlY2tBcGlLZXlSZXF1ZXN0Eg8K", + "B2FwaV9rZXkYASABKAkiOAoTQ2hlY2tBcGlLZXlSZXNwb25zZRIQCghpc192", + "YWxpZBgBIAEoCBIPCgdtZXNzYWdlGAIgASgJMqcFCgxTY2FkYVNlcnZpY2US", + "OAoHQ29ubmVjdBIVLnNjYWRhLkNvbm5lY3RSZXF1ZXN0GhYuc2NhZGEuQ29u", + "bmVjdFJlc3BvbnNlEkEKCkRpc2Nvbm5lY3QSGC5zY2FkYS5EaXNjb25uZWN0", + "UmVxdWVzdBoZLnNjYWRhLkRpc2Nvbm5lY3RSZXNwb25zZRJZChJHZXRDb25u", + "ZWN0aW9uU3RhdGUSIC5zY2FkYS5HZXRDb25uZWN0aW9uU3RhdGVSZXF1ZXN0", + "GiEuc2NhZGEuR2V0Q29ubmVjdGlvblN0YXRlUmVzcG9uc2USLwoEUmVhZBIS", + "LnNjYWRhLlJlYWRSZXF1ZXN0GhMuc2NhZGEuUmVhZFJlc3BvbnNlEj4KCVJl", + "YWRCYXRjaBIXLnNjYWRhLlJlYWRCYXRjaFJlcXVlc3QaGC5zY2FkYS5SZWFk", + "QmF0Y2hSZXNwb25zZRIyCgVXcml0ZRITLnNjYWRhLldyaXRlUmVxdWVzdBoU", + "LnNjYWRhLldyaXRlUmVzcG9uc2USQQoKV3JpdGVCYXRjaBIYLnNjYWRhLldy", + "aXRlQmF0Y2hSZXF1ZXN0Ghkuc2NhZGEuV3JpdGVCYXRjaFJlc3BvbnNlElYK", + "EVdyaXRlQmF0Y2hBbmRXYWl0Eh8uc2NhZGEuV3JpdGVCYXRjaEFuZFdhaXRS", + "ZXF1ZXN0GiAuc2NhZGEuV3JpdGVCYXRjaEFuZFdhaXRSZXNwb25zZRI5CglT", + "dWJzY3JpYmUSFy5zY2FkYS5TdWJzY3JpYmVSZXF1ZXN0GhEuc2NhZGEuVnRx", + "TWVzc2FnZTABEkQKC0NoZWNrQXBpS2V5Ehkuc2NhZGEuQ2hlY2tBcGlLZXlS", + "ZXF1ZXN0Ghouc2NhZGEuQ2hlY2tBcGlLZXlSZXNwb25zZUI3qgI0U2NhZGFM", + "aW5rLkRhdGFDb25uZWN0aW9uTGF5ZXIuQWRhcHRlcnMuTG14UHJveHkuR3Jw", + "Y2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest.Parser, new[]{ "ClientId", "ApiKey" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectResponse.Parser, new[]{ "Success", "Message", "SessionId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest.Parser, new[]{ "SessionId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectResponse.Parser, new[]{ "Success", "Message" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest.Parser, new[]{ "SessionId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateResponse.Parser, new[]{ "IsConnected", "ClientId", "ConnectedSinceUtcTicks" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage.Parser, new[]{ "Tag", "Value", "TimestampUtcTicks", "Quality" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest.Parser, new[]{ "SessionId", "Tag" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadResponse.Parser, new[]{ "Success", "Message", "Vtq" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest.Parser, new[]{ "SessionId", "Tags" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchResponse.Parser, new[]{ "Success", "Message", "Vtqs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest.Parser, new[]{ "SessionId", "Tag", "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResponse.Parser, new[]{ "Success", "Message" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteItem), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteItem.Parser, new[]{ "Tag", "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResult), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResult.Parser, new[]{ "Tag", "Success", "Message" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest.Parser, new[]{ "SessionId", "Items" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchResponse.Parser, new[]{ "Success", "Message", "Results" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest.Parser, new[]{ "SessionId", "Items", "FlagTag", "FlagValue", "TimeoutMs", "PollIntervalMs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitResponse.Parser, new[]{ "Success", "Message", "WriteResults", "FlagReached", "ElapsedMs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.SubscribeRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.SubscribeRequest.Parser, new[]{ "SessionId", "Tags", "SamplingMs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest.Parser, new[]{ "ApiKey" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyResponse), global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyResponse.Parser, new[]{ "IsValid", "Message" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ConnectRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConnectRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConnectRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConnectRequest(ConnectRequest other) : this() { + clientId_ = other.clientId_; + apiKey_ = other.apiKey_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConnectRequest Clone() { + return new ConnectRequest(this); + } + + /// Field number for the "client_id" field. + public const int ClientIdFieldNumber = 1; + private string clientId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ClientId { + get { return clientId_; } + set { + clientId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "api_key" field. + public const int ApiKeyFieldNumber = 2; + private string apiKey_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ApiKey { + get { return apiKey_; } + set { + apiKey_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ConnectRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ConnectRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ClientId != other.ClientId) return false; + if (ApiKey != other.ApiKey) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ClientId.Length != 0) hash ^= ClientId.GetHashCode(); + if (ApiKey.Length != 0) hash ^= ApiKey.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ClientId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ClientId); + } + if (ApiKey.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ApiKey); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ClientId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ClientId); + } + if (ApiKey.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ApiKey); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ClientId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ClientId); + } + if (ApiKey.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiKey); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ConnectRequest other) { + if (other == null) { + return; + } + if (other.ClientId.Length != 0) { + ClientId = other.ClientId; + } + if (other.ApiKey.Length != 0) { + ApiKey = other.ApiKey; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ClientId = input.ReadString(); + break; + } + case 18: { + ApiKey = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ClientId = input.ReadString(); + break; + } + case 18: { + ApiKey = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ConnectResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConnectResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConnectResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConnectResponse(ConnectResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + sessionId_ = other.sessionId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ConnectResponse Clone() { + return new ConnectResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 3; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ConnectResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ConnectResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + if (SessionId != other.SessionId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (SessionId.Length != 0) { + output.WriteRawTag(26); + output.WriteString(SessionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (SessionId.Length != 0) { + output.WriteRawTag(26); + output.WriteString(SessionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ConnectResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + SessionId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + SessionId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class DisconnectRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DisconnectRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DisconnectRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DisconnectRequest(DisconnectRequest other) : this() { + sessionId_ = other.sessionId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DisconnectRequest Clone() { + return new DisconnectRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DisconnectRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DisconnectRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DisconnectRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class DisconnectResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DisconnectResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DisconnectResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DisconnectResponse(DisconnectResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DisconnectResponse Clone() { + return new DisconnectResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DisconnectResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DisconnectResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DisconnectResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GetConnectionStateRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetConnectionStateRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetConnectionStateRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetConnectionStateRequest(GetConnectionStateRequest other) : this() { + sessionId_ = other.sessionId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetConnectionStateRequest Clone() { + return new GetConnectionStateRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetConnectionStateRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetConnectionStateRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetConnectionStateRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GetConnectionStateResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetConnectionStateResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetConnectionStateResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetConnectionStateResponse(GetConnectionStateResponse other) : this() { + isConnected_ = other.isConnected_; + clientId_ = other.clientId_; + connectedSinceUtcTicks_ = other.connectedSinceUtcTicks_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetConnectionStateResponse Clone() { + return new GetConnectionStateResponse(this); + } + + /// Field number for the "is_connected" field. + public const int IsConnectedFieldNumber = 1; + private bool isConnected_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsConnected { + get { return isConnected_; } + set { + isConnected_ = value; + } + } + + /// Field number for the "client_id" field. + public const int ClientIdFieldNumber = 2; + private string clientId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ClientId { + get { return clientId_; } + set { + clientId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "connected_since_utc_ticks" field. + public const int ConnectedSinceUtcTicksFieldNumber = 3; + private long connectedSinceUtcTicks_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long ConnectedSinceUtcTicks { + get { return connectedSinceUtcTicks_; } + set { + connectedSinceUtcTicks_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetConnectionStateResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetConnectionStateResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IsConnected != other.IsConnected) return false; + if (ClientId != other.ClientId) return false; + if (ConnectedSinceUtcTicks != other.ConnectedSinceUtcTicks) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (IsConnected != false) hash ^= IsConnected.GetHashCode(); + if (ClientId.Length != 0) hash ^= ClientId.GetHashCode(); + if (ConnectedSinceUtcTicks != 0L) hash ^= ConnectedSinceUtcTicks.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (IsConnected != false) { + output.WriteRawTag(8); + output.WriteBool(IsConnected); + } + if (ClientId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ClientId); + } + if (ConnectedSinceUtcTicks != 0L) { + output.WriteRawTag(24); + output.WriteInt64(ConnectedSinceUtcTicks); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (IsConnected != false) { + output.WriteRawTag(8); + output.WriteBool(IsConnected); + } + if (ClientId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ClientId); + } + if (ConnectedSinceUtcTicks != 0L) { + output.WriteRawTag(24); + output.WriteInt64(ConnectedSinceUtcTicks); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (IsConnected != false) { + size += 1 + 1; + } + if (ClientId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ClientId); + } + if (ConnectedSinceUtcTicks != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ConnectedSinceUtcTicks); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetConnectionStateResponse other) { + if (other == null) { + return; + } + if (other.IsConnected != false) { + IsConnected = other.IsConnected; + } + if (other.ClientId.Length != 0) { + ClientId = other.ClientId; + } + if (other.ConnectedSinceUtcTicks != 0L) { + ConnectedSinceUtcTicks = other.ConnectedSinceUtcTicks; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IsConnected = input.ReadBool(); + break; + } + case 18: { + ClientId = input.ReadString(); + break; + } + case 24: { + ConnectedSinceUtcTicks = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + IsConnected = input.ReadBool(); + break; + } + case 18: { + ClientId = input.ReadString(); + break; + } + case 24: { + ConnectedSinceUtcTicks = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class VtqMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VtqMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VtqMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VtqMessage(VtqMessage other) : this() { + tag_ = other.tag_; + value_ = other.value_; + timestampUtcTicks_ = other.timestampUtcTicks_; + quality_ = other.quality_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public VtqMessage Clone() { + return new VtqMessage(this); + } + + /// Field number for the "tag" field. + public const int TagFieldNumber = 1; + private string tag_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Tag { + get { return tag_; } + set { + tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 2; + private string value_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Value { + get { return value_; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "timestamp_utc_ticks" field. + public const int TimestampUtcTicksFieldNumber = 3; + private long timestampUtcTicks_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TimestampUtcTicks { + get { return timestampUtcTicks_; } + set { + timestampUtcTicks_ = value; + } + } + + /// Field number for the "quality" field. + public const int QualityFieldNumber = 4; + private string quality_ = ""; + /// + /// "Good", "Uncertain", "Bad" + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Quality { + get { return quality_; } + set { + quality_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as VtqMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(VtqMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Tag != other.Tag) return false; + if (Value != other.Value) return false; + if (TimestampUtcTicks != other.TimestampUtcTicks) return false; + if (Quality != other.Quality) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Tag.Length != 0) hash ^= Tag.GetHashCode(); + if (Value.Length != 0) hash ^= Value.GetHashCode(); + if (TimestampUtcTicks != 0L) hash ^= TimestampUtcTicks.GetHashCode(); + if (Quality.Length != 0) hash ^= Quality.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Tag.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Tag); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Value); + } + if (TimestampUtcTicks != 0L) { + output.WriteRawTag(24); + output.WriteInt64(TimestampUtcTicks); + } + if (Quality.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Quality); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Tag.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Tag); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Value); + } + if (TimestampUtcTicks != 0L) { + output.WriteRawTag(24); + output.WriteInt64(TimestampUtcTicks); + } + if (Quality.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Quality); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Tag.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag); + } + if (Value.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); + } + if (TimestampUtcTicks != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimestampUtcTicks); + } + if (Quality.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Quality); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(VtqMessage other) { + if (other == null) { + return; + } + if (other.Tag.Length != 0) { + Tag = other.Tag; + } + if (other.Value.Length != 0) { + Value = other.Value; + } + if (other.TimestampUtcTicks != 0L) { + TimestampUtcTicks = other.TimestampUtcTicks; + } + if (other.Quality.Length != 0) { + Quality = other.Quality; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Tag = input.ReadString(); + break; + } + case 18: { + Value = input.ReadString(); + break; + } + case 24: { + TimestampUtcTicks = input.ReadInt64(); + break; + } + case 34: { + Quality = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Tag = input.ReadString(); + break; + } + case 18: { + Value = input.ReadString(); + break; + } + case 24: { + TimestampUtcTicks = input.ReadInt64(); + break; + } + case 34: { + Quality = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ReadRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReadRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadRequest(ReadRequest other) : this() { + sessionId_ = other.sessionId_; + tag_ = other.tag_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadRequest Clone() { + return new ReadRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "tag" field. + public const int TagFieldNumber = 2; + private string tag_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Tag { + get { return tag_; } + set { + tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReadRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReadRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + if (Tag != other.Tag) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + if (Tag.Length != 0) hash ^= Tag.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (Tag.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Tag); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (Tag.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Tag); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + if (Tag.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReadRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + if (other.Tag.Length != 0) { + Tag = other.Tag; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + Tag = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + Tag = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ReadResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReadResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadResponse(ReadResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + vtq_ = other.vtq_ != null ? other.vtq_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadResponse Clone() { + return new ReadResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "vtq" field. + public const int VtqFieldNumber = 3; + private global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage vtq_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage Vtq { + get { return vtq_; } + set { + vtq_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReadResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReadResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + if (!object.Equals(Vtq, other.Vtq)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (vtq_ != null) hash ^= Vtq.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (vtq_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Vtq); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (vtq_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Vtq); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (vtq_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Vtq); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReadResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + if (other.vtq_ != null) { + if (vtq_ == null) { + Vtq = new global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage(); + } + Vtq.MergeFrom(other.Vtq); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + if (vtq_ == null) { + Vtq = new global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage(); + } + input.ReadMessage(Vtq); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + if (vtq_ == null) { + Vtq = new global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage(); + } + input.ReadMessage(Vtq); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ReadBatchRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReadBatchRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadBatchRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadBatchRequest(ReadBatchRequest other) : this() { + sessionId_ = other.sessionId_; + tags_ = other.tags_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadBatchRequest Clone() { + return new ReadBatchRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "tags" field. + public const int TagsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_tags_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField tags_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Tags { + get { return tags_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReadBatchRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReadBatchRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + if(!tags_.Equals(other.tags_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + hash ^= tags_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + tags_.WriteTo(output, _repeated_tags_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + tags_.WriteTo(ref output, _repeated_tags_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + size += tags_.CalculateSize(_repeated_tags_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReadBatchRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + tags_.Add(other.tags_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + tags_.AddEntriesFrom(input, _repeated_tags_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + tags_.AddEntriesFrom(ref input, _repeated_tags_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ReadBatchResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReadBatchResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadBatchResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadBatchResponse(ReadBatchResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + vtqs_ = other.vtqs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ReadBatchResponse Clone() { + return new ReadBatchResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "vtqs" field. + public const int VtqsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_vtqs_codec + = pb::FieldCodec.ForMessage(26, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage.Parser); + private readonly pbc::RepeatedField vtqs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Vtqs { + get { return vtqs_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ReadBatchResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ReadBatchResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + if(!vtqs_.Equals(other.vtqs_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + hash ^= vtqs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + vtqs_.WriteTo(output, _repeated_vtqs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + vtqs_.WriteTo(ref output, _repeated_vtqs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + size += vtqs_.CalculateSize(_repeated_vtqs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ReadBatchResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + vtqs_.Add(other.vtqs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + vtqs_.AddEntriesFrom(input, _repeated_vtqs_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + vtqs_.AddEntriesFrom(ref input, _repeated_vtqs_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteRequest(WriteRequest other) : this() { + sessionId_ = other.sessionId_; + tag_ = other.tag_; + value_ = other.value_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteRequest Clone() { + return new WriteRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "tag" field. + public const int TagFieldNumber = 2; + private string tag_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Tag { + get { return tag_; } + set { + tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 3; + private string value_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Value { + get { return value_; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + if (Tag != other.Tag) return false; + if (Value != other.Value) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + if (Tag.Length != 0) hash ^= Tag.GetHashCode(); + if (Value.Length != 0) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (Tag.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Tag); + } + if (Value.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + if (Tag.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Tag); + } + if (Value.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + if (Tag.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag); + } + if (Value.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + if (other.Tag.Length != 0) { + Tag = other.Tag; + } + if (other.Value.Length != 0) { + Value = other.Value; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + Tag = input.ReadString(); + break; + } + case 26: { + Value = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + Tag = input.ReadString(); + break; + } + case 26: { + Value = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteResponse(WriteResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteResponse Clone() { + return new WriteResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteItem : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteItem()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteItem() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteItem(WriteItem other) : this() { + tag_ = other.tag_; + value_ = other.value_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteItem Clone() { + return new WriteItem(this); + } + + /// Field number for the "tag" field. + public const int TagFieldNumber = 1; + private string tag_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Tag { + get { return tag_; } + set { + tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 2; + private string value_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Value { + get { return value_; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteItem); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteItem other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Tag != other.Tag) return false; + if (Value != other.Value) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Tag.Length != 0) hash ^= Tag.GetHashCode(); + if (Value.Length != 0) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Tag.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Tag); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Tag.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Tag); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Tag.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag); + } + if (Value.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteItem other) { + if (other == null) { + return; + } + if (other.Tag.Length != 0) { + Tag = other.Tag; + } + if (other.Value.Length != 0) { + Value = other.Value; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Tag = input.ReadString(); + break; + } + case 18: { + Value = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Tag = input.ReadString(); + break; + } + case 18: { + Value = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteResult : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteResult()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteResult(WriteResult other) : this() { + tag_ = other.tag_; + success_ = other.success_; + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteResult Clone() { + return new WriteResult(this); + } + + /// Field number for the "tag" field. + public const int TagFieldNumber = 1; + private string tag_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Tag { + get { return tag_; } + set { + tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 2; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 3; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Tag != other.Tag) return false; + if (Success != other.Success) return false; + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Tag.Length != 0) hash ^= Tag.GetHashCode(); + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Tag.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Tag); + } + if (Success != false) { + output.WriteRawTag(16); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Tag.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Tag); + } + if (Success != false) { + output.WriteRawTag(16); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Tag.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag); + } + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteResult other) { + if (other == null) { + return; + } + if (other.Tag.Length != 0) { + Tag = other.Tag; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Tag = input.ReadString(); + break; + } + case 16: { + Success = input.ReadBool(); + break; + } + case 26: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Tag = input.ReadString(); + break; + } + case 16: { + Success = input.ReadBool(); + break; + } + case 26: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteBatchRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteBatchRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchRequest(WriteBatchRequest other) : this() { + sessionId_ = other.sessionId_; + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchRequest Clone() { + return new WriteBatchRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(18, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Items { + get { return items_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteBatchRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteBatchRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + if(!items_.Equals(other.items_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + hash ^= items_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + items_.WriteTo(output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + items_.WriteTo(ref output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + size += items_.CalculateSize(_repeated_items_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteBatchRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + items_.Add(other.items_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + items_.AddEntriesFrom(ref input, _repeated_items_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteBatchResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteBatchResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchResponse(WriteBatchResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + results_ = other.results_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchResponse Clone() { + return new WriteBatchResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "results" field. + public const int ResultsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_results_codec + = pb::FieldCodec.ForMessage(26, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResult.Parser); + private readonly pbc::RepeatedField results_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Results { + get { return results_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteBatchResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteBatchResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + if(!results_.Equals(other.results_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + hash ^= results_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + results_.WriteTo(output, _repeated_results_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + results_.WriteTo(ref output, _repeated_results_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + size += results_.CalculateSize(_repeated_results_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteBatchResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + results_.Add(other.results_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + results_.AddEntriesFrom(input, _repeated_results_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + results_.AddEntriesFrom(ref input, _repeated_results_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteBatchAndWaitRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteBatchAndWaitRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchAndWaitRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchAndWaitRequest(WriteBatchAndWaitRequest other) : this() { + sessionId_ = other.sessionId_; + items_ = other.items_.Clone(); + flagTag_ = other.flagTag_; + flagValue_ = other.flagValue_; + timeoutMs_ = other.timeoutMs_; + pollIntervalMs_ = other.pollIntervalMs_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchAndWaitRequest Clone() { + return new WriteBatchAndWaitRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(18, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Items { + get { return items_; } + } + + /// Field number for the "flag_tag" field. + public const int FlagTagFieldNumber = 3; + private string flagTag_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FlagTag { + get { return flagTag_; } + set { + flagTag_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "flag_value" field. + public const int FlagValueFieldNumber = 4; + private string flagValue_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string FlagValue { + get { return flagValue_; } + set { + flagValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "timeout_ms" field. + public const int TimeoutMsFieldNumber = 5; + private int timeoutMs_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TimeoutMs { + get { return timeoutMs_; } + set { + timeoutMs_ = value; + } + } + + /// Field number for the "poll_interval_ms" field. + public const int PollIntervalMsFieldNumber = 6; + private int pollIntervalMs_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PollIntervalMs { + get { return pollIntervalMs_; } + set { + pollIntervalMs_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteBatchAndWaitRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteBatchAndWaitRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + if(!items_.Equals(other.items_)) return false; + if (FlagTag != other.FlagTag) return false; + if (FlagValue != other.FlagValue) return false; + if (TimeoutMs != other.TimeoutMs) return false; + if (PollIntervalMs != other.PollIntervalMs) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + hash ^= items_.GetHashCode(); + if (FlagTag.Length != 0) hash ^= FlagTag.GetHashCode(); + if (FlagValue.Length != 0) hash ^= FlagValue.GetHashCode(); + if (TimeoutMs != 0) hash ^= TimeoutMs.GetHashCode(); + if (PollIntervalMs != 0) hash ^= PollIntervalMs.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + items_.WriteTo(output, _repeated_items_codec); + if (FlagTag.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FlagTag); + } + if (FlagValue.Length != 0) { + output.WriteRawTag(34); + output.WriteString(FlagValue); + } + if (TimeoutMs != 0) { + output.WriteRawTag(40); + output.WriteInt32(TimeoutMs); + } + if (PollIntervalMs != 0) { + output.WriteRawTag(48); + output.WriteInt32(PollIntervalMs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + items_.WriteTo(ref output, _repeated_items_codec); + if (FlagTag.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FlagTag); + } + if (FlagValue.Length != 0) { + output.WriteRawTag(34); + output.WriteString(FlagValue); + } + if (TimeoutMs != 0) { + output.WriteRawTag(40); + output.WriteInt32(TimeoutMs); + } + if (PollIntervalMs != 0) { + output.WriteRawTag(48); + output.WriteInt32(PollIntervalMs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + size += items_.CalculateSize(_repeated_items_codec); + if (FlagTag.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FlagTag); + } + if (FlagValue.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FlagValue); + } + if (TimeoutMs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TimeoutMs); + } + if (PollIntervalMs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PollIntervalMs); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteBatchAndWaitRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + items_.Add(other.items_); + if (other.FlagTag.Length != 0) { + FlagTag = other.FlagTag; + } + if (other.FlagValue.Length != 0) { + FlagValue = other.FlagValue; + } + if (other.TimeoutMs != 0) { + TimeoutMs = other.TimeoutMs; + } + if (other.PollIntervalMs != 0) { + PollIntervalMs = other.PollIntervalMs; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + case 26: { + FlagTag = input.ReadString(); + break; + } + case 34: { + FlagValue = input.ReadString(); + break; + } + case 40: { + TimeoutMs = input.ReadInt32(); + break; + } + case 48: { + PollIntervalMs = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + items_.AddEntriesFrom(ref input, _repeated_items_codec); + break; + } + case 26: { + FlagTag = input.ReadString(); + break; + } + case 34: { + FlagValue = input.ReadString(); + break; + } + case 40: { + TimeoutMs = input.ReadInt32(); + break; + } + case 48: { + PollIntervalMs = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class WriteBatchAndWaitResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteBatchAndWaitResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchAndWaitResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchAndWaitResponse(WriteBatchAndWaitResponse other) : this() { + success_ = other.success_; + message_ = other.message_; + writeResults_ = other.writeResults_.Clone(); + flagReached_ = other.flagReached_; + elapsedMs_ = other.elapsedMs_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public WriteBatchAndWaitResponse Clone() { + return new WriteBatchAndWaitResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "write_results" field. + public const int WriteResultsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_writeResults_codec + = pb::FieldCodec.ForMessage(26, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResult.Parser); + private readonly pbc::RepeatedField writeResults_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField WriteResults { + get { return writeResults_; } + } + + /// Field number for the "flag_reached" field. + public const int FlagReachedFieldNumber = 4; + private bool flagReached_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool FlagReached { + get { return flagReached_; } + set { + flagReached_ = value; + } + } + + /// Field number for the "elapsed_ms" field. + public const int ElapsedMsFieldNumber = 5; + private int elapsedMs_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ElapsedMs { + get { return elapsedMs_; } + set { + elapsedMs_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as WriteBatchAndWaitResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(WriteBatchAndWaitResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + if (Message != other.Message) return false; + if(!writeResults_.Equals(other.writeResults_)) return false; + if (FlagReached != other.FlagReached) return false; + if (ElapsedMs != other.ElapsedMs) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + hash ^= writeResults_.GetHashCode(); + if (FlagReached != false) hash ^= FlagReached.GetHashCode(); + if (ElapsedMs != 0) hash ^= ElapsedMs.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + writeResults_.WriteTo(output, _repeated_writeResults_codec); + if (FlagReached != false) { + output.WriteRawTag(32); + output.WriteBool(FlagReached); + } + if (ElapsedMs != 0) { + output.WriteRawTag(40); + output.WriteInt32(ElapsedMs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + writeResults_.WriteTo(ref output, _repeated_writeResults_codec); + if (FlagReached != false) { + output.WriteRawTag(32); + output.WriteBool(FlagReached); + } + if (ElapsedMs != 0) { + output.WriteRawTag(40); + output.WriteInt32(ElapsedMs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + size += writeResults_.CalculateSize(_repeated_writeResults_codec); + if (FlagReached != false) { + size += 1 + 1; + } + if (ElapsedMs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ElapsedMs); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(WriteBatchAndWaitResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + writeResults_.Add(other.writeResults_); + if (other.FlagReached != false) { + FlagReached = other.FlagReached; + } + if (other.ElapsedMs != 0) { + ElapsedMs = other.ElapsedMs; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + writeResults_.AddEntriesFrom(input, _repeated_writeResults_codec); + break; + } + case 32: { + FlagReached = input.ReadBool(); + break; + } + case 40: { + ElapsedMs = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + case 26: { + writeResults_.AddEntriesFrom(ref input, _repeated_writeResults_codec); + break; + } + case 32: { + FlagReached = input.ReadBool(); + break; + } + case 40: { + ElapsedMs = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class SubscribeRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubscribeRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SubscribeRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SubscribeRequest(SubscribeRequest other) : this() { + sessionId_ = other.sessionId_; + tags_ = other.tags_.Clone(); + samplingMs_ = other.samplingMs_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public SubscribeRequest Clone() { + return new SubscribeRequest(this); + } + + /// Field number for the "session_id" field. + public const int SessionIdFieldNumber = 1; + private string sessionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string SessionId { + get { return sessionId_; } + set { + sessionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "tags" field. + public const int TagsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_tags_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField tags_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Tags { + get { return tags_; } + } + + /// Field number for the "sampling_ms" field. + public const int SamplingMsFieldNumber = 3; + private int samplingMs_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SamplingMs { + get { return samplingMs_; } + set { + samplingMs_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as SubscribeRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(SubscribeRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SessionId != other.SessionId) return false; + if(!tags_.Equals(other.tags_)) return false; + if (SamplingMs != other.SamplingMs) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (SessionId.Length != 0) hash ^= SessionId.GetHashCode(); + hash ^= tags_.GetHashCode(); + if (SamplingMs != 0) hash ^= SamplingMs.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + tags_.WriteTo(output, _repeated_tags_codec); + if (SamplingMs != 0) { + output.WriteRawTag(24); + output.WriteInt32(SamplingMs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SessionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SessionId); + } + tags_.WriteTo(ref output, _repeated_tags_codec); + if (SamplingMs != 0) { + output.WriteRawTag(24); + output.WriteInt32(SamplingMs); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (SessionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SessionId); + } + size += tags_.CalculateSize(_repeated_tags_codec); + if (SamplingMs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SamplingMs); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(SubscribeRequest other) { + if (other == null) { + return; + } + if (other.SessionId.Length != 0) { + SessionId = other.SessionId; + } + tags_.Add(other.tags_); + if (other.SamplingMs != 0) { + SamplingMs = other.SamplingMs; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + tags_.AddEntriesFrom(input, _repeated_tags_codec); + break; + } + case 24: { + SamplingMs = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SessionId = input.ReadString(); + break; + } + case 18: { + tags_.AddEntriesFrom(ref input, _repeated_tags_codec); + break; + } + case 24: { + SamplingMs = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class CheckApiKeyRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CheckApiKeyRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CheckApiKeyRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CheckApiKeyRequest(CheckApiKeyRequest other) : this() { + apiKey_ = other.apiKey_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CheckApiKeyRequest Clone() { + return new CheckApiKeyRequest(this); + } + + /// Field number for the "api_key" field. + public const int ApiKeyFieldNumber = 1; + private string apiKey_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ApiKey { + get { return apiKey_; } + set { + apiKey_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CheckApiKeyRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CheckApiKeyRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ApiKey != other.ApiKey) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ApiKey.Length != 0) hash ^= ApiKey.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ApiKey.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ApiKey); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ApiKey.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ApiKey); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ApiKey.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiKey); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CheckApiKeyRequest other) { + if (other == null) { + return; + } + if (other.ApiKey.Length != 0) { + ApiKey = other.ApiKey; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ApiKey = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ApiKey = input.ReadString(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class CheckApiKeyResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CheckApiKeyResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CheckApiKeyResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CheckApiKeyResponse(CheckApiKeyResponse other) : this() { + isValid_ = other.isValid_; + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CheckApiKeyResponse Clone() { + return new CheckApiKeyResponse(this); + } + + /// Field number for the "is_valid" field. + public const int IsValidFieldNumber = 1; + private bool isValid_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsValid { + get { return isValid_; } + set { + isValid_ = value; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CheckApiKeyResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CheckApiKeyResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IsValid != other.IsValid) return false; + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (IsValid != false) hash ^= IsValid.GetHashCode(); + if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (IsValid != false) { + output.WriteRawTag(8); + output.WriteBool(IsValid); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (IsValid != false) { + output.WriteRawTag(8); + output.WriteBool(IsValid); + } + if (Message.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (IsValid != false) { + size += 1 + 1; + } + if (Message.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CheckApiKeyResponse other) { + if (other == null) { + return; + } + if (other.IsValid != false) { + IsValid = other.IsValid; + } + if (other.Message.Length != 0) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + IsValid = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + IsValid = input.ReadBool(); + break; + } + case 18: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyGrpc/ScadaGrpc.cs b/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyGrpc/ScadaGrpc.cs new file mode 100644 index 0000000..cd74975 --- /dev/null +++ b/src/ScadaLink.DataConnectionLayer/Adapters/LmxProxyGrpc/ScadaGrpc.cs @@ -0,0 +1,531 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Adapters/Protos/scada.proto +// +#pragma warning disable 0414, 1591, 8981, 0612 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc { + /// + /// The SCADA service definition + /// + public static partial class ScadaService + { + static readonly string __ServiceName = "scada.ScadaService"; + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_ConnectRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_ConnectResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_DisconnectRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_DisconnectResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_GetConnectionStateRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_GetConnectionStateResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_ReadRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_ReadResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_ReadBatchRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_ReadBatchResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_WriteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_WriteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_WriteBatchRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_WriteBatchResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_WriteBatchAndWaitRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_WriteBatchAndWaitResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_SubscribeRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.SubscribeRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_VtqMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.VtqMessage.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_CheckApiKeyRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_scada_CheckApiKeyResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyResponse.Parser)); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_Connect = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Connect", + __Marshaller_scada_ConnectRequest, + __Marshaller_scada_ConnectResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_Disconnect = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Disconnect", + __Marshaller_scada_DisconnectRequest, + __Marshaller_scada_DisconnectResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_GetConnectionState = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetConnectionState", + __Marshaller_scada_GetConnectionStateRequest, + __Marshaller_scada_GetConnectionStateResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_Read = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Read", + __Marshaller_scada_ReadRequest, + __Marshaller_scada_ReadResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_ReadBatch = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ReadBatch", + __Marshaller_scada_ReadBatchRequest, + __Marshaller_scada_ReadBatchResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_Write = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Write", + __Marshaller_scada_WriteRequest, + __Marshaller_scada_WriteResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_WriteBatch = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "WriteBatch", + __Marshaller_scada_WriteBatchRequest, + __Marshaller_scada_WriteBatchResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_WriteBatchAndWait = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "WriteBatchAndWait", + __Marshaller_scada_WriteBatchAndWaitRequest, + __Marshaller_scada_WriteBatchAndWaitResponse); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_Subscribe = new grpc::Method( + grpc::MethodType.ServerStreaming, + __ServiceName, + "Subscribe", + __Marshaller_scada_SubscribeRequest, + __Marshaller_scada_VtqMessage); + + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_CheckApiKey = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "CheckApiKey", + __Marshaller_scada_CheckApiKeyRequest, + __Marshaller_scada_CheckApiKeyResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ScadaReflection.Descriptor.Services[0]; } + } + + /// Client for ScadaService + public partial class ScadaServiceClient : grpc::ClientBase + { + /// Creates a new client for ScadaService + /// The channel to use to make remote calls. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public ScadaServiceClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for ScadaService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public ScadaServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + protected ScadaServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + protected ScadaServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Connection management + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectResponse Connect(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Connect(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Connection management + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectResponse Connect(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Connect, null, options, request); + } + /// + /// Connection management + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ConnectAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ConnectAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Connection management + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ConnectAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ConnectRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Connect, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectResponse Disconnect(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Disconnect(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectResponse Disconnect(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Disconnect, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall DisconnectAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return DisconnectAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall DisconnectAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.DisconnectRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Disconnect, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateResponse GetConnectionState(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetConnectionState(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateResponse GetConnectionState(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetConnectionState, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall GetConnectionStateAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetConnectionStateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall GetConnectionStateAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.GetConnectionStateRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetConnectionState, null, options, request); + } + /// + /// Read operations + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadResponse Read(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Read(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Read operations + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadResponse Read(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Read, null, options, request); + } + /// + /// Read operations + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ReadAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ReadAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Read operations + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ReadAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Read, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchResponse ReadBatch(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ReadBatch(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchResponse ReadBatch(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ReadBatch, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ReadBatchAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ReadBatchAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall ReadBatchAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.ReadBatchRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ReadBatch, null, options, request); + } + /// + /// Write operations + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResponse Write(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Write(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Write operations + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteResponse Write(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Write, null, options, request); + } + /// + /// Write operations + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall WriteAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return WriteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Write operations + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall WriteAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Write, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchResponse WriteBatch(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return WriteBatch(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchResponse WriteBatch(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_WriteBatch, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall WriteBatchAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return WriteBatchAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall WriteBatchAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_WriteBatch, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitResponse WriteBatchAndWait(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return WriteBatchAndWait(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitResponse WriteBatchAndWait(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_WriteBatchAndWait, null, options, request); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall WriteBatchAndWaitAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return WriteBatchAndWaitAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall WriteBatchAndWaitAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.WriteBatchAndWaitRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_WriteBatchAndWait, null, options, request); + } + /// + /// Subscription operations (server streaming) - now streams VtqMessage directly + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncServerStreamingCall Subscribe(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.SubscribeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Subscribe(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Subscription operations (server streaming) - now streams VtqMessage directly + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncServerStreamingCall Subscribe(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.SubscribeRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncServerStreamingCall(__Method_Subscribe, null, options, request); + } + /// + /// Authentication + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyResponse CheckApiKey(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CheckApiKey(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Authentication + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyResponse CheckApiKey(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_CheckApiKey, null, options, request); + } + /// + /// Authentication + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall CheckApiKeyAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CheckApiKeyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Authentication + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall CheckApiKeyAsync(global::ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc.CheckApiKeyRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_CheckApiKey, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + protected override ScadaServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new ScadaServiceClient(configuration); + } + } + + } +} +#endregion diff --git a/src/ScadaLink.DataConnectionLayer/Adapters/Protos/scada.proto b/src/ScadaLink.DataConnectionLayer/Adapters/Protos/scada.proto new file mode 100644 index 0000000..fa4904d --- /dev/null +++ b/src/ScadaLink.DataConnectionLayer/Adapters/Protos/scada.proto @@ -0,0 +1,166 @@ +syntax = "proto3"; + +option csharp_namespace = "ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc"; + +package scada; + +// The SCADA service definition +service ScadaService { + // Connection management + rpc Connect(ConnectRequest) returns (ConnectResponse); + rpc Disconnect(DisconnectRequest) returns (DisconnectResponse); + rpc GetConnectionState(GetConnectionStateRequest) returns (GetConnectionStateResponse); + + // Read operations + rpc Read(ReadRequest) returns (ReadResponse); + rpc ReadBatch(ReadBatchRequest) returns (ReadBatchResponse); + + // Write operations + rpc Write(WriteRequest) returns (WriteResponse); + rpc WriteBatch(WriteBatchRequest) returns (WriteBatchResponse); + rpc WriteBatchAndWait(WriteBatchAndWaitRequest) returns (WriteBatchAndWaitResponse); + + // Subscription operations (server streaming) - now streams VtqMessage directly + rpc Subscribe(SubscribeRequest) returns (stream VtqMessage); + + // Authentication + rpc CheckApiKey(CheckApiKeyRequest) returns (CheckApiKeyResponse); +} + +// === CONNECTION MESSAGES === + +message ConnectRequest { + string client_id = 1; + string api_key = 2; +} + +message ConnectResponse { + bool success = 1; + string message = 2; + string session_id = 3; +} + +message DisconnectRequest { + string session_id = 1; +} + +message DisconnectResponse { + bool success = 1; + string message = 2; +} + +message GetConnectionStateRequest { + string session_id = 1; +} + +message GetConnectionStateResponse { + bool is_connected = 1; + string client_id = 2; + int64 connected_since_utc_ticks = 3; +} + +// === VTQ MESSAGE === + +message VtqMessage { + string tag = 1; + string value = 2; + int64 timestamp_utc_ticks = 3; + string quality = 4; // "Good", "Uncertain", "Bad" +} + +// === READ MESSAGES === + +message ReadRequest { + string session_id = 1; + string tag = 2; +} + +message ReadResponse { + bool success = 1; + string message = 2; + VtqMessage vtq = 3; +} + +message ReadBatchRequest { + string session_id = 1; + repeated string tags = 2; +} + +message ReadBatchResponse { + bool success = 1; + string message = 2; + repeated VtqMessage vtqs = 3; +} + +// === WRITE MESSAGES === + +message WriteRequest { + string session_id = 1; + string tag = 2; + string value = 3; +} + +message WriteResponse { + bool success = 1; + string message = 2; +} + +message WriteItem { + string tag = 1; + string value = 2; +} + +message WriteResult { + string tag = 1; + bool success = 2; + string message = 3; +} + +message WriteBatchRequest { + string session_id = 1; + repeated WriteItem items = 2; +} + +message WriteBatchResponse { + bool success = 1; + string message = 2; + repeated WriteResult results = 3; +} + +message WriteBatchAndWaitRequest { + string session_id = 1; + repeated WriteItem items = 2; + string flag_tag = 3; + string flag_value = 4; + int32 timeout_ms = 5; + int32 poll_interval_ms = 6; +} + +message WriteBatchAndWaitResponse { + bool success = 1; + string message = 2; + repeated WriteResult write_results = 3; + bool flag_reached = 4; + int32 elapsed_ms = 5; +} + +// === SUBSCRIPTION MESSAGES === + +message SubscribeRequest { + string session_id = 1; + repeated string tags = 2; + int32 sampling_ms = 3; +} + +// Note: Subscribe RPC now streams VtqMessage directly (defined above) + +// === AUTHENTICATION MESSAGES === + +message CheckApiKeyRequest { + string api_key = 1; +} + +message CheckApiKeyResponse { + bool is_valid = 1; + string message = 2; +} diff --git a/src/ScadaLink.DataConnectionLayer/Adapters/RealLmxProxyClient.cs b/src/ScadaLink.DataConnectionLayer/Adapters/RealLmxProxyClient.cs new file mode 100644 index 0000000..2204b85 --- /dev/null +++ b/src/ScadaLink.DataConnectionLayer/Adapters/RealLmxProxyClient.cs @@ -0,0 +1,196 @@ +using System.Net.Http; +using Grpc.Core; +using Grpc.Net.Client; +using ScadaLink.DataConnectionLayer.Adapters.LmxProxy.Grpc; + +namespace ScadaLink.DataConnectionLayer.Adapters; + +/// +/// Production ILmxProxyClient that talks to the LmxProxy gRPC service +/// using proto-generated client stubs with x-api-key header injection. +/// +internal class RealLmxProxyClient : ILmxProxyClient +{ + private readonly string _host; + private readonly int _port; + private readonly string? _apiKey; + private GrpcChannel? _channel; + private ScadaService.ScadaServiceClient? _client; + private string? _sessionId; + private Metadata? _headers; + + public RealLmxProxyClient(string host, int port, string? apiKey) + { + _host = host; + _port = port; + _apiKey = apiKey; + } + + public bool IsConnected => _client != null && !string.IsNullOrEmpty(_sessionId); + + public async Task ConnectAsync(CancellationToken cancellationToken = default) + { + AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); + + _channel = GrpcChannel.ForAddress($"http://{_host}:{_port}"); + _client = new ScadaService.ScadaServiceClient(_channel); + + _headers = new Metadata(); + if (!string.IsNullOrEmpty(_apiKey)) + _headers.Add("x-api-key", _apiKey); + + var response = await _client.ConnectAsync(new ConnectRequest + { + ClientId = $"ScadaLink-{Guid.NewGuid():N}", + ApiKey = _apiKey ?? string.Empty + }, _headers, cancellationToken: cancellationToken); + + if (!response.Success) + throw new InvalidOperationException($"LmxProxy connect failed: {response.Message}"); + + _sessionId = response.SessionId; + } + + public async Task DisconnectAsync() + { + if (_client != null && !string.IsNullOrEmpty(_sessionId)) + { + try { await _client.DisconnectAsync(new DisconnectRequest { SessionId = _sessionId }, _headers); } + catch { /* best-effort */ } + } + _client = null; + _sessionId = null; + } + + public async Task ReadAsync(string address, CancellationToken cancellationToken = default) + { + EnsureConnected(); + var response = await _client!.ReadAsync( + new ReadRequest { SessionId = _sessionId!, Tag = address }, + _headers, cancellationToken: cancellationToken); + if (!response.Success) + throw new InvalidOperationException($"Read failed for '{address}': {response.Message}"); + return ConvertVtq(response.Vtq); + } + + public async Task> ReadBatchAsync(IEnumerable addresses, CancellationToken cancellationToken = default) + { + EnsureConnected(); + var request = new ReadBatchRequest { SessionId = _sessionId! }; + request.Tags.AddRange(addresses); + var response = await _client!.ReadBatchAsync(request, _headers, cancellationToken: cancellationToken); + if (!response.Success) + throw new InvalidOperationException($"ReadBatch failed: {response.Message}"); + return response.Vtqs.ToDictionary(v => v.Tag, v => ConvertVtq(v)); + } + + public async Task WriteAsync(string address, object value, CancellationToken cancellationToken = default) + { + EnsureConnected(); + var response = await _client!.WriteAsync(new WriteRequest + { + SessionId = _sessionId!, + Tag = address, + Value = value?.ToString() ?? string.Empty + }, _headers, cancellationToken: cancellationToken); + if (!response.Success) + throw new InvalidOperationException($"Write failed for '{address}': {response.Message}"); + } + + public async Task WriteBatchAsync(IDictionary values, CancellationToken cancellationToken = default) + { + EnsureConnected(); + var request = new WriteBatchRequest { SessionId = _sessionId! }; + request.Items.AddRange(values.Select(kv => new WriteItem + { + Tag = kv.Key, + Value = kv.Value?.ToString() ?? string.Empty + })); + var response = await _client!.WriteBatchAsync(request, _headers, cancellationToken: cancellationToken); + if (!response.Success) + throw new InvalidOperationException($"WriteBatch failed: {response.Message}"); + } + + public Task SubscribeAsync(IEnumerable addresses, Action onUpdate, CancellationToken cancellationToken = default) + { + EnsureConnected(); + var tags = addresses.ToList(); + var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + + var request = new SubscribeRequest { SessionId = _sessionId!, SamplingMs = 0 }; + request.Tags.AddRange(tags); + + var call = _client!.Subscribe(request, _headers, cancellationToken: cts.Token); + + _ = Task.Run(async () => + { + try + { + while (await call.ResponseStream.MoveNext(cts.Token)) + { + var msg = call.ResponseStream.Current; + onUpdate(msg.Tag, ConvertVtq(msg)); + } + } + catch (OperationCanceledException) { } + catch (RpcException ex) when (ex.StatusCode == StatusCode.Cancelled) { } + }, cts.Token); + + return Task.FromResult(new CtsSubscription(cts)); + } + + public async ValueTask DisposeAsync() + { + await DisconnectAsync(); + _channel?.Dispose(); + _channel = null; + } + + private void EnsureConnected() + { + if (_client == null || string.IsNullOrEmpty(_sessionId)) + throw new InvalidOperationException("LmxProxy client is not connected."); + } + + private static LmxVtq ConvertVtq(VtqMessage? msg) + { + if (msg == null) + return new LmxVtq(null, DateTime.UtcNow, LmxQuality.Bad); + + object? value = msg.Value; + if (!string.IsNullOrEmpty(msg.Value)) + { + if (double.TryParse(msg.Value, out var d)) value = d; + else if (bool.TryParse(msg.Value, out var b)) value = b; + else value = msg.Value; + } + + var timestamp = new DateTime(msg.TimestampUtcTicks, DateTimeKind.Utc); + var quality = msg.Quality?.ToUpperInvariant() switch + { + "GOOD" => LmxQuality.Good, + "UNCERTAIN" => LmxQuality.Uncertain, + _ => LmxQuality.Bad + }; + return new LmxVtq(value, timestamp, quality); + } + + private sealed class CtsSubscription(CancellationTokenSource cts) : ILmxSubscription + { + public ValueTask DisposeAsync() + { + cts.Cancel(); + cts.Dispose(); + return ValueTask.CompletedTask; + } + } +} + +/// +/// Production factory that creates real LmxProxy gRPC clients. +/// +public class RealLmxProxyClientFactory : ILmxProxyClientFactory +{ + public ILmxProxyClient Create(string host, int port, string? apiKey) + => new RealLmxProxyClient(host, port, apiKey); +} diff --git a/src/ScadaLink.DataConnectionLayer/DataConnectionFactory.cs b/src/ScadaLink.DataConnectionLayer/DataConnectionFactory.cs index 4f5f1a2..e7db44f 100644 --- a/src/ScadaLink.DataConnectionLayer/DataConnectionFactory.cs +++ b/src/ScadaLink.DataConnectionLayer/DataConnectionFactory.cs @@ -20,8 +20,8 @@ public class DataConnectionFactory : IDataConnectionFactory // Register built-in protocols RegisterAdapter("OpcUa", details => new OpcUaDataConnection( new RealOpcUaClientFactory(), _loggerFactory.CreateLogger())); - RegisterAdapter("LmxProxy", details => new LmxProxyDataConnection( - new DefaultLmxProxyClientFactory(), _loggerFactory.CreateLogger())); + RegisterAdapter("LmxProxy", _ => new LmxProxyDataConnection( + new RealLmxProxyClientFactory(), _loggerFactory.CreateLogger())); } /// diff --git a/src/ScadaLink.DataConnectionLayer/ScadaLink.DataConnectionLayer.csproj b/src/ScadaLink.DataConnectionLayer/ScadaLink.DataConnectionLayer.csproj index d823592..6a2be7f 100644 --- a/src/ScadaLink.DataConnectionLayer/ScadaLink.DataConnectionLayer.csproj +++ b/src/ScadaLink.DataConnectionLayer/ScadaLink.DataConnectionLayer.csproj @@ -15,6 +15,8 @@ + + diff --git a/tests/ScadaLink.DataConnectionLayer.Tests/LmxProxyDataConnectionTests.cs b/tests/ScadaLink.DataConnectionLayer.Tests/LmxProxyDataConnectionTests.cs index b07eaed..a299f20 100644 --- a/tests/ScadaLink.DataConnectionLayer.Tests/LmxProxyDataConnectionTests.cs +++ b/tests/ScadaLink.DataConnectionLayer.Tests/LmxProxyDataConnectionTests.cs @@ -1,13 +1,12 @@ using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; +using NSubstitute.ExceptionExtensions; +using ScadaLink.Commons.Interfaces.Protocol; using ScadaLink.Commons.Types.Enums; using ScadaLink.DataConnectionLayer.Adapters; namespace ScadaLink.DataConnectionLayer.Tests; -/// -/// WP-8: Tests for LmxProxy adapter. -/// public class LmxProxyDataConnectionTests { private readonly ILmxProxyClient _mockClient; @@ -18,15 +17,21 @@ public class LmxProxyDataConnectionTests { _mockClient = Substitute.For(); _mockFactory = Substitute.For(); - _mockFactory.Create().Returns(_mockClient); + _mockFactory.Create(Arg.Any(), Arg.Any(), Arg.Any()).Returns(_mockClient); _adapter = new LmxProxyDataConnection(_mockFactory, NullLogger.Instance); } - [Fact] - public async Task Connect_OpensSessionWithHostAndPort() + private async Task ConnectAdapter(Dictionary? details = null) + { + _mockClient.IsConnected.Returns(true); + await _adapter.ConnectAsync(details ?? new Dictionary()); + } + + // --- Connection --- + + [Fact] + public async Task Connect_SetsStatusToConnected() { - _mockClient.OpenSessionAsync("myhost", 5001, Arg.Any()) - .Returns("session-123"); _mockClient.IsConnected.Returns(true); await _adapter.ConnectAsync(new Dictionary @@ -36,91 +41,240 @@ public class LmxProxyDataConnectionTests }); Assert.Equal(ConnectionHealth.Connected, _adapter.Status); - await _mockClient.Received(1).OpenSessionAsync("myhost", 5001, Arg.Any()); + _mockFactory.Received(1).Create("myhost", 5001, null); + await _mockClient.Received(1).ConnectAsync(Arg.Any()); } [Fact] - public async Task Disconnect_ClosesSession() + public async Task Connect_ExtractsApiKeyFromDetails() + { + _mockClient.IsConnected.Returns(true); + + await _adapter.ConnectAsync(new Dictionary + { + ["Host"] = "server", + ["Port"] = "50051", + ["ApiKey"] = "my-secret-key" + }); + + _mockFactory.Received(1).Create("server", 50051, "my-secret-key"); + } + + [Fact] + public async Task Connect_DefaultsHostAndPort() { _mockClient.IsConnected.Returns(true); - _mockClient.OpenSessionAsync(Arg.Any(), Arg.Any(), Arg.Any()) - .Returns("session-123"); await _adapter.ConnectAsync(new Dictionary()); + + _mockFactory.Received(1).Create("localhost", 50051, null); + } + + [Fact] + public async Task Disconnect_SetsStatusToDisconnected() + { + await ConnectAdapter(); await _adapter.DisconnectAsync(); Assert.Equal(ConnectionHealth.Disconnected, _adapter.Status); - await _mockClient.Received(1).CloseSessionAsync(Arg.Any()); + await _mockClient.Received(1).DisconnectAsync(); } + // --- Read --- + + [Fact] + public async Task Read_Good_ReturnsSuccessWithValue() + { + await ConnectAdapter(); + var now = DateTime.UtcNow; + _mockClient.ReadAsync("Tag1", Arg.Any()) + .Returns(new LmxVtq(42.5, now, LmxQuality.Good)); + + var result = await _adapter.ReadAsync("Tag1"); + + Assert.True(result.Success); + Assert.Equal(42.5, result.Value!.Value); + Assert.Equal(QualityCode.Good, result.Value.Quality); + } + + [Fact] + public async Task Read_Bad_ReturnsFailureWithValue() + { + await ConnectAdapter(); + _mockClient.ReadAsync("Tag1", Arg.Any()) + .Returns(new LmxVtq(null, DateTime.UtcNow, LmxQuality.Bad)); + + var result = await _adapter.ReadAsync("Tag1"); + + Assert.False(result.Success); + Assert.NotNull(result.Value); + Assert.Equal(QualityCode.Bad, result.Value!.Quality); + } + + [Fact] + public async Task Read_Uncertain_MapsQuality() + { + await ConnectAdapter(); + _mockClient.ReadAsync("Tag1", Arg.Any()) + .Returns(new LmxVtq("maybe", DateTime.UtcNow, LmxQuality.Uncertain)); + + var result = await _adapter.ReadAsync("Tag1"); + + Assert.True(result.Success); + Assert.Equal(QualityCode.Uncertain, result.Value!.Quality); + } + + [Fact] + public async Task ReadBatch_ReturnsMappedResults() + { + await ConnectAdapter(); + var now = DateTime.UtcNow; + _mockClient.ReadBatchAsync(Arg.Any>(), Arg.Any()) + .Returns(new Dictionary + { + ["Tag1"] = new(10, now, LmxQuality.Good), + ["Tag2"] = new(null, now, LmxQuality.Bad) + }); + + var results = await _adapter.ReadBatchAsync(["Tag1", "Tag2"]); + + Assert.True(results["Tag1"].Success); + Assert.Equal(10, results["Tag1"].Value!.Value); + Assert.False(results["Tag2"].Success); + } + + // --- Write --- + [Fact] public async Task Write_Success_ReturnsGoodResult() { - _mockClient.IsConnected.Returns(true); - _mockClient.OpenSessionAsync(Arg.Any(), Arg.Any(), Arg.Any()) - .Returns("session-123"); - _mockClient.WriteTagAsync("Tag1", 42, Arg.Any()) - .Returns(true); + await ConnectAdapter(); - await _adapter.ConnectAsync(new Dictionary()); var result = await _adapter.WriteAsync("Tag1", 42); Assert.True(result.Success); + await _mockClient.Received(1).WriteAsync("Tag1", 42, Arg.Any()); } [Fact] public async Task Write_Failure_ReturnsError() { - _mockClient.IsConnected.Returns(true); - _mockClient.OpenSessionAsync(Arg.Any(), Arg.Any(), Arg.Any()) - .Returns("session-123"); - _mockClient.WriteTagAsync("Tag1", 42, Arg.Any()) - .Returns(false); + await ConnectAdapter(); + _mockClient.WriteAsync("Tag1", 42, Arg.Any()) + .Throws(new InvalidOperationException("Write failed for tag")); - await _adapter.ConnectAsync(new Dictionary()); var result = await _adapter.WriteAsync("Tag1", 42); Assert.False(result.Success); - Assert.Equal("LmxProxy write failed", result.ErrorMessage); + Assert.Contains("Write failed for tag", result.ErrorMessage); } [Fact] - public async Task Read_Good_ReturnsValue() + public async Task WriteBatch_Success_ReturnsAllGood() { - _mockClient.IsConnected.Returns(true); - _mockClient.OpenSessionAsync(Arg.Any(), Arg.Any(), Arg.Any()) - .Returns("session-123"); - _mockClient.ReadTagAsync("Tag1", Arg.Any()) - .Returns((42.5, DateTime.UtcNow, true)); + await ConnectAdapter(); - await _adapter.ConnectAsync(new Dictionary()); - var result = await _adapter.ReadAsync("Tag1"); + var results = await _adapter.WriteBatchAsync(new Dictionary { ["T1"] = 1, ["T2"] = 2 }); - Assert.True(result.Success); - Assert.Equal(42.5, result.Value!.Value); + Assert.True(results["T1"].Success); + Assert.True(results["T2"].Success); } [Fact] - public async Task Read_Bad_ReturnsFailure() + public async Task WriteBatch_Failure_ReturnsAllErrors() { - _mockClient.IsConnected.Returns(true); - _mockClient.OpenSessionAsync(Arg.Any(), Arg.Any(), Arg.Any()) - .Returns("session-123"); - _mockClient.ReadTagAsync("Tag1", Arg.Any()) - .Returns((null, DateTime.UtcNow, false)); + await ConnectAdapter(); + _mockClient.WriteBatchAsync(Arg.Any>(), Arg.Any()) + .Throws(new InvalidOperationException("Batch write failed")); - await _adapter.ConnectAsync(new Dictionary()); - var result = await _adapter.ReadAsync("Tag1"); + var results = await _adapter.WriteBatchAsync(new Dictionary { ["T1"] = 1, ["T2"] = 2 }); - Assert.False(result.Success); + Assert.False(results["T1"].Success); + Assert.False(results["T2"].Success); + Assert.Contains("Batch write failed", results["T1"].ErrorMessage); + } + + // --- Subscribe --- + + [Fact] + public async Task Subscribe_CreatesSubscriptionAndReturnsId() + { + await ConnectAdapter(); + var mockSub = Substitute.For(); + _mockClient.SubscribeAsync(Arg.Any>(), Arg.Any>(), Arg.Any()) + .Returns(mockSub); + + var subId = await _adapter.SubscribeAsync("Tag1", (_, _) => { }); + + Assert.NotNull(subId); + Assert.NotEmpty(subId); + await _mockClient.Received(1).SubscribeAsync( + Arg.Any>(), Arg.Any>(), Arg.Any()); } [Fact] - public async Task NotConnected_ThrowsOnOperations() + public async Task Unsubscribe_DisposesSubscription() + { + await ConnectAdapter(); + var mockSub = Substitute.For(); + _mockClient.SubscribeAsync(Arg.Any>(), Arg.Any>(), Arg.Any()) + .Returns(mockSub); + + var subId = await _adapter.SubscribeAsync("Tag1", (_, _) => { }); + await _adapter.UnsubscribeAsync(subId); + + await mockSub.Received(1).DisposeAsync(); + } + + [Fact] + public async Task Unsubscribe_UnknownId_DoesNotThrow() + { + await ConnectAdapter(); + await _adapter.UnsubscribeAsync("nonexistent-id"); + } + + // --- Dispose --- + + [Fact] + public async Task Dispose_DisposesClientAndSubscriptions() + { + await ConnectAdapter(); + var mockSub = Substitute.For(); + _mockClient.SubscribeAsync(Arg.Any>(), Arg.Any>(), Arg.Any()) + .Returns(mockSub); + await _adapter.SubscribeAsync("Tag1", (_, _) => { }); + + await _adapter.DisposeAsync(); + + await mockSub.Received(1).DisposeAsync(); + await _mockClient.Received(1).DisposeAsync(); + Assert.Equal(ConnectionHealth.Disconnected, _adapter.Status); + } + + // --- Guard --- + + [Fact] + public async Task NotConnected_ThrowsOnRead() + { + _mockClient.IsConnected.Returns(false); + + await Assert.ThrowsAsync(() => _adapter.ReadAsync("tag1")); + } + + [Fact] + public async Task NotConnected_ThrowsOnWrite() + { + _mockClient.IsConnected.Returns(false); + + await Assert.ThrowsAsync(() => _adapter.WriteAsync("tag1", 1)); + } + + [Fact] + public async Task NotConnected_ThrowsOnSubscribe() { _mockClient.IsConnected.Returns(false); await Assert.ThrowsAsync(() => - _adapter.ReadAsync("tag1")); + _adapter.SubscribeAsync("tag1", (_, _) => { })); } }