// 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 'dart:async';
import 'dart:convert';

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

import 'api.dart';
import 'api/account_groups.dart';
import 'api/accounts.dart';
import 'api/bug_report.dart';
import 'api/chat_list.dart';
import 'api/chat_summary.dart';
import 'api/drafts.dart';
import 'api/error.dart';
import 'api/group_state.dart';
import 'api/groups.dart';
import 'api/lifecycle.dart';
import 'api/logs.dart';
import 'api/markdown.dart';
import 'api/media_files.dart';
import 'api/messages.dart';
import 'api/metadata.dart';
import 'api/mute_list.dart';
import 'api/notifications.dart';
import 'api/relay_defaults.dart';
import 'api/relays.dart';
import 'api/signer.dart';
import 'api/user_search.dart';
import 'api/users.dart';
import 'api/utils.dart';
import 'api/zapstore.dart';
import 'frb_generated.dart';
import 'frb_generated.io.dart' if (dart.library.js_interop) 'frb_generated.web.dart';
import 'lib.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 {}

  @override
  ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
      kDefaultExternalLibraryLoaderConfig;

  @override
  String get codegenVersion => '2.12.0';

  @override
  int get rustContentHash => -1175481794;

  static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig(
    stem: 'rust_lib_whitenoise',
    ioDirectory: 'rust/target/release/',
    webPrefix: 'pkg/',
  );
}

abstract class RustLibApi extends BaseApi {
  Future<DartSigner> crateApiSignerDartSignerNew({
    required PublicKey pubkey,
    required FutureOr<String> Function(String) signEvent,
    required FutureOr<String> Function(String, String) nip04Encrypt,
    required FutureOr<String> Function(String, String) nip04Decrypt,
    required FutureOr<String> Function(String, String) nip44Encrypt,
    required FutureOr<String> Function(String, String) nip44Decrypt,
  });

  Future<AccountGroup> crateApiAccountGroupsAcceptAccountGroup({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Future<List<User>> crateApiAccountsAccountFollows({required String pubkey});

  Future<FlutterEvent?> crateApiAccountsAccountKeyPackage({
    required String pubkey,
  });

  Future<List<FlutterEvent>> crateApiAccountsAccountKeyPackages({
    required String accountPubkey,
  });

  Future<List<Relay>> crateApiAccountsAccountRelays({
    required String pubkey,
    required RelayType relayType,
  });

  Future<AccountSettings> crateApiAccountsAccountSettings({
    required String pubkey,
  });

  Future<List<Group>> crateApiGroupsActiveGroups({required String pubkey});

  Future<void> crateApiAccountsAddAccountRelay({
    required String pubkey,
    required String url,
    required RelayType relayType,
  });

  Future<void> crateApiGroupsAddMembersToGroup({
    required String pubkey,
    required String groupId,
    required List<String> memberPubkeys,
  });

  Future<String> crateApiErrorApiErrorErrorType({required ApiError that});

  Future<String> crateApiErrorApiErrorMessageText({required ApiError that});

  Future<Language> crateApiAppSettingsLanguage({
    required AppSettings appSettings,
  });

  Future<ThemeMode> crateApiAppSettingsThemeMode({
    required AppSettings appSettings,
  });

  Future<void> crateApiAccountGroupsArchiveChat({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Future<void> crateApiMuteListBlockUser({
    required String accountPubkey,
    required String targetPubkey,
  });

  Future<void> crateApiGroupsClearChat({
    required String accountPubkey,
    required String groupId,
  });

  Future<void> crateApiNotificationsClearPushRegistration({
    required String pubkey,
  });

  Future<Group> crateApiGroupsCreateGroup({
    required String creatorPubkey,
    required List<String> memberPubkeys,
    required List<String> adminPubkeys,
    required String groupName,
    required String groupDescription,
    required GroupType groupType,
  });

  Future<Account> crateApiAccountsCreateIdentity();

  Future<WhitenoiseConfig> crateApiCreateWhitenoiseConfig({
    required String dataDir,
    required String logsDir,
    List<String>? defaultRelayUrls,
  });

  Future<String> crateApiRelaysDebugRelayControlState();

  Future<AccountGroup> crateApiAccountGroupsDeclineAccountGroup({
    required String accountPubkey,
    required String mlsGroupId,
  });

  List<String> crateApiRelayDefaultsDefaultRelayUrls();

  Future<List<RelayUrl>> crateApiRelayDefaultsDefaultRelayUrlsParsed();

  Future<bool> crateApiAccountsDeleteAccountKeyPackage({
    required String accountPubkey,
    required String keyPackageId,
  });

  Future<BigInt> crateApiAccountsDeleteAccountKeyPackages({
    required String accountPubkey,
  });

  Future<BigInt> crateApiAccountsDeleteAllAccountKeyPackages({
    required String accountPubkey,
  });

  Future<void> crateApiDeleteAllData();

  Future<void> crateApiGroupsDeleteChat({
    required String accountPubkey,
    required String groupId,
  });

  Future<void> crateApiDraftsDeleteDraft({
    required String pubkey,
    required String groupId,
  });

  Future<MediaFile> crateApiMediaFilesDownloadChatMedia({
    required String accountPubkey,
    required String groupId,
    required String originalFileHash,
  });

  Future<void> crateApiRelaysEnsureAllSubscriptions();

  String crateApiUtilsEventIdToNeventUri({
    required String eventIdHex,
    required String pubkeyHex,
  });

  Future<String> crateApiAccountsExportAccountNsec({required String pubkey});

  Future<List<ChatMessage>> crateApiMessagesFetchAggregatedMessagesForGroup({
    required String pubkey,
    required String groupId,
    DateTime? before,
    String? beforeMessageId,
    int? limit,
  });

  Future<List<ChatSummary>> crateApiChatListFetchArchivedChatListSnapshot({
    required String accountPubkey,
  });

  Future<List<ChatSummary>> crateApiChatListFetchChatListSnapshot({
    required String accountPubkey,
  });

  Future<String?> crateApiZapstoreFetchLatestZapstoreVersion();

  Future<ChatMessage?> crateApiMessagesFetchMessageById({
    required String pubkey,
    required String groupId,
    required String messageId,
  });

  Future<List<ChatMessage>> crateApiMessagesFetchMessagesUnreadWithMinimum({
    required String pubkey,
    required String groupId,
    int? minimum,
  });

  Future<void> crateApiAccountsFollowUser({
    required String accountPubkey,
    required String userToFollowPubkey,
  });

  Future<Account> crateApiAccountsGetAccount({required String pubkey});

  Future<AccountGroup> crateApiAccountGroupsGetAccountGroup({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Future<List<Account>> crateApiAccountsGetAccounts();

  Future<AppSettings> crateApiGetAppSettings();

  Future<List<MuteListEntry>> crateApiMuteListGetBlockedUsers({
    required String accountPubkey,
  });

  Future<List<ChatSummary>> crateApiChatListGetChatList({
    required String accountPubkey,
  });

  Future<ChatSummary> crateApiChatSummaryGetChatSummary({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Future<String> crateApiUtilsGetDefaultBlossomServerUrl();

  Future<String?> crateApiAccountGroupsGetDmGroupWithPeer({
    required String accountPubkey,
    required String peerPubkey,
  });

  Future<Group> crateApiGroupsGetGroup({
    required String accountPubkey,
    required String groupId,
  });

  Future<String?> crateApiGroupsGetGroupImagePath({
    required String accountPubkey,
    required String groupId,
  });

  Future<GroupInformation> crateApiGroupsGetGroupInformation({
    required String accountPubkey,
    required String groupId,
  });

  Future<GroupPushDebugInfo> crateApiNotificationsGetGroupPushDebugInfo({
    required String pubkey,
    required String groupId,
  });

  Future<List<GroupInformation>> crateApiGroupsGetGroupsInformations({
    required String accountPubkey,
    required List<String> groupIds,
  });

  Future<PushRegistration?> crateApiNotificationsGetPushRegistration({
    required String pubkey,
  });

  Future<RatchetTreeInfo> crateApiGroupsGetRatchetTreeInfo({
    required String accountPubkey,
    required String groupId,
  });

  Future<User> crateApiUsersGetUser({
    required String pubkey,
    required bool blockingDataSync,
  });

  Future<List<String>> crateApiGroupsGroupAdmins({
    required String pubkey,
    required String groupId,
  });

  Future<GroupType> crateApiGroupsGroupGroupType({
    required Group that,
    required String accountPubkey,
  });

  Future<GroupId> crateApiUtilsGroupIdFromString({required String groupId});

  Future<String> crateApiUtilsGroupIdToString({required GroupId groupId});

  Future<bool> crateApiGroupsGroupIsDirectMessageType({
    required Group that,
    required String accountPubkey,
  });

  Future<bool> crateApiGroupsGroupIsGroupType({
    required Group that,
    required String accountPubkey,
  });

  Future<List<String>> crateApiGroupsGroupMembers({
    required String pubkey,
    required String groupId,
  });

  Future<List<RequiredProposal>> crateApiGroupsGroupRequiredProposals({
    required String accountPubkey,
    required String groupId,
  });

  Future<void> crateApiGroupsGroupUpdateGroupData({
    required Group that,
    required String accountPubkey,
    required FlutterGroupDataUpdate groupData,
  });

  String crateApiUtilsHexPubkeyFromNpub({required String npub});

  Future<void> crateApiInitializeWhitenoise({required WhitenoiseConfig config});

  Future<bool> crateApiAccountsIsFollowingUser({
    required String accountPubkey,
    required String userPubkey,
  });

  Future<bool> crateApiMuteListIsUserBlocked({
    required String accountPubkey,
    required String targetPubkey,
  });

  Language crateApiUtilsLanguageChineseSimplified();

  Language crateApiUtilsLanguageChineseTraditional();

  Language crateApiUtilsLanguageEnglish();

  Language crateApiUtilsLanguageFrench();

  Language crateApiUtilsLanguageGerman();

  Language crateApiUtilsLanguageItalian();

  Language crateApiUtilsLanguagePortuguese();

  Language crateApiUtilsLanguageRussian();

  Language crateApiUtilsLanguageSpanish();

  Language crateApiUtilsLanguageSystem();

  String crateApiUtilsLanguageToString({required Language language});

  Language crateApiUtilsLanguageTurkish();

  Future<void> crateApiGroupsLeaveAndDeleteGroup({
    required String accountPubkey,
    required String groupId,
  });

  Future<void> crateApiGroupsLeaveGroup({
    required String pubkey,
    required String groupId,
  });

  Future<Draft?> crateApiDraftsLoadDraft({
    required String pubkey,
    required String groupId,
  });

  Future<void> crateApiAccountsLoginCancel({required String pubkey});

  Future<LoginResult> crateApiSignerLoginExternalSignerPublishDefaultRelays({
    required String pubkey,
  });

  Future<LoginResult> crateApiSignerLoginExternalSignerStart({
    required String pubkey,
    required FutureOr<String> Function(String) signEvent,
    required FutureOr<String> Function(String, String) nip04Encrypt,
    required FutureOr<String> Function(String, String) nip04Decrypt,
    required FutureOr<String> Function(String, String) nip44Encrypt,
    required FutureOr<String> Function(String, String) nip44Decrypt,
  });

  Future<LoginResult> crateApiSignerLoginExternalSignerWithCustomRelay({
    required String pubkey,
    required String relayUrl,
  });

  Future<LoginResult> crateApiAccountsLoginPublishDefaultRelays({
    required String pubkey,
  });

  Future<LoginResult> crateApiAccountsLoginStart({
    required String nsecOrHexPrivkey,
  });

  Future<LoginResult> crateApiAccountsLoginWithCustomRelay({
    required String pubkey,
    required String relayUrl,
  });

  Future<void> crateApiAccountsLogout({required String pubkey});

  Future<AccountGroup> crateApiAccountGroupsMarkMessageRead({
    required String accountPubkey,
    required String messageId,
  });

  Future<void> crateApiChatListMuteChat({
    required String accountPubkey,
    required String mlsGroupId,
    required ChatMuteDuration duration,
  });

  String crateApiUtilsNpubFromHexPubkey({required String hexPubkey});

  Future<void> crateApiAccountsPublishAccountKeyPackage({
    required String accountPubkey,
  });

  Future<void> crateApiSignerRegisterExternalSigner({
    required String pubkey,
    required FutureOr<String> Function(String) signEvent,
    required FutureOr<String> Function(String, String) nip04Encrypt,
    required FutureOr<String> Function(String, String) nip04Decrypt,
    required FutureOr<String> Function(String, String) nip44Encrypt,
    required FutureOr<String> Function(String, String) nip44Decrypt,
  });

  Future<void> crateApiReinitializeWhitenoise();

  Future<RelayType> crateApiRelaysRelayTypeInbox();

  Future<RelayType> crateApiRelaysRelayTypeKeyPackage();

  Future<RelayType> crateApiRelaysRelayTypeNip65();

  Future<RelayUrl> crateApiUtilsRelayUrlFromString({required String url});

  Future<void> crateApiAccountsRemoveAccountRelay({
    required String pubkey,
    required String url,
    required RelayType relayType,
  });

  Future<void> crateApiGroupsRemoveMembersFromGroup({
    required String pubkey,
    required String groupId,
    required List<String> memberPubkeys,
  });

  Future<void> crateApiAccountsRestoreDefaultRelays({required String pubkey});

  Future<void> crateApiLifecycleResumeAfterBackground();

  Future<void> crateApiMessagesRetryMessagePublish({
    required String pubkey,
    required String groupId,
    required String eventId,
  });

  Future<Draft> crateApiDraftsSaveDraft({
    required String pubkey,
    required String groupId,
    required String content,
    String? replyToId,
    required List<MediaFile> mediaAttachments,
  });

  Future<List<SearchResult>> crateApiMessagesSearchMessages({
    required String pubkey,
    required String query,
    int? limit,
  });

  Future<List<SearchResult>> crateApiMessagesSearchMessagesInGroup({
    required String pubkey,
    required String groupId,
    required String query,
    int? limit,
  });

  Stream<UserSearchUpdate> crateApiUserSearchSearchUsers({
    required String accountPubkey,
    required String query,
    required int radiusStart,
    required int radiusEnd,
  });

  Future<void> crateApiGroupsSelfDemote({
    required String pubkey,
    required String groupId,
  });

  Future<void> crateApiBugReportSendBugReport({
    required String whatWentWrong,
    String? expectedBehavior,
    String? stepsToReproduce,
    String? frequency,
    String? npub,
    String? logs,
    required String appVersion,
    required String platform,
    required String osVersion,
  });

  Future<MessageWithTokens> crateApiMessagesSendMessageToGroup({
    required String pubkey,
    required String groupId,
    required String message,
    required int kind,
    List<Tag>? tags,
  });

  Future<void> crateApiChatListSetChatPinOrder({
    required String accountPubkey,
    required String mlsGroupId,
    PlatformInt64? pinOrder,
  });

  Future<String> crateApiUtilsStringFromRelayUrl({required RelayUrl relayUrl});

  Stream<ChatListStreamItem> crateApiChatListSubscribeToArchivedChatList({
    required String accountPubkey,
  });

  Stream<ChatListStreamItem> crateApiChatListSubscribeToChatList({
    required String accountPubkey,
  });

  Stream<MessageStreamItem> crateApiMessagesSubscribeToGroupMessages({
    String? pubkey,
    required String groupId,
  });

  Stream<GroupStateUpdate> crateApiGroupStateSubscribeToGroupState({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Stream<NotificationUpdate> crateApiNotificationsSubscribeToNotifications();

  Stream<String> crateApiLogsSubscribeToRustLogs({required String logsBaseDir});

  Stream<UserStreamItem> crateApiUsersSubscribeToUser({required String pubkey});

  Future<Tag> crateApiUtilsTagFromVec({required List<String> vec});

  ThemeMode crateApiUtilsThemeModeDark();

  ThemeMode crateApiUtilsThemeModeLight();

  ThemeMode crateApiUtilsThemeModeSystem();

  String crateApiUtilsThemeModeToString({required ThemeMode themeMode});

  Future<void> crateApiAccountGroupsUnarchiveChat({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Future<void> crateApiMuteListUnblockUser({
    required String accountPubkey,
    required String targetPubkey,
  });

  Future<void> crateApiAccountsUnfollowUser({
    required String accountPubkey,
    required String userToUnfollowPubkey,
  });

  Future<void> crateApiChatListUnmuteChat({
    required String accountPubkey,
    required String mlsGroupId,
  });

  Future<void> crateApiAccountsUpdateAccountMetadata({
    required String pubkey,
    required FlutterMetadata metadata,
  });

  Future<void> crateApiUpdateLanguage({required Language language});

  Future<AccountSettings> crateApiAccountsUpdateNotificationsEnabled({
    required String pubkey,
    required bool enabled,
  });

  Future<void> crateApiUpdateThemeMode({required ThemeMode themeMode});

  Future<String> crateApiAccountsUploadAccountProfilePicture({
    required String pubkey,
    required String serverUrl,
    required String filePath,
    required String imageType,
  });

  Future<MediaFile> crateApiMediaFilesUploadChatMedia({
    required String accountPubkey,
    required String groupId,
    required String filePath,
  });

  Future<UploadGroupImageResult> crateApiGroupsUploadGroupImage({
    required String accountPubkey,
    required String groupId,
    required String filePath,
    required String serverUrl,
  });

  Future<PushRegistration> crateApiNotificationsUpsertPushRegistration({
    required String pubkey,
    required PushPlatform platform,
    required String rawToken,
    required String serverPubkey,
    String? relayHint,
  });

  Future<KeyPackageStatus> crateApiUsersUserHasKeyPackage({
    required String pubkey,
    required bool blockingDataSync,
  });

  Future<FlutterMetadata> crateApiUsersUserMetadata({
    required String pubkey,
    required bool blockingDataSync,
  });

  Future<List<Relay>> crateApiUsersUserRelays({
    required String pubkey,
    required RelayType relayType,
    required bool blockingDataSync,
  });

  Future<List<GroupWithInfoAndMembership>> crateApiGroupsVisibleGroupsWithInfo({
    required String accountPubkey,
  });

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_AppSettings;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_AppSettings;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_AppSettingsPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_DartSigner;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_DartSigner;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_DartSignerPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_GroupId;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_GroupId;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_GroupIdPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Language;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Language;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_LanguagePtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_PublicKey;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_PublicKey;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_PublicKeyPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RelayType;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RelayType;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RelayTypePtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RelayUrl;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RelayUrl;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RelayUrlPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Tag;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Tag;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_TagPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_ThemeMode;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_ThemeMode;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ThemeModePtr;
}

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

  @override
  Future<DartSigner> crateApiSignerDartSignerNew({
    required PublicKey pubkey,
    required FutureOr<String> Function(String) signEvent,
    required FutureOr<String> Function(String, String) nip04Encrypt,
    required FutureOr<String> Function(String, String) nip04Decrypt,
    required FutureOr<String> Function(String, String) nip44Encrypt,
    required FutureOr<String> Function(String, String) nip44Decrypt,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
            pubkey,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_Output_String_AnyhowException(
            signEvent,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip04Encrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip04Decrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip44Encrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip44Decrypt,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 1,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiSignerDartSignerNewConstMeta,
        argValues: [
          pubkey,
          signEvent,
          nip04Encrypt,
          nip04Decrypt,
          nip44Encrypt,
          nip44Decrypt,
        ],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSignerDartSignerNewConstMeta => const TaskConstMeta(
    debugName: 'DartSigner_new',
    argNames: [
      'pubkey',
      'signEvent',
      'nip04Encrypt',
      'nip04Decrypt',
      'nip44Encrypt',
      'nip44Decrypt',
    ],
  );

  @override
  Future<AccountGroup> crateApiAccountGroupsAcceptAccountGroup({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 2,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsAcceptAccountGroupConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsAcceptAccountGroupConstMeta => const TaskConstMeta(
    debugName: 'accept_account_group',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

  @override
  Future<List<User>> crateApiAccountsAccountFollows({required String pubkey}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 3,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_user,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsAccountFollowsConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsAccountFollowsConstMeta => const TaskConstMeta(
    debugName: 'account_follows',
    argNames: ['pubkey'],
  );

  @override
  Future<FlutterEvent?> crateApiAccountsAccountKeyPackage({
    required String pubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 4,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_flutter_event,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsAccountKeyPackageConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsAccountKeyPackageConstMeta => const TaskConstMeta(
    debugName: 'account_key_package',
    argNames: ['pubkey'],
  );

  @override
  Future<List<FlutterEvent>> crateApiAccountsAccountKeyPackages({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 5,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_flutter_event,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsAccountKeyPackagesConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsAccountKeyPackagesConstMeta => const TaskConstMeta(
    debugName: 'account_key_packages',
    argNames: ['accountPubkey'],
  );

  @override
  Future<List<Relay>> crateApiAccountsAccountRelays({
    required String pubkey,
    required RelayType relayType,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
            relayType,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 6,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_relay,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsAccountRelaysConstMeta,
        argValues: [pubkey, relayType],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsAccountRelaysConstMeta => const TaskConstMeta(
    debugName: 'account_relays',
    argNames: ['pubkey', 'relayType'],
  );

  @override
  Future<AccountSettings> crateApiAccountsAccountSettings({
    required String pubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 7,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account_settings,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsAccountSettingsConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsAccountSettingsConstMeta => const TaskConstMeta(
    debugName: 'account_settings',
    argNames: ['pubkey'],
  );

  @override
  Future<List<Group>> crateApiGroupsActiveGroups({required String pubkey}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 8,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsActiveGroupsConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsActiveGroupsConstMeta => const TaskConstMeta(
    debugName: 'active_groups',
    argNames: ['pubkey'],
  );

  @override
  Future<void> crateApiAccountsAddAccountRelay({
    required String pubkey,
    required String url,
    required RelayType relayType,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(url, serializer);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
            relayType,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 9,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsAddAccountRelayConstMeta,
        argValues: [pubkey, url, relayType],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsAddAccountRelayConstMeta => const TaskConstMeta(
    debugName: 'add_account_relay',
    argNames: ['pubkey', 'url', 'relayType'],
  );

  @override
  Future<void> crateApiGroupsAddMembersToGroup({
    required String pubkey,
    required String groupId,
    required List<String> memberPubkeys,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_list_String(memberPubkeys, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 10,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsAddMembersToGroupConstMeta,
        argValues: [pubkey, groupId, memberPubkeys],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsAddMembersToGroupConstMeta => const TaskConstMeta(
    debugName: 'add_members_to_group',
    argNames: ['pubkey', 'groupId', 'memberPubkeys'],
  );

  @override
  Future<String> crateApiErrorApiErrorErrorType({required ApiError that}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_api_error(that, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 11,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiErrorApiErrorErrorTypeConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiErrorApiErrorErrorTypeConstMeta => const TaskConstMeta(
    debugName: 'api_error_error_type',
    argNames: ['that'],
  );

  @override
  Future<String> crateApiErrorApiErrorMessageText({required ApiError that}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_api_error(that, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 12,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiErrorApiErrorMessageTextConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiErrorApiErrorMessageTextConstMeta => const TaskConstMeta(
    debugName: 'api_error_message_text',
    argNames: ['that'],
  );

  @override
  Future<Language> crateApiAppSettingsLanguage({
    required AppSettings appSettings,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
            appSettings,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 13,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAppSettingsLanguageConstMeta,
        argValues: [appSettings],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAppSettingsLanguageConstMeta => const TaskConstMeta(
    debugName: 'app_settings_language',
    argNames: ['appSettings'],
  );

  @override
  Future<ThemeMode> crateApiAppSettingsThemeMode({
    required AppSettings appSettings,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
            appSettings,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 14,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAppSettingsThemeModeConstMeta,
        argValues: [appSettings],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAppSettingsThemeModeConstMeta => const TaskConstMeta(
    debugName: 'app_settings_theme_mode',
    argNames: ['appSettings'],
  );

  @override
  Future<void> crateApiAccountGroupsArchiveChat({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 15,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsArchiveChatConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsArchiveChatConstMeta => const TaskConstMeta(
    debugName: 'archive_chat',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

  @override
  Future<void> crateApiMuteListBlockUser({
    required String accountPubkey,
    required String targetPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(targetPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 16,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMuteListBlockUserConstMeta,
        argValues: [accountPubkey, targetPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMuteListBlockUserConstMeta => const TaskConstMeta(
    debugName: 'block_user',
    argNames: ['accountPubkey', 'targetPubkey'],
  );

  @override
  Future<void> crateApiGroupsClearChat({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 17,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsClearChatConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsClearChatConstMeta => const TaskConstMeta(
    debugName: 'clear_chat',
    argNames: ['accountPubkey', 'groupId'],
  );

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

  TaskConstMeta get kCrateApiNotificationsClearPushRegistrationConstMeta => const TaskConstMeta(
    debugName: 'clear_push_registration',
    argNames: ['pubkey'],
  );

  @override
  Future<Group> crateApiGroupsCreateGroup({
    required String creatorPubkey,
    required List<String> memberPubkeys,
    required List<String> adminPubkeys,
    required String groupName,
    required String groupDescription,
    required GroupType groupType,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(creatorPubkey, serializer);
          sse_encode_list_String(memberPubkeys, serializer);
          sse_encode_list_String(adminPubkeys, serializer);
          sse_encode_String(groupName, serializer);
          sse_encode_String(groupDescription, serializer);
          sse_encode_group_type(groupType, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 19,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsCreateGroupConstMeta,
        argValues: [
          creatorPubkey,
          memberPubkeys,
          adminPubkeys,
          groupName,
          groupDescription,
          groupType,
        ],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsCreateGroupConstMeta => const TaskConstMeta(
    debugName: 'create_group',
    argNames: [
      'creatorPubkey',
      'memberPubkeys',
      'adminPubkeys',
      'groupName',
      'groupDescription',
      'groupType',
    ],
  );

  @override
  Future<Account> crateApiAccountsCreateIdentity() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 20,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsCreateIdentityConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsCreateIdentityConstMeta => const TaskConstMeta(
    debugName: 'create_identity',
    argNames: [],
  );

  @override
  Future<WhitenoiseConfig> crateApiCreateWhitenoiseConfig({
    required String dataDir,
    required String logsDir,
    List<String>? defaultRelayUrls,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(dataDir, serializer);
          sse_encode_String(logsDir, serializer);
          sse_encode_opt_list_String(defaultRelayUrls, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 21,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_whitenoise_config,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiCreateWhitenoiseConfigConstMeta,
        argValues: [dataDir, logsDir, defaultRelayUrls],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiCreateWhitenoiseConfigConstMeta => const TaskConstMeta(
    debugName: 'create_whitenoise_config',
    argNames: ['dataDir', 'logsDir', 'defaultRelayUrls'],
  );

  @override
  Future<String> crateApiRelaysDebugRelayControlState() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 22,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiRelaysDebugRelayControlStateConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiRelaysDebugRelayControlStateConstMeta => const TaskConstMeta(
    debugName: 'debug_relay_control_state',
    argNames: [],
  );

  @override
  Future<AccountGroup> crateApiAccountGroupsDeclineAccountGroup({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 23,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsDeclineAccountGroupConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsDeclineAccountGroupConstMeta => const TaskConstMeta(
    debugName: 'decline_account_group',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

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

  TaskConstMeta get kCrateApiRelayDefaultsDefaultRelayUrlsConstMeta => const TaskConstMeta(
    debugName: 'default_relay_urls',
    argNames: [],
  );

  @override
  Future<List<RelayUrl>> crateApiRelayDefaultsDefaultRelayUrlsParsed() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 25,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiRelayDefaultsDefaultRelayUrlsParsedConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiRelayDefaultsDefaultRelayUrlsParsedConstMeta => const TaskConstMeta(
    debugName: 'default_relay_urls_parsed',
    argNames: [],
  );

  @override
  Future<bool> crateApiAccountsDeleteAccountKeyPackage({
    required String accountPubkey,
    required String keyPackageId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(keyPackageId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 26,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsDeleteAccountKeyPackageConstMeta,
        argValues: [accountPubkey, keyPackageId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsDeleteAccountKeyPackageConstMeta => const TaskConstMeta(
    debugName: 'delete_account_key_package',
    argNames: ['accountPubkey', 'keyPackageId'],
  );

  @override
  Future<BigInt> crateApiAccountsDeleteAccountKeyPackages({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 27,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_usize,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsDeleteAccountKeyPackagesConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsDeleteAccountKeyPackagesConstMeta => const TaskConstMeta(
    debugName: 'delete_account_key_packages',
    argNames: ['accountPubkey'],
  );

  @override
  Future<BigInt> crateApiAccountsDeleteAllAccountKeyPackages({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 28,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_usize,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsDeleteAllAccountKeyPackagesConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsDeleteAllAccountKeyPackagesConstMeta => const TaskConstMeta(
    debugName: 'delete_all_account_key_packages',
    argNames: ['accountPubkey'],
  );

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

  TaskConstMeta get kCrateApiDeleteAllDataConstMeta => const TaskConstMeta(
    debugName: 'delete_all_data',
    argNames: [],
  );

  @override
  Future<void> crateApiGroupsDeleteChat({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 30,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsDeleteChatConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsDeleteChatConstMeta => const TaskConstMeta(
    debugName: 'delete_chat',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<void> crateApiDraftsDeleteDraft({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 31,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiDraftsDeleteDraftConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiDraftsDeleteDraftConstMeta => const TaskConstMeta(
    debugName: 'delete_draft',
    argNames: ['pubkey', 'groupId'],
  );

  @override
  Future<MediaFile> crateApiMediaFilesDownloadChatMedia({
    required String accountPubkey,
    required String groupId,
    required String originalFileHash,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(originalFileHash, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 32,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_media_file,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMediaFilesDownloadChatMediaConstMeta,
        argValues: [accountPubkey, groupId, originalFileHash],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMediaFilesDownloadChatMediaConstMeta => const TaskConstMeta(
    debugName: 'download_chat_media',
    argNames: ['accountPubkey', 'groupId', 'originalFileHash'],
  );

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

  TaskConstMeta get kCrateApiRelaysEnsureAllSubscriptionsConstMeta => const TaskConstMeta(
    debugName: 'ensure_all_subscriptions',
    argNames: [],
  );

  @override
  String crateApiUtilsEventIdToNeventUri({
    required String eventIdHex,
    required String pubkeyHex,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(eventIdHex, serializer);
          sse_encode_String(pubkeyHex, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 34)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUtilsEventIdToNeventUriConstMeta,
        argValues: [eventIdHex, pubkeyHex],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsEventIdToNeventUriConstMeta => const TaskConstMeta(
    debugName: 'event_id_to_nevent_uri',
    argNames: ['eventIdHex', 'pubkeyHex'],
  );

  @override
  Future<String> crateApiAccountsExportAccountNsec({required String pubkey}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 35,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsExportAccountNsecConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsExportAccountNsecConstMeta => const TaskConstMeta(
    debugName: 'export_account_nsec',
    argNames: ['pubkey'],
  );

  @override
  Future<List<ChatMessage>> crateApiMessagesFetchAggregatedMessagesForGroup({
    required String pubkey,
    required String groupId,
    DateTime? before,
    String? beforeMessageId,
    int? limit,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_opt_box_autoadd_Chrono_Utc(before, serializer);
          sse_encode_opt_String(beforeMessageId, serializer);
          sse_encode_opt_box_autoadd_u_32(limit, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 36,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_chat_message,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesFetchAggregatedMessagesForGroupConstMeta,
        argValues: [pubkey, groupId, before, beforeMessageId, limit],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesFetchAggregatedMessagesForGroupConstMeta =>
      const TaskConstMeta(
        debugName: 'fetch_aggregated_messages_for_group',
        argNames: ['pubkey', 'groupId', 'before', 'beforeMessageId', 'limit'],
      );

  @override
  Future<List<ChatSummary>> crateApiChatListFetchArchivedChatListSnapshot({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 37,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_chat_summary,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatListFetchArchivedChatListSnapshotConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatListFetchArchivedChatListSnapshotConstMeta => const TaskConstMeta(
    debugName: 'fetch_archived_chat_list_snapshot',
    argNames: ['accountPubkey'],
  );

  @override
  Future<List<ChatSummary>> crateApiChatListFetchChatListSnapshot({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 38,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_chat_summary,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatListFetchChatListSnapshotConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatListFetchChatListSnapshotConstMeta => const TaskConstMeta(
    debugName: 'fetch_chat_list_snapshot',
    argNames: ['accountPubkey'],
  );

  @override
  Future<String?> crateApiZapstoreFetchLatestZapstoreVersion() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 39,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiZapstoreFetchLatestZapstoreVersionConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiZapstoreFetchLatestZapstoreVersionConstMeta => const TaskConstMeta(
    debugName: 'fetch_latest_zapstore_version',
    argNames: [],
  );

  @override
  Future<ChatMessage?> crateApiMessagesFetchMessageById({
    required String pubkey,
    required String groupId,
    required String messageId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(messageId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 40,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_chat_message,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesFetchMessageByIdConstMeta,
        argValues: [pubkey, groupId, messageId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesFetchMessageByIdConstMeta => const TaskConstMeta(
    debugName: 'fetch_message_by_id',
    argNames: ['pubkey', 'groupId', 'messageId'],
  );

  @override
  Future<List<ChatMessage>> crateApiMessagesFetchMessagesUnreadWithMinimum({
    required String pubkey,
    required String groupId,
    int? minimum,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_opt_box_autoadd_u_32(minimum, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 41,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_chat_message,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesFetchMessagesUnreadWithMinimumConstMeta,
        argValues: [pubkey, groupId, minimum],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesFetchMessagesUnreadWithMinimumConstMeta => const TaskConstMeta(
    debugName: 'fetch_messages_unread_with_minimum',
    argNames: ['pubkey', 'groupId', 'minimum'],
  );

  @override
  Future<void> crateApiAccountsFollowUser({
    required String accountPubkey,
    required String userToFollowPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(userToFollowPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 42,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsFollowUserConstMeta,
        argValues: [accountPubkey, userToFollowPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsFollowUserConstMeta => const TaskConstMeta(
    debugName: 'follow_user',
    argNames: ['accountPubkey', 'userToFollowPubkey'],
  );

  @override
  Future<Account> crateApiAccountsGetAccount({required String pubkey}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 43,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsGetAccountConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsGetAccountConstMeta => const TaskConstMeta(
    debugName: 'get_account',
    argNames: ['pubkey'],
  );

  @override
  Future<AccountGroup> crateApiAccountGroupsGetAccountGroup({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 44,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsGetAccountGroupConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsGetAccountGroupConstMeta => const TaskConstMeta(
    debugName: 'get_account_group',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

  @override
  Future<List<Account>> crateApiAccountsGetAccounts() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 45,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_account,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsGetAccountsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsGetAccountsConstMeta => const TaskConstMeta(
    debugName: 'get_accounts',
    argNames: [],
  );

  @override
  Future<AppSettings> crateApiGetAppSettings() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 46,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGetAppSettingsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGetAppSettingsConstMeta => const TaskConstMeta(
    debugName: 'get_app_settings',
    argNames: [],
  );

  @override
  Future<List<MuteListEntry>> crateApiMuteListGetBlockedUsers({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 47,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_mute_list_entry,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMuteListGetBlockedUsersConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMuteListGetBlockedUsersConstMeta => const TaskConstMeta(
    debugName: 'get_blocked_users',
    argNames: ['accountPubkey'],
  );

  @override
  Future<List<ChatSummary>> crateApiChatListGetChatList({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 48,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_chat_summary,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatListGetChatListConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatListGetChatListConstMeta => const TaskConstMeta(
    debugName: 'get_chat_list',
    argNames: ['accountPubkey'],
  );

  @override
  Future<ChatSummary> crateApiChatSummaryGetChatSummary({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 49,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_chat_summary,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatSummaryGetChatSummaryConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatSummaryGetChatSummaryConstMeta => const TaskConstMeta(
    debugName: 'get_chat_summary',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

  @override
  Future<String> crateApiUtilsGetDefaultBlossomServerUrl() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 50,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsGetDefaultBlossomServerUrlConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsGetDefaultBlossomServerUrlConstMeta => const TaskConstMeta(
    debugName: 'get_default_blossom_server_url',
    argNames: [],
  );

  @override
  Future<String?> crateApiAccountGroupsGetDmGroupWithPeer({
    required String accountPubkey,
    required String peerPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(peerPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 51,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsGetDmGroupWithPeerConstMeta,
        argValues: [accountPubkey, peerPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsGetDmGroupWithPeerConstMeta => const TaskConstMeta(
    debugName: 'get_dm_group_with_peer',
    argNames: ['accountPubkey', 'peerPubkey'],
  );

  @override
  Future<Group> crateApiGroupsGetGroup({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 52,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGetGroupConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGetGroupConstMeta => const TaskConstMeta(
    debugName: 'get_group',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<String?> crateApiGroupsGetGroupImagePath({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 53,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGetGroupImagePathConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGetGroupImagePathConstMeta => const TaskConstMeta(
    debugName: 'get_group_image_path',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<GroupInformation> crateApiGroupsGetGroupInformation({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 54,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_group_information,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGetGroupInformationConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGetGroupInformationConstMeta => const TaskConstMeta(
    debugName: 'get_group_information',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<GroupPushDebugInfo> crateApiNotificationsGetGroupPushDebugInfo({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 55,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_group_push_debug_info,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiNotificationsGetGroupPushDebugInfoConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiNotificationsGetGroupPushDebugInfoConstMeta => const TaskConstMeta(
    debugName: 'get_group_push_debug_info',
    argNames: ['pubkey', 'groupId'],
  );

  @override
  Future<List<GroupInformation>> crateApiGroupsGetGroupsInformations({
    required String accountPubkey,
    required List<String> groupIds,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_list_String(groupIds, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 56,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_group_information,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGetGroupsInformationsConstMeta,
        argValues: [accountPubkey, groupIds],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGetGroupsInformationsConstMeta => const TaskConstMeta(
    debugName: 'get_groups_informations',
    argNames: ['accountPubkey', 'groupIds'],
  );

  @override
  Future<PushRegistration?> crateApiNotificationsGetPushRegistration({
    required String pubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 57,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_push_registration,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiNotificationsGetPushRegistrationConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiNotificationsGetPushRegistrationConstMeta => const TaskConstMeta(
    debugName: 'get_push_registration',
    argNames: ['pubkey'],
  );

  @override
  Future<RatchetTreeInfo> crateApiGroupsGetRatchetTreeInfo({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 58,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_ratchet_tree_info,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGetRatchetTreeInfoConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGetRatchetTreeInfoConstMeta => const TaskConstMeta(
    debugName: 'get_ratchet_tree_info',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<User> crateApiUsersGetUser({
    required String pubkey,
    required bool blockingDataSync,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_bool(blockingDataSync, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 59,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_user,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUsersGetUserConstMeta,
        argValues: [pubkey, blockingDataSync],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUsersGetUserConstMeta => const TaskConstMeta(
    debugName: 'get_user',
    argNames: ['pubkey', 'blockingDataSync'],
  );

  @override
  Future<List<String>> crateApiGroupsGroupAdmins({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 60,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupAdminsConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupAdminsConstMeta => const TaskConstMeta(
    debugName: 'group_admins',
    argNames: ['pubkey', 'groupId'],
  );

  @override
  Future<GroupType> crateApiGroupsGroupGroupType({
    required Group that,
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_group(that, serializer);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 61,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_group_type,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupGroupTypeConstMeta,
        argValues: [that, accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupGroupTypeConstMeta => const TaskConstMeta(
    debugName: 'group_group_type',
    argNames: ['that', 'accountPubkey'],
  );

  @override
  Future<GroupId> crateApiUtilsGroupIdFromString({required String groupId}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 62,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUtilsGroupIdFromStringConstMeta,
        argValues: [groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsGroupIdFromStringConstMeta => const TaskConstMeta(
    debugName: 'group_id_from_string',
    argNames: ['groupId'],
  );

  @override
  Future<String> crateApiUtilsGroupIdToString({required GroupId groupId}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
            groupId,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 63,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsGroupIdToStringConstMeta,
        argValues: [groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsGroupIdToStringConstMeta => const TaskConstMeta(
    debugName: 'group_id_to_string',
    argNames: ['groupId'],
  );

  @override
  Future<bool> crateApiGroupsGroupIsDirectMessageType({
    required Group that,
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_group(that, serializer);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 64,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupIsDirectMessageTypeConstMeta,
        argValues: [that, accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupIsDirectMessageTypeConstMeta => const TaskConstMeta(
    debugName: 'group_is_direct_message_type',
    argNames: ['that', 'accountPubkey'],
  );

  @override
  Future<bool> crateApiGroupsGroupIsGroupType({
    required Group that,
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_group(that, serializer);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 65,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupIsGroupTypeConstMeta,
        argValues: [that, accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupIsGroupTypeConstMeta => const TaskConstMeta(
    debugName: 'group_is_group_type',
    argNames: ['that', 'accountPubkey'],
  );

  @override
  Future<List<String>> crateApiGroupsGroupMembers({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 66,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupMembersConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupMembersConstMeta => const TaskConstMeta(
    debugName: 'group_members',
    argNames: ['pubkey', 'groupId'],
  );

  @override
  Future<List<RequiredProposal>> crateApiGroupsGroupRequiredProposals({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 67,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_required_proposal,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupRequiredProposalsConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupRequiredProposalsConstMeta => const TaskConstMeta(
    debugName: 'group_required_proposals',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<void> crateApiGroupsGroupUpdateGroupData({
    required Group that,
    required String accountPubkey,
    required FlutterGroupDataUpdate groupData,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_group(that, serializer);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_box_autoadd_flutter_group_data_update(
            groupData,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 68,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsGroupUpdateGroupDataConstMeta,
        argValues: [that, accountPubkey, groupData],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsGroupUpdateGroupDataConstMeta => const TaskConstMeta(
    debugName: 'group_update_group_data',
    argNames: ['that', 'accountPubkey', 'groupData'],
  );

  @override
  String crateApiUtilsHexPubkeyFromNpub({required String npub}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(npub, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 69)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUtilsHexPubkeyFromNpubConstMeta,
        argValues: [npub],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsHexPubkeyFromNpubConstMeta => const TaskConstMeta(
    debugName: 'hex_pubkey_from_npub',
    argNames: ['npub'],
  );

  @override
  Future<void> crateApiInitializeWhitenoise({
    required WhitenoiseConfig config,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_whitenoise_config(config, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 70,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiInitializeWhitenoiseConstMeta,
        argValues: [config],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiInitializeWhitenoiseConstMeta => const TaskConstMeta(
    debugName: 'initialize_whitenoise',
    argNames: ['config'],
  );

  @override
  Future<bool> crateApiAccountsIsFollowingUser({
    required String accountPubkey,
    required String userPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(userPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 71,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsIsFollowingUserConstMeta,
        argValues: [accountPubkey, userPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsIsFollowingUserConstMeta => const TaskConstMeta(
    debugName: 'is_following_user',
    argNames: ['accountPubkey', 'userPubkey'],
  );

  @override
  Future<bool> crateApiMuteListIsUserBlocked({
    required String accountPubkey,
    required String targetPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(targetPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 72,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMuteListIsUserBlockedConstMeta,
        argValues: [accountPubkey, targetPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMuteListIsUserBlockedConstMeta => const TaskConstMeta(
    debugName: 'is_user_blocked',
    argNames: ['accountPubkey', 'targetPubkey'],
  );

  @override
  Language crateApiUtilsLanguageChineseSimplified() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 73)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageChineseSimplifiedConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageChineseSimplifiedConstMeta => const TaskConstMeta(
    debugName: 'language_chinese_simplified',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageChineseTraditional() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 74)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageChineseTraditionalConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageChineseTraditionalConstMeta => const TaskConstMeta(
    debugName: 'language_chinese_traditional',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageEnglish() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 75)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageEnglishConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageEnglishConstMeta => const TaskConstMeta(
    debugName: 'language_english',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageFrench() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 76)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageFrenchConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageFrenchConstMeta => const TaskConstMeta(
    debugName: 'language_french',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageGerman() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 77)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageGermanConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageGermanConstMeta => const TaskConstMeta(
    debugName: 'language_german',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageItalian() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 78)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageItalianConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageItalianConstMeta => const TaskConstMeta(
    debugName: 'language_italian',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguagePortuguese() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 79)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguagePortugueseConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguagePortugueseConstMeta => const TaskConstMeta(
    debugName: 'language_portuguese',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageRussian() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 80)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageRussianConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageRussianConstMeta => const TaskConstMeta(
    debugName: 'language_russian',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageSpanish() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 81)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageSpanishConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageSpanishConstMeta => const TaskConstMeta(
    debugName: 'language_spanish',
    argNames: [],
  );

  @override
  Language crateApiUtilsLanguageSystem() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 82)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageSystemConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageSystemConstMeta => const TaskConstMeta(
    debugName: 'language_system',
    argNames: [],
  );

  @override
  String crateApiUtilsLanguageToString({required Language language}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
            language,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 83)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageToStringConstMeta,
        argValues: [language],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageToStringConstMeta => const TaskConstMeta(
    debugName: 'language_to_string',
    argNames: ['language'],
  );

  @override
  Language crateApiUtilsLanguageTurkish() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 84)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsLanguageTurkishConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsLanguageTurkishConstMeta => const TaskConstMeta(
    debugName: 'language_turkish',
    argNames: [],
  );

  @override
  Future<void> crateApiGroupsLeaveAndDeleteGroup({
    required String accountPubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 85,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsLeaveAndDeleteGroupConstMeta,
        argValues: [accountPubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsLeaveAndDeleteGroupConstMeta => const TaskConstMeta(
    debugName: 'leave_and_delete_group',
    argNames: ['accountPubkey', 'groupId'],
  );

  @override
  Future<void> crateApiGroupsLeaveGroup({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 86,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsLeaveGroupConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsLeaveGroupConstMeta => const TaskConstMeta(
    debugName: 'leave_group',
    argNames: ['pubkey', 'groupId'],
  );

  @override
  Future<Draft?> crateApiDraftsLoadDraft({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 87,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_draft,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiDraftsLoadDraftConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiDraftsLoadDraftConstMeta => const TaskConstMeta(
    debugName: 'load_draft',
    argNames: ['pubkey', 'groupId'],
  );

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

  TaskConstMeta get kCrateApiAccountsLoginCancelConstMeta => const TaskConstMeta(
    debugName: 'login_cancel',
    argNames: ['pubkey'],
  );

  @override
  Future<LoginResult> crateApiSignerLoginExternalSignerPublishDefaultRelays({
    required String pubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 89,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_login_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiSignerLoginExternalSignerPublishDefaultRelaysConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSignerLoginExternalSignerPublishDefaultRelaysConstMeta =>
      const TaskConstMeta(
        debugName: 'login_external_signer_publish_default_relays',
        argNames: ['pubkey'],
      );

  @override
  Future<LoginResult> crateApiSignerLoginExternalSignerStart({
    required String pubkey,
    required FutureOr<String> Function(String) signEvent,
    required FutureOr<String> Function(String, String) nip04Encrypt,
    required FutureOr<String> Function(String, String) nip04Decrypt,
    required FutureOr<String> Function(String, String) nip44Encrypt,
    required FutureOr<String> Function(String, String) nip44Decrypt,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_DartFn_Inputs_String_Output_String_AnyhowException(
            signEvent,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip04Encrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip04Decrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip44Encrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip44Decrypt,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 90,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_login_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiSignerLoginExternalSignerStartConstMeta,
        argValues: [
          pubkey,
          signEvent,
          nip04Encrypt,
          nip04Decrypt,
          nip44Encrypt,
          nip44Decrypt,
        ],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSignerLoginExternalSignerStartConstMeta => const TaskConstMeta(
    debugName: 'login_external_signer_start',
    argNames: [
      'pubkey',
      'signEvent',
      'nip04Encrypt',
      'nip04Decrypt',
      'nip44Encrypt',
      'nip44Decrypt',
    ],
  );

  @override
  Future<LoginResult> crateApiSignerLoginExternalSignerWithCustomRelay({
    required String pubkey,
    required String relayUrl,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(relayUrl, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 91,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_login_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiSignerLoginExternalSignerWithCustomRelayConstMeta,
        argValues: [pubkey, relayUrl],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSignerLoginExternalSignerWithCustomRelayConstMeta =>
      const TaskConstMeta(
        debugName: 'login_external_signer_with_custom_relay',
        argNames: ['pubkey', 'relayUrl'],
      );

  @override
  Future<LoginResult> crateApiAccountsLoginPublishDefaultRelays({
    required String pubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 92,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_login_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsLoginPublishDefaultRelaysConstMeta,
        argValues: [pubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsLoginPublishDefaultRelaysConstMeta => const TaskConstMeta(
    debugName: 'login_publish_default_relays',
    argNames: ['pubkey'],
  );

  @override
  Future<LoginResult> crateApiAccountsLoginStart({
    required String nsecOrHexPrivkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(nsecOrHexPrivkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 93,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_login_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsLoginStartConstMeta,
        argValues: [nsecOrHexPrivkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsLoginStartConstMeta => const TaskConstMeta(
    debugName: 'login_start',
    argNames: ['nsecOrHexPrivkey'],
  );

  @override
  Future<LoginResult> crateApiAccountsLoginWithCustomRelay({
    required String pubkey,
    required String relayUrl,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(relayUrl, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 94,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_login_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsLoginWithCustomRelayConstMeta,
        argValues: [pubkey, relayUrl],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsLoginWithCustomRelayConstMeta => const TaskConstMeta(
    debugName: 'login_with_custom_relay',
    argNames: ['pubkey', 'relayUrl'],
  );

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

  TaskConstMeta get kCrateApiAccountsLogoutConstMeta => const TaskConstMeta(
    debugName: 'logout',
    argNames: ['pubkey'],
  );

  @override
  Future<AccountGroup> crateApiAccountGroupsMarkMessageRead({
    required String accountPubkey,
    required String messageId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(messageId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 96,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account_group,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsMarkMessageReadConstMeta,
        argValues: [accountPubkey, messageId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsMarkMessageReadConstMeta => const TaskConstMeta(
    debugName: 'mark_message_read',
    argNames: ['accountPubkey', 'messageId'],
  );

  @override
  Future<void> crateApiChatListMuteChat({
    required String accountPubkey,
    required String mlsGroupId,
    required ChatMuteDuration duration,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          sse_encode_box_autoadd_chat_mute_duration(duration, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 97,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatListMuteChatConstMeta,
        argValues: [accountPubkey, mlsGroupId, duration],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatListMuteChatConstMeta => const TaskConstMeta(
    debugName: 'mute_chat',
    argNames: ['accountPubkey', 'mlsGroupId', 'duration'],
  );

  @override
  String crateApiUtilsNpubFromHexPubkey({required String hexPubkey}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(hexPubkey, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 98)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUtilsNpubFromHexPubkeyConstMeta,
        argValues: [hexPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsNpubFromHexPubkeyConstMeta => const TaskConstMeta(
    debugName: 'npub_from_hex_pubkey',
    argNames: ['hexPubkey'],
  );

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

  TaskConstMeta get kCrateApiAccountsPublishAccountKeyPackageConstMeta => const TaskConstMeta(
    debugName: 'publish_account_key_package',
    argNames: ['accountPubkey'],
  );

  @override
  Future<void> crateApiSignerRegisterExternalSigner({
    required String pubkey,
    required FutureOr<String> Function(String) signEvent,
    required FutureOr<String> Function(String, String) nip04Encrypt,
    required FutureOr<String> Function(String, String) nip04Decrypt,
    required FutureOr<String> Function(String, String) nip44Encrypt,
    required FutureOr<String> Function(String, String) nip44Decrypt,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_DartFn_Inputs_String_Output_String_AnyhowException(
            signEvent,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip04Encrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip04Decrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip44Encrypt,
            serializer,
          );
          sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
            nip44Decrypt,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 100,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiSignerRegisterExternalSignerConstMeta,
        argValues: [
          pubkey,
          signEvent,
          nip04Encrypt,
          nip04Decrypt,
          nip44Encrypt,
          nip44Decrypt,
        ],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSignerRegisterExternalSignerConstMeta => const TaskConstMeta(
    debugName: 'register_external_signer',
    argNames: [
      'pubkey',
      'signEvent',
      'nip04Encrypt',
      'nip04Decrypt',
      'nip44Encrypt',
      'nip44Decrypt',
    ],
  );

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

  TaskConstMeta get kCrateApiReinitializeWhitenoiseConstMeta => const TaskConstMeta(
    debugName: 'reinitialize_whitenoise',
    argNames: [],
  );

  @override
  Future<RelayType> crateApiRelaysRelayTypeInbox() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 102,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiRelaysRelayTypeInboxConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiRelaysRelayTypeInboxConstMeta => const TaskConstMeta(
    debugName: 'relay_type_inbox',
    argNames: [],
  );

  @override
  Future<RelayType> crateApiRelaysRelayTypeKeyPackage() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 103,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiRelaysRelayTypeKeyPackageConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiRelaysRelayTypeKeyPackageConstMeta => const TaskConstMeta(
    debugName: 'relay_type_key_package',
    argNames: [],
  );

  @override
  Future<RelayType> crateApiRelaysRelayTypeNip65() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 104,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiRelaysRelayTypeNip65ConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiRelaysRelayTypeNip65ConstMeta => const TaskConstMeta(
    debugName: 'relay_type_nip65',
    argNames: [],
  );

  @override
  Future<RelayUrl> crateApiUtilsRelayUrlFromString({required String url}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(url, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 105,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUtilsRelayUrlFromStringConstMeta,
        argValues: [url],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsRelayUrlFromStringConstMeta => const TaskConstMeta(
    debugName: 'relay_url_from_string',
    argNames: ['url'],
  );

  @override
  Future<void> crateApiAccountsRemoveAccountRelay({
    required String pubkey,
    required String url,
    required RelayType relayType,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(url, serializer);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
            relayType,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 106,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsRemoveAccountRelayConstMeta,
        argValues: [pubkey, url, relayType],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsRemoveAccountRelayConstMeta => const TaskConstMeta(
    debugName: 'remove_account_relay',
    argNames: ['pubkey', 'url', 'relayType'],
  );

  @override
  Future<void> crateApiGroupsRemoveMembersFromGroup({
    required String pubkey,
    required String groupId,
    required List<String> memberPubkeys,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_list_String(memberPubkeys, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 107,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsRemoveMembersFromGroupConstMeta,
        argValues: [pubkey, groupId, memberPubkeys],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsRemoveMembersFromGroupConstMeta => const TaskConstMeta(
    debugName: 'remove_members_from_group',
    argNames: ['pubkey', 'groupId', 'memberPubkeys'],
  );

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

  TaskConstMeta get kCrateApiAccountsRestoreDefaultRelaysConstMeta => const TaskConstMeta(
    debugName: 'restore_default_relays',
    argNames: ['pubkey'],
  );

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

  TaskConstMeta get kCrateApiLifecycleResumeAfterBackgroundConstMeta => const TaskConstMeta(
    debugName: 'resume_after_background',
    argNames: [],
  );

  @override
  Future<void> crateApiMessagesRetryMessagePublish({
    required String pubkey,
    required String groupId,
    required String eventId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(eventId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 110,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesRetryMessagePublishConstMeta,
        argValues: [pubkey, groupId, eventId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesRetryMessagePublishConstMeta => const TaskConstMeta(
    debugName: 'retry_message_publish',
    argNames: ['pubkey', 'groupId', 'eventId'],
  );

  @override
  Future<Draft> crateApiDraftsSaveDraft({
    required String pubkey,
    required String groupId,
    required String content,
    String? replyToId,
    required List<MediaFile> mediaAttachments,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(content, serializer);
          sse_encode_opt_String(replyToId, serializer);
          sse_encode_list_media_file(mediaAttachments, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 111,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_draft,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiDraftsSaveDraftConstMeta,
        argValues: [pubkey, groupId, content, replyToId, mediaAttachments],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiDraftsSaveDraftConstMeta => const TaskConstMeta(
    debugName: 'save_draft',
    argNames: ['pubkey', 'groupId', 'content', 'replyToId', 'mediaAttachments'],
  );

  @override
  Future<List<SearchResult>> crateApiMessagesSearchMessages({
    required String pubkey,
    required String query,
    int? limit,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(query, serializer);
          sse_encode_opt_box_autoadd_u_32(limit, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 112,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_search_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesSearchMessagesConstMeta,
        argValues: [pubkey, query, limit],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesSearchMessagesConstMeta => const TaskConstMeta(
    debugName: 'search_messages',
    argNames: ['pubkey', 'query', 'limit'],
  );

  @override
  Future<List<SearchResult>> crateApiMessagesSearchMessagesInGroup({
    required String pubkey,
    required String groupId,
    required String query,
    int? limit,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(query, serializer);
          sse_encode_opt_box_autoadd_u_32(limit, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 113,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_search_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesSearchMessagesInGroupConstMeta,
        argValues: [pubkey, groupId, query, limit],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesSearchMessagesInGroupConstMeta => const TaskConstMeta(
    debugName: 'search_messages_in_group',
    argNames: ['pubkey', 'groupId', 'query', 'limit'],
  );

  @override
  Stream<UserSearchUpdate> crateApiUserSearchSearchUsers({
    required String accountPubkey,
    required String query,
    required int radiusStart,
    required int radiusEnd,
  }) {
    final sink = RustStreamSink<UserSearchUpdate>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_String(accountPubkey, serializer);
            sse_encode_String(query, serializer);
            sse_encode_u_8(radiusStart, serializer);
            sse_encode_u_8(radiusEnd, serializer);
            sse_encode_StreamSink_user_search_update_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 114,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiUserSearchSearchUsersConstMeta,
          argValues: [accountPubkey, query, radiusStart, radiusEnd, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiUserSearchSearchUsersConstMeta => const TaskConstMeta(
    debugName: 'search_users',
    argNames: [
      'accountPubkey',
      'query',
      'radiusStart',
      'radiusEnd',
      'sink',
    ],
  );

  @override
  Future<void> crateApiGroupsSelfDemote({
    required String pubkey,
    required String groupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 115,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsSelfDemoteConstMeta,
        argValues: [pubkey, groupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsSelfDemoteConstMeta => const TaskConstMeta(
    debugName: 'self_demote',
    argNames: ['pubkey', 'groupId'],
  );

  @override
  Future<void> crateApiBugReportSendBugReport({
    required String whatWentWrong,
    String? expectedBehavior,
    String? stepsToReproduce,
    String? frequency,
    String? npub,
    String? logs,
    required String appVersion,
    required String platform,
    required String osVersion,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(whatWentWrong, serializer);
          sse_encode_opt_String(expectedBehavior, serializer);
          sse_encode_opt_String(stepsToReproduce, serializer);
          sse_encode_opt_String(frequency, serializer);
          sse_encode_opt_String(npub, serializer);
          sse_encode_opt_String(logs, serializer);
          sse_encode_String(appVersion, serializer);
          sse_encode_String(platform, serializer);
          sse_encode_String(osVersion, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 116,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiBugReportSendBugReportConstMeta,
        argValues: [
          whatWentWrong,
          expectedBehavior,
          stepsToReproduce,
          frequency,
          npub,
          logs,
          appVersion,
          platform,
          osVersion,
        ],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiBugReportSendBugReportConstMeta => const TaskConstMeta(
    debugName: 'send_bug_report',
    argNames: [
      'whatWentWrong',
      'expectedBehavior',
      'stepsToReproduce',
      'frequency',
      'npub',
      'logs',
      'appVersion',
      'platform',
      'osVersion',
    ],
  );

  @override
  Future<MessageWithTokens> crateApiMessagesSendMessageToGroup({
    required String pubkey,
    required String groupId,
    required String message,
    required int kind,
    List<Tag>? tags,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(message, serializer);
          sse_encode_u_16(kind, serializer);
          sse_encode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
            tags,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 117,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_message_with_tokens,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMessagesSendMessageToGroupConstMeta,
        argValues: [pubkey, groupId, message, kind, tags],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMessagesSendMessageToGroupConstMeta => const TaskConstMeta(
    debugName: 'send_message_to_group',
    argNames: ['pubkey', 'groupId', 'message', 'kind', 'tags'],
  );

  @override
  Future<void> crateApiChatListSetChatPinOrder({
    required String accountPubkey,
    required String mlsGroupId,
    PlatformInt64? pinOrder,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          sse_encode_opt_box_autoadd_i_64(pinOrder, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 118,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatListSetChatPinOrderConstMeta,
        argValues: [accountPubkey, mlsGroupId, pinOrder],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatListSetChatPinOrderConstMeta => const TaskConstMeta(
    debugName: 'set_chat_pin_order',
    argNames: ['accountPubkey', 'mlsGroupId', 'pinOrder'],
  );

  @override
  Future<String> crateApiUtilsStringFromRelayUrl({required RelayUrl relayUrl}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
            relayUrl,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 119,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsStringFromRelayUrlConstMeta,
        argValues: [relayUrl],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsStringFromRelayUrlConstMeta => const TaskConstMeta(
    debugName: 'string_from_relay_url',
    argNames: ['relayUrl'],
  );

  @override
  Stream<ChatListStreamItem> crateApiChatListSubscribeToArchivedChatList({
    required String accountPubkey,
  }) {
    final sink = RustStreamSink<ChatListStreamItem>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_String(accountPubkey, serializer);
            sse_encode_StreamSink_chat_list_stream_item_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 120,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiChatListSubscribeToArchivedChatListConstMeta,
          argValues: [accountPubkey, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiChatListSubscribeToArchivedChatListConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_archived_chat_list',
    argNames: ['accountPubkey', 'sink'],
  );

  @override
  Stream<ChatListStreamItem> crateApiChatListSubscribeToChatList({
    required String accountPubkey,
  }) {
    final sink = RustStreamSink<ChatListStreamItem>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_String(accountPubkey, serializer);
            sse_encode_StreamSink_chat_list_stream_item_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 121,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiChatListSubscribeToChatListConstMeta,
          argValues: [accountPubkey, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiChatListSubscribeToChatListConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_chat_list',
    argNames: ['accountPubkey', 'sink'],
  );

  @override
  Stream<MessageStreamItem> crateApiMessagesSubscribeToGroupMessages({
    String? pubkey,
    required String groupId,
  }) {
    final sink = RustStreamSink<MessageStreamItem>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_opt_String(pubkey, serializer);
            sse_encode_String(groupId, serializer);
            sse_encode_StreamSink_message_stream_item_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 122,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiMessagesSubscribeToGroupMessagesConstMeta,
          argValues: [pubkey, groupId, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiMessagesSubscribeToGroupMessagesConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_group_messages',
    argNames: ['pubkey', 'groupId', 'sink'],
  );

  @override
  Stream<GroupStateUpdate> crateApiGroupStateSubscribeToGroupState({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    final sink = RustStreamSink<GroupStateUpdate>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_String(accountPubkey, serializer);
            sse_encode_String(mlsGroupId, serializer);
            sse_encode_StreamSink_group_state_update_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 123,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiGroupStateSubscribeToGroupStateConstMeta,
          argValues: [accountPubkey, mlsGroupId, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiGroupStateSubscribeToGroupStateConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_group_state',
    argNames: ['accountPubkey', 'mlsGroupId', 'sink'],
  );

  @override
  Stream<NotificationUpdate> crateApiNotificationsSubscribeToNotifications() {
    final sink = RustStreamSink<NotificationUpdate>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_StreamSink_notification_update_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 124,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiNotificationsSubscribeToNotificationsConstMeta,
          argValues: [sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiNotificationsSubscribeToNotificationsConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_notifications',
    argNames: ['sink'],
  );

  @override
  Stream<String> crateApiLogsSubscribeToRustLogs({
    required String logsBaseDir,
  }) {
    final sink = RustStreamSink<String>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_String(logsBaseDir, serializer);
            sse_encode_StreamSink_String_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 125,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiLogsSubscribeToRustLogsConstMeta,
          argValues: [logsBaseDir, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiLogsSubscribeToRustLogsConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_rust_logs',
    argNames: ['logsBaseDir', 'sink'],
  );

  @override
  Stream<UserStreamItem> crateApiUsersSubscribeToUser({
    required String pubkey,
  }) {
    final sink = RustStreamSink<UserStreamItem>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_String(pubkey, serializer);
            sse_encode_StreamSink_user_stream_item_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 126,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_api_error,
          ),
          constMeta: kCrateApiUsersSubscribeToUserConstMeta,
          argValues: [pubkey, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiUsersSubscribeToUserConstMeta => const TaskConstMeta(
    debugName: 'subscribe_to_user',
    argNames: ['pubkey', 'sink'],
  );

  @override
  Future<Tag> crateApiUtilsTagFromVec({required List<String> vec}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_list_String(vec, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 127,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUtilsTagFromVecConstMeta,
        argValues: [vec],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsTagFromVecConstMeta => const TaskConstMeta(
    debugName: 'tag_from_vec',
    argNames: ['vec'],
  );

  @override
  ThemeMode crateApiUtilsThemeModeDark() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 128,
          )!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsThemeModeDarkConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsThemeModeDarkConstMeta => const TaskConstMeta(
    debugName: 'theme_mode_dark',
    argNames: [],
  );

  @override
  ThemeMode crateApiUtilsThemeModeLight() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 129,
          )!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsThemeModeLightConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsThemeModeLightConstMeta => const TaskConstMeta(
    debugName: 'theme_mode_light',
    argNames: [],
  );

  @override
  ThemeMode crateApiUtilsThemeModeSystem() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 130,
          )!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsThemeModeSystemConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsThemeModeSystemConstMeta => const TaskConstMeta(
    debugName: 'theme_mode_system',
    argNames: [],
  );

  @override
  String crateApiUtilsThemeModeToString({required ThemeMode themeMode}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
            themeMode,
            serializer,
          );
          return pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 131,
          )!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiUtilsThemeModeToStringConstMeta,
        argValues: [themeMode],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUtilsThemeModeToStringConstMeta => const TaskConstMeta(
    debugName: 'theme_mode_to_string',
    argNames: ['themeMode'],
  );

  @override
  Future<void> crateApiAccountGroupsUnarchiveChat({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 132,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountGroupsUnarchiveChatConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountGroupsUnarchiveChatConstMeta => const TaskConstMeta(
    debugName: 'unarchive_chat',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

  @override
  Future<void> crateApiMuteListUnblockUser({
    required String accountPubkey,
    required String targetPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(targetPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 133,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMuteListUnblockUserConstMeta,
        argValues: [accountPubkey, targetPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMuteListUnblockUserConstMeta => const TaskConstMeta(
    debugName: 'unblock_user',
    argNames: ['accountPubkey', 'targetPubkey'],
  );

  @override
  Future<void> crateApiAccountsUnfollowUser({
    required String accountPubkey,
    required String userToUnfollowPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(userToUnfollowPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 134,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsUnfollowUserConstMeta,
        argValues: [accountPubkey, userToUnfollowPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsUnfollowUserConstMeta => const TaskConstMeta(
    debugName: 'unfollow_user',
    argNames: ['accountPubkey', 'userToUnfollowPubkey'],
  );

  @override
  Future<void> crateApiChatListUnmuteChat({
    required String accountPubkey,
    required String mlsGroupId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(mlsGroupId, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 135,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiChatListUnmuteChatConstMeta,
        argValues: [accountPubkey, mlsGroupId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiChatListUnmuteChatConstMeta => const TaskConstMeta(
    debugName: 'unmute_chat',
    argNames: ['accountPubkey', 'mlsGroupId'],
  );

  @override
  Future<void> crateApiAccountsUpdateAccountMetadata({
    required String pubkey,
    required FlutterMetadata metadata,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_box_autoadd_flutter_metadata(metadata, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 136,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsUpdateAccountMetadataConstMeta,
        argValues: [pubkey, metadata],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsUpdateAccountMetadataConstMeta => const TaskConstMeta(
    debugName: 'update_account_metadata',
    argNames: ['pubkey', 'metadata'],
  );

  @override
  Future<void> crateApiUpdateLanguage({required Language language}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
            language,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 137,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUpdateLanguageConstMeta,
        argValues: [language],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUpdateLanguageConstMeta => const TaskConstMeta(
    debugName: 'update_language',
    argNames: ['language'],
  );

  @override
  Future<AccountSettings> crateApiAccountsUpdateNotificationsEnabled({
    required String pubkey,
    required bool enabled,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_bool(enabled, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 138,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_account_settings,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsUpdateNotificationsEnabledConstMeta,
        argValues: [pubkey, enabled],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsUpdateNotificationsEnabledConstMeta => const TaskConstMeta(
    debugName: 'update_notifications_enabled',
    argNames: ['pubkey', 'enabled'],
  );

  @override
  Future<void> crateApiUpdateThemeMode({required ThemeMode themeMode}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
            themeMode,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 139,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUpdateThemeModeConstMeta,
        argValues: [themeMode],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUpdateThemeModeConstMeta => const TaskConstMeta(
    debugName: 'update_theme_mode',
    argNames: ['themeMode'],
  );

  @override
  Future<String> crateApiAccountsUploadAccountProfilePicture({
    required String pubkey,
    required String serverUrl,
    required String filePath,
    required String imageType,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_String(serverUrl, serializer);
          sse_encode_String(filePath, serializer);
          sse_encode_String(imageType, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 140,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiAccountsUploadAccountProfilePictureConstMeta,
        argValues: [pubkey, serverUrl, filePath, imageType],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAccountsUploadAccountProfilePictureConstMeta => const TaskConstMeta(
    debugName: 'upload_account_profile_picture',
    argNames: ['pubkey', 'serverUrl', 'filePath', 'imageType'],
  );

  @override
  Future<MediaFile> crateApiMediaFilesUploadChatMedia({
    required String accountPubkey,
    required String groupId,
    required String filePath,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(filePath, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 141,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_media_file,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiMediaFilesUploadChatMediaConstMeta,
        argValues: [accountPubkey, groupId, filePath],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMediaFilesUploadChatMediaConstMeta => const TaskConstMeta(
    debugName: 'upload_chat_media',
    argNames: ['accountPubkey', 'groupId', 'filePath'],
  );

  @override
  Future<UploadGroupImageResult> crateApiGroupsUploadGroupImage({
    required String accountPubkey,
    required String groupId,
    required String filePath,
    required String serverUrl,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          sse_encode_String(groupId, serializer);
          sse_encode_String(filePath, serializer);
          sse_encode_String(serverUrl, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 142,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_upload_group_image_result,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsUploadGroupImageConstMeta,
        argValues: [accountPubkey, groupId, filePath, serverUrl],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsUploadGroupImageConstMeta => const TaskConstMeta(
    debugName: 'upload_group_image',
    argNames: ['accountPubkey', 'groupId', 'filePath', 'serverUrl'],
  );

  @override
  Future<PushRegistration> crateApiNotificationsUpsertPushRegistration({
    required String pubkey,
    required PushPlatform platform,
    required String rawToken,
    required String serverPubkey,
    String? relayHint,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_push_platform(platform, serializer);
          sse_encode_String(rawToken, serializer);
          sse_encode_String(serverPubkey, serializer);
          sse_encode_opt_String(relayHint, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 143,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_push_registration,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiNotificationsUpsertPushRegistrationConstMeta,
        argValues: [pubkey, platform, rawToken, serverPubkey, relayHint],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiNotificationsUpsertPushRegistrationConstMeta => const TaskConstMeta(
    debugName: 'upsert_push_registration',
    argNames: [
      'pubkey',
      'platform',
      'rawToken',
      'serverPubkey',
      'relayHint',
    ],
  );

  @override
  Future<KeyPackageStatus> crateApiUsersUserHasKeyPackage({
    required String pubkey,
    required bool blockingDataSync,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_bool(blockingDataSync, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 144,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_key_package_status,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUsersUserHasKeyPackageConstMeta,
        argValues: [pubkey, blockingDataSync],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUsersUserHasKeyPackageConstMeta => const TaskConstMeta(
    debugName: 'user_has_key_package',
    argNames: ['pubkey', 'blockingDataSync'],
  );

  @override
  Future<FlutterMetadata> crateApiUsersUserMetadata({
    required String pubkey,
    required bool blockingDataSync,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_bool(blockingDataSync, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 145,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_flutter_metadata,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUsersUserMetadataConstMeta,
        argValues: [pubkey, blockingDataSync],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUsersUserMetadataConstMeta => const TaskConstMeta(
    debugName: 'user_metadata',
    argNames: ['pubkey', 'blockingDataSync'],
  );

  @override
  Future<List<Relay>> crateApiUsersUserRelays({
    required String pubkey,
    required RelayType relayType,
    required bool blockingDataSync,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(pubkey, serializer);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
            relayType,
            serializer,
          );
          sse_encode_bool(blockingDataSync, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 146,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_relay,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiUsersUserRelaysConstMeta,
        argValues: [pubkey, relayType, blockingDataSync],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUsersUserRelaysConstMeta => const TaskConstMeta(
    debugName: 'user_relays',
    argNames: ['pubkey', 'relayType', 'blockingDataSync'],
  );

  @override
  Future<List<GroupWithInfoAndMembership>> crateApiGroupsVisibleGroupsWithInfo({
    required String accountPubkey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(accountPubkey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 147,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_group_with_info_and_membership,
          decodeErrorData: sse_decode_api_error,
        ),
        constMeta: kCrateApiGroupsVisibleGroupsWithInfoConstMeta,
        argValues: [accountPubkey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiGroupsVisibleGroupsWithInfoConstMeta => const TaskConstMeta(
    debugName: 'visible_groups_with_info',
    argNames: ['accountPubkey'],
  );

  Future<void> Function(int, dynamic) encode_DartFn_Inputs_String_Output_String_AnyhowException(
    FutureOr<String> Function(String) raw,
  ) {
    return (callId, rawArg0) async {
      final arg0 = dco_decode_String(rawArg0);

      Box<String>? rawOutput;
      Box<AnyhowException>? rawError;
      try {
        rawOutput = Box(await raw(arg0));
      } catch (e, s) {
        rawError = Box(AnyhowException('$e\n\n$s'));
      }

      final serializer = SseSerializer(generalizedFrbRustBinding);
      assert((rawOutput != null) ^ (rawError != null));
      if (rawOutput != null) {
        serializer.buffer.putUint8(0);
        sse_encode_String(rawOutput.value, serializer);
      } else {
        serializer.buffer.putUint8(1);
        sse_encode_AnyhowException(rawError!.value, serializer);
      }
      final output = serializer.intoRaw();

      generalizedFrbRustBinding.dartFnDeliverOutput(
        callId: callId,
        ptr: output.ptr,
        rustVecLen: output.rustVecLen,
        dataLen: output.dataLen,
      );
    };
  }

  Future<void> Function(int, dynamic, dynamic)
  encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
    FutureOr<String> Function(String, String) raw,
  ) {
    return (callId, rawArg0, rawArg1) async {
      final arg0 = dco_decode_String(rawArg0);
      final arg1 = dco_decode_String(rawArg1);

      Box<String>? rawOutput;
      Box<AnyhowException>? rawError;
      try {
        rawOutput = Box(await raw(arg0, arg1));
      } catch (e, s) {
        rawError = Box(AnyhowException('$e\n\n$s'));
      }

      final serializer = SseSerializer(generalizedFrbRustBinding);
      assert((rawOutput != null) ^ (rawError != null));
      if (rawOutput != null) {
        serializer.buffer.putUint8(0);
        sse_encode_String(rawOutput.value, serializer);
      } else {
        serializer.buffer.putUint8(1);
        sse_encode_AnyhowException(rawError!.value, serializer);
      }
      final output = serializer.intoRaw();

      generalizedFrbRustBinding.dartFnDeliverOutput(
        callId: callId,
        ptr: output.ptr,
        rustVecLen: output.rustVecLen,
        dataLen: output.dataLen,
      );
    };
  }

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_AppSettings => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_AppSettings => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_DartSigner => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_DartSigner => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_GroupId => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_GroupId => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Language => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Language => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_PublicKey => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_PublicKey => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RelayType => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RelayType => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RelayUrl => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RelayUrl => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Tag => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Tag => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_ThemeMode => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_ThemeMode => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode;

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

  @protected
  AppSettings
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return AppSettingsImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  DartSigner
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return DartSignerImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  GroupId
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return GroupIdImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Language
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return LanguageImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  PublicKey
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PublicKeyImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  RelayType
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RelayTypeImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  RelayUrl
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RelayUrlImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Tag dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return TagImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  ThemeMode
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return ThemeModeImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  AppSettings
  dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return AppSettingsImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  GroupId dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return GroupIdImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Language
  dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return LanguageImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  RelayUrl
  dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RelayUrlImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  ThemeMode
  dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return ThemeModeImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  DateTime dco_decode_Chrono_Utc(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dcoDecodeTimestamp(ts: dco_decode_i_64(raw).toInt(), isUtc: true);
  }

  @protected
  FutureOr<String> Function(String) dco_decode_DartFn_Inputs_String_Output_String_AnyhowException(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError('');
  }

  @protected
  FutureOr<String> Function(String, String)
  dco_decode_DartFn_Inputs_String_String_Output_String_AnyhowException(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError('');
  }

  @protected
  Object dco_decode_DartOpaque(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return decodeDartOpaque(raw, generalizedFrbRustBinding);
  }

  @protected
  Map<String, String> dco_decode_Map_String_String_None(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return Map.fromEntries(
      dco_decode_list_record_string_string(
        raw,
      ).map((e) => MapEntry(e.$1, e.$2)),
    );
  }

  @protected
  AppSettings dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return AppSettingsImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  DartSigner dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return DartSignerImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  GroupId dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return GroupIdImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Language dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return LanguageImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  PublicKey dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PublicKeyImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  RelayType dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RelayTypeImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  RelayUrl dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RelayUrlImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Tag dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return TagImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  ThemeMode dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return ThemeModeImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

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

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

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

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

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

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

  @protected
  RustStreamSink<UserStreamItem> dco_decode_StreamSink_user_stream_item_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
  Account dco_decode_account(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 Account(
      pubkey: dco_decode_String(arr[0]),
      accountType: dco_decode_account_type(arr[1]),
      lastSyncedAt: dco_decode_opt_box_autoadd_Chrono_Utc(arr[2]),
      createdAt: dco_decode_Chrono_Utc(arr[3]),
      updatedAt: dco_decode_Chrono_Utc(arr[4]),
    );
  }

  @protected
  AccountGroup dco_decode_account_group(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 10) throw Exception('unexpected arr length: expect 10 but see ${arr.length}');
    return AccountGroup(
      id: dco_decode_opt_box_autoadd_i_64(arr[0]),
      accountPubkey: dco_decode_String(arr[1]),
      mlsGroupId: dco_decode_String(arr[2]),
      userConfirmation: dco_decode_opt_box_autoadd_bool(arr[3]),
      welcomerPubkey: dco_decode_opt_String(arr[4]),
      lastReadMessageId: dco_decode_opt_String(arr[5]),
      pinOrder: dco_decode_opt_box_autoadd_i_64(arr[6]),
      archivedAt: dco_decode_opt_box_autoadd_i_64(arr[7]),
      createdAt: dco_decode_i_64(arr[8]),
      updatedAt: dco_decode_i_64(arr[9]),
    );
  }

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

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

  @protected
  ApiError dco_decode_api_error(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return ApiError_Whitenoise(
          message: dco_decode_String(raw[1]),
        );
      case 1:
        return ApiError_DatabasePoolTimedOut(
          message: dco_decode_String(raw[1]),
        );
      case 2:
        return ApiError_InvalidKey(
          message: dco_decode_String(raw[1]),
        );
      case 3:
        return ApiError_NostrUrl(
          message: dco_decode_String(raw[1]),
        );
      case 4:
        return ApiError_NostrTag(
          message: dco_decode_String(raw[1]),
        );
      case 5:
        return ApiError_NostrEvent(
          message: dco_decode_String(raw[1]),
        );
      case 6:
        return ApiError_NostrParse(
          message: dco_decode_String(raw[1]),
        );
      case 7:
        return ApiError_NostrHex(
          message: dco_decode_String(raw[1]),
        );
      case 8:
        return ApiError_LoginInvalidKeyFormat(
          message: dco_decode_String(raw[1]),
        );
      case 9:
        return const ApiError_LoginNoRelayConnections();
      case 10:
        return ApiError_LoginTimeout(
          message: dco_decode_String(raw[1]),
        );
      case 11:
        return const ApiError_LoginNoLoginInProgress();
      case 12:
        return ApiError_LoginInternal(
          message: dco_decode_String(raw[1]),
        );
      case 13:
        return ApiError_LoginKeyringUnavailable(
          message: dco_decode_String(raw[1]),
        );
      case 14:
        return ApiError_Other(
          message: dco_decode_String(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @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
  MarkdownListKind dco_decode_box_autoadd_markdown_list_kind(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_markdown_list_kind(raw);
  }

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

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

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

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

  @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
  User dco_decode_box_autoadd_user(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_user(raw);
  }

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

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

  @protected
  ChatListStreamItem dco_decode_chat_list_stream_item(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return ChatListStreamItem_InitialSnapshot(
          items: dco_decode_list_chat_summary(raw[1]),
        );
      case 1:
        return ChatListStreamItem_Update(
          update: dco_decode_box_autoadd_chat_list_update(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  ChatListUpdate dco_decode_chat_list_update(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 ChatListUpdate(
      trigger: dco_decode_chat_list_update_trigger(arr[0]),
      item: dco_decode_chat_summary(arr[1]),
    );
  }

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

  @protected
  ChatMessage dco_decode_chat_message(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 ChatMessage(
      id: dco_decode_String(arr[0]),
      pubkey: dco_decode_String(arr[1]),
      content: dco_decode_String(arr[2]),
      createdAt: dco_decode_Chrono_Utc(arr[3]),
      tags: dco_decode_list_list_String(arr[4]),
      isReply: dco_decode_bool(arr[5]),
      replyToId: dco_decode_opt_String(arr[6]),
      isDeleted: dco_decode_bool(arr[7]),
      contentTokens: dco_decode_markdown_document(arr[8]),
      reactions: dco_decode_reaction_summary(arr[9]),
      mediaAttachments: dco_decode_list_media_file(arr[10]),
      kind: dco_decode_u_16(arr[11]),
      deliveryStatus: dco_decode_opt_box_autoadd_delivery_status(arr[12]),
    );
  }

  @protected
  ChatMessageSummary dco_decode_chat_message_summary(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 ChatMessageSummary(
      mlsGroupId: dco_decode_String(arr[0]),
      author: dco_decode_String(arr[1]),
      authorDisplayName: dco_decode_opt_String(arr[2]),
      content: dco_decode_String(arr[3]),
      createdAt: dco_decode_Chrono_Utc(arr[4]),
      mediaAttachmentCount: dco_decode_u_64(arr[5]),
    );
  }

  @protected
  ChatMuteDuration dco_decode_chat_mute_duration(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return const ChatMuteDuration_OneHour();
      case 1:
        return const ChatMuteDuration_EightHours();
      case 2:
        return const ChatMuteDuration_OneDay();
      case 3:
        return const ChatMuteDuration_OneWeek();
      case 4:
        return const ChatMuteDuration_Forever();
      case 5:
        return ChatMuteDuration_Custom(
          until: dco_decode_Chrono_Utc(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  ChatSummary dco_decode_chat_summary(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 16) throw Exception('unexpected arr length: expect 16 but see ${arr.length}');
    return ChatSummary(
      mlsGroupId: dco_decode_String(arr[0]),
      name: dco_decode_opt_String(arr[1]),
      groupType: dco_decode_group_type(arr[2]),
      createdAt: dco_decode_Chrono_Utc(arr[3]),
      groupImagePath: dco_decode_opt_String(arr[4]),
      groupImageUrl: dco_decode_opt_String(arr[5]),
      lastMessage: dco_decode_opt_box_autoadd_chat_message_summary(arr[6]),
      pendingConfirmation: dco_decode_bool(arr[7]),
      welcomerPubkey: dco_decode_opt_String(arr[8]),
      archivedAt: dco_decode_opt_box_autoadd_Chrono_Utc(arr[9]),
      removedAt: dco_decode_opt_box_autoadd_Chrono_Utc(arr[10]),
      selfRemoved: dco_decode_bool(arr[11]),
      unreadCount: dco_decode_u_64(arr[12]),
      pinOrder: dco_decode_opt_box_autoadd_i_64(arr[13]),
      dmPeerPubkey: dco_decode_opt_String(arr[14]),
      mutedUntil: dco_decode_opt_box_autoadd_Chrono_Utc(arr[15]),
    );
  }

  @protected
  DeliveryStatus dco_decode_delivery_status(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return const DeliveryStatus_Sending();
      case 1:
        return DeliveryStatus_Sent(
          relayCount: dco_decode_u_64(raw[1]),
        );
      case 2:
        return DeliveryStatus_Failed(
          reason: dco_decode_String(raw[1]),
        );
      case 3:
        return const DeliveryStatus_Retried();
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  Draft dco_decode_draft(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 Draft(
      accountPubkey: dco_decode_String(arr[0]),
      mlsGroupId: dco_decode_String(arr[1]),
      content: dco_decode_String(arr[2]),
      replyToId: dco_decode_opt_String(arr[3]),
      mediaAttachments: dco_decode_list_media_file(arr[4]),
      createdAt: dco_decode_Chrono_Utc(arr[5]),
      updatedAt: dco_decode_Chrono_Utc(arr[6]),
    );
  }

  @protected
  EmojiReaction dco_decode_emoji_reaction(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 EmojiReaction(
      emoji: dco_decode_String(arr[0]),
      count: dco_decode_u_64(arr[1]),
      users: dco_decode_list_String(arr[2]),
    );
  }

  @protected
  FileMetadata dco_decode_file_metadata(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 FileMetadata(
      originalFilename: dco_decode_opt_String(arr[0]),
      dimensions: dco_decode_opt_String(arr[1]),
      blurhash: dco_decode_opt_String(arr[2]),
      thumbhash: dco_decode_opt_String(arr[3]),
      durationMs: dco_decode_opt_box_autoadd_u_64(arr[4]),
      waveform: dco_decode_opt_list_prim_u_8_strict(arr[5]),
    );
  }

  @protected
  FlutterEvent dco_decode_flutter_event(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 FlutterEvent(
      id: dco_decode_String(arr[0]),
      pubkey: dco_decode_String(arr[1]),
      createdAt: dco_decode_Chrono_Utc(arr[2]),
      kind: dco_decode_u_16(arr[3]),
      tags: dco_decode_list_list_String(arr[4]),
      content: dco_decode_String(arr[5]),
    );
  }

  @protected
  FlutterGroupDataUpdate dco_decode_flutter_group_data_update(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 FlutterGroupDataUpdate(
      name: dco_decode_opt_String(arr[0]),
      description: dco_decode_opt_String(arr[1]),
      relays: dco_decode_opt_list_String(arr[2]),
      admins: dco_decode_opt_list_String(arr[3]),
      imageKey: dco_decode_opt_u_8_array_32(arr[4]),
      imageHash: dco_decode_opt_u_8_array_32(arr[5]),
      imageNonce: dco_decode_opt_u_8_array_12(arr[6]),
    );
  }

  @protected
  FlutterMetadata dco_decode_flutter_metadata(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 10) throw Exception('unexpected arr length: expect 10 but see ${arr.length}');
    return FlutterMetadata(
      name: dco_decode_opt_String(arr[0]),
      displayName: dco_decode_opt_String(arr[1]),
      about: dco_decode_opt_String(arr[2]),
      picture: dco_decode_opt_String(arr[3]),
      banner: dco_decode_opt_String(arr[4]),
      website: dco_decode_opt_String(arr[5]),
      nip05: dco_decode_opt_String(arr[6]),
      lud06: dco_decode_opt_String(arr[7]),
      lud16: dco_decode_opt_String(arr[8]),
      custom: dco_decode_Map_String_String_None(arr[9]),
    );
  }

  @protected
  Group dco_decode_group(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 11) throw Exception('unexpected arr length: expect 11 but see ${arr.length}');
    return Group(
      mlsGroupId: dco_decode_String(arr[0]),
      nostrGroupId: dco_decode_String(arr[1]),
      name: dco_decode_String(arr[2]),
      description: dco_decode_String(arr[3]),
      imageHash: dco_decode_opt_u_8_array_32(arr[4]),
      imageKey: dco_decode_opt_u_8_array_32(arr[5]),
      adminPubkeys: dco_decode_list_String(arr[6]),
      lastMessageId: dco_decode_opt_String(arr[7]),
      lastMessageAt: dco_decode_opt_box_autoadd_Chrono_Utc(arr[8]),
      epoch: dco_decode_u_64(arr[9]),
      state: dco_decode_group_state(arr[10]),
    );
  }

  @protected
  GroupInformation dco_decode_group_information(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return GroupInformation(
      mlsGroupId: dco_decode_String(arr[0]),
      groupType: dco_decode_group_type(arr[1]),
      createdAt: dco_decode_Chrono_Utc(arr[2]),
      updatedAt: dco_decode_Chrono_Utc(arr[3]),
    );
  }

  @protected
  GroupPushDebugInfo dco_decode_group_push_debug_info(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 GroupPushDebugInfo(
      totalTokenCount: dco_decode_u_32(arr[0]),
      activeTokenCount: dco_decode_u_32(arr[1]),
      staleTokenCount: dco_decode_u_32(arr[2]),
      missingRelayHintCount: dco_decode_u_32(arr[3]),
      lastTokenListUpdatedAt: dco_decode_opt_box_autoadd_Chrono_Utc(arr[4]),
      localRegistration: dco_decode_local_push_registration_debug_info(arr[5]),
      tokens: dco_decode_list_group_push_token_debug_entry(arr[6]),
    );
  }

  @protected
  GroupPushTokenDebugEntry dco_decode_group_push_token_debug_entry(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8) throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return GroupPushTokenDebugEntry(
      memberPubkey: dco_decode_String(arr[0]),
      leafIndex: dco_decode_u_32(arr[1]),
      serverPubkey: dco_decode_String(arr[2]),
      hasRelayHint: dco_decode_bool(arr[3]),
      activeLeaf: dco_decode_bool(arr[4]),
      memberMatchesActiveLeaf: dco_decode_bool(arr[5]),
      isLocalMember: dco_decode_bool(arr[6]),
      updatedAt: dco_decode_Chrono_Utc(arr[7]),
    );
  }

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

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

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

  @protected
  GroupWithInfoAndMembership dco_decode_group_with_info_and_membership(
    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 GroupWithInfoAndMembership(
      group: dco_decode_group(arr[0]),
      info: dco_decode_group_information(arr[1]),
      membership: dco_decode_account_group(arr[2]),
    );
  }

  @protected
  HighlightSpan dco_decode_highlight_span(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 HighlightSpan(
      start: dco_decode_i_32(arr[0]),
      end: dco_decode_i_32(arr[1]),
    );
  }

  @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
  PlatformInt64 dco_decode_isize(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dcoDecodeI64(raw);
  }

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

  @protected
  LeafNodeInfo dco_decode_leaf_node_info(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return LeafNodeInfo(
      index: dco_decode_u_32(arr[0]),
      encryptionKey: dco_decode_String(arr[1]),
      signatureKey: dco_decode_String(arr[2]),
      credentialIdentity: dco_decode_String(arr[3]),
    );
  }

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

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

  @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<Account> dco_decode_list_account(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_account).toList();
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  List<MuteListEntry> dco_decode_list_mute_list_entry(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_mute_list_entry).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
  List<(String, String)> dco_decode_list_record_string_string(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_record_string_string).toList();
  }

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

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

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

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

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

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

  @protected
  LocalPushRegistrationDebugInfo dco_decode_local_push_registration_debug_info(
    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 LocalPushRegistrationDebugInfo(
      registered: dco_decode_bool(arr[0]),
      shareable: dco_decode_bool(arr[1]),
      notificationsEnabled: dco_decode_bool(arr[2]),
      localLeafIndex: dco_decode_opt_box_autoadd_u_32(arr[3]),
      localTokenCached: dco_decode_bool(arr[4]),
    );
  }

  @protected
  LoginResult dco_decode_login_result(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 LoginResult(
      account: dco_decode_account(arr[0]),
      status: dco_decode_login_status(arr[1]),
    );
  }

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

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

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

  @protected
  MarkdownBlock dco_decode_markdown_block(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return MarkdownBlock_Paragraph(
          inlines: dco_decode_list_markdown_inline(raw[1]),
        );
      case 1:
        return MarkdownBlock_Heading(
          level: dco_decode_u_8(raw[1]),
          inlines: dco_decode_list_markdown_inline(raw[2]),
        );
      case 2:
        return const MarkdownBlock_ThematicBreak();
      case 3:
        return MarkdownBlock_CodeBlock(
          kind: dco_decode_markdown_code_block_kind(raw[1]),
          info: dco_decode_String(raw[2]),
          content: dco_decode_String(raw[3]),
        );
      case 4:
        return MarkdownBlock_BlockQuote(
          blocks: dco_decode_list_markdown_block(raw[1]),
        );
      case 5:
        return MarkdownBlock_List(
          kind: dco_decode_box_autoadd_markdown_list_kind(raw[1]),
          tight: dco_decode_bool(raw[2]),
          items: dco_decode_list_markdown_list_item(raw[3]),
        );
      case 6:
        return MarkdownBlock_Table(
          alignments: dco_decode_list_markdown_alignment(raw[1]),
          header: dco_decode_list_markdown_table_cell(raw[2]),
          rows: dco_decode_list_list_markdown_table_cell(raw[3]),
        );
      case 7:
        return MarkdownBlock_MathBlock(
          content: dco_decode_String(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

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

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

  @protected
  MarkdownInline dco_decode_markdown_inline(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return MarkdownInline_Text(
          content: dco_decode_String(raw[1]),
        );
      case 1:
        return const MarkdownInline_SoftBreak();
      case 2:
        return const MarkdownInline_HardBreak();
      case 3:
        return MarkdownInline_Code(
          content: dco_decode_String(raw[1]),
        );
      case 4:
        return MarkdownInline_Emph(
          children: dco_decode_list_markdown_inline(raw[1]),
        );
      case 5:
        return MarkdownInline_Strong(
          children: dco_decode_list_markdown_inline(raw[1]),
        );
      case 6:
        return MarkdownInline_Strikethrough(
          children: dco_decode_list_markdown_inline(raw[1]),
        );
      case 7:
        return MarkdownInline_Link(
          dest: dco_decode_String(raw[1]),
          title: dco_decode_opt_String(raw[2]),
          children: dco_decode_list_markdown_inline(raw[3]),
        );
      case 8:
        return MarkdownInline_Image(
          dest: dco_decode_String(raw[1]),
          title: dco_decode_opt_String(raw[2]),
          alt: dco_decode_list_markdown_inline(raw[3]),
        );
      case 9:
        return MarkdownInline_Autolink(
          url: dco_decode_String(raw[1]),
          kind: dco_decode_markdown_autolink_kind(raw[2]),
        );
      case 10:
        return MarkdownInline_Math(
          content: dco_decode_String(raw[1]),
        );
      case 11:
        return MarkdownInline_NostrMention(
          entity: dco_decode_box_autoadd_markdown_nostr_entity(raw[1]),
        );
      case 12:
        return MarkdownInline_NostrUri(
          entity: dco_decode_box_autoadd_markdown_nostr_entity(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  MarkdownListItem dco_decode_markdown_list_item(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 MarkdownListItem(
      blocks: dco_decode_list_markdown_block(arr[0]),
      checked: dco_decode_opt_box_autoadd_bool(arr[1]),
    );
  }

  @protected
  MarkdownListKind dco_decode_markdown_list_kind(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return MarkdownListKind_Bullet(
          marker: dco_decode_String(raw[1]),
        );
      case 1:
        return MarkdownListKind_Ordered(
          start: dco_decode_u_32(raw[1]),
          delimiter: dco_decode_String(raw[2]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  MarkdownNostrEntity dco_decode_markdown_nostr_entity(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 MarkdownNostrEntity(
      hrp: dco_decode_markdown_nostr_hrp(arr[0]),
      bech32: dco_decode_String(arr[1]),
    );
  }

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

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

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

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

  @protected
  MediaFile dco_decode_media_file(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 14) throw Exception('unexpected arr length: expect 14 but see ${arr.length}');
    return MediaFile(
      id: dco_decode_String(arr[0]),
      mlsGroupId: dco_decode_String(arr[1]),
      accountPubkey: dco_decode_String(arr[2]),
      filePath: dco_decode_String(arr[3]),
      originalFileHash: dco_decode_opt_String(arr[4]),
      encryptedFileHash: dco_decode_String(arr[5]),
      mimeType: dco_decode_String(arr[6]),
      mediaType: dco_decode_String(arr[7]),
      blossomUrl: dco_decode_String(arr[8]),
      nostrKey: dco_decode_String(arr[9]),
      fileMetadata: dco_decode_opt_box_autoadd_file_metadata(arr[10]),
      createdAt: dco_decode_Chrono_Utc(arr[11]),
      nonce: dco_decode_opt_String(arr[12]),
      schemeVersion: dco_decode_opt_String(arr[13]),
    );
  }

  @protected
  MessageStreamItem dco_decode_message_stream_item(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return MessageStreamItem_InitialSnapshot(
          messages: dco_decode_list_chat_message(raw[1]),
        );
      case 1:
        return MessageStreamItem_Update(
          update: dco_decode_box_autoadd_message_update(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  MessageUpdate dco_decode_message_update(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 MessageUpdate(
      trigger: dco_decode_update_trigger(arr[0]),
      message: dco_decode_chat_message(arr[1]),
    );
  }

  @protected
  MessageWithTokens dco_decode_message_with_tokens(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 MessageWithTokens(
      id: dco_decode_String(arr[0]),
      pubkey: dco_decode_String(arr[1]),
      kind: dco_decode_u_16(arr[2]),
      createdAt: dco_decode_Chrono_Utc(arr[3]),
      content: dco_decode_opt_String(arr[4]),
      tokens: dco_decode_markdown_document(arr[5]),
    );
  }

  @protected
  MuteListEntry dco_decode_mute_list_entry(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return MuteListEntry(
      accountPubkey: dco_decode_String(arr[0]),
      mutedPubkey: dco_decode_String(arr[1]),
      isPrivate: dco_decode_bool(arr[2]),
      createdAt: dco_decode_Chrono_Utc(arr[3]),
    );
  }

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

  @protected
  NotificationUpdate dco_decode_notification_update(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8) throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return NotificationUpdate(
      trigger: dco_decode_notification_trigger(arr[0]),
      mlsGroupId: dco_decode_String(arr[1]),
      groupName: dco_decode_opt_String(arr[2]),
      isDm: dco_decode_bool(arr[3]),
      receiver: dco_decode_notification_user(arr[4]),
      sender: dco_decode_notification_user(arr[5]),
      content: dco_decode_String(arr[6]),
      timestamp: dco_decode_Chrono_Utc(arr[7]),
    );
  }

  @protected
  NotificationUser dco_decode_notification_user(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 NotificationUser(
      pubkey: dco_decode_String(arr[0]),
      displayName: dco_decode_opt_String(arr[1]),
      pictureUrl: dco_decode_opt_String(arr[2]),
    );
  }

  @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
  DateTime? dco_decode_opt_box_autoadd_Chrono_Utc(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_Chrono_Utc(raw);
  }

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

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

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

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

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

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

  @protected
  FlutterEvent? dco_decode_opt_box_autoadd_flutter_event(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_flutter_event(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
  PushRegistration? dco_decode_opt_box_autoadd_push_registration(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_push_registration(raw);
  }

  @protected
  int? dco_decode_opt_box_autoadd_u_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_u_32(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
  List<Tag>?
  dco_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null
        ? null
        : dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
            raw,
          );
  }

  @protected
  List<String>? dco_decode_opt_list_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_list_String(raw);
  }

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

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

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

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

  @protected
  PushRegistration dco_decode_push_registration(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8) throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return PushRegistration(
      accountPubkey: dco_decode_String(arr[0]),
      platform: dco_decode_push_platform(arr[1]),
      rawToken: dco_decode_String(arr[2]),
      serverPubkey: dco_decode_String(arr[3]),
      relayHint: dco_decode_opt_String(arr[4]),
      createdAt: dco_decode_Chrono_Utc(arr[5]),
      updatedAt: dco_decode_Chrono_Utc(arr[6]),
      lastSharedAt: dco_decode_opt_box_autoadd_Chrono_Utc(arr[7]),
    );
  }

  @protected
  RatchetTreeInfo dco_decode_ratchet_tree_info(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 RatchetTreeInfo(
      treeHash: dco_decode_String(arr[0]),
      serializedTree: dco_decode_String(arr[1]),
      leafNodes: dco_decode_list_leaf_node_info(arr[2]),
    );
  }

  @protected
  ReactionSummary dco_decode_reaction_summary(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 ReactionSummary(
      byEmoji: dco_decode_list_emoji_reaction(arr[0]),
      userReactions: dco_decode_list_user_reaction(arr[1]),
    );
  }

  @protected
  (String, String) dco_decode_record_string_string(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 2) {
      throw Exception('Expected 2 elements, got ${arr.length}');
    }
    return (
      dco_decode_String(arr[0]),
      dco_decode_String(arr[1]),
    );
  }

  @protected
  Relay dco_decode_relay(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 Relay(
      url: dco_decode_String(arr[0]),
      createdAt: dco_decode_Chrono_Utc(arr[1]),
      updatedAt: dco_decode_Chrono_Utc(arr[2]),
    );
  }

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

  @protected
  SearchResult dco_decode_search_result(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return SearchResult(
      message: dco_decode_chat_message(arr[0]),
      mlsGroupId: dco_decode_String(arr[1]),
      highlightSpans: dco_decode_list_highlight_span(arr[2]),
      position: dco_decode_u_64(arr[3]),
    );
  }

  @protected
  SearchUpdateTrigger dco_decode_search_update_trigger(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return SearchUpdateTrigger_RadiusStarted(
          radius: dco_decode_u_8(raw[1]),
        );
      case 1:
        return const SearchUpdateTrigger_ResultsFound();
      case 2:
        return SearchUpdateTrigger_RadiusCompleted(
          radius: dco_decode_u_8(raw[1]),
          totalPubkeysSearched: dco_decode_u_64(raw[2]),
        );
      case 3:
        return SearchUpdateTrigger_RadiusTimeout(
          radius: dco_decode_u_8(raw[1]),
        );
      case 4:
        return SearchUpdateTrigger_SearchCompleted(
          finalRadius: dco_decode_u_8(raw[1]),
          totalResults: dco_decode_u_64(raw[2]),
        );
      case 5:
        return SearchUpdateTrigger_Error(
          message: dco_decode_String(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  int dco_decode_u_16(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return 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
  U8Array12 dco_decode_u_8_array_12(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return U8Array12(dco_decode_list_prim_u_8_strict(raw));
  }

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

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

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

  @protected
  UploadGroupImageResult dco_decode_upload_group_image_result(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 UploadGroupImageResult(
      encryptedHash: dco_decode_u_8_array_32(arr[0]),
      imageKey: dco_decode_u_8_array_32(arr[1]),
      imageNonce: dco_decode_u_8_array_12(arr[2]),
    );
  }

  @protected
  User dco_decode_user(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return User(
      pubkey: dco_decode_String(arr[0]),
      metadata: dco_decode_flutter_metadata(arr[1]),
      createdAt: dco_decode_Chrono_Utc(arr[2]),
      updatedAt: dco_decode_Chrono_Utc(arr[3]),
    );
  }

  @protected
  UserReaction dco_decode_user_reaction(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return UserReaction(
      reactionId: dco_decode_String(arr[0]),
      user: dco_decode_String(arr[1]),
      emoji: dco_decode_String(arr[2]),
      createdAt: dco_decode_Chrono_Utc(arr[3]),
    );
  }

  @protected
  UserSearchResult dco_decode_user_search_result(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 UserSearchResult(
      pubkey: dco_decode_String(arr[0]),
      metadata: dco_decode_flutter_metadata(arr[1]),
      radius: dco_decode_u_8(arr[2]),
      matchQuality: dco_decode_match_quality(arr[3]),
      bestField: dco_decode_matched_field(arr[4]),
      matchedFields: dco_decode_list_matched_field(arr[5]),
    );
  }

  @protected
  UserSearchUpdate dco_decode_user_search_update(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 UserSearchUpdate(
      trigger: dco_decode_search_update_trigger(arr[0]),
      newResults: dco_decode_list_user_search_result(arr[1]),
      totalResultCount: dco_decode_u_64(arr[2]),
    );
  }

  @protected
  UserStreamItem dco_decode_user_stream_item(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return UserStreamItem_InitialSnapshot(
          user: dco_decode_box_autoadd_user(raw[1]),
        );
      case 1:
        return UserStreamItem_Update(
          update: dco_decode_box_autoadd_user_update(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  UserUpdate dco_decode_user_update(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 UserUpdate(
      trigger: dco_decode_user_update_trigger(arr[0]),
      user: dco_decode_user(arr[1]),
    );
  }

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

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

  @protected
  WhitenoiseConfig dco_decode_whitenoise_config(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 WhitenoiseConfig(
      dataDir: dco_decode_String(arr[0]),
      logsDir: dco_decode_String(arr[1]),
      defaultRelayUrls: dco_decode_opt_list_String(arr[2]),
    );
  }

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

  @protected
  AppSettings
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return AppSettingsImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  DartSigner
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return DartSignerImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  GroupId
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return GroupIdImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  Language
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return LanguageImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  PublicKey
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return PublicKeyImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  RelayType
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RelayTypeImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  RelayUrl
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RelayUrlImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  Tag sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return TagImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  ThemeMode
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return ThemeModeImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  AppSettings
  sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return AppSettingsImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  GroupId sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return GroupIdImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  Language
  sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return LanguageImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  RelayUrl
  sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RelayUrlImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  ThemeMode
  sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return ThemeModeImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  DateTime sse_decode_Chrono_Utc(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final inner = sse_decode_i_64(deserializer);
    return DateTime.fromMicrosecondsSinceEpoch(inner.toInt(), isUtc: true);
  }

  @protected
  Object sse_decode_DartOpaque(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final inner = sse_decode_isize(deserializer);
    return decodeDartOpaque(inner, generalizedFrbRustBinding);
  }

  @protected
  Map<String, String> sse_decode_Map_String_String_None(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final inner = sse_decode_list_record_string_string(deserializer);
    return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2)));
  }

  @protected
  AppSettings sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return AppSettingsImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  DartSigner sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return DartSignerImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  GroupId sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return GroupIdImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  Language sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return LanguageImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  PublicKey sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return PublicKeyImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  RelayType sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RelayTypeImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  RelayUrl sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RelayUrlImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  Tag sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return TagImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

  @protected
  ThemeMode sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return ThemeModeImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

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

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

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

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

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

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

  @protected
  RustStreamSink<UserStreamItem> sse_decode_StreamSink_user_stream_item_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
    final inner = sse_decode_list_prim_u_8_strict(deserializer);
    return utf8.decoder.convert(inner);
  }

  @protected
  Account sse_decode_account(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_pubkey = sse_decode_String(deserializer);
    final var_accountType = sse_decode_account_type(deserializer);
    final var_lastSyncedAt = sse_decode_opt_box_autoadd_Chrono_Utc(
      deserializer,
    );
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    return Account(
      pubkey: var_pubkey,
      accountType: var_accountType,
      lastSyncedAt: var_lastSyncedAt,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
    );
  }

  @protected
  AccountGroup sse_decode_account_group(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_id = sse_decode_opt_box_autoadd_i_64(deserializer);
    final var_accountPubkey = sse_decode_String(deserializer);
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_userConfirmation = sse_decode_opt_box_autoadd_bool(deserializer);
    final var_welcomerPubkey = sse_decode_opt_String(deserializer);
    final var_lastReadMessageId = sse_decode_opt_String(deserializer);
    final var_pinOrder = sse_decode_opt_box_autoadd_i_64(deserializer);
    final var_archivedAt = sse_decode_opt_box_autoadd_i_64(deserializer);
    final var_createdAt = sse_decode_i_64(deserializer);
    final var_updatedAt = sse_decode_i_64(deserializer);
    return AccountGroup(
      id: var_id,
      accountPubkey: var_accountPubkey,
      mlsGroupId: var_mlsGroupId,
      userConfirmation: var_userConfirmation,
      welcomerPubkey: var_welcomerPubkey,
      lastReadMessageId: var_lastReadMessageId,
      pinOrder: var_pinOrder,
      archivedAt: var_archivedAt,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
    );
  }

  @protected
  AccountSettings sse_decode_account_settings(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_notificationsEnabled = sse_decode_bool(deserializer);
    return AccountSettings(notificationsEnabled: var_notificationsEnabled);
  }

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

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_message = sse_decode_String(deserializer);
        return ApiError_Whitenoise(message: var_message);
      case 1:
        final var_message = sse_decode_String(deserializer);
        return ApiError_DatabasePoolTimedOut(message: var_message);
      case 2:
        final var_message = sse_decode_String(deserializer);
        return ApiError_InvalidKey(message: var_message);
      case 3:
        final var_message = sse_decode_String(deserializer);
        return ApiError_NostrUrl(message: var_message);
      case 4:
        final var_message = sse_decode_String(deserializer);
        return ApiError_NostrTag(message: var_message);
      case 5:
        final var_message = sse_decode_String(deserializer);
        return ApiError_NostrEvent(message: var_message);
      case 6:
        final var_message = sse_decode_String(deserializer);
        return ApiError_NostrParse(message: var_message);
      case 7:
        final var_message = sse_decode_String(deserializer);
        return ApiError_NostrHex(message: var_message);
      case 8:
        final var_message = sse_decode_String(deserializer);
        return ApiError_LoginInvalidKeyFormat(message: var_message);
      case 9:
        return const ApiError_LoginNoRelayConnections();
      case 10:
        final var_message = sse_decode_String(deserializer);
        return ApiError_LoginTimeout(message: var_message);
      case 11:
        return const ApiError_LoginNoLoginInProgress();
      case 12:
        final var_message = sse_decode_String(deserializer);
        return ApiError_LoginInternal(message: var_message);
      case 13:
        final var_message = sse_decode_String(deserializer);
        return ApiError_LoginKeyringUnavailable(message: var_message);
      case 14:
        final var_message = sse_decode_String(deserializer);
        return ApiError_Other(message: var_message);
      default:
        throw UnimplementedError('');
    }
  }

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

  @protected
  DateTime sse_decode_box_autoadd_Chrono_Utc(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_Chrono_Utc(deserializer));
  }

  @protected
  ApiError sse_decode_box_autoadd_api_error(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_api_error(deserializer));
  }

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

  @protected
  ChatListUpdate sse_decode_box_autoadd_chat_list_update(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_chat_list_update(deserializer));
  }

  @protected
  ChatMessage sse_decode_box_autoadd_chat_message(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_chat_message(deserializer));
  }

  @protected
  ChatMessageSummary sse_decode_box_autoadd_chat_message_summary(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_chat_message_summary(deserializer));
  }

  @protected
  ChatMuteDuration sse_decode_box_autoadd_chat_mute_duration(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_chat_mute_duration(deserializer));
  }

  @protected
  DeliveryStatus sse_decode_box_autoadd_delivery_status(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_delivery_status(deserializer));
  }

  @protected
  Draft sse_decode_box_autoadd_draft(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_draft(deserializer));
  }

  @protected
  FileMetadata sse_decode_box_autoadd_file_metadata(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_file_metadata(deserializer));
  }

  @protected
  FlutterEvent sse_decode_box_autoadd_flutter_event(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_flutter_event(deserializer));
  }

  @protected
  FlutterGroupDataUpdate sse_decode_box_autoadd_flutter_group_data_update(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_flutter_group_data_update(deserializer));
  }

  @protected
  FlutterMetadata sse_decode_box_autoadd_flutter_metadata(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_flutter_metadata(deserializer));
  }

  @protected
  Group sse_decode_box_autoadd_group(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_group(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
  MarkdownListKind sse_decode_box_autoadd_markdown_list_kind(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_markdown_list_kind(deserializer));
  }

  @protected
  MarkdownNostrEntity sse_decode_box_autoadd_markdown_nostr_entity(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_markdown_nostr_entity(deserializer));
  }

  @protected
  MessageUpdate sse_decode_box_autoadd_message_update(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_message_update(deserializer));
  }

  @protected
  PushRegistration sse_decode_box_autoadd_push_registration(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_push_registration(deserializer));
  }

  @protected
  int sse_decode_box_autoadd_u_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_u_32(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
  User sse_decode_box_autoadd_user(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_user(deserializer));
  }

  @protected
  UserUpdate sse_decode_box_autoadd_user_update(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_user_update(deserializer));
  }

  @protected
  WhitenoiseConfig sse_decode_box_autoadd_whitenoise_config(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_whitenoise_config(deserializer));
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_items = sse_decode_list_chat_summary(deserializer);
        return ChatListStreamItem_InitialSnapshot(items: var_items);
      case 1:
        final var_update = sse_decode_box_autoadd_chat_list_update(
          deserializer,
        );
        return ChatListStreamItem_Update(update: var_update);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  ChatListUpdate sse_decode_chat_list_update(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_trigger = sse_decode_chat_list_update_trigger(deserializer);
    final var_item = sse_decode_chat_summary(deserializer);
    return ChatListUpdate(trigger: var_trigger, item: var_item);
  }

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

  @protected
  ChatMessage sse_decode_chat_message(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_id = sse_decode_String(deserializer);
    final var_pubkey = sse_decode_String(deserializer);
    final var_content = sse_decode_String(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_tags = sse_decode_list_list_String(deserializer);
    final var_isReply = sse_decode_bool(deserializer);
    final var_replyToId = sse_decode_opt_String(deserializer);
    final var_isDeleted = sse_decode_bool(deserializer);
    final var_contentTokens = sse_decode_markdown_document(deserializer);
    final var_reactions = sse_decode_reaction_summary(deserializer);
    final var_mediaAttachments = sse_decode_list_media_file(deserializer);
    final var_kind = sse_decode_u_16(deserializer);
    final var_deliveryStatus = sse_decode_opt_box_autoadd_delivery_status(
      deserializer,
    );
    return ChatMessage(
      id: var_id,
      pubkey: var_pubkey,
      content: var_content,
      createdAt: var_createdAt,
      tags: var_tags,
      isReply: var_isReply,
      replyToId: var_replyToId,
      isDeleted: var_isDeleted,
      contentTokens: var_contentTokens,
      reactions: var_reactions,
      mediaAttachments: var_mediaAttachments,
      kind: var_kind,
      deliveryStatus: var_deliveryStatus,
    );
  }

  @protected
  ChatMessageSummary sse_decode_chat_message_summary(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_author = sse_decode_String(deserializer);
    final var_authorDisplayName = sse_decode_opt_String(deserializer);
    final var_content = sse_decode_String(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_mediaAttachmentCount = sse_decode_u_64(deserializer);
    return ChatMessageSummary(
      mlsGroupId: var_mlsGroupId,
      author: var_author,
      authorDisplayName: var_authorDisplayName,
      content: var_content,
      createdAt: var_createdAt,
      mediaAttachmentCount: var_mediaAttachmentCount,
    );
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        return const ChatMuteDuration_OneHour();
      case 1:
        return const ChatMuteDuration_EightHours();
      case 2:
        return const ChatMuteDuration_OneDay();
      case 3:
        return const ChatMuteDuration_OneWeek();
      case 4:
        return const ChatMuteDuration_Forever();
      case 5:
        final var_until = sse_decode_Chrono_Utc(deserializer);
        return ChatMuteDuration_Custom(until: var_until);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  ChatSummary sse_decode_chat_summary(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_name = sse_decode_opt_String(deserializer);
    final var_groupType = sse_decode_group_type(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_groupImagePath = sse_decode_opt_String(deserializer);
    final var_groupImageUrl = sse_decode_opt_String(deserializer);
    final var_lastMessage = sse_decode_opt_box_autoadd_chat_message_summary(
      deserializer,
    );
    final var_pendingConfirmation = sse_decode_bool(deserializer);
    final var_welcomerPubkey = sse_decode_opt_String(deserializer);
    final var_archivedAt = sse_decode_opt_box_autoadd_Chrono_Utc(deserializer);
    final var_removedAt = sse_decode_opt_box_autoadd_Chrono_Utc(deserializer);
    final var_selfRemoved = sse_decode_bool(deserializer);
    final var_unreadCount = sse_decode_u_64(deserializer);
    final var_pinOrder = sse_decode_opt_box_autoadd_i_64(deserializer);
    final var_dmPeerPubkey = sse_decode_opt_String(deserializer);
    final var_mutedUntil = sse_decode_opt_box_autoadd_Chrono_Utc(deserializer);
    return ChatSummary(
      mlsGroupId: var_mlsGroupId,
      name: var_name,
      groupType: var_groupType,
      createdAt: var_createdAt,
      groupImagePath: var_groupImagePath,
      groupImageUrl: var_groupImageUrl,
      lastMessage: var_lastMessage,
      pendingConfirmation: var_pendingConfirmation,
      welcomerPubkey: var_welcomerPubkey,
      archivedAt: var_archivedAt,
      removedAt: var_removedAt,
      selfRemoved: var_selfRemoved,
      unreadCount: var_unreadCount,
      pinOrder: var_pinOrder,
      dmPeerPubkey: var_dmPeerPubkey,
      mutedUntil: var_mutedUntil,
    );
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        return const DeliveryStatus_Sending();
      case 1:
        final var_relayCount = sse_decode_u_64(deserializer);
        return DeliveryStatus_Sent(relayCount: var_relayCount);
      case 2:
        final var_reason = sse_decode_String(deserializer);
        return DeliveryStatus_Failed(reason: var_reason);
      case 3:
        return const DeliveryStatus_Retried();
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  Draft sse_decode_draft(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_accountPubkey = sse_decode_String(deserializer);
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_content = sse_decode_String(deserializer);
    final var_replyToId = sse_decode_opt_String(deserializer);
    final var_mediaAttachments = sse_decode_list_media_file(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    return Draft(
      accountPubkey: var_accountPubkey,
      mlsGroupId: var_mlsGroupId,
      content: var_content,
      replyToId: var_replyToId,
      mediaAttachments: var_mediaAttachments,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
    );
  }

  @protected
  EmojiReaction sse_decode_emoji_reaction(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_emoji = sse_decode_String(deserializer);
    final var_count = sse_decode_u_64(deserializer);
    final var_users = sse_decode_list_String(deserializer);
    return EmojiReaction(emoji: var_emoji, count: var_count, users: var_users);
  }

  @protected
  FileMetadata sse_decode_file_metadata(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_originalFilename = sse_decode_opt_String(deserializer);
    final var_dimensions = sse_decode_opt_String(deserializer);
    final var_blurhash = sse_decode_opt_String(deserializer);
    final var_thumbhash = sse_decode_opt_String(deserializer);
    final var_durationMs = sse_decode_opt_box_autoadd_u_64(deserializer);
    final var_waveform = sse_decode_opt_list_prim_u_8_strict(deserializer);
    return FileMetadata(
      originalFilename: var_originalFilename,
      dimensions: var_dimensions,
      blurhash: var_blurhash,
      thumbhash: var_thumbhash,
      durationMs: var_durationMs,
      waveform: var_waveform,
    );
  }

  @protected
  FlutterEvent sse_decode_flutter_event(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_id = sse_decode_String(deserializer);
    final var_pubkey = sse_decode_String(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_kind = sse_decode_u_16(deserializer);
    final var_tags = sse_decode_list_list_String(deserializer);
    final var_content = sse_decode_String(deserializer);
    return FlutterEvent(
      id: var_id,
      pubkey: var_pubkey,
      createdAt: var_createdAt,
      kind: var_kind,
      tags: var_tags,
      content: var_content,
    );
  }

  @protected
  FlutterGroupDataUpdate sse_decode_flutter_group_data_update(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_name = sse_decode_opt_String(deserializer);
    final var_description = sse_decode_opt_String(deserializer);
    final var_relays = sse_decode_opt_list_String(deserializer);
    final var_admins = sse_decode_opt_list_String(deserializer);
    final var_imageKey = sse_decode_opt_u_8_array_32(deserializer);
    final var_imageHash = sse_decode_opt_u_8_array_32(deserializer);
    final var_imageNonce = sse_decode_opt_u_8_array_12(deserializer);
    return FlutterGroupDataUpdate(
      name: var_name,
      description: var_description,
      relays: var_relays,
      admins: var_admins,
      imageKey: var_imageKey,
      imageHash: var_imageHash,
      imageNonce: var_imageNonce,
    );
  }

  @protected
  FlutterMetadata sse_decode_flutter_metadata(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_name = sse_decode_opt_String(deserializer);
    final var_displayName = sse_decode_opt_String(deserializer);
    final var_about = sse_decode_opt_String(deserializer);
    final var_picture = sse_decode_opt_String(deserializer);
    final var_banner = sse_decode_opt_String(deserializer);
    final var_website = sse_decode_opt_String(deserializer);
    final var_nip05 = sse_decode_opt_String(deserializer);
    final var_lud06 = sse_decode_opt_String(deserializer);
    final var_lud16 = sse_decode_opt_String(deserializer);
    final var_custom = sse_decode_Map_String_String_None(deserializer);
    return FlutterMetadata(
      name: var_name,
      displayName: var_displayName,
      about: var_about,
      picture: var_picture,
      banner: var_banner,
      website: var_website,
      nip05: var_nip05,
      lud06: var_lud06,
      lud16: var_lud16,
      custom: var_custom,
    );
  }

  @protected
  Group sse_decode_group(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_nostrGroupId = sse_decode_String(deserializer);
    final var_name = sse_decode_String(deserializer);
    final var_description = sse_decode_String(deserializer);
    final var_imageHash = sse_decode_opt_u_8_array_32(deserializer);
    final var_imageKey = sse_decode_opt_u_8_array_32(deserializer);
    final var_adminPubkeys = sse_decode_list_String(deserializer);
    final var_lastMessageId = sse_decode_opt_String(deserializer);
    final var_lastMessageAt = sse_decode_opt_box_autoadd_Chrono_Utc(
      deserializer,
    );
    final var_epoch = sse_decode_u_64(deserializer);
    final var_state = sse_decode_group_state(deserializer);
    return Group(
      mlsGroupId: var_mlsGroupId,
      nostrGroupId: var_nostrGroupId,
      name: var_name,
      description: var_description,
      imageHash: var_imageHash,
      imageKey: var_imageKey,
      adminPubkeys: var_adminPubkeys,
      lastMessageId: var_lastMessageId,
      lastMessageAt: var_lastMessageAt,
      epoch: var_epoch,
      state: var_state,
    );
  }

  @protected
  GroupInformation sse_decode_group_information(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_groupType = sse_decode_group_type(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    return GroupInformation(
      mlsGroupId: var_mlsGroupId,
      groupType: var_groupType,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
    );
  }

  @protected
  GroupPushDebugInfo sse_decode_group_push_debug_info(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_totalTokenCount = sse_decode_u_32(deserializer);
    final var_activeTokenCount = sse_decode_u_32(deserializer);
    final var_staleTokenCount = sse_decode_u_32(deserializer);
    final var_missingRelayHintCount = sse_decode_u_32(deserializer);
    final var_lastTokenListUpdatedAt = sse_decode_opt_box_autoadd_Chrono_Utc(
      deserializer,
    );
    final var_localRegistration = sse_decode_local_push_registration_debug_info(
      deserializer,
    );
    final var_tokens = sse_decode_list_group_push_token_debug_entry(
      deserializer,
    );
    return GroupPushDebugInfo(
      totalTokenCount: var_totalTokenCount,
      activeTokenCount: var_activeTokenCount,
      staleTokenCount: var_staleTokenCount,
      missingRelayHintCount: var_missingRelayHintCount,
      lastTokenListUpdatedAt: var_lastTokenListUpdatedAt,
      localRegistration: var_localRegistration,
      tokens: var_tokens,
    );
  }

  @protected
  GroupPushTokenDebugEntry sse_decode_group_push_token_debug_entry(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_memberPubkey = sse_decode_String(deserializer);
    final var_leafIndex = sse_decode_u_32(deserializer);
    final var_serverPubkey = sse_decode_String(deserializer);
    final var_hasRelayHint = sse_decode_bool(deserializer);
    final var_activeLeaf = sse_decode_bool(deserializer);
    final var_memberMatchesActiveLeaf = sse_decode_bool(deserializer);
    final var_isLocalMember = sse_decode_bool(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    return GroupPushTokenDebugEntry(
      memberPubkey: var_memberPubkey,
      leafIndex: var_leafIndex,
      serverPubkey: var_serverPubkey,
      hasRelayHint: var_hasRelayHint,
      activeLeaf: var_activeLeaf,
      memberMatchesActiveLeaf: var_memberMatchesActiveLeaf,
      isLocalMember: var_isLocalMember,
      updatedAt: var_updatedAt,
    );
  }

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

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

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

  @protected
  GroupWithInfoAndMembership sse_decode_group_with_info_and_membership(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_group = sse_decode_group(deserializer);
    final var_info = sse_decode_group_information(deserializer);
    final var_membership = sse_decode_account_group(deserializer);
    return GroupWithInfoAndMembership(
      group: var_group,
      info: var_info,
      membership: var_membership,
    );
  }

  @protected
  HighlightSpan sse_decode_highlight_span(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_start = sse_decode_i_32(deserializer);
    final var_end = sse_decode_i_32(deserializer);
    return HighlightSpan(start: var_start, end: var_end);
  }

  @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
  PlatformInt64 sse_decode_isize(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getPlatformInt64();
  }

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

  @protected
  LeafNodeInfo sse_decode_leaf_node_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_index = sse_decode_u_32(deserializer);
    final var_encryptionKey = sse_decode_String(deserializer);
    final var_signatureKey = sse_decode_String(deserializer);
    final var_credentialIdentity = sse_decode_String(deserializer);
    return LeafNodeInfo(
      index: var_index,
      encryptionKey: var_encryptionKey,
      signatureKey: var_signatureKey,
      credentialIdentity: var_credentialIdentity,
    );
  }

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

    final len_ = sse_decode_i_32(deserializer);
    final ans_ = <RelayUrl>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(
        sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
          deserializer,
        ),
      );
    }
    return ans_;
  }

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

    final len_ = sse_decode_i_32(deserializer);
    final ans_ = <Tag>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(
        sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
          deserializer,
        ),
      );
    }
    return ans_;
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    final len_ = sse_decode_i_32(deserializer);
    final ans_ = <List<MarkdownTableCell>>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_list_markdown_table_cell(deserializer));
    }
    return ans_;
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  LocalPushRegistrationDebugInfo sse_decode_local_push_registration_debug_info(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_registered = sse_decode_bool(deserializer);
    final var_shareable = sse_decode_bool(deserializer);
    final var_notificationsEnabled = sse_decode_bool(deserializer);
    final var_localLeafIndex = sse_decode_opt_box_autoadd_u_32(deserializer);
    final var_localTokenCached = sse_decode_bool(deserializer);
    return LocalPushRegistrationDebugInfo(
      registered: var_registered,
      shareable: var_shareable,
      notificationsEnabled: var_notificationsEnabled,
      localLeafIndex: var_localLeafIndex,
      localTokenCached: var_localTokenCached,
    );
  }

  @protected
  LoginResult sse_decode_login_result(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_account = sse_decode_account(deserializer);
    final var_status = sse_decode_login_status(deserializer);
    return LoginResult(account: var_account, status: var_status);
  }

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

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

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

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_inlines = sse_decode_list_markdown_inline(deserializer);
        return MarkdownBlock_Paragraph(inlines: var_inlines);
      case 1:
        final var_level = sse_decode_u_8(deserializer);
        final var_inlines = sse_decode_list_markdown_inline(deserializer);
        return MarkdownBlock_Heading(level: var_level, inlines: var_inlines);
      case 2:
        return const MarkdownBlock_ThematicBreak();
      case 3:
        final var_kind = sse_decode_markdown_code_block_kind(deserializer);
        final var_info = sse_decode_String(deserializer);
        final var_content = sse_decode_String(deserializer);
        return MarkdownBlock_CodeBlock(
          kind: var_kind,
          info: var_info,
          content: var_content,
        );
      case 4:
        final var_blocks = sse_decode_list_markdown_block(deserializer);
        return MarkdownBlock_BlockQuote(blocks: var_blocks);
      case 5:
        final var_kind = sse_decode_box_autoadd_markdown_list_kind(
          deserializer,
        );
        final var_tight = sse_decode_bool(deserializer);
        final var_items = sse_decode_list_markdown_list_item(deserializer);
        return MarkdownBlock_List(
          kind: var_kind,
          tight: var_tight,
          items: var_items,
        );
      case 6:
        final var_alignments = sse_decode_list_markdown_alignment(deserializer);
        final var_header = sse_decode_list_markdown_table_cell(deserializer);
        final var_rows = sse_decode_list_list_markdown_table_cell(deserializer);
        return MarkdownBlock_Table(
          alignments: var_alignments,
          header: var_header,
          rows: var_rows,
        );
      case 7:
        final var_content = sse_decode_String(deserializer);
        return MarkdownBlock_MathBlock(content: var_content);
      default:
        throw UnimplementedError('');
    }
  }

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

  @protected
  MarkdownDocument sse_decode_markdown_document(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_blocks = sse_decode_list_markdown_block(deserializer);
    return MarkdownDocument(blocks: var_blocks);
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_content = sse_decode_String(deserializer);
        return MarkdownInline_Text(content: var_content);
      case 1:
        return const MarkdownInline_SoftBreak();
      case 2:
        return const MarkdownInline_HardBreak();
      case 3:
        final var_content = sse_decode_String(deserializer);
        return MarkdownInline_Code(content: var_content);
      case 4:
        final var_children = sse_decode_list_markdown_inline(deserializer);
        return MarkdownInline_Emph(children: var_children);
      case 5:
        final var_children = sse_decode_list_markdown_inline(deserializer);
        return MarkdownInline_Strong(children: var_children);
      case 6:
        final var_children = sse_decode_list_markdown_inline(deserializer);
        return MarkdownInline_Strikethrough(children: var_children);
      case 7:
        final var_dest = sse_decode_String(deserializer);
        final var_title = sse_decode_opt_String(deserializer);
        final var_children = sse_decode_list_markdown_inline(deserializer);
        return MarkdownInline_Link(
          dest: var_dest,
          title: var_title,
          children: var_children,
        );
      case 8:
        final var_dest = sse_decode_String(deserializer);
        final var_title = sse_decode_opt_String(deserializer);
        final var_alt = sse_decode_list_markdown_inline(deserializer);
        return MarkdownInline_Image(
          dest: var_dest,
          title: var_title,
          alt: var_alt,
        );
      case 9:
        final var_url = sse_decode_String(deserializer);
        final var_kind = sse_decode_markdown_autolink_kind(deserializer);
        return MarkdownInline_Autolink(url: var_url, kind: var_kind);
      case 10:
        final var_content = sse_decode_String(deserializer);
        return MarkdownInline_Math(content: var_content);
      case 11:
        final var_entity = sse_decode_box_autoadd_markdown_nostr_entity(
          deserializer,
        );
        return MarkdownInline_NostrMention(entity: var_entity);
      case 12:
        final var_entity = sse_decode_box_autoadd_markdown_nostr_entity(
          deserializer,
        );
        return MarkdownInline_NostrUri(entity: var_entity);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  MarkdownListItem sse_decode_markdown_list_item(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_blocks = sse_decode_list_markdown_block(deserializer);
    final var_checked = sse_decode_opt_box_autoadd_bool(deserializer);
    return MarkdownListItem(blocks: var_blocks, checked: var_checked);
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_marker = sse_decode_String(deserializer);
        return MarkdownListKind_Bullet(marker: var_marker);
      case 1:
        final var_start = sse_decode_u_32(deserializer);
        final var_delimiter = sse_decode_String(deserializer);
        return MarkdownListKind_Ordered(
          start: var_start,
          delimiter: var_delimiter,
        );
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  MarkdownNostrEntity sse_decode_markdown_nostr_entity(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_hrp = sse_decode_markdown_nostr_hrp(deserializer);
    final var_bech32 = sse_decode_String(deserializer);
    return MarkdownNostrEntity(hrp: var_hrp, bech32: var_bech32);
  }

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

  @protected
  MarkdownTableCell sse_decode_markdown_table_cell(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_inlines = sse_decode_list_markdown_inline(deserializer);
    return MarkdownTableCell(inlines: var_inlines);
  }

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

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

  @protected
  MediaFile sse_decode_media_file(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_id = sse_decode_String(deserializer);
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_accountPubkey = sse_decode_String(deserializer);
    final var_filePath = sse_decode_String(deserializer);
    final var_originalFileHash = sse_decode_opt_String(deserializer);
    final var_encryptedFileHash = sse_decode_String(deserializer);
    final var_mimeType = sse_decode_String(deserializer);
    final var_mediaType = sse_decode_String(deserializer);
    final var_blossomUrl = sse_decode_String(deserializer);
    final var_nostrKey = sse_decode_String(deserializer);
    final var_fileMetadata = sse_decode_opt_box_autoadd_file_metadata(
      deserializer,
    );
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_nonce = sse_decode_opt_String(deserializer);
    final var_schemeVersion = sse_decode_opt_String(deserializer);
    return MediaFile(
      id: var_id,
      mlsGroupId: var_mlsGroupId,
      accountPubkey: var_accountPubkey,
      filePath: var_filePath,
      originalFileHash: var_originalFileHash,
      encryptedFileHash: var_encryptedFileHash,
      mimeType: var_mimeType,
      mediaType: var_mediaType,
      blossomUrl: var_blossomUrl,
      nostrKey: var_nostrKey,
      fileMetadata: var_fileMetadata,
      createdAt: var_createdAt,
      nonce: var_nonce,
      schemeVersion: var_schemeVersion,
    );
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_messages = sse_decode_list_chat_message(deserializer);
        return MessageStreamItem_InitialSnapshot(messages: var_messages);
      case 1:
        final var_update = sse_decode_box_autoadd_message_update(deserializer);
        return MessageStreamItem_Update(update: var_update);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  MessageUpdate sse_decode_message_update(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_trigger = sse_decode_update_trigger(deserializer);
    final var_message = sse_decode_chat_message(deserializer);
    return MessageUpdate(trigger: var_trigger, message: var_message);
  }

  @protected
  MessageWithTokens sse_decode_message_with_tokens(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_id = sse_decode_String(deserializer);
    final var_pubkey = sse_decode_String(deserializer);
    final var_kind = sse_decode_u_16(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_content = sse_decode_opt_String(deserializer);
    final var_tokens = sse_decode_markdown_document(deserializer);
    return MessageWithTokens(
      id: var_id,
      pubkey: var_pubkey,
      kind: var_kind,
      createdAt: var_createdAt,
      content: var_content,
      tokens: var_tokens,
    );
  }

  @protected
  MuteListEntry sse_decode_mute_list_entry(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_accountPubkey = sse_decode_String(deserializer);
    final var_mutedPubkey = sse_decode_String(deserializer);
    final var_isPrivate = sse_decode_bool(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    return MuteListEntry(
      accountPubkey: var_accountPubkey,
      mutedPubkey: var_mutedPubkey,
      isPrivate: var_isPrivate,
      createdAt: var_createdAt,
    );
  }

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

  @protected
  NotificationUpdate sse_decode_notification_update(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_trigger = sse_decode_notification_trigger(deserializer);
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_groupName = sse_decode_opt_String(deserializer);
    final var_isDm = sse_decode_bool(deserializer);
    final var_receiver = sse_decode_notification_user(deserializer);
    final var_sender = sse_decode_notification_user(deserializer);
    final var_content = sse_decode_String(deserializer);
    final var_timestamp = sse_decode_Chrono_Utc(deserializer);
    return NotificationUpdate(
      trigger: var_trigger,
      mlsGroupId: var_mlsGroupId,
      groupName: var_groupName,
      isDm: var_isDm,
      receiver: var_receiver,
      sender: var_sender,
      content: var_content,
      timestamp: var_timestamp,
    );
  }

  @protected
  NotificationUser sse_decode_notification_user(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_pubkey = sse_decode_String(deserializer);
    final var_displayName = sse_decode_opt_String(deserializer);
    final var_pictureUrl = sse_decode_opt_String(deserializer);
    return NotificationUser(
      pubkey: var_pubkey,
      displayName: var_displayName,
      pictureUrl: var_pictureUrl,
    );
  }

  @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
  DateTime? sse_decode_opt_box_autoadd_Chrono_Utc(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_flutter_event(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
  PushRegistration? sse_decode_opt_box_autoadd_push_registration(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

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

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_u_32(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
  List<Tag>?
  sse_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

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

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

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

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

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

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

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

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

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

  @protected
  PushRegistration sse_decode_push_registration(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_accountPubkey = sse_decode_String(deserializer);
    final var_platform = sse_decode_push_platform(deserializer);
    final var_rawToken = sse_decode_String(deserializer);
    final var_serverPubkey = sse_decode_String(deserializer);
    final var_relayHint = sse_decode_opt_String(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    final var_lastSharedAt = sse_decode_opt_box_autoadd_Chrono_Utc(
      deserializer,
    );
    return PushRegistration(
      accountPubkey: var_accountPubkey,
      platform: var_platform,
      rawToken: var_rawToken,
      serverPubkey: var_serverPubkey,
      relayHint: var_relayHint,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
      lastSharedAt: var_lastSharedAt,
    );
  }

  @protected
  RatchetTreeInfo sse_decode_ratchet_tree_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_treeHash = sse_decode_String(deserializer);
    final var_serializedTree = sse_decode_String(deserializer);
    final var_leafNodes = sse_decode_list_leaf_node_info(deserializer);
    return RatchetTreeInfo(
      treeHash: var_treeHash,
      serializedTree: var_serializedTree,
      leafNodes: var_leafNodes,
    );
  }

  @protected
  ReactionSummary sse_decode_reaction_summary(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_byEmoji = sse_decode_list_emoji_reaction(deserializer);
    final var_userReactions = sse_decode_list_user_reaction(deserializer);
    return ReactionSummary(
      byEmoji: var_byEmoji,
      userReactions: var_userReactions,
    );
  }

  @protected
  (String, String) sse_decode_record_string_string(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_field0 = sse_decode_String(deserializer);
    final var_field1 = sse_decode_String(deserializer);
    return (var_field0, var_field1);
  }

  @protected
  Relay sse_decode_relay(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_url = sse_decode_String(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    return Relay(
      url: var_url,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
    );
  }

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

  @protected
  SearchResult sse_decode_search_result(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_message = sse_decode_chat_message(deserializer);
    final var_mlsGroupId = sse_decode_String(deserializer);
    final var_highlightSpans = sse_decode_list_highlight_span(deserializer);
    final var_position = sse_decode_u_64(deserializer);
    return SearchResult(
      message: var_message,
      mlsGroupId: var_mlsGroupId,
      highlightSpans: var_highlightSpans,
      position: var_position,
    );
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_radius = sse_decode_u_8(deserializer);
        return SearchUpdateTrigger_RadiusStarted(radius: var_radius);
      case 1:
        return const SearchUpdateTrigger_ResultsFound();
      case 2:
        final var_radius = sse_decode_u_8(deserializer);
        final var_totalPubkeysSearched = sse_decode_u_64(deserializer);
        return SearchUpdateTrigger_RadiusCompleted(
          radius: var_radius,
          totalPubkeysSearched: var_totalPubkeysSearched,
        );
      case 3:
        final var_radius = sse_decode_u_8(deserializer);
        return SearchUpdateTrigger_RadiusTimeout(radius: var_radius);
      case 4:
        final var_finalRadius = sse_decode_u_8(deserializer);
        final var_totalResults = sse_decode_u_64(deserializer);
        return SearchUpdateTrigger_SearchCompleted(
          finalRadius: var_finalRadius,
          totalResults: var_totalResults,
        );
      case 5:
        final var_message = sse_decode_String(deserializer);
        return SearchUpdateTrigger_Error(message: var_message);
      default:
        throw UnimplementedError('');
    }
  }

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

  @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
  U8Array12 sse_decode_u_8_array_12(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final inner = sse_decode_list_prim_u_8_strict(deserializer);
    return U8Array12(inner);
  }

  @protected
  U8Array32 sse_decode_u_8_array_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final inner = sse_decode_list_prim_u_8_strict(deserializer);
    return U8Array32(inner);
  }

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

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

  @protected
  UploadGroupImageResult sse_decode_upload_group_image_result(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_encryptedHash = sse_decode_u_8_array_32(deserializer);
    final var_imageKey = sse_decode_u_8_array_32(deserializer);
    final var_imageNonce = sse_decode_u_8_array_12(deserializer);
    return UploadGroupImageResult(
      encryptedHash: var_encryptedHash,
      imageKey: var_imageKey,
      imageNonce: var_imageNonce,
    );
  }

  @protected
  User sse_decode_user(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_pubkey = sse_decode_String(deserializer);
    final var_metadata = sse_decode_flutter_metadata(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    final var_updatedAt = sse_decode_Chrono_Utc(deserializer);
    return User(
      pubkey: var_pubkey,
      metadata: var_metadata,
      createdAt: var_createdAt,
      updatedAt: var_updatedAt,
    );
  }

  @protected
  UserReaction sse_decode_user_reaction(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_reactionId = sse_decode_String(deserializer);
    final var_user = sse_decode_String(deserializer);
    final var_emoji = sse_decode_String(deserializer);
    final var_createdAt = sse_decode_Chrono_Utc(deserializer);
    return UserReaction(
      reactionId: var_reactionId,
      user: var_user,
      emoji: var_emoji,
      createdAt: var_createdAt,
    );
  }

  @protected
  UserSearchResult sse_decode_user_search_result(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_pubkey = sse_decode_String(deserializer);
    final var_metadata = sse_decode_flutter_metadata(deserializer);
    final var_radius = sse_decode_u_8(deserializer);
    final var_matchQuality = sse_decode_match_quality(deserializer);
    final var_bestField = sse_decode_matched_field(deserializer);
    final var_matchedFields = sse_decode_list_matched_field(deserializer);
    return UserSearchResult(
      pubkey: var_pubkey,
      metadata: var_metadata,
      radius: var_radius,
      matchQuality: var_matchQuality,
      bestField: var_bestField,
      matchedFields: var_matchedFields,
    );
  }

  @protected
  UserSearchUpdate sse_decode_user_search_update(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_trigger = sse_decode_search_update_trigger(deserializer);
    final var_newResults = sse_decode_list_user_search_result(deserializer);
    final var_totalResultCount = sse_decode_u_64(deserializer);
    return UserSearchUpdate(
      trigger: var_trigger,
      newResults: var_newResults,
      totalResultCount: var_totalResultCount,
    );
  }

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

    final tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        final var_user = sse_decode_box_autoadd_user(deserializer);
        return UserStreamItem_InitialSnapshot(user: var_user);
      case 1:
        final var_update = sse_decode_box_autoadd_user_update(deserializer);
        return UserStreamItem_Update(update: var_update);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  UserUpdate sse_decode_user_update(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_trigger = sse_decode_user_update_trigger(deserializer);
    final var_user = sse_decode_user(deserializer);
    return UserUpdate(trigger: var_trigger, user: var_user);
  }

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

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

  @protected
  WhitenoiseConfig sse_decode_whitenoise_config(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    final var_dataDir = sse_decode_String(deserializer);
    final var_logsDir = sse_decode_String(deserializer);
    final var_defaultRelayUrls = sse_decode_opt_list_String(deserializer);
    return WhitenoiseConfig(
      dataDir: var_dataDir,
      logsDir: var_logsDir,
      defaultRelayUrls: var_defaultRelayUrls,
    );
  }

  @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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    AppSettings self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as AppSettingsImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner(
    DartSigner self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as DartSignerImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    GroupId self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as GroupIdImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    Language self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as LanguageImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
    PublicKey self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as PublicKeyImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
    RelayType self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as RelayTypeImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    RelayUrl self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as RelayUrlImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    Tag self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as TagImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    ThemeMode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as ThemeModeImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    AppSettings self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as AppSettingsImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    GroupId self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as GroupIdImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    Language self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as LanguageImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    RelayUrl self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as RelayUrlImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    ThemeMode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as ThemeModeImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void sse_encode_Chrono_Utc(DateTime self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_64(
      PlatformInt64Util.from(self.microsecondsSinceEpoch),
      serializer,
    );
  }

  @protected
  void sse_encode_DartFn_Inputs_String_Output_String_AnyhowException(
    FutureOr<String> Function(String) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_DartOpaque(
      encode_DartFn_Inputs_String_Output_String_AnyhowException(self),
      serializer,
    );
  }

  @protected
  void sse_encode_DartFn_Inputs_String_String_Output_String_AnyhowException(
    FutureOr<String> Function(String, String) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_DartOpaque(
      encode_DartFn_Inputs_String_String_Output_String_AnyhowException(self),
      serializer,
    );
  }

  @protected
  void sse_encode_DartOpaque(Object self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_isize(
      PlatformPointerUtil.ptrToPlatformInt64(
        encodeDartOpaque(
          self,
          portManager.dartHandlerPort,
          generalizedFrbRustBinding,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_Map_String_String_None(
    Map<String, String> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_record_string_string(
      self.entries.map((e) => (e.key, e.value)).toList(),
      serializer,
    );
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAppSettings(
    AppSettings self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as AppSettingsImpl).frbInternalSseEncode(),
      serializer,
    );
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartSigner(
    DartSigner self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as DartSignerImpl).frbInternalSseEncode(),
      serializer,
    );
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGroupId(
    GroupId self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize((self as GroupIdImpl).frbInternalSseEncode(), serializer);
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLanguage(
    Language self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize((self as LanguageImpl).frbInternalSseEncode(), serializer);
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPublicKey(
    PublicKey self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as PublicKeyImpl).frbInternalSseEncode(),
      serializer,
    );
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayType(
    RelayType self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as RelayTypeImpl).frbInternalSseEncode(),
      serializer,
    );
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    RelayUrl self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize((self as RelayUrlImpl).frbInternalSseEncode(), serializer);
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    Tag self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize((self as TagImpl).frbInternalSseEncode(), serializer);
  }

  @protected
  void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerThemeMode(
    ThemeMode self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as ThemeModeImpl).frbInternalSseEncode(),
      serializer,
    );
  }

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

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

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

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

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

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

  @protected
  void sse_encode_StreamSink_user_stream_item_Sse(
    RustStreamSink<UserStreamItem> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_user_stream_item,
          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_account(Account self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.pubkey, serializer);
    sse_encode_account_type(self.accountType, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(self.lastSyncedAt, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
  }

  @protected
  void sse_encode_account_group(AccountGroup self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_opt_box_autoadd_i_64(self.id, serializer);
    sse_encode_String(self.accountPubkey, serializer);
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_opt_box_autoadd_bool(self.userConfirmation, serializer);
    sse_encode_opt_String(self.welcomerPubkey, serializer);
    sse_encode_opt_String(self.lastReadMessageId, serializer);
    sse_encode_opt_box_autoadd_i_64(self.pinOrder, serializer);
    sse_encode_opt_box_autoadd_i_64(self.archivedAt, serializer);
    sse_encode_i_64(self.createdAt, serializer);
    sse_encode_i_64(self.updatedAt, serializer);
  }

  @protected
  void sse_encode_account_settings(
    AccountSettings self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bool(self.notificationsEnabled, serializer);
  }

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

  @protected
  void sse_encode_api_error(ApiError self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case ApiError_Whitenoise(message: final message):
        sse_encode_i_32(0, serializer);
        sse_encode_String(message, serializer);
      case ApiError_DatabasePoolTimedOut(message: final message):
        sse_encode_i_32(1, serializer);
        sse_encode_String(message, serializer);
      case ApiError_InvalidKey(message: final message):
        sse_encode_i_32(2, serializer);
        sse_encode_String(message, serializer);
      case ApiError_NostrUrl(message: final message):
        sse_encode_i_32(3, serializer);
        sse_encode_String(message, serializer);
      case ApiError_NostrTag(message: final message):
        sse_encode_i_32(4, serializer);
        sse_encode_String(message, serializer);
      case ApiError_NostrEvent(message: final message):
        sse_encode_i_32(5, serializer);
        sse_encode_String(message, serializer);
      case ApiError_NostrParse(message: final message):
        sse_encode_i_32(6, serializer);
        sse_encode_String(message, serializer);
      case ApiError_NostrHex(message: final message):
        sse_encode_i_32(7, serializer);
        sse_encode_String(message, serializer);
      case ApiError_LoginInvalidKeyFormat(message: final message):
        sse_encode_i_32(8, serializer);
        sse_encode_String(message, serializer);
      case ApiError_LoginNoRelayConnections():
        sse_encode_i_32(9, serializer);
      case ApiError_LoginTimeout(message: final message):
        sse_encode_i_32(10, serializer);
        sse_encode_String(message, serializer);
      case ApiError_LoginNoLoginInProgress():
        sse_encode_i_32(11, serializer);
      case ApiError_LoginInternal(message: final message):
        sse_encode_i_32(12, serializer);
        sse_encode_String(message, serializer);
      case ApiError_LoginKeyringUnavailable(message: final message):
        sse_encode_i_32(13, serializer);
        sse_encode_String(message, serializer);
      case ApiError_Other(message: final message):
        sse_encode_i_32(14, serializer);
        sse_encode_String(message, 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_Chrono_Utc(
    DateTime self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_Chrono_Utc(self, serializer);
  }

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  void sse_encode_box_autoadd_group(Group self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_group(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_markdown_list_kind(
    MarkdownListKind self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_markdown_list_kind(self, serializer);
  }

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

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

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

  @protected
  void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_32(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_box_autoadd_user(User self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_user(self, serializer);
  }

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

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

  @protected
  void sse_encode_chat_list_stream_item(
    ChatListStreamItem self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case ChatListStreamItem_InitialSnapshot(items: final items):
        sse_encode_i_32(0, serializer);
        sse_encode_list_chat_summary(items, serializer);
      case ChatListStreamItem_Update(update: final update):
        sse_encode_i_32(1, serializer);
        sse_encode_box_autoadd_chat_list_update(update, serializer);
    }
  }

  @protected
  void sse_encode_chat_list_update(
    ChatListUpdate self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_chat_list_update_trigger(self.trigger, serializer);
    sse_encode_chat_summary(self.item, serializer);
  }

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

  @protected
  void sse_encode_chat_message(ChatMessage self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_String(self.pubkey, serializer);
    sse_encode_String(self.content, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_list_list_String(self.tags, serializer);
    sse_encode_bool(self.isReply, serializer);
    sse_encode_opt_String(self.replyToId, serializer);
    sse_encode_bool(self.isDeleted, serializer);
    sse_encode_markdown_document(self.contentTokens, serializer);
    sse_encode_reaction_summary(self.reactions, serializer);
    sse_encode_list_media_file(self.mediaAttachments, serializer);
    sse_encode_u_16(self.kind, serializer);
    sse_encode_opt_box_autoadd_delivery_status(self.deliveryStatus, serializer);
  }

  @protected
  void sse_encode_chat_message_summary(
    ChatMessageSummary self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_String(self.author, serializer);
    sse_encode_opt_String(self.authorDisplayName, serializer);
    sse_encode_String(self.content, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_u_64(self.mediaAttachmentCount, serializer);
  }

  @protected
  void sse_encode_chat_mute_duration(
    ChatMuteDuration self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case ChatMuteDuration_OneHour():
        sse_encode_i_32(0, serializer);
      case ChatMuteDuration_EightHours():
        sse_encode_i_32(1, serializer);
      case ChatMuteDuration_OneDay():
        sse_encode_i_32(2, serializer);
      case ChatMuteDuration_OneWeek():
        sse_encode_i_32(3, serializer);
      case ChatMuteDuration_Forever():
        sse_encode_i_32(4, serializer);
      case ChatMuteDuration_Custom(until: final until):
        sse_encode_i_32(5, serializer);
        sse_encode_Chrono_Utc(until, serializer);
    }
  }

  @protected
  void sse_encode_chat_summary(ChatSummary self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_opt_String(self.name, serializer);
    sse_encode_group_type(self.groupType, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_opt_String(self.groupImagePath, serializer);
    sse_encode_opt_String(self.groupImageUrl, serializer);
    sse_encode_opt_box_autoadd_chat_message_summary(
      self.lastMessage,
      serializer,
    );
    sse_encode_bool(self.pendingConfirmation, serializer);
    sse_encode_opt_String(self.welcomerPubkey, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(self.archivedAt, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(self.removedAt, serializer);
    sse_encode_bool(self.selfRemoved, serializer);
    sse_encode_u_64(self.unreadCount, serializer);
    sse_encode_opt_box_autoadd_i_64(self.pinOrder, serializer);
    sse_encode_opt_String(self.dmPeerPubkey, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(self.mutedUntil, serializer);
  }

  @protected
  void sse_encode_delivery_status(
    DeliveryStatus self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case DeliveryStatus_Sending():
        sse_encode_i_32(0, serializer);
      case DeliveryStatus_Sent(relayCount: final relayCount):
        sse_encode_i_32(1, serializer);
        sse_encode_u_64(relayCount, serializer);
      case DeliveryStatus_Failed(reason: final reason):
        sse_encode_i_32(2, serializer);
        sse_encode_String(reason, serializer);
      case DeliveryStatus_Retried():
        sse_encode_i_32(3, serializer);
    }
  }

  @protected
  void sse_encode_draft(Draft self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.accountPubkey, serializer);
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_String(self.content, serializer);
    sse_encode_opt_String(self.replyToId, serializer);
    sse_encode_list_media_file(self.mediaAttachments, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
  }

  @protected
  void sse_encode_emoji_reaction(EmojiReaction self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.emoji, serializer);
    sse_encode_u_64(self.count, serializer);
    sse_encode_list_String(self.users, serializer);
  }

  @protected
  void sse_encode_file_metadata(FileMetadata self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_opt_String(self.originalFilename, serializer);
    sse_encode_opt_String(self.dimensions, serializer);
    sse_encode_opt_String(self.blurhash, serializer);
    sse_encode_opt_String(self.thumbhash, serializer);
    sse_encode_opt_box_autoadd_u_64(self.durationMs, serializer);
    sse_encode_opt_list_prim_u_8_strict(self.waveform, serializer);
  }

  @protected
  void sse_encode_flutter_event(FlutterEvent self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_String(self.pubkey, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_u_16(self.kind, serializer);
    sse_encode_list_list_String(self.tags, serializer);
    sse_encode_String(self.content, serializer);
  }

  @protected
  void sse_encode_flutter_group_data_update(
    FlutterGroupDataUpdate self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_opt_String(self.name, serializer);
    sse_encode_opt_String(self.description, serializer);
    sse_encode_opt_list_String(self.relays, serializer);
    sse_encode_opt_list_String(self.admins, serializer);
    sse_encode_opt_u_8_array_32(self.imageKey, serializer);
    sse_encode_opt_u_8_array_32(self.imageHash, serializer);
    sse_encode_opt_u_8_array_12(self.imageNonce, serializer);
  }

  @protected
  void sse_encode_flutter_metadata(
    FlutterMetadata self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_opt_String(self.name, serializer);
    sse_encode_opt_String(self.displayName, serializer);
    sse_encode_opt_String(self.about, serializer);
    sse_encode_opt_String(self.picture, serializer);
    sse_encode_opt_String(self.banner, serializer);
    sse_encode_opt_String(self.website, serializer);
    sse_encode_opt_String(self.nip05, serializer);
    sse_encode_opt_String(self.lud06, serializer);
    sse_encode_opt_String(self.lud16, serializer);
    sse_encode_Map_String_String_None(self.custom, serializer);
  }

  @protected
  void sse_encode_group(Group self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_String(self.nostrGroupId, serializer);
    sse_encode_String(self.name, serializer);
    sse_encode_String(self.description, serializer);
    sse_encode_opt_u_8_array_32(self.imageHash, serializer);
    sse_encode_opt_u_8_array_32(self.imageKey, serializer);
    sse_encode_list_String(self.adminPubkeys, serializer);
    sse_encode_opt_String(self.lastMessageId, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(self.lastMessageAt, serializer);
    sse_encode_u_64(self.epoch, serializer);
    sse_encode_group_state(self.state, serializer);
  }

  @protected
  void sse_encode_group_information(
    GroupInformation self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_group_type(self.groupType, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
  }

  @protected
  void sse_encode_group_push_debug_info(
    GroupPushDebugInfo self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_32(self.totalTokenCount, serializer);
    sse_encode_u_32(self.activeTokenCount, serializer);
    sse_encode_u_32(self.staleTokenCount, serializer);
    sse_encode_u_32(self.missingRelayHintCount, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(
      self.lastTokenListUpdatedAt,
      serializer,
    );
    sse_encode_local_push_registration_debug_info(
      self.localRegistration,
      serializer,
    );
    sse_encode_list_group_push_token_debug_entry(self.tokens, serializer);
  }

  @protected
  void sse_encode_group_push_token_debug_entry(
    GroupPushTokenDebugEntry self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.memberPubkey, serializer);
    sse_encode_u_32(self.leafIndex, serializer);
    sse_encode_String(self.serverPubkey, serializer);
    sse_encode_bool(self.hasRelayHint, serializer);
    sse_encode_bool(self.activeLeaf, serializer);
    sse_encode_bool(self.memberMatchesActiveLeaf, serializer);
    sse_encode_bool(self.isLocalMember, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
  }

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

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

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

  @protected
  void sse_encode_group_with_info_and_membership(
    GroupWithInfoAndMembership self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_group(self.group, serializer);
    sse_encode_group_information(self.info, serializer);
    sse_encode_account_group(self.membership, serializer);
  }

  @protected
  void sse_encode_highlight_span(HighlightSpan self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.start, serializer);
    sse_encode_i_32(self.end, serializer);
  }

  @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_isize(PlatformInt64 self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putPlatformInt64(self);
  }

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

  @protected
  void sse_encode_leaf_node_info(LeafNodeInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_32(self.index, serializer);
    sse_encode_String(self.encryptionKey, serializer);
    sse_encode_String(self.signatureKey, serializer);
    sse_encode_String(self.credentialIdentity, serializer);
  }

  @protected
  void
  sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
    List<RelayUrl> 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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRelayUrl(
        item,
        serializer,
      );
    }
  }

  @protected
  void sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    List<Tag> 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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
        item,
        serializer,
      );
    }
  }

  @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_account(List<Account> 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_account(item, serializer);
    }
  }

  @protected
  void sse_encode_list_chat_message(
    List<ChatMessage> 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_chat_message(item, serializer);
    }
  }

  @protected
  void sse_encode_list_chat_summary(
    List<ChatSummary> 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_chat_summary(item, serializer);
    }
  }

  @protected
  void sse_encode_list_emoji_reaction(
    List<EmojiReaction> 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_emoji_reaction(item, serializer);
    }
  }

  @protected
  void sse_encode_list_flutter_event(
    List<FlutterEvent> 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_flutter_event(item, serializer);
    }
  }

  @protected
  void sse_encode_list_group(List<Group> 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_group(item, serializer);
    }
  }

  @protected
  void sse_encode_list_group_information(
    List<GroupInformation> 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_group_information(item, serializer);
    }
  }

  @protected
  void sse_encode_list_group_push_token_debug_entry(
    List<GroupPushTokenDebugEntry> 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_group_push_token_debug_entry(item, serializer);
    }
  }

  @protected
  void sse_encode_list_group_with_info_and_membership(
    List<GroupWithInfoAndMembership> 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_group_with_info_and_membership(item, serializer);
    }
  }

  @protected
  void sse_encode_list_highlight_span(
    List<HighlightSpan> 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_highlight_span(item, serializer);
    }
  }

  @protected
  void sse_encode_list_leaf_node_info(
    List<LeafNodeInfo> 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_leaf_node_info(item, serializer);
    }
  }

  @protected
  void sse_encode_list_list_String(
    List<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_list_String(item, serializer);
    }
  }

  @protected
  void sse_encode_list_list_markdown_table_cell(
    List<List<MarkdownTableCell>> 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_list_markdown_table_cell(item, serializer);
    }
  }

  @protected
  void sse_encode_list_markdown_alignment(
    List<MarkdownAlignment> 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_markdown_alignment(item, serializer);
    }
  }

  @protected
  void sse_encode_list_markdown_block(
    List<MarkdownBlock> 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_markdown_block(item, serializer);
    }
  }

  @protected
  void sse_encode_list_markdown_inline(
    List<MarkdownInline> 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_markdown_inline(item, serializer);
    }
  }

  @protected
  void sse_encode_list_markdown_list_item(
    List<MarkdownListItem> 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_markdown_list_item(item, serializer);
    }
  }

  @protected
  void sse_encode_list_markdown_table_cell(
    List<MarkdownTableCell> 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_markdown_table_cell(item, serializer);
    }
  }

  @protected
  void sse_encode_list_matched_field(
    List<MatchedField> 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_matched_field(item, serializer);
    }
  }

  @protected
  void sse_encode_list_media_file(
    List<MediaFile> 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_media_file(item, serializer);
    }
  }

  @protected
  void sse_encode_list_mute_list_entry(
    List<MuteListEntry> 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_mute_list_entry(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_list_record_string_string(
    List<(String, 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_record_string_string(item, serializer);
    }
  }

  @protected
  void sse_encode_list_relay(List<Relay> 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_relay(item, serializer);
    }
  }

  @protected
  void sse_encode_list_required_proposal(
    List<RequiredProposal> 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_required_proposal(item, serializer);
    }
  }

  @protected
  void sse_encode_list_search_result(
    List<SearchResult> 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_search_result(item, serializer);
    }
  }

  @protected
  void sse_encode_list_user(List<User> 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_user(item, serializer);
    }
  }

  @protected
  void sse_encode_list_user_reaction(
    List<UserReaction> 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_user_reaction(item, serializer);
    }
  }

  @protected
  void sse_encode_list_user_search_result(
    List<UserSearchResult> 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_user_search_result(item, serializer);
    }
  }

  @protected
  void sse_encode_local_push_registration_debug_info(
    LocalPushRegistrationDebugInfo self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bool(self.registered, serializer);
    sse_encode_bool(self.shareable, serializer);
    sse_encode_bool(self.notificationsEnabled, serializer);
    sse_encode_opt_box_autoadd_u_32(self.localLeafIndex, serializer);
    sse_encode_bool(self.localTokenCached, serializer);
  }

  @protected
  void sse_encode_login_result(LoginResult self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_account(self.account, serializer);
    sse_encode_login_status(self.status, serializer);
  }

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

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

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

  @protected
  void sse_encode_markdown_block(MarkdownBlock self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case MarkdownBlock_Paragraph(inlines: final inlines):
        sse_encode_i_32(0, serializer);
        sse_encode_list_markdown_inline(inlines, serializer);
      case MarkdownBlock_Heading(level: final level, inlines: final inlines):
        sse_encode_i_32(1, serializer);
        sse_encode_u_8(level, serializer);
        sse_encode_list_markdown_inline(inlines, serializer);
      case MarkdownBlock_ThematicBreak():
        sse_encode_i_32(2, serializer);
      case MarkdownBlock_CodeBlock(
        kind: final kind,
        info: final info,
        content: final content,
      ):
        sse_encode_i_32(3, serializer);
        sse_encode_markdown_code_block_kind(kind, serializer);
        sse_encode_String(info, serializer);
        sse_encode_String(content, serializer);
      case MarkdownBlock_BlockQuote(blocks: final blocks):
        sse_encode_i_32(4, serializer);
        sse_encode_list_markdown_block(blocks, serializer);
      case MarkdownBlock_List(
        kind: final kind,
        tight: final tight,
        items: final items,
      ):
        sse_encode_i_32(5, serializer);
        sse_encode_box_autoadd_markdown_list_kind(kind, serializer);
        sse_encode_bool(tight, serializer);
        sse_encode_list_markdown_list_item(items, serializer);
      case MarkdownBlock_Table(
        alignments: final alignments,
        header: final header,
        rows: final rows,
      ):
        sse_encode_i_32(6, serializer);
        sse_encode_list_markdown_alignment(alignments, serializer);
        sse_encode_list_markdown_table_cell(header, serializer);
        sse_encode_list_list_markdown_table_cell(rows, serializer);
      case MarkdownBlock_MathBlock(content: final content):
        sse_encode_i_32(7, serializer);
        sse_encode_String(content, serializer);
    }
  }

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

  @protected
  void sse_encode_markdown_document(
    MarkdownDocument self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_markdown_block(self.blocks, serializer);
  }

  @protected
  void sse_encode_markdown_inline(
    MarkdownInline self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case MarkdownInline_Text(content: final content):
        sse_encode_i_32(0, serializer);
        sse_encode_String(content, serializer);
      case MarkdownInline_SoftBreak():
        sse_encode_i_32(1, serializer);
      case MarkdownInline_HardBreak():
        sse_encode_i_32(2, serializer);
      case MarkdownInline_Code(content: final content):
        sse_encode_i_32(3, serializer);
        sse_encode_String(content, serializer);
      case MarkdownInline_Emph(children: final children):
        sse_encode_i_32(4, serializer);
        sse_encode_list_markdown_inline(children, serializer);
      case MarkdownInline_Strong(children: final children):
        sse_encode_i_32(5, serializer);
        sse_encode_list_markdown_inline(children, serializer);
      case MarkdownInline_Strikethrough(children: final children):
        sse_encode_i_32(6, serializer);
        sse_encode_list_markdown_inline(children, serializer);
      case MarkdownInline_Link(
        dest: final dest,
        title: final title,
        children: final children,
      ):
        sse_encode_i_32(7, serializer);
        sse_encode_String(dest, serializer);
        sse_encode_opt_String(title, serializer);
        sse_encode_list_markdown_inline(children, serializer);
      case MarkdownInline_Image(
        dest: final dest,
        title: final title,
        alt: final alt,
      ):
        sse_encode_i_32(8, serializer);
        sse_encode_String(dest, serializer);
        sse_encode_opt_String(title, serializer);
        sse_encode_list_markdown_inline(alt, serializer);
      case MarkdownInline_Autolink(url: final url, kind: final kind):
        sse_encode_i_32(9, serializer);
        sse_encode_String(url, serializer);
        sse_encode_markdown_autolink_kind(kind, serializer);
      case MarkdownInline_Math(content: final content):
        sse_encode_i_32(10, serializer);
        sse_encode_String(content, serializer);
      case MarkdownInline_NostrMention(entity: final entity):
        sse_encode_i_32(11, serializer);
        sse_encode_box_autoadd_markdown_nostr_entity(entity, serializer);
      case MarkdownInline_NostrUri(entity: final entity):
        sse_encode_i_32(12, serializer);
        sse_encode_box_autoadd_markdown_nostr_entity(entity, serializer);
    }
  }

  @protected
  void sse_encode_markdown_list_item(
    MarkdownListItem self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_markdown_block(self.blocks, serializer);
    sse_encode_opt_box_autoadd_bool(self.checked, serializer);
  }

  @protected
  void sse_encode_markdown_list_kind(
    MarkdownListKind self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case MarkdownListKind_Bullet(marker: final marker):
        sse_encode_i_32(0, serializer);
        sse_encode_String(marker, serializer);
      case MarkdownListKind_Ordered(
        start: final start,
        delimiter: final delimiter,
      ):
        sse_encode_i_32(1, serializer);
        sse_encode_u_32(start, serializer);
        sse_encode_String(delimiter, serializer);
    }
  }

  @protected
  void sse_encode_markdown_nostr_entity(
    MarkdownNostrEntity self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_markdown_nostr_hrp(self.hrp, serializer);
    sse_encode_String(self.bech32, serializer);
  }

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

  @protected
  void sse_encode_markdown_table_cell(
    MarkdownTableCell self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_markdown_inline(self.inlines, serializer);
  }

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

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

  @protected
  void sse_encode_media_file(MediaFile self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_String(self.accountPubkey, serializer);
    sse_encode_String(self.filePath, serializer);
    sse_encode_opt_String(self.originalFileHash, serializer);
    sse_encode_String(self.encryptedFileHash, serializer);
    sse_encode_String(self.mimeType, serializer);
    sse_encode_String(self.mediaType, serializer);
    sse_encode_String(self.blossomUrl, serializer);
    sse_encode_String(self.nostrKey, serializer);
    sse_encode_opt_box_autoadd_file_metadata(self.fileMetadata, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_opt_String(self.nonce, serializer);
    sse_encode_opt_String(self.schemeVersion, serializer);
  }

  @protected
  void sse_encode_message_stream_item(
    MessageStreamItem self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case MessageStreamItem_InitialSnapshot(messages: final messages):
        sse_encode_i_32(0, serializer);
        sse_encode_list_chat_message(messages, serializer);
      case MessageStreamItem_Update(update: final update):
        sse_encode_i_32(1, serializer);
        sse_encode_box_autoadd_message_update(update, serializer);
    }
  }

  @protected
  void sse_encode_message_update(MessageUpdate self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_update_trigger(self.trigger, serializer);
    sse_encode_chat_message(self.message, serializer);
  }

  @protected
  void sse_encode_message_with_tokens(
    MessageWithTokens self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_String(self.pubkey, serializer);
    sse_encode_u_16(self.kind, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_opt_String(self.content, serializer);
    sse_encode_markdown_document(self.tokens, serializer);
  }

  @protected
  void sse_encode_mute_list_entry(
    MuteListEntry self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.accountPubkey, serializer);
    sse_encode_String(self.mutedPubkey, serializer);
    sse_encode_bool(self.isPrivate, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
  }

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

  @protected
  void sse_encode_notification_update(
    NotificationUpdate self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_notification_trigger(self.trigger, serializer);
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_opt_String(self.groupName, serializer);
    sse_encode_bool(self.isDm, serializer);
    sse_encode_notification_user(self.receiver, serializer);
    sse_encode_notification_user(self.sender, serializer);
    sse_encode_String(self.content, serializer);
    sse_encode_Chrono_Utc(self.timestamp, serializer);
  }

  @protected
  void sse_encode_notification_user(
    NotificationUser self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.pubkey, serializer);
    sse_encode_opt_String(self.displayName, serializer);
    sse_encode_opt_String(self.pictureUrl, serializer);
  }

  @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_Chrono_Utc(
    DateTime? 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_Chrono_Utc(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_bool(bool? 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_bool(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_chat_message(
    ChatMessage? 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_chat_message(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_chat_message_summary(
    ChatMessageSummary? 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_chat_message_summary(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_delivery_status(
    DeliveryStatus? 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_delivery_status(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_draft(Draft? 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_draft(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_file_metadata(
    FileMetadata? 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_file_metadata(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_flutter_event(
    FlutterEvent? 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_flutter_event(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_push_registration(
    PushRegistration? 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_push_registration(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_u_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_u_32(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_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerTag(
    List<Tag>? self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

  @protected
  void sse_encode_opt_list_String(
    List<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_list_String(self, serializer);
    }
  }

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

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

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

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

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

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

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

  @protected
  void sse_encode_push_registration(
    PushRegistration self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.accountPubkey, serializer);
    sse_encode_push_platform(self.platform, serializer);
    sse_encode_String(self.rawToken, serializer);
    sse_encode_String(self.serverPubkey, serializer);
    sse_encode_opt_String(self.relayHint, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
    sse_encode_opt_box_autoadd_Chrono_Utc(self.lastSharedAt, serializer);
  }

  @protected
  void sse_encode_ratchet_tree_info(
    RatchetTreeInfo self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.treeHash, serializer);
    sse_encode_String(self.serializedTree, serializer);
    sse_encode_list_leaf_node_info(self.leafNodes, serializer);
  }

  @protected
  void sse_encode_reaction_summary(
    ReactionSummary self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_emoji_reaction(self.byEmoji, serializer);
    sse_encode_list_user_reaction(self.userReactions, serializer);
  }

  @protected
  void sse_encode_record_string_string(
    (String, String) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.$1, serializer);
    sse_encode_String(self.$2, serializer);
  }

  @protected
  void sse_encode_relay(Relay self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.url, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
  }

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

  @protected
  void sse_encode_search_result(SearchResult self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_chat_message(self.message, serializer);
    sse_encode_String(self.mlsGroupId, serializer);
    sse_encode_list_highlight_span(self.highlightSpans, serializer);
    sse_encode_u_64(self.position, serializer);
  }

  @protected
  void sse_encode_search_update_trigger(
    SearchUpdateTrigger self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case SearchUpdateTrigger_RadiusStarted(radius: final radius):
        sse_encode_i_32(0, serializer);
        sse_encode_u_8(radius, serializer);
      case SearchUpdateTrigger_ResultsFound():
        sse_encode_i_32(1, serializer);
      case SearchUpdateTrigger_RadiusCompleted(
        radius: final radius,
        totalPubkeysSearched: final totalPubkeysSearched,
      ):
        sse_encode_i_32(2, serializer);
        sse_encode_u_8(radius, serializer);
        sse_encode_u_64(totalPubkeysSearched, serializer);
      case SearchUpdateTrigger_RadiusTimeout(radius: final radius):
        sse_encode_i_32(3, serializer);
        sse_encode_u_8(radius, serializer);
      case SearchUpdateTrigger_SearchCompleted(
        finalRadius: final finalRadius,
        totalResults: final totalResults,
      ):
        sse_encode_i_32(4, serializer);
        sse_encode_u_8(finalRadius, serializer);
        sse_encode_u_64(totalResults, serializer);
      case SearchUpdateTrigger_Error(message: final message):
        sse_encode_i_32(5, serializer);
        sse_encode_String(message, serializer);
    }
  }

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

  @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_u_8_array_12(U8Array12 self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_prim_u_8_strict(self.inner, serializer);
  }

  @protected
  void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_prim_u_8_strict(self.inner, serializer);
  }

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

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

  @protected
  void sse_encode_upload_group_image_result(
    UploadGroupImageResult self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_8_array_32(self.encryptedHash, serializer);
    sse_encode_u_8_array_32(self.imageKey, serializer);
    sse_encode_u_8_array_12(self.imageNonce, serializer);
  }

  @protected
  void sse_encode_user(User self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.pubkey, serializer);
    sse_encode_flutter_metadata(self.metadata, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
    sse_encode_Chrono_Utc(self.updatedAt, serializer);
  }

  @protected
  void sse_encode_user_reaction(UserReaction self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.reactionId, serializer);
    sse_encode_String(self.user, serializer);
    sse_encode_String(self.emoji, serializer);
    sse_encode_Chrono_Utc(self.createdAt, serializer);
  }

  @protected
  void sse_encode_user_search_result(
    UserSearchResult self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.pubkey, serializer);
    sse_encode_flutter_metadata(self.metadata, serializer);
    sse_encode_u_8(self.radius, serializer);
    sse_encode_match_quality(self.matchQuality, serializer);
    sse_encode_matched_field(self.bestField, serializer);
    sse_encode_list_matched_field(self.matchedFields, serializer);
  }

  @protected
  void sse_encode_user_search_update(
    UserSearchUpdate self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_search_update_trigger(self.trigger, serializer);
    sse_encode_list_user_search_result(self.newResults, serializer);
    sse_encode_u_64(self.totalResultCount, serializer);
  }

  @protected
  void sse_encode_user_stream_item(
    UserStreamItem self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case UserStreamItem_InitialSnapshot(user: final user):
        sse_encode_i_32(0, serializer);
        sse_encode_box_autoadd_user(user, serializer);
      case UserStreamItem_Update(update: final update):
        sse_encode_i_32(1, serializer);
        sse_encode_box_autoadd_user_update(update, serializer);
    }
  }

  @protected
  void sse_encode_user_update(UserUpdate self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_user_update_trigger(self.trigger, serializer);
    sse_encode_user(self.user, serializer);
  }

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

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

  @protected
  void sse_encode_whitenoise_config(
    WhitenoiseConfig self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.dataDir, serializer);
    sse_encode_String(self.logsDir, serializer);
    sse_encode_opt_list_String(self.defaultRelayUrls, serializer);
  }
}

@sealed
class AppSettingsImpl extends RustOpaque implements AppSettings {
  // Not to be used by end users
  AppSettingsImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  AppSettingsImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_AppSettings,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_AppSettings,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_AppSettingsPtr,
  );
}

@sealed
class DartSignerImpl extends RustOpaque implements DartSigner {
  // Not to be used by end users
  DartSignerImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  DartSignerImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_DartSigner,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_DartSigner,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_DartSignerPtr,
  );
}

@sealed
class GroupIdImpl extends RustOpaque implements GroupId {
  // Not to be used by end users
  GroupIdImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  GroupIdImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_GroupId,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_GroupId,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_GroupIdPtr,
  );
}

@sealed
class LanguageImpl extends RustOpaque implements Language {
  // Not to be used by end users
  LanguageImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  LanguageImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_Language,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_Language,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_LanguagePtr,
  );
}

@sealed
class PublicKeyImpl extends RustOpaque implements PublicKey {
  // Not to be used by end users
  PublicKeyImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  PublicKeyImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_PublicKey,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_PublicKey,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_PublicKeyPtr,
  );
}

@sealed
class RelayTypeImpl extends RustOpaque implements RelayType {
  // Not to be used by end users
  RelayTypeImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  RelayTypeImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RelayType,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RelayType,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_RelayTypePtr,
  );
}

@sealed
class RelayUrlImpl extends RustOpaque implements RelayUrl {
  // Not to be used by end users
  RelayUrlImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  RelayUrlImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RelayUrl,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RelayUrl,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_RelayUrlPtr,
  );
}

@sealed
class TagImpl extends RustOpaque implements Tag {
  // Not to be used by end users
  TagImpl.frbInternalDcoDecode(List<dynamic> wire) : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  TagImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_Tag,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_Tag,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_TagPtr,
  );
}

@sealed
class ThemeModeImpl extends RustOpaque implements ThemeMode {
  // Not to be used by end users
  ThemeModeImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  ThemeModeImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
    : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_ThemeMode,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_ThemeMode,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_ThemeModePtr,
  );
}
