fromValue static method

NSURLSessionWebSocketCloseCode fromValue(
  1. int value
)

Implementation

static NSURLSessionWebSocketCloseCode fromValue(int value) => switch (value) {
  0 => NSURLSessionWebSocketCloseCodeInvalid,
  1000 => NSURLSessionWebSocketCloseCodeNormalClosure,
  1001 => NSURLSessionWebSocketCloseCodeGoingAway,
  1002 => NSURLSessionWebSocketCloseCodeProtocolError,
  1003 => NSURLSessionWebSocketCloseCodeUnsupportedData,
  1005 => NSURLSessionWebSocketCloseCodeNoStatusReceived,
  1006 => NSURLSessionWebSocketCloseCodeAbnormalClosure,
  1007 => NSURLSessionWebSocketCloseCodeInvalidFramePayloadData,
  1008 => NSURLSessionWebSocketCloseCodePolicyViolation,
  1009 => NSURLSessionWebSocketCloseCodeMessageTooBig,
  1010 => NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing,
  1011 => NSURLSessionWebSocketCloseCodeInternalServerError,
  1015 => NSURLSessionWebSocketCloseCodeTLSHandshakeFailure,
  _ => throw ArgumentError('Unknown value for NSURLSessionWebSocketCloseCode: $value'),
};