parse static method

SessionState parse(
  1. String value
)

Parses a wire value, defaulting to SessionState.detached for unknown input (the detached-session APIs only ever serialize detached).

Implementation

static SessionState parse(String value) => switch (value) {
  'opening' => SessionState.opening,
  'open' => SessionState.open,
  'closing' => SessionState.closing,
  'closed' => SessionState.closed,
  'attached' => SessionState.attached,
  _ => SessionState.detached,
};