PatchbaySnapshotRequest.fromWire constructor

PatchbaySnapshotRequest.fromWire(
  1. PatchbaySnapshotRequestWire wire
)

Decodes one wire request.

Every failure is a FormatException — including the range check the ui.wait decoder expresses as an ArgumentError — so a caller has one exception type to translate into one rejection, and no malformed request can escape as an error class the host does not answer.

Implementation

factory PatchbaySnapshotRequest.fromWire(PatchbaySnapshotRequestWire wire) =>
    PatchbaySnapshotRequest(
      path: wire.path,
      until: wire.until == null
          ? null
          : PatchbaySnapshotCondition.fromWire(wire.until!),
      value: wire.value,
      timeout: wire.timeoutMs == null
          ? null
          : Duration(milliseconds: wire.timeoutMs!),
    );