ios_to_code static method

LoginErrorCode ios_to_code(
  1. ByteRTCLoginErrorCode value
)

Implementation

static LoginErrorCode ios_to_code($p_i.ByteRTCLoginErrorCode value) {
  var $m = {
    $p_i.ByteRTCLoginErrorCode.ByteRTCLoginErrorCodeSuccess:
        LoginErrorCode.success,
    $p_i.ByteRTCLoginErrorCode.ByteRTCLoginErrorCodeInvalidToken:
        LoginErrorCode.invalid_token,
    $p_i.ByteRTCLoginErrorCode.ByteRTCLoginErrorCodeLoginFailed:
        LoginErrorCode.login_failed,
    $p_i.ByteRTCLoginErrorCode.ByteRTCLoginErrorCodeInvalidUserId:
        LoginErrorCode.invalid_user_id,
    $p_i.ByteRTCLoginErrorCode.ByteRTCLoginErrorCodeServerError:
        LoginErrorCode.code_server_error,
  };
  if (!($m.containsKey(value))) {
    throw Exception("invalid value:" + value.toString());
  }
  // @ts-ignore
  return $m[value] as LoginErrorCode;
}