// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

import 'api.dart';
import 'dart:async';
import 'dart:convert';
import 'frb_generated.dart';
import 'frb_generated.io.dart'
    if (dart.library.js_interop) 'frb_generated.web.dart';
import 'lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

/// Main entrypoint of the Rust API
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
  @internal
  static final instance = RustLib._();

  RustLib._();

  /// Initialize flutter_rust_bridge
  static Future<void> init({
    RustLibApi? api,
    BaseHandler? handler,
    ExternalLibrary? externalLibrary,
    bool forceSameCodegenVersion = true,
  }) async {
    await instance.initImpl(
      api: api,
      handler: handler,
      externalLibrary: externalLibrary,
      forceSameCodegenVersion: forceSameCodegenVersion,
    );
  }

  /// Initialize flutter_rust_bridge in mock mode.
  /// No libraries for FFI are loaded.
  static void initMock({required RustLibApi api}) {
    instance.initMockImpl(api: api);
  }

  /// Dispose flutter_rust_bridge
  ///
  /// The call to this function is optional, since flutter_rust_bridge (and everything else)
  /// is automatically disposed when the app stops.
  static void dispose() => instance.disposeImpl();

  @override
  ApiImplConstructor<RustLibApiImpl, RustLibWire> get apiImplConstructor =>
      RustLibApiImpl.new;

  @override
  WireConstructor<RustLibWire> get wireConstructor =>
      RustLibWire.fromExternalLibrary;

  @override
  Future<void> executeRustInitializers() async {
    await api.crateApiBridgeInit();
  }

  @override
  ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
      kDefaultExternalLibraryLoaderConfig;

  @override
  String get codegenVersion => '2.12.0';

  @override
  int get rustContentHash => 281698435;

  static const kDefaultExternalLibraryLoaderConfig =
      ExternalLibraryLoaderConfig(
        stem: 'chanora_bridge',
        ioDirectory: '../../crates/chanora_bridge/target/release/',
        webPrefix: 'pkg/',
        wasmBindgenName: 'wasm_bindgen',
      );
}

abstract class RustLibApi extends BaseApi {
  Future<PlatformInt64> crateApiAddBookmark({required BridgeBookmark b});

  Future<BridgeAudioProcessingStats> crateApiAudioProcessingStats();

  Future<BridgeAudioStats> crateApiAudioStats();

  Future<void> crateApiBridgeInit();

  Future<BridgeClientProfile> crateApiClientProfile({required BigInt clientId});

  Future<BridgeSnapshot> crateApiConnect({
    required String host,
    required String nickname,
    required String password,
  });

  Future<void> crateApiDeleteBookmark({required PlatformInt64 id});

  Future<void> crateApiDisconnect();

  Future<void> crateApiEnableAudioDebugWavDump({required bool enabled});

  Stream<BridgeEvent> crateApiEventsStream();

  String crateApiExportDiagnostics();

  Future<BridgeAudioProcessingConfig> crateApiGetAudioProcessingConfig();

  Future<BridgePttBinding> crateApiGetPttBinding();

  Future<int> crateApiGetReleaseTailMs();

  Future<BridgeTransmitMode> crateApiGetTransmitMode();

  void crateApiHandleInterruptionBegan();

  void crateApiHandleInterruptionEnded({required bool shouldResume});

  void crateApiHandleMediaServicesResetWithRoute({required String routeClass});

  void crateApiHandleRouteChange({required BridgeAudioRoute route});

  Future<void> crateApiInitStorage({required String dir});

  Future<bool> crateApiIsConnected();

  Future<BridgeAudioDeviceList> crateApiListAudioDevices();

  Future<List<BridgeBookmark>> crateApiListBookmarks();

  String crateApiLogFilePathStr();

  Future<void> crateApiMoveToChannel({
    required BigInt channelId,
    required String password,
  });

  Future<void> crateApiPrefetchServer({required String host});

  Future<BridgePttDescriptor> crateApiPttDescriptor();

  void crateApiRecordLifecycleEvent({required String state});

  Future<void> crateApiSendChatMessage({
    required String message,
    required BridgeMessageTarget target,
  });

  void crateApiSetAudioOutputRoute({required BridgeAudioRoute route});

  Future<void> crateApiSetAudioProcessingConfig({
    required BridgeAudioProcessingConfig config,
  });

  Future<void> crateApiSetClientVolume({
    required BigInt clientId,
    required double volume,
  });

  Future<void> crateApiSetHardMute({required bool muted});

  Future<void> crateApiSetInputDevice({String? id});

  Future<void> crateApiSetInputMuted({required bool muted});

  Future<void> crateApiSetIosVoiceProcessingMode({
    required BridgeIosVoiceProcessingMode mode,
  });

  void crateApiSetNetworkState({required BridgeNetworkState state});

  Future<void> crateApiSetOutputDevice({String? id});

  Future<void> crateApiSetOutputGain({required double gain});

  Future<void> crateApiSetOutputMuted({required bool muted});

  Future<void> crateApiSetPtt({required bool active});

  Future<void> crateApiSetPttBinding({
    required BridgePttInputClass inputClass,
    required String platformKey,
  });

  Future<void> crateApiSetReleaseTailMs({required int ms});

  Future<void> crateApiSetTransmitMode({required BridgeTransmitMode mode});

  Future<void> crateApiSetVadModelPath({required String path});

  Future<BridgeSnapshot> crateApiSnapshot();

  Future<void> crateApiUpdateBookmark({required BridgeBookmark b});

  Future<void> crateApiVoiceJoin({
    required BigInt channelId,
    required String password,
  });

  Future<void> crateApiVoiceLeave();
}

class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
  RustLibApiImpl({
    required super.handler,
    required super.wire,
    required super.generalizedFrbRustBinding,
    required super.portManager,
  });

  @override
  Future<PlatformInt64> crateApiAddBookmark({required BridgeBookmark b}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_bridge_bookmark(b, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 1,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_i_64,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiAddBookmarkConstMeta,
        argValues: [b],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAddBookmarkConstMeta =>
      const TaskConstMeta(debugName: "add_bookmark", argNames: ["b"]);

  @override
  Future<BridgeAudioProcessingStats> crateApiAudioProcessingStats() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 2,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_audio_processing_stats,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiAudioProcessingStatsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAudioProcessingStatsConstMeta =>
      const TaskConstMeta(debugName: "audio_processing_stats", argNames: []);

  @override
  Future<BridgeAudioStats> crateApiAudioStats() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 3,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_audio_stats,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiAudioStatsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAudioStatsConstMeta =>
      const TaskConstMeta(debugName: "audio_stats", argNames: []);

  @override
  Future<void> crateApiBridgeInit() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 4,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiBridgeInitConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiBridgeInitConstMeta =>
      const TaskConstMeta(debugName: "bridge_init", argNames: []);

  @override
  Future<BridgeClientProfile> crateApiClientProfile({
    required BigInt clientId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_64(clientId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 5,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_client_profile,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiClientProfileConstMeta,
        argValues: [clientId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiClientProfileConstMeta =>
      const TaskConstMeta(debugName: "client_profile", argNames: ["clientId"]);

  @override
  Future<BridgeSnapshot> crateApiConnect({
    required String host,
    required String nickname,
    required String password,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(host, serializer);
          sse_encode_String(nickname, serializer);
          sse_encode_String(password, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 6,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_snapshot,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiConnectConstMeta,
        argValues: [host, nickname, password],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiConnectConstMeta => const TaskConstMeta(
    debugName: "connect",
    argNames: ["host", "nickname", "password"],
  );

  @override
  Future<void> crateApiDeleteBookmark({required PlatformInt64 id}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_i_64(id, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 7,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiDeleteBookmarkConstMeta,
        argValues: [id],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiDeleteBookmarkConstMeta =>
      const TaskConstMeta(debugName: "delete_bookmark", argNames: ["id"]);

  @override
  Future<void> crateApiDisconnect() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 8,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiDisconnectConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiDisconnectConstMeta =>
      const TaskConstMeta(debugName: "disconnect", argNames: []);

  @override
  Future<void> crateApiEnableAudioDebugWavDump({required bool enabled}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(enabled, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 9,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiEnableAudioDebugWavDumpConstMeta,
        argValues: [enabled],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiEnableAudioDebugWavDumpConstMeta =>
      const TaskConstMeta(
        debugName: "enable_audio_debug_wav_dump",
        argNames: ["enabled"],
      );

  @override
  Stream<BridgeEvent> crateApiEventsStream() {
    final sink = RustStreamSink<BridgeEvent>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_StreamSink_bridge_event_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 10,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_bridge_error,
          ),
          constMeta: kCrateApiEventsStreamConstMeta,
          argValues: [sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiEventsStreamConstMeta =>
      const TaskConstMeta(debugName: "events_stream", argNames: ["sink"]);

  @override
  String crateApiExportDiagnostics() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 11)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiExportDiagnosticsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiExportDiagnosticsConstMeta =>
      const TaskConstMeta(debugName: "export_diagnostics", argNames: []);

  @override
  Future<BridgeAudioProcessingConfig> crateApiGetAudioProcessingConfig() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 12,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_audio_processing_config,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiGetAudioProcessingConfigConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGetAudioProcessingConfigConstMeta =>
      const TaskConstMeta(
        debugName: "get_audio_processing_config",
        argNames: [],
      );

  @override
  Future<BridgePttBinding> crateApiGetPttBinding() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 13,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_ptt_binding,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiGetPttBindingConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGetPttBindingConstMeta =>
      const TaskConstMeta(debugName: "get_ptt_binding", argNames: []);

  @override
  Future<int> crateApiGetReleaseTailMs() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 14,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_u_32,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiGetReleaseTailMsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGetReleaseTailMsConstMeta =>
      const TaskConstMeta(debugName: "get_release_tail_ms", argNames: []);

  @override
  Future<BridgeTransmitMode> crateApiGetTransmitMode() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 15,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_transmit_mode,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiGetTransmitModeConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGetTransmitModeConstMeta =>
      const TaskConstMeta(debugName: "get_transmit_mode", argNames: []);

  @override
  void crateApiHandleInterruptionBegan() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 16)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiHandleInterruptionBeganConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHandleInterruptionBeganConstMeta =>
      const TaskConstMeta(debugName: "handle_interruption_began", argNames: []);

  @override
  void crateApiHandleInterruptionEnded({required bool shouldResume}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(shouldResume, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 17)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiHandleInterruptionEndedConstMeta,
        argValues: [shouldResume],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHandleInterruptionEndedConstMeta =>
      const TaskConstMeta(
        debugName: "handle_interruption_ended",
        argNames: ["shouldResume"],
      );

  @override
  void crateApiHandleMediaServicesResetWithRoute({required String routeClass}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(routeClass, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 18)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiHandleMediaServicesResetWithRouteConstMeta,
        argValues: [routeClass],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHandleMediaServicesResetWithRouteConstMeta =>
      const TaskConstMeta(
        debugName: "handle_media_services_reset_with_route",
        argNames: ["routeClass"],
      );

  @override
  void crateApiHandleRouteChange({required BridgeAudioRoute route}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_audio_route(route, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 19)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiHandleRouteChangeConstMeta,
        argValues: [route],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHandleRouteChangeConstMeta => const TaskConstMeta(
    debugName: "handle_route_change",
    argNames: ["route"],
  );

  @override
  Future<void> crateApiInitStorage({required String dir}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(dir, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 20,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiInitStorageConstMeta,
        argValues: [dir],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiInitStorageConstMeta =>
      const TaskConstMeta(debugName: "init_storage", argNames: ["dir"]);

  @override
  Future<bool> crateApiIsConnected() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 21,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiIsConnectedConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiIsConnectedConstMeta =>
      const TaskConstMeta(debugName: "is_connected", argNames: []);

  @override
  Future<BridgeAudioDeviceList> crateApiListAudioDevices() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 22,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_audio_device_list,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiListAudioDevicesConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiListAudioDevicesConstMeta =>
      const TaskConstMeta(debugName: "list_audio_devices", argNames: []);

  @override
  Future<List<BridgeBookmark>> crateApiListBookmarks() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 23,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_bridge_bookmark,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiListBookmarksConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiListBookmarksConstMeta =>
      const TaskConstMeta(debugName: "list_bookmarks", argNames: []);

  @override
  String crateApiLogFilePathStr() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 24)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiLogFilePathStrConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiLogFilePathStrConstMeta =>
      const TaskConstMeta(debugName: "log_file_path_str", argNames: []);

  @override
  Future<void> crateApiMoveToChannel({
    required BigInt channelId,
    required String password,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_64(channelId, serializer);
          sse_encode_String(password, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 25,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiMoveToChannelConstMeta,
        argValues: [channelId, password],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMoveToChannelConstMeta => const TaskConstMeta(
    debugName: "move_to_channel",
    argNames: ["channelId", "password"],
  );

  @override
  Future<void> crateApiPrefetchServer({required String host}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(host, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 26,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiPrefetchServerConstMeta,
        argValues: [host],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiPrefetchServerConstMeta =>
      const TaskConstMeta(debugName: "prefetch_server", argNames: ["host"]);

  @override
  Future<BridgePttDescriptor> crateApiPttDescriptor() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 27,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_ptt_descriptor,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiPttDescriptorConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiPttDescriptorConstMeta =>
      const TaskConstMeta(debugName: "ptt_descriptor", argNames: []);

  @override
  void crateApiRecordLifecycleEvent({required String state}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(state, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 28)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiRecordLifecycleEventConstMeta,
        argValues: [state],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiRecordLifecycleEventConstMeta =>
      const TaskConstMeta(
        debugName: "record_lifecycle_event",
        argNames: ["state"],
      );

  @override
  Future<void> crateApiSendChatMessage({
    required String message,
    required BridgeMessageTarget target,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(message, serializer);
          sse_encode_box_autoadd_bridge_message_target(target, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 29,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSendChatMessageConstMeta,
        argValues: [message, target],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSendChatMessageConstMeta => const TaskConstMeta(
    debugName: "send_chat_message",
    argNames: ["message", "target"],
  );

  @override
  void crateApiSetAudioOutputRoute({required BridgeAudioRoute route}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_audio_route(route, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 30)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiSetAudioOutputRouteConstMeta,
        argValues: [route],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetAudioOutputRouteConstMeta =>
      const TaskConstMeta(
        debugName: "set_audio_output_route",
        argNames: ["route"],
      );

  @override
  Future<void> crateApiSetAudioProcessingConfig({
    required BridgeAudioProcessingConfig config,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_bridge_audio_processing_config(
            config,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 31,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetAudioProcessingConfigConstMeta,
        argValues: [config],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetAudioProcessingConfigConstMeta =>
      const TaskConstMeta(
        debugName: "set_audio_processing_config",
        argNames: ["config"],
      );

  @override
  Future<void> crateApiSetClientVolume({
    required BigInt clientId,
    required double volume,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_64(clientId, serializer);
          sse_encode_f_32(volume, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 32,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetClientVolumeConstMeta,
        argValues: [clientId, volume],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetClientVolumeConstMeta => const TaskConstMeta(
    debugName: "set_client_volume",
    argNames: ["clientId", "volume"],
  );

  @override
  Future<void> crateApiSetHardMute({required bool muted}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(muted, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 33,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetHardMuteConstMeta,
        argValues: [muted],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetHardMuteConstMeta =>
      const TaskConstMeta(debugName: "set_hard_mute", argNames: ["muted"]);

  @override
  Future<void> crateApiSetInputDevice({String? id}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_opt_String(id, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 34,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetInputDeviceConstMeta,
        argValues: [id],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetInputDeviceConstMeta =>
      const TaskConstMeta(debugName: "set_input_device", argNames: ["id"]);

  @override
  Future<void> crateApiSetInputMuted({required bool muted}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(muted, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 35,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetInputMutedConstMeta,
        argValues: [muted],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetInputMutedConstMeta =>
      const TaskConstMeta(debugName: "set_input_muted", argNames: ["muted"]);

  @override
  Future<void> crateApiSetIosVoiceProcessingMode({
    required BridgeIosVoiceProcessingMode mode,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_ios_voice_processing_mode(mode, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 36,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetIosVoiceProcessingModeConstMeta,
        argValues: [mode],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetIosVoiceProcessingModeConstMeta =>
      const TaskConstMeta(
        debugName: "set_ios_voice_processing_mode",
        argNames: ["mode"],
      );

  @override
  void crateApiSetNetworkState({required BridgeNetworkState state}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_network_state(state, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 37)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiSetNetworkStateConstMeta,
        argValues: [state],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetNetworkStateConstMeta =>
      const TaskConstMeta(debugName: "set_network_state", argNames: ["state"]);

  @override
  Future<void> crateApiSetOutputDevice({String? id}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_opt_String(id, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 38,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetOutputDeviceConstMeta,
        argValues: [id],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetOutputDeviceConstMeta =>
      const TaskConstMeta(debugName: "set_output_device", argNames: ["id"]);

  @override
  Future<void> crateApiSetOutputGain({required double gain}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_f_32(gain, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 39,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetOutputGainConstMeta,
        argValues: [gain],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetOutputGainConstMeta =>
      const TaskConstMeta(debugName: "set_output_gain", argNames: ["gain"]);

  @override
  Future<void> crateApiSetOutputMuted({required bool muted}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(muted, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 40,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetOutputMutedConstMeta,
        argValues: [muted],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetOutputMutedConstMeta =>
      const TaskConstMeta(debugName: "set_output_muted", argNames: ["muted"]);

  @override
  Future<void> crateApiSetPtt({required bool active}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(active, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 41,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetPttConstMeta,
        argValues: [active],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetPttConstMeta =>
      const TaskConstMeta(debugName: "set_ptt", argNames: ["active"]);

  @override
  Future<void> crateApiSetPttBinding({
    required BridgePttInputClass inputClass,
    required String platformKey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_ptt_input_class(inputClass, serializer);
          sse_encode_String(platformKey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 42,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetPttBindingConstMeta,
        argValues: [inputClass, platformKey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetPttBindingConstMeta => const TaskConstMeta(
    debugName: "set_ptt_binding",
    argNames: ["inputClass", "platformKey"],
  );

  @override
  Future<void> crateApiSetReleaseTailMs({required int ms}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_32(ms, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 43,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetReleaseTailMsConstMeta,
        argValues: [ms],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetReleaseTailMsConstMeta =>
      const TaskConstMeta(debugName: "set_release_tail_ms", argNames: ["ms"]);

  @override
  Future<void> crateApiSetTransmitMode({required BridgeTransmitMode mode}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_transmit_mode(mode, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 44,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetTransmitModeConstMeta,
        argValues: [mode],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetTransmitModeConstMeta =>
      const TaskConstMeta(debugName: "set_transmit_mode", argNames: ["mode"]);

  @override
  Future<void> crateApiSetVadModelPath({required String path}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(path, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 45,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetVadModelPathConstMeta,
        argValues: [path],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetVadModelPathConstMeta =>
      const TaskConstMeta(debugName: "set_vad_model_path", argNames: ["path"]);

  @override
  Future<BridgeSnapshot> crateApiSnapshot() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 46,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_snapshot,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSnapshotConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSnapshotConstMeta =>
      const TaskConstMeta(debugName: "snapshot", argNames: []);

  @override
  Future<void> crateApiUpdateBookmark({required BridgeBookmark b}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_bridge_bookmark(b, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 47,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiUpdateBookmarkConstMeta,
        argValues: [b],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUpdateBookmarkConstMeta =>
      const TaskConstMeta(debugName: "update_bookmark", argNames: ["b"]);

  @override
  Future<void> crateApiVoiceJoin({
    required BigInt channelId,
    required String password,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_64(channelId, serializer);
          sse_encode_String(password, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 48,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiVoiceJoinConstMeta,
        argValues: [channelId, password],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiVoiceJoinConstMeta => const TaskConstMeta(
    debugName: "voice_join",
    argNames: ["channelId", "password"],
  );

  @override
  Future<void> crateApiVoiceLeave() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 49,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiVoiceLeaveConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiVoiceLeaveConstMeta =>
      const TaskConstMeta(debugName: "voice_leave", argNames: []);

  @protected
  AnyhowException dco_decode_AnyhowException(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return AnyhowException(raw as String);
  }

  @protected
  RustStreamSink<BridgeEvent> dco_decode_StreamSink_bridge_event_Sse(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  String dco_decode_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as String;
  }

  @protected
  bool dco_decode_bool(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as bool;
  }

  @protected
  BridgeAudioProcessingConfig
  dco_decode_box_autoadd_bridge_audio_processing_config(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_bridge_audio_processing_config(raw);
  }

  @protected
  BridgeBookmark dco_decode_box_autoadd_bridge_bookmark(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_bridge_bookmark(raw);
  }

  @protected
  BridgeMessageTarget dco_decode_box_autoadd_bridge_message_target(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_bridge_message_target(raw);
  }

  @protected
  BridgeVoiceJoinErrorCode dco_decode_box_autoadd_bridge_voice_join_error_code(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_bridge_voice_join_error_code(raw);
  }

  @protected
  double dco_decode_box_autoadd_f_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as double;
  }

  @protected
  int dco_decode_box_autoadd_i_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  PlatformInt64 dco_decode_box_autoadd_i_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_i_64(raw);
  }

  @protected
  BigInt dco_decode_box_autoadd_u_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_u_64(raw);
  }

  @protected
  BridgeAudioBackend dco_decode_bridge_audio_backend(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeAudioBackend.values[raw as int];
  }

  @protected
  BridgeAudioDevice dco_decode_bridge_audio_device(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 5)
      throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
    return BridgeAudioDevice(
      id: dco_decode_String(arr[0]),
      name: dco_decode_String(arr[1]),
      details: dco_decode_String(arr[2]),
      isDefault: dco_decode_bool(arr[3]),
      isSelected: dco_decode_bool(arr[4]),
    );
  }

  @protected
  BridgeAudioDeviceList dco_decode_bridge_audio_device_list(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 2)
      throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
    return BridgeAudioDeviceList(
      inputDevices: dco_decode_list_bridge_audio_device(arr[0]),
      outputDevices: dco_decode_list_bridge_audio_device(arr[1]),
    );
  }

  @protected
  BridgeAudioProcessingConfig dco_decode_bridge_audio_processing_config(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 13)
      throw Exception('unexpected arr length: expect 13 but see ${arr.length}');
    return BridgeAudioProcessingConfig(
      route: dco_decode_bridge_audio_route(arr[0]),
      iosMode: dco_decode_bridge_ios_voice_processing_mode(arr[1]),
      processingBackend: dco_decode_bridge_audio_backend(arr[2]),
      vadBackend: dco_decode_bridge_vad_backend(arr[3]),
      aec: dco_decode_bridge_effect_owner(arr[4]),
      ns: dco_decode_bridge_effect_owner(arr[5]),
      agc: dco_decode_bridge_effect_owner(arr[6]),
      hpfEnabled: dco_decode_bool(arr[7]),
      limiterEnabled: dco_decode_bool(arr[8]),
      vadHangoverMs: dco_decode_u_32(arr[9]),
      vadPreRollMs: dco_decode_u_32(arr[10]),
      vadMinTxMs: dco_decode_u_32(arr[11]),
      debugWavDumpEnabled: dco_decode_bool(arr[12]),
    );
  }

  @protected
  BridgeAudioProcessingStats dco_decode_bridge_audio_processing_stats(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 24)
      throw Exception('unexpected arr length: expect 24 but see ${arr.length}');
    return BridgeAudioProcessingStats(
      inputDbfs: dco_decode_f_32(arr[0]),
      renderDbfs: dco_decode_f_32(arr[1]),
      processedDbfs: dco_decode_f_32(arr[2]),
      vadProbability: dco_decode_f_32(arr[3]),
      vadActive: dco_decode_bool(arr[4]),
      transmitting: dco_decode_bool(arr[5]),
      vadBackend: dco_decode_bridge_vad_backend(arr[6]),
      vadFallbackActive: dco_decode_bool(arr[7]),
      processingBackend: dco_decode_bridge_audio_backend(arr[8]),
      iosVoiceProcessingMode: dco_decode_bridge_ios_voice_processing_mode(
        arr[9],
      ),
      audioRoute: dco_decode_bridge_audio_route(arr[10]),
      actualSampleRateHz: dco_decode_u_32(arr[11]),
      actualIoBufferFrames: dco_decode_u_32(arr[12]),
      inputOverruns: dco_decode_u_64(arr[13]),
      outputUnderruns: dco_decode_u_64(arr[14]),
      callbackXruns: dco_decode_u_64(arr[15]),
      clippedSamples: dco_decode_u_64(arr[16]),
      zeroFrames: dco_decode_u_64(arr[17]),
      captureFrames: dco_decode_u_64(arr[18]),
      callbacks10Ms: dco_decode_u_64(arr[19]),
      callbacks20Ms: dco_decode_u_64(arr[20]),
      callbacksOther: dco_decode_u_64(arr[21]),
      sonoraEnabled: dco_decode_bool(arr[22]),
      platformVoiceProcessingEnabled: dco_decode_bool(arr[23]),
    );
  }

  @protected
  BridgeAudioRoute dco_decode_bridge_audio_route(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeAudioRoute.values[raw as int];
  }

  @protected
  BridgeAudioStats dco_decode_bridge_audio_stats(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 3)
      throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
    return BridgeAudioStats(
      framesSent: dco_decode_u_32(arr[0]),
      framesReceived: dco_decode_u_32(arr[1]),
      pttActive: dco_decode_bool(arr[2]),
    );
  }

  @protected
  BridgeBookmark dco_decode_bridge_bookmark(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 5)
      throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
    return BridgeBookmark(
      id: dco_decode_i_64(arr[0]),
      displayName: dco_decode_String(arr[1]),
      host: dco_decode_String(arr[2]),
      nickname: dco_decode_String(arr[3]),
      password: dco_decode_String(arr[4]),
    );
  }

  @protected
  BridgeChannel dco_decode_bridge_channel(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 6)
      throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
    return BridgeChannel(
      id: dco_decode_u_64(arr[0]),
      parent: dco_decode_u_64(arr[1]),
      name: dco_decode_String(arr[2]),
      order: dco_decode_i_64(arr[3]),
      hasPassword: dco_decode_bool(arr[4]),
      neededTalkPower: dco_decode_opt_box_autoadd_i_32(arr[5]),
    );
  }

  @protected
  BridgeClient dco_decode_bridge_client(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 9)
      throw Exception('unexpected arr length: expect 9 but see ${arr.length}');
    return BridgeClient(
      id: dco_decode_u_64(arr[0]),
      channel: dco_decode_u_64(arr[1]),
      name: dco_decode_String(arr[2]),
      inputMuted: dco_decode_bool(arr[3]),
      outputMuted: dco_decode_bool(arr[4]),
      isSpeaking: dco_decode_bool(arr[5]),
      isServerQuery: dco_decode_bool(arr[6]),
      talkPower: dco_decode_i_32(arr[7]),
      talkPowerGranted: dco_decode_bool(arr[8]),
    );
  }

  @protected
  BridgeClientProfile dco_decode_bridge_client_profile(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 25)
      throw Exception('unexpected arr length: expect 25 but see ${arr.length}');
    return BridgeClientProfile(
      id: dco_decode_u_64(arr[0]),
      channel: dco_decode_u_64(arr[1]),
      name: dco_decode_String(arr[2]),
      uniqueId: dco_decode_String(arr[3]),
      databaseId: dco_decode_opt_box_autoadd_u_64(arr[4]),
      countryCode: dco_decode_String(arr[5]),
      description: dco_decode_String(arr[6]),
      version: dco_decode_String(arr[7]),
      platform: dco_decode_String(arr[8]),
      createdUnixSeconds: dco_decode_opt_box_autoadd_i_64(arr[9]),
      lastConnectedUnixSeconds: dco_decode_opt_box_autoadd_i_64(arr[10]),
      connectionsTotal: dco_decode_opt_box_autoadd_u_64(arr[11]),
      onlineSeconds: dco_decode_opt_box_autoadd_i_64(arr[12]),
      idleMilliseconds: dco_decode_opt_box_autoadd_i_64(arr[13]),
      pingMilliseconds: dco_decode_opt_box_autoadd_i_64(arr[14]),
      clientAddress: dco_decode_String(arr[15]),
      serverGroups: dco_decode_list_String(arr[16]),
      channelGroup: dco_decode_String(arr[17]),
      avatarPath: dco_decode_String(arr[18]),
      bytesDownloadedMonth: dco_decode_opt_box_autoadd_u_64(arr[19]),
      bytesUploadedMonth: dco_decode_opt_box_autoadd_u_64(arr[20]),
      bytesDownloadedTotal: dco_decode_opt_box_autoadd_u_64(arr[21]),
      bytesUploadedTotal: dco_decode_opt_box_autoadd_u_64(arr[22]),
      packetLossClientToServerTotal: dco_decode_opt_box_autoadd_f_32(arr[23]),
      packetLossServerToClientTotal: dco_decode_opt_box_autoadd_f_32(arr[24]),
    );
  }

  @protected
  BridgeEffectOwner dco_decode_bridge_effect_owner(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeEffectOwner.values[raw as int];
  }

  @protected
  BridgeError dco_decode_bridge_error(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return BridgeError_InvalidCommand(dco_decode_String(raw[1]));
      case 1:
        return BridgeError_DnsFailed(
          host: dco_decode_String(raw[1]),
          reason: dco_decode_String(raw[2]),
        );
      case 2:
        return BridgeError_Connection(dco_decode_String(raw[1]));
      case 3:
        return BridgeError_NotConnected();
      case 4:
        return BridgeError_AlreadyConnected();
      case 5:
        return BridgeError_ServerRejected(
          code: dco_decode_u_32(raw[1]),
          message: dco_decode_String(raw[2]),
        );
      case 6:
        return BridgeError_Unmapped(dco_decode_String(raw[1]));
      default:
        throw Exception("unreachable");
    }
  }

  @protected
  BridgeEvent dco_decode_bridge_event(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return BridgeEvent_Connected(serverName: dco_decode_String(raw[1]));
      case 1:
        return BridgeEvent_Lost(reason: dco_decode_String(raw[1]));
      case 2:
        return BridgeEvent_Reconnecting(
          attempt: dco_decode_u_32(raw[1]),
          delaySecs: dco_decode_u_32(raw[2]),
        );
      case 3:
        return BridgeEvent_Disconnected(reason: dco_decode_String(raw[1]));
      case 4:
        return BridgeEvent_AudioStarted();
      case 5:
        return BridgeEvent_AudioStopped();
      case 6:
        return BridgeEvent_SnapshotChanged(
          channels: dco_decode_u_32(raw[1]),
          clients: dco_decode_u_32(raw[2]),
        );
      case 7:
        return BridgeEvent_PttCapability(
          level: dco_decode_String(raw[1]),
          backendId: dco_decode_String(raw[2]),
          boundInputClass: dco_decode_String(raw[3]),
        );
      case 8:
        return BridgeEvent_VoiceState(
          inChannel: dco_decode_bool(raw[1]),
          transmitMode: dco_decode_bridge_transmit_mode(raw[2]),
          mute: dco_decode_bool(raw[3]),
          releaseTailMs: dco_decode_u_32(raw[4]),
          currentChannelId: dco_decode_opt_box_autoadd_u_64(raw[5]),
          pendingTargetChannelId: dco_decode_opt_box_autoadd_u_64(raw[6]),
          canJoin: dco_decode_bool(raw[7]),
          canLeave: dco_decode_bool(raw[8]),
          joinSyncState: dco_decode_bridge_voice_join_sync_state(raw[9]),
          joinErrorCode:
              dco_decode_opt_box_autoadd_bridge_voice_join_error_code(raw[10]),
        );
      case 9:
        return BridgeEvent_InterruptionState(
          began: dco_decode_bool(raw[1]),
          shouldResume: dco_decode_bool(raw[2]),
        );
      case 10:
        return BridgeEvent_PermissionState(
          permission: dco_decode_String(raw[1]),
          state: dco_decode_permission_state_kind(raw[2]),
        );
      case 11:
        return BridgeEvent_ChatMessage(
          senderId: dco_decode_u_64(raw[1]),
          senderName: dco_decode_String(raw[2]),
          message: dco_decode_String(raw[3]),
          target: dco_decode_box_autoadd_bridge_message_target(raw[4]),
        );
      case 12:
        return BridgeEvent_ServerActivity(message: dco_decode_String(raw[1]));
      case 13:
        return BridgeEvent_AudioRouteChanged(
          route: dco_decode_bridge_audio_route(raw[1]),
        );
      default:
        throw Exception("unreachable");
    }
  }

  @protected
  BridgeIosVoiceProcessingMode dco_decode_bridge_ios_voice_processing_mode(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeIosVoiceProcessingMode.values[raw as int];
  }

  @protected
  BridgeMessageTarget dco_decode_bridge_message_target(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return BridgeMessageTarget_Server();
      case 1:
        return BridgeMessageTarget_Channel();
      case 2:
        return BridgeMessageTarget_Client(dco_decode_u_64(raw[1]));
      case 3:
        return BridgeMessageTarget_Poke(dco_decode_u_64(raw[1]));
      default:
        throw Exception("unreachable");
    }
  }

  @protected
  BridgeNetworkState dco_decode_bridge_network_state(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeNetworkState.values[raw as int];
  }

  @protected
  BridgePttBinding dco_decode_bridge_ptt_binding(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 2)
      throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
    return BridgePttBinding(
      inputClass: dco_decode_String(arr[0]),
      keyLabel: dco_decode_String(arr[1]),
    );
  }

  @protected
  BridgePttDescriptor dco_decode_bridge_ptt_descriptor(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 3)
      throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
    return BridgePttDescriptor(
      level: dco_decode_String(arr[0]),
      backendId: dco_decode_String(arr[1]),
      boundInputClass: dco_decode_String(arr[2]),
    );
  }

  @protected
  BridgePttInputClass dco_decode_bridge_ptt_input_class(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgePttInputClass.values[raw as int];
  }

  @protected
  BridgeSnapshot dco_decode_bridge_snapshot(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 7)
      throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
    return BridgeSnapshot(
      serverName: dco_decode_String(arr[0]),
      welcomeMessage: dco_decode_String(arr[1]),
      platform: dco_decode_String(arr[2]),
      version: dco_decode_String(arr[3]),
      channels: dco_decode_list_bridge_channel(arr[4]),
      clients: dco_decode_list_bridge_client(arr[5]),
      ownClientId: dco_decode_u_64(arr[6]),
    );
  }

  @protected
  BridgeTransmitMode dco_decode_bridge_transmit_mode(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeTransmitMode.values[raw as int];
  }

  @protected
  BridgeVadBackend dco_decode_bridge_vad_backend(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeVadBackend.values[raw as int];
  }

  @protected
  BridgeVoiceJoinErrorCode dco_decode_bridge_voice_join_error_code(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeVoiceJoinErrorCode.values[raw as int];
  }

  @protected
  BridgeVoiceJoinSyncState dco_decode_bridge_voice_join_sync_state(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return BridgeVoiceJoinSyncState.values[raw as int];
  }

  @protected
  double dco_decode_f_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as double;
  }

  @protected
  int dco_decode_i_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  PlatformInt64 dco_decode_i_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dcoDecodeI64(raw);
  }

  @protected
  List<String> dco_decode_list_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_String).toList();
  }

  @protected
  List<BridgeAudioDevice> dco_decode_list_bridge_audio_device(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_bridge_audio_device).toList();
  }

  @protected
  List<BridgeBookmark> dco_decode_list_bridge_bookmark(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_bridge_bookmark).toList();
  }

  @protected
  List<BridgeChannel> dco_decode_list_bridge_channel(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_bridge_channel).toList();
  }

  @protected
  List<BridgeClient> dco_decode_list_bridge_client(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_bridge_client).toList();
  }

  @protected
  Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as Uint8List;
  }

  @protected
  String? dco_decode_opt_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_String(raw);
  }

  @protected
  BridgeVoiceJoinErrorCode?
  dco_decode_opt_box_autoadd_bridge_voice_join_error_code(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null
        ? null
        : dco_decode_box_autoadd_bridge_voice_join_error_code(raw);
  }

  @protected
  double? dco_decode_opt_box_autoadd_f_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_f_32(raw);
  }

  @protected
  int? dco_decode_opt_box_autoadd_i_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_i_32(raw);
  }

  @protected
  PlatformInt64? dco_decode_opt_box_autoadd_i_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_i_64(raw);
  }

  @protected
  BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_u_64(raw);
  }

  @protected
  PermissionStateKind dco_decode_permission_state_kind(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PermissionStateKind.values[raw as int];
  }

  @protected
  int dco_decode_u_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  BigInt dco_decode_u_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dcoDecodeU64(raw);
  }

  @protected
  int dco_decode_u_8(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  void dco_decode_unit(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return;
  }

  @protected
  AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_String(deserializer);
    return AnyhowException(inner);
  }

  @protected
  RustStreamSink<BridgeEvent> sse_decode_StreamSink_bridge_event_Sse(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  String sse_decode_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_list_prim_u_8_strict(deserializer);
    return utf8.decoder.convert(inner);
  }

  @protected
  bool sse_decode_bool(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint8() != 0;
  }

  @protected
  BridgeAudioProcessingConfig
  sse_decode_box_autoadd_bridge_audio_processing_config(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_bridge_audio_processing_config(deserializer));
  }

  @protected
  BridgeBookmark sse_decode_box_autoadd_bridge_bookmark(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_bridge_bookmark(deserializer));
  }

  @protected
  BridgeMessageTarget sse_decode_box_autoadd_bridge_message_target(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_bridge_message_target(deserializer));
  }

  @protected
  BridgeVoiceJoinErrorCode sse_decode_box_autoadd_bridge_voice_join_error_code(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_bridge_voice_join_error_code(deserializer));
  }

  @protected
  double sse_decode_box_autoadd_f_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_f_32(deserializer));
  }

  @protected
  int sse_decode_box_autoadd_i_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_i_32(deserializer));
  }

  @protected
  PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_i_64(deserializer));
  }

  @protected
  BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_u_64(deserializer));
  }

  @protected
  BridgeAudioBackend sse_decode_bridge_audio_backend(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeAudioBackend.values[inner];
  }

  @protected
  BridgeAudioDevice sse_decode_bridge_audio_device(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_String(deserializer);
    var var_name = sse_decode_String(deserializer);
    var var_details = sse_decode_String(deserializer);
    var var_isDefault = sse_decode_bool(deserializer);
    var var_isSelected = sse_decode_bool(deserializer);
    return BridgeAudioDevice(
      id: var_id,
      name: var_name,
      details: var_details,
      isDefault: var_isDefault,
      isSelected: var_isSelected,
    );
  }

  @protected
  BridgeAudioDeviceList sse_decode_bridge_audio_device_list(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_inputDevices = sse_decode_list_bridge_audio_device(deserializer);
    var var_outputDevices = sse_decode_list_bridge_audio_device(deserializer);
    return BridgeAudioDeviceList(
      inputDevices: var_inputDevices,
      outputDevices: var_outputDevices,
    );
  }

  @protected
  BridgeAudioProcessingConfig sse_decode_bridge_audio_processing_config(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_route = sse_decode_bridge_audio_route(deserializer);
    var var_iosMode = sse_decode_bridge_ios_voice_processing_mode(deserializer);
    var var_processingBackend = sse_decode_bridge_audio_backend(deserializer);
    var var_vadBackend = sse_decode_bridge_vad_backend(deserializer);
    var var_aec = sse_decode_bridge_effect_owner(deserializer);
    var var_ns = sse_decode_bridge_effect_owner(deserializer);
    var var_agc = sse_decode_bridge_effect_owner(deserializer);
    var var_hpfEnabled = sse_decode_bool(deserializer);
    var var_limiterEnabled = sse_decode_bool(deserializer);
    var var_vadHangoverMs = sse_decode_u_32(deserializer);
    var var_vadPreRollMs = sse_decode_u_32(deserializer);
    var var_vadMinTxMs = sse_decode_u_32(deserializer);
    var var_debugWavDumpEnabled = sse_decode_bool(deserializer);
    return BridgeAudioProcessingConfig(
      route: var_route,
      iosMode: var_iosMode,
      processingBackend: var_processingBackend,
      vadBackend: var_vadBackend,
      aec: var_aec,
      ns: var_ns,
      agc: var_agc,
      hpfEnabled: var_hpfEnabled,
      limiterEnabled: var_limiterEnabled,
      vadHangoverMs: var_vadHangoverMs,
      vadPreRollMs: var_vadPreRollMs,
      vadMinTxMs: var_vadMinTxMs,
      debugWavDumpEnabled: var_debugWavDumpEnabled,
    );
  }

  @protected
  BridgeAudioProcessingStats sse_decode_bridge_audio_processing_stats(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_inputDbfs = sse_decode_f_32(deserializer);
    var var_renderDbfs = sse_decode_f_32(deserializer);
    var var_processedDbfs = sse_decode_f_32(deserializer);
    var var_vadProbability = sse_decode_f_32(deserializer);
    var var_vadActive = sse_decode_bool(deserializer);
    var var_transmitting = sse_decode_bool(deserializer);
    var var_vadBackend = sse_decode_bridge_vad_backend(deserializer);
    var var_vadFallbackActive = sse_decode_bool(deserializer);
    var var_processingBackend = sse_decode_bridge_audio_backend(deserializer);
    var var_iosVoiceProcessingMode =
        sse_decode_bridge_ios_voice_processing_mode(deserializer);
    var var_audioRoute = sse_decode_bridge_audio_route(deserializer);
    var var_actualSampleRateHz = sse_decode_u_32(deserializer);
    var var_actualIoBufferFrames = sse_decode_u_32(deserializer);
    var var_inputOverruns = sse_decode_u_64(deserializer);
    var var_outputUnderruns = sse_decode_u_64(deserializer);
    var var_callbackXruns = sse_decode_u_64(deserializer);
    var var_clippedSamples = sse_decode_u_64(deserializer);
    var var_zeroFrames = sse_decode_u_64(deserializer);
    var var_captureFrames = sse_decode_u_64(deserializer);
    var var_callbacks10Ms = sse_decode_u_64(deserializer);
    var var_callbacks20Ms = sse_decode_u_64(deserializer);
    var var_callbacksOther = sse_decode_u_64(deserializer);
    var var_sonoraEnabled = sse_decode_bool(deserializer);
    var var_platformVoiceProcessingEnabled = sse_decode_bool(deserializer);
    return BridgeAudioProcessingStats(
      inputDbfs: var_inputDbfs,
      renderDbfs: var_renderDbfs,
      processedDbfs: var_processedDbfs,
      vadProbability: var_vadProbability,
      vadActive: var_vadActive,
      transmitting: var_transmitting,
      vadBackend: var_vadBackend,
      vadFallbackActive: var_vadFallbackActive,
      processingBackend: var_processingBackend,
      iosVoiceProcessingMode: var_iosVoiceProcessingMode,
      audioRoute: var_audioRoute,
      actualSampleRateHz: var_actualSampleRateHz,
      actualIoBufferFrames: var_actualIoBufferFrames,
      inputOverruns: var_inputOverruns,
      outputUnderruns: var_outputUnderruns,
      callbackXruns: var_callbackXruns,
      clippedSamples: var_clippedSamples,
      zeroFrames: var_zeroFrames,
      captureFrames: var_captureFrames,
      callbacks10Ms: var_callbacks10Ms,
      callbacks20Ms: var_callbacks20Ms,
      callbacksOther: var_callbacksOther,
      sonoraEnabled: var_sonoraEnabled,
      platformVoiceProcessingEnabled: var_platformVoiceProcessingEnabled,
    );
  }

  @protected
  BridgeAudioRoute sse_decode_bridge_audio_route(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeAudioRoute.values[inner];
  }

  @protected
  BridgeAudioStats sse_decode_bridge_audio_stats(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_framesSent = sse_decode_u_32(deserializer);
    var var_framesReceived = sse_decode_u_32(deserializer);
    var var_pttActive = sse_decode_bool(deserializer);
    return BridgeAudioStats(
      framesSent: var_framesSent,
      framesReceived: var_framesReceived,
      pttActive: var_pttActive,
    );
  }

  @protected
  BridgeBookmark sse_decode_bridge_bookmark(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_i_64(deserializer);
    var var_displayName = sse_decode_String(deserializer);
    var var_host = sse_decode_String(deserializer);
    var var_nickname = sse_decode_String(deserializer);
    var var_password = sse_decode_String(deserializer);
    return BridgeBookmark(
      id: var_id,
      displayName: var_displayName,
      host: var_host,
      nickname: var_nickname,
      password: var_password,
    );
  }

  @protected
  BridgeChannel sse_decode_bridge_channel(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_u_64(deserializer);
    var var_parent = sse_decode_u_64(deserializer);
    var var_name = sse_decode_String(deserializer);
    var var_order = sse_decode_i_64(deserializer);
    var var_hasPassword = sse_decode_bool(deserializer);
    var var_neededTalkPower = sse_decode_opt_box_autoadd_i_32(deserializer);
    return BridgeChannel(
      id: var_id,
      parent: var_parent,
      name: var_name,
      order: var_order,
      hasPassword: var_hasPassword,
      neededTalkPower: var_neededTalkPower,
    );
  }

  @protected
  BridgeClient sse_decode_bridge_client(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_u_64(deserializer);
    var var_channel = sse_decode_u_64(deserializer);
    var var_name = sse_decode_String(deserializer);
    var var_inputMuted = sse_decode_bool(deserializer);
    var var_outputMuted = sse_decode_bool(deserializer);
    var var_isSpeaking = sse_decode_bool(deserializer);
    var var_isServerQuery = sse_decode_bool(deserializer);
    var var_talkPower = sse_decode_i_32(deserializer);
    var var_talkPowerGranted = sse_decode_bool(deserializer);
    return BridgeClient(
      id: var_id,
      channel: var_channel,
      name: var_name,
      inputMuted: var_inputMuted,
      outputMuted: var_outputMuted,
      isSpeaking: var_isSpeaking,
      isServerQuery: var_isServerQuery,
      talkPower: var_talkPower,
      talkPowerGranted: var_talkPowerGranted,
    );
  }

  @protected
  BridgeClientProfile sse_decode_bridge_client_profile(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_u_64(deserializer);
    var var_channel = sse_decode_u_64(deserializer);
    var var_name = sse_decode_String(deserializer);
    var var_uniqueId = sse_decode_String(deserializer);
    var var_databaseId = sse_decode_opt_box_autoadd_u_64(deserializer);
    var var_countryCode = sse_decode_String(deserializer);
    var var_description = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_platform = sse_decode_String(deserializer);
    var var_createdUnixSeconds = sse_decode_opt_box_autoadd_i_64(deserializer);
    var var_lastConnectedUnixSeconds = sse_decode_opt_box_autoadd_i_64(
      deserializer,
    );
    var var_connectionsTotal = sse_decode_opt_box_autoadd_u_64(deserializer);
    var var_onlineSeconds = sse_decode_opt_box_autoadd_i_64(deserializer);
    var var_idleMilliseconds = sse_decode_opt_box_autoadd_i_64(deserializer);
    var var_pingMilliseconds = sse_decode_opt_box_autoadd_i_64(deserializer);
    var var_clientAddress = sse_decode_String(deserializer);
    var var_serverGroups = sse_decode_list_String(deserializer);
    var var_channelGroup = sse_decode_String(deserializer);
    var var_avatarPath = sse_decode_String(deserializer);
    var var_bytesDownloadedMonth = sse_decode_opt_box_autoadd_u_64(
      deserializer,
    );
    var var_bytesUploadedMonth = sse_decode_opt_box_autoadd_u_64(deserializer);
    var var_bytesDownloadedTotal = sse_decode_opt_box_autoadd_u_64(
      deserializer,
    );
    var var_bytesUploadedTotal = sse_decode_opt_box_autoadd_u_64(deserializer);
    var var_packetLossClientToServerTotal = sse_decode_opt_box_autoadd_f_32(
      deserializer,
    );
    var var_packetLossServerToClientTotal = sse_decode_opt_box_autoadd_f_32(
      deserializer,
    );
    return BridgeClientProfile(
      id: var_id,
      channel: var_channel,
      name: var_name,
      uniqueId: var_uniqueId,
      databaseId: var_databaseId,
      countryCode: var_countryCode,
      description: var_description,
      version: var_version,
      platform: var_platform,
      createdUnixSeconds: var_createdUnixSeconds,
      lastConnectedUnixSeconds: var_lastConnectedUnixSeconds,
      connectionsTotal: var_connectionsTotal,
      onlineSeconds: var_onlineSeconds,
      idleMilliseconds: var_idleMilliseconds,
      pingMilliseconds: var_pingMilliseconds,
      clientAddress: var_clientAddress,
      serverGroups: var_serverGroups,
      channelGroup: var_channelGroup,
      avatarPath: var_avatarPath,
      bytesDownloadedMonth: var_bytesDownloadedMonth,
      bytesUploadedMonth: var_bytesUploadedMonth,
      bytesDownloadedTotal: var_bytesDownloadedTotal,
      bytesUploadedTotal: var_bytesUploadedTotal,
      packetLossClientToServerTotal: var_packetLossClientToServerTotal,
      packetLossServerToClientTotal: var_packetLossServerToClientTotal,
    );
  }

  @protected
  BridgeEffectOwner sse_decode_bridge_effect_owner(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeEffectOwner.values[inner];
  }

  @protected
  BridgeError sse_decode_bridge_error(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        var var_field0 = sse_decode_String(deserializer);
        return BridgeError_InvalidCommand(var_field0);
      case 1:
        var var_host = sse_decode_String(deserializer);
        var var_reason = sse_decode_String(deserializer);
        return BridgeError_DnsFailed(host: var_host, reason: var_reason);
      case 2:
        var var_field0 = sse_decode_String(deserializer);
        return BridgeError_Connection(var_field0);
      case 3:
        return BridgeError_NotConnected();
      case 4:
        return BridgeError_AlreadyConnected();
      case 5:
        var var_code = sse_decode_u_32(deserializer);
        var var_message = sse_decode_String(deserializer);
        return BridgeError_ServerRejected(code: var_code, message: var_message);
      case 6:
        var var_field0 = sse_decode_String(deserializer);
        return BridgeError_Unmapped(var_field0);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  BridgeEvent sse_decode_bridge_event(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        var var_serverName = sse_decode_String(deserializer);
        return BridgeEvent_Connected(serverName: var_serverName);
      case 1:
        var var_reason = sse_decode_String(deserializer);
        return BridgeEvent_Lost(reason: var_reason);
      case 2:
        var var_attempt = sse_decode_u_32(deserializer);
        var var_delaySecs = sse_decode_u_32(deserializer);
        return BridgeEvent_Reconnecting(
          attempt: var_attempt,
          delaySecs: var_delaySecs,
        );
      case 3:
        var var_reason = sse_decode_String(deserializer);
        return BridgeEvent_Disconnected(reason: var_reason);
      case 4:
        return BridgeEvent_AudioStarted();
      case 5:
        return BridgeEvent_AudioStopped();
      case 6:
        var var_channels = sse_decode_u_32(deserializer);
        var var_clients = sse_decode_u_32(deserializer);
        return BridgeEvent_SnapshotChanged(
          channels: var_channels,
          clients: var_clients,
        );
      case 7:
        var var_level = sse_decode_String(deserializer);
        var var_backendId = sse_decode_String(deserializer);
        var var_boundInputClass = sse_decode_String(deserializer);
        return BridgeEvent_PttCapability(
          level: var_level,
          backendId: var_backendId,
          boundInputClass: var_boundInputClass,
        );
      case 8:
        var var_inChannel = sse_decode_bool(deserializer);
        var var_transmitMode = sse_decode_bridge_transmit_mode(deserializer);
        var var_mute = sse_decode_bool(deserializer);
        var var_releaseTailMs = sse_decode_u_32(deserializer);
        var var_currentChannelId = sse_decode_opt_box_autoadd_u_64(
          deserializer,
        );
        var var_pendingTargetChannelId = sse_decode_opt_box_autoadd_u_64(
          deserializer,
        );
        var var_canJoin = sse_decode_bool(deserializer);
        var var_canLeave = sse_decode_bool(deserializer);
        var var_joinSyncState = sse_decode_bridge_voice_join_sync_state(
          deserializer,
        );
        var var_joinErrorCode =
            sse_decode_opt_box_autoadd_bridge_voice_join_error_code(
              deserializer,
            );
        return BridgeEvent_VoiceState(
          inChannel: var_inChannel,
          transmitMode: var_transmitMode,
          mute: var_mute,
          releaseTailMs: var_releaseTailMs,
          currentChannelId: var_currentChannelId,
          pendingTargetChannelId: var_pendingTargetChannelId,
          canJoin: var_canJoin,
          canLeave: var_canLeave,
          joinSyncState: var_joinSyncState,
          joinErrorCode: var_joinErrorCode,
        );
      case 9:
        var var_began = sse_decode_bool(deserializer);
        var var_shouldResume = sse_decode_bool(deserializer);
        return BridgeEvent_InterruptionState(
          began: var_began,
          shouldResume: var_shouldResume,
        );
      case 10:
        var var_permission = sse_decode_String(deserializer);
        var var_state = sse_decode_permission_state_kind(deserializer);
        return BridgeEvent_PermissionState(
          permission: var_permission,
          state: var_state,
        );
      case 11:
        var var_senderId = sse_decode_u_64(deserializer);
        var var_senderName = sse_decode_String(deserializer);
        var var_message = sse_decode_String(deserializer);
        var var_target = sse_decode_box_autoadd_bridge_message_target(
          deserializer,
        );
        return BridgeEvent_ChatMessage(
          senderId: var_senderId,
          senderName: var_senderName,
          message: var_message,
          target: var_target,
        );
      case 12:
        var var_message = sse_decode_String(deserializer);
        return BridgeEvent_ServerActivity(message: var_message);
      case 13:
        var var_route = sse_decode_bridge_audio_route(deserializer);
        return BridgeEvent_AudioRouteChanged(route: var_route);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  BridgeIosVoiceProcessingMode sse_decode_bridge_ios_voice_processing_mode(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeIosVoiceProcessingMode.values[inner];
  }

  @protected
  BridgeMessageTarget sse_decode_bridge_message_target(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        return BridgeMessageTarget_Server();
      case 1:
        return BridgeMessageTarget_Channel();
      case 2:
        var var_field0 = sse_decode_u_64(deserializer);
        return BridgeMessageTarget_Client(var_field0);
      case 3:
        var var_field0 = sse_decode_u_64(deserializer);
        return BridgeMessageTarget_Poke(var_field0);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  BridgeNetworkState sse_decode_bridge_network_state(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeNetworkState.values[inner];
  }

  @protected
  BridgePttBinding sse_decode_bridge_ptt_binding(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_inputClass = sse_decode_String(deserializer);
    var var_keyLabel = sse_decode_String(deserializer);
    return BridgePttBinding(inputClass: var_inputClass, keyLabel: var_keyLabel);
  }

  @protected
  BridgePttDescriptor sse_decode_bridge_ptt_descriptor(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_level = sse_decode_String(deserializer);
    var var_backendId = sse_decode_String(deserializer);
    var var_boundInputClass = sse_decode_String(deserializer);
    return BridgePttDescriptor(
      level: var_level,
      backendId: var_backendId,
      boundInputClass: var_boundInputClass,
    );
  }

  @protected
  BridgePttInputClass sse_decode_bridge_ptt_input_class(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgePttInputClass.values[inner];
  }

  @protected
  BridgeSnapshot sse_decode_bridge_snapshot(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_serverName = sse_decode_String(deserializer);
    var var_welcomeMessage = sse_decode_String(deserializer);
    var var_platform = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_channels = sse_decode_list_bridge_channel(deserializer);
    var var_clients = sse_decode_list_bridge_client(deserializer);
    var var_ownClientId = sse_decode_u_64(deserializer);
    return BridgeSnapshot(
      serverName: var_serverName,
      welcomeMessage: var_welcomeMessage,
      platform: var_platform,
      version: var_version,
      channels: var_channels,
      clients: var_clients,
      ownClientId: var_ownClientId,
    );
  }

  @protected
  BridgeTransmitMode sse_decode_bridge_transmit_mode(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeTransmitMode.values[inner];
  }

  @protected
  BridgeVadBackend sse_decode_bridge_vad_backend(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeVadBackend.values[inner];
  }

  @protected
  BridgeVoiceJoinErrorCode sse_decode_bridge_voice_join_error_code(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeVoiceJoinErrorCode.values[inner];
  }

  @protected
  BridgeVoiceJoinSyncState sse_decode_bridge_voice_join_sync_state(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return BridgeVoiceJoinSyncState.values[inner];
  }

  @protected
  double sse_decode_f_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getFloat32();
  }

  @protected
  int sse_decode_i_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getInt32();
  }

  @protected
  PlatformInt64 sse_decode_i_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getPlatformInt64();
  }

  @protected
  List<String> sse_decode_list_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <String>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_String(deserializer));
    }
    return ans_;
  }

  @protected
  List<BridgeAudioDevice> sse_decode_list_bridge_audio_device(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <BridgeAudioDevice>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_bridge_audio_device(deserializer));
    }
    return ans_;
  }

  @protected
  List<BridgeBookmark> sse_decode_list_bridge_bookmark(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <BridgeBookmark>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_bridge_bookmark(deserializer));
    }
    return ans_;
  }

  @protected
  List<BridgeChannel> sse_decode_list_bridge_channel(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <BridgeChannel>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_bridge_channel(deserializer));
    }
    return ans_;
  }

  @protected
  List<BridgeClient> sse_decode_list_bridge_client(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <BridgeClient>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_bridge_client(deserializer));
    }
    return ans_;
  }

  @protected
  Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var len_ = sse_decode_i_32(deserializer);
    return deserializer.buffer.getUint8List(len_);
  }

  @protected
  String? sse_decode_opt_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_String(deserializer));
    } else {
      return null;
    }
  }

  @protected
  BridgeVoiceJoinErrorCode?
  sse_decode_opt_box_autoadd_bridge_voice_join_error_code(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_bridge_voice_join_error_code(
        deserializer,
      ));
    } else {
      return null;
    }
  }

  @protected
  double? sse_decode_opt_box_autoadd_f_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_f_32(deserializer));
    } else {
      return null;
    }
  }

  @protected
  int? sse_decode_opt_box_autoadd_i_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_i_32(deserializer));
    } else {
      return null;
    }
  }

  @protected
  PlatformInt64? sse_decode_opt_box_autoadd_i_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_i_64(deserializer));
    } else {
      return null;
    }
  }

  @protected
  BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_u_64(deserializer));
    } else {
      return null;
    }
  }

  @protected
  PermissionStateKind sse_decode_permission_state_kind(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return PermissionStateKind.values[inner];
  }

  @protected
  int sse_decode_u_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint32();
  }

  @protected
  BigInt sse_decode_u_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getBigUint64();
  }

  @protected
  int sse_decode_u_8(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint8();
  }

  @protected
  void sse_decode_unit(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
  }

  @protected
  void sse_encode_AnyhowException(
    AnyhowException self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.message, serializer);
  }

  @protected
  void sse_encode_StreamSink_bridge_event_Sse(
    RustStreamSink<BridgeEvent> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_event,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_String(String self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer);
  }

  @protected
  void sse_encode_bool(bool self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putUint8(self ? 1 : 0);
  }

  @protected
  void sse_encode_box_autoadd_bridge_audio_processing_config(
    BridgeAudioProcessingConfig self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bridge_audio_processing_config(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_bridge_bookmark(
    BridgeBookmark self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bridge_bookmark(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_bridge_message_target(
    BridgeMessageTarget self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bridge_message_target(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_bridge_voice_join_error_code(
    BridgeVoiceJoinErrorCode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bridge_voice_join_error_code(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_f_32(double self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_f_32(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_i_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_i_64(
    PlatformInt64 self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_64(self, serializer);
  }

  @protected
  void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_64(self, serializer);
  }

  @protected
  void sse_encode_bridge_audio_backend(
    BridgeAudioBackend self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_audio_device(
    BridgeAudioDevice self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_String(self.name, serializer);
    sse_encode_String(self.details, serializer);
    sse_encode_bool(self.isDefault, serializer);
    sse_encode_bool(self.isSelected, serializer);
  }

  @protected
  void sse_encode_bridge_audio_device_list(
    BridgeAudioDeviceList self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_bridge_audio_device(self.inputDevices, serializer);
    sse_encode_list_bridge_audio_device(self.outputDevices, serializer);
  }

  @protected
  void sse_encode_bridge_audio_processing_config(
    BridgeAudioProcessingConfig self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bridge_audio_route(self.route, serializer);
    sse_encode_bridge_ios_voice_processing_mode(self.iosMode, serializer);
    sse_encode_bridge_audio_backend(self.processingBackend, serializer);
    sse_encode_bridge_vad_backend(self.vadBackend, serializer);
    sse_encode_bridge_effect_owner(self.aec, serializer);
    sse_encode_bridge_effect_owner(self.ns, serializer);
    sse_encode_bridge_effect_owner(self.agc, serializer);
    sse_encode_bool(self.hpfEnabled, serializer);
    sse_encode_bool(self.limiterEnabled, serializer);
    sse_encode_u_32(self.vadHangoverMs, serializer);
    sse_encode_u_32(self.vadPreRollMs, serializer);
    sse_encode_u_32(self.vadMinTxMs, serializer);
    sse_encode_bool(self.debugWavDumpEnabled, serializer);
  }

  @protected
  void sse_encode_bridge_audio_processing_stats(
    BridgeAudioProcessingStats self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_f_32(self.inputDbfs, serializer);
    sse_encode_f_32(self.renderDbfs, serializer);
    sse_encode_f_32(self.processedDbfs, serializer);
    sse_encode_f_32(self.vadProbability, serializer);
    sse_encode_bool(self.vadActive, serializer);
    sse_encode_bool(self.transmitting, serializer);
    sse_encode_bridge_vad_backend(self.vadBackend, serializer);
    sse_encode_bool(self.vadFallbackActive, serializer);
    sse_encode_bridge_audio_backend(self.processingBackend, serializer);
    sse_encode_bridge_ios_voice_processing_mode(
      self.iosVoiceProcessingMode,
      serializer,
    );
    sse_encode_bridge_audio_route(self.audioRoute, serializer);
    sse_encode_u_32(self.actualSampleRateHz, serializer);
    sse_encode_u_32(self.actualIoBufferFrames, serializer);
    sse_encode_u_64(self.inputOverruns, serializer);
    sse_encode_u_64(self.outputUnderruns, serializer);
    sse_encode_u_64(self.callbackXruns, serializer);
    sse_encode_u_64(self.clippedSamples, serializer);
    sse_encode_u_64(self.zeroFrames, serializer);
    sse_encode_u_64(self.captureFrames, serializer);
    sse_encode_u_64(self.callbacks10Ms, serializer);
    sse_encode_u_64(self.callbacks20Ms, serializer);
    sse_encode_u_64(self.callbacksOther, serializer);
    sse_encode_bool(self.sonoraEnabled, serializer);
    sse_encode_bool(self.platformVoiceProcessingEnabled, serializer);
  }

  @protected
  void sse_encode_bridge_audio_route(
    BridgeAudioRoute self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_audio_stats(
    BridgeAudioStats self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_32(self.framesSent, serializer);
    sse_encode_u_32(self.framesReceived, serializer);
    sse_encode_bool(self.pttActive, serializer);
  }

  @protected
  void sse_encode_bridge_bookmark(
    BridgeBookmark self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_64(self.id, serializer);
    sse_encode_String(self.displayName, serializer);
    sse_encode_String(self.host, serializer);
    sse_encode_String(self.nickname, serializer);
    sse_encode_String(self.password, serializer);
  }

  @protected
  void sse_encode_bridge_channel(BridgeChannel self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_64(self.id, serializer);
    sse_encode_u_64(self.parent, serializer);
    sse_encode_String(self.name, serializer);
    sse_encode_i_64(self.order, serializer);
    sse_encode_bool(self.hasPassword, serializer);
    sse_encode_opt_box_autoadd_i_32(self.neededTalkPower, serializer);
  }

  @protected
  void sse_encode_bridge_client(BridgeClient self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_64(self.id, serializer);
    sse_encode_u_64(self.channel, serializer);
    sse_encode_String(self.name, serializer);
    sse_encode_bool(self.inputMuted, serializer);
    sse_encode_bool(self.outputMuted, serializer);
    sse_encode_bool(self.isSpeaking, serializer);
    sse_encode_bool(self.isServerQuery, serializer);
    sse_encode_i_32(self.talkPower, serializer);
    sse_encode_bool(self.talkPowerGranted, serializer);
  }

  @protected
  void sse_encode_bridge_client_profile(
    BridgeClientProfile self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_64(self.id, serializer);
    sse_encode_u_64(self.channel, serializer);
    sse_encode_String(self.name, serializer);
    sse_encode_String(self.uniqueId, serializer);
    sse_encode_opt_box_autoadd_u_64(self.databaseId, serializer);
    sse_encode_String(self.countryCode, serializer);
    sse_encode_String(self.description, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_String(self.platform, serializer);
    sse_encode_opt_box_autoadd_i_64(self.createdUnixSeconds, serializer);
    sse_encode_opt_box_autoadd_i_64(self.lastConnectedUnixSeconds, serializer);
    sse_encode_opt_box_autoadd_u_64(self.connectionsTotal, serializer);
    sse_encode_opt_box_autoadd_i_64(self.onlineSeconds, serializer);
    sse_encode_opt_box_autoadd_i_64(self.idleMilliseconds, serializer);
    sse_encode_opt_box_autoadd_i_64(self.pingMilliseconds, serializer);
    sse_encode_String(self.clientAddress, serializer);
    sse_encode_list_String(self.serverGroups, serializer);
    sse_encode_String(self.channelGroup, serializer);
    sse_encode_String(self.avatarPath, serializer);
    sse_encode_opt_box_autoadd_u_64(self.bytesDownloadedMonth, serializer);
    sse_encode_opt_box_autoadd_u_64(self.bytesUploadedMonth, serializer);
    sse_encode_opt_box_autoadd_u_64(self.bytesDownloadedTotal, serializer);
    sse_encode_opt_box_autoadd_u_64(self.bytesUploadedTotal, serializer);
    sse_encode_opt_box_autoadd_f_32(
      self.packetLossClientToServerTotal,
      serializer,
    );
    sse_encode_opt_box_autoadd_f_32(
      self.packetLossServerToClientTotal,
      serializer,
    );
  }

  @protected
  void sse_encode_bridge_effect_owner(
    BridgeEffectOwner self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_error(BridgeError self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case BridgeError_InvalidCommand(field0: final field0):
        sse_encode_i_32(0, serializer);
        sse_encode_String(field0, serializer);
      case BridgeError_DnsFailed(host: final host, reason: final reason):
        sse_encode_i_32(1, serializer);
        sse_encode_String(host, serializer);
        sse_encode_String(reason, serializer);
      case BridgeError_Connection(field0: final field0):
        sse_encode_i_32(2, serializer);
        sse_encode_String(field0, serializer);
      case BridgeError_NotConnected():
        sse_encode_i_32(3, serializer);
      case BridgeError_AlreadyConnected():
        sse_encode_i_32(4, serializer);
      case BridgeError_ServerRejected(code: final code, message: final message):
        sse_encode_i_32(5, serializer);
        sse_encode_u_32(code, serializer);
        sse_encode_String(message, serializer);
      case BridgeError_Unmapped(field0: final field0):
        sse_encode_i_32(6, serializer);
        sse_encode_String(field0, serializer);
    }
  }

  @protected
  void sse_encode_bridge_event(BridgeEvent self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case BridgeEvent_Connected(serverName: final serverName):
        sse_encode_i_32(0, serializer);
        sse_encode_String(serverName, serializer);
      case BridgeEvent_Lost(reason: final reason):
        sse_encode_i_32(1, serializer);
        sse_encode_String(reason, serializer);
      case BridgeEvent_Reconnecting(
        attempt: final attempt,
        delaySecs: final delaySecs,
      ):
        sse_encode_i_32(2, serializer);
        sse_encode_u_32(attempt, serializer);
        sse_encode_u_32(delaySecs, serializer);
      case BridgeEvent_Disconnected(reason: final reason):
        sse_encode_i_32(3, serializer);
        sse_encode_String(reason, serializer);
      case BridgeEvent_AudioStarted():
        sse_encode_i_32(4, serializer);
      case BridgeEvent_AudioStopped():
        sse_encode_i_32(5, serializer);
      case BridgeEvent_SnapshotChanged(
        channels: final channels,
        clients: final clients,
      ):
        sse_encode_i_32(6, serializer);
        sse_encode_u_32(channels, serializer);
        sse_encode_u_32(clients, serializer);
      case BridgeEvent_PttCapability(
        level: final level,
        backendId: final backendId,
        boundInputClass: final boundInputClass,
      ):
        sse_encode_i_32(7, serializer);
        sse_encode_String(level, serializer);
        sse_encode_String(backendId, serializer);
        sse_encode_String(boundInputClass, serializer);
      case BridgeEvent_VoiceState(
        inChannel: final inChannel,
        transmitMode: final transmitMode,
        mute: final mute,
        releaseTailMs: final releaseTailMs,
        currentChannelId: final currentChannelId,
        pendingTargetChannelId: final pendingTargetChannelId,
        canJoin: final canJoin,
        canLeave: final canLeave,
        joinSyncState: final joinSyncState,
        joinErrorCode: final joinErrorCode,
      ):
        sse_encode_i_32(8, serializer);
        sse_encode_bool(inChannel, serializer);
        sse_encode_bridge_transmit_mode(transmitMode, serializer);
        sse_encode_bool(mute, serializer);
        sse_encode_u_32(releaseTailMs, serializer);
        sse_encode_opt_box_autoadd_u_64(currentChannelId, serializer);
        sse_encode_opt_box_autoadd_u_64(pendingTargetChannelId, serializer);
        sse_encode_bool(canJoin, serializer);
        sse_encode_bool(canLeave, serializer);
        sse_encode_bridge_voice_join_sync_state(joinSyncState, serializer);
        sse_encode_opt_box_autoadd_bridge_voice_join_error_code(
          joinErrorCode,
          serializer,
        );
      case BridgeEvent_InterruptionState(
        began: final began,
        shouldResume: final shouldResume,
      ):
        sse_encode_i_32(9, serializer);
        sse_encode_bool(began, serializer);
        sse_encode_bool(shouldResume, serializer);
      case BridgeEvent_PermissionState(
        permission: final permission,
        state: final state,
      ):
        sse_encode_i_32(10, serializer);
        sse_encode_String(permission, serializer);
        sse_encode_permission_state_kind(state, serializer);
      case BridgeEvent_ChatMessage(
        senderId: final senderId,
        senderName: final senderName,
        message: final message,
        target: final target,
      ):
        sse_encode_i_32(11, serializer);
        sse_encode_u_64(senderId, serializer);
        sse_encode_String(senderName, serializer);
        sse_encode_String(message, serializer);
        sse_encode_box_autoadd_bridge_message_target(target, serializer);
      case BridgeEvent_ServerActivity(message: final message):
        sse_encode_i_32(12, serializer);
        sse_encode_String(message, serializer);
      case BridgeEvent_AudioRouteChanged(route: final route):
        sse_encode_i_32(13, serializer);
        sse_encode_bridge_audio_route(route, serializer);
    }
  }

  @protected
  void sse_encode_bridge_ios_voice_processing_mode(
    BridgeIosVoiceProcessingMode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_message_target(
    BridgeMessageTarget self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case BridgeMessageTarget_Server():
        sse_encode_i_32(0, serializer);
      case BridgeMessageTarget_Channel():
        sse_encode_i_32(1, serializer);
      case BridgeMessageTarget_Client(field0: final field0):
        sse_encode_i_32(2, serializer);
        sse_encode_u_64(field0, serializer);
      case BridgeMessageTarget_Poke(field0: final field0):
        sse_encode_i_32(3, serializer);
        sse_encode_u_64(field0, serializer);
    }
  }

  @protected
  void sse_encode_bridge_network_state(
    BridgeNetworkState self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_ptt_binding(
    BridgePttBinding self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.inputClass, serializer);
    sse_encode_String(self.keyLabel, serializer);
  }

  @protected
  void sse_encode_bridge_ptt_descriptor(
    BridgePttDescriptor self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.level, serializer);
    sse_encode_String(self.backendId, serializer);
    sse_encode_String(self.boundInputClass, serializer);
  }

  @protected
  void sse_encode_bridge_ptt_input_class(
    BridgePttInputClass self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_snapshot(
    BridgeSnapshot self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.serverName, serializer);
    sse_encode_String(self.welcomeMessage, serializer);
    sse_encode_String(self.platform, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_list_bridge_channel(self.channels, serializer);
    sse_encode_list_bridge_client(self.clients, serializer);
    sse_encode_u_64(self.ownClientId, serializer);
  }

  @protected
  void sse_encode_bridge_transmit_mode(
    BridgeTransmitMode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_vad_backend(
    BridgeVadBackend self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_voice_join_error_code(
    BridgeVoiceJoinErrorCode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_bridge_voice_join_sync_state(
    BridgeVoiceJoinSyncState self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_f_32(double self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putFloat32(self);
  }

  @protected
  void sse_encode_i_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putInt32(self);
  }

  @protected
  void sse_encode_i_64(PlatformInt64 self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putPlatformInt64(self);
  }

  @protected
  void sse_encode_list_String(List<String> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_String(item, serializer);
    }
  }

  @protected
  void sse_encode_list_bridge_audio_device(
    List<BridgeAudioDevice> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_bridge_audio_device(item, serializer);
    }
  }

  @protected
  void sse_encode_list_bridge_bookmark(
    List<BridgeBookmark> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_bridge_bookmark(item, serializer);
    }
  }

  @protected
  void sse_encode_list_bridge_channel(
    List<BridgeChannel> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_bridge_channel(item, serializer);
    }
  }

  @protected
  void sse_encode_list_bridge_client(
    List<BridgeClient> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_bridge_client(item, serializer);
    }
  }

  @protected
  void sse_encode_list_prim_u_8_strict(
    Uint8List self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    serializer.buffer.putUint8List(self);
  }

  @protected
  void sse_encode_opt_String(String? self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_String(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_bridge_voice_join_error_code(
    BridgeVoiceJoinErrorCode? self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_bridge_voice_join_error_code(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_f_32(double? self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_f_32(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_i_32(int? self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_i_32(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_i_64(
    PlatformInt64? self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_i_64(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_u_64(self, serializer);
    }
  }

  @protected
  void sse_encode_permission_state_kind(
    PermissionStateKind self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @protected
  void sse_encode_u_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putUint32(self);
  }

  @protected
  void sse_encode_u_64(BigInt self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putBigUint64(self);
  }

  @protected
  void sse_encode_u_8(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putUint8(self);
  }

  @protected
  void sse_encode_unit(void self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
  }
}
