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

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

class RustKeyManager {
  const RustKeyManager();

  static Future<Uint8List> decryptCloudMediaKey({
    required List<int> encryptedMediaKey,
    required String addition,
  }) => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerDecryptCloudMediaKey(
        encryptedMediaKey: encryptedMediaKey,
        addition: addition,
      );

  static Future<Uint8List> encryptCloudMediaKey({
    required List<int> mediaKey,
    required String addition,
  }) => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerEncryptCloudMediaKey(
        mediaKey: mediaKey,
        addition: addition,
      );

  static Future<Uint8List> getLoginToken() => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerGetLoginToken();

  static Future<(Uint8List, PlatformInt64)> getSignalIdentity() => RustLib
      .instance
      .api
      .crateBridgeWrapperKeyManagerRustKeyManagerGetSignalIdentity();

  static Future<PlatformInt64?> getUserId() => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerGetUserId();

  static Future<void> importSerialized({required List<int> serializedBytes}) =>
      RustLib.instance.api
          .crateBridgeWrapperKeyManagerRustKeyManagerImportSerialized(
            serializedBytes: serializedBytes,
          );

  static Future<void> importSignalIdentity({
    required List<int> identityKeyPairStructure,
    required PlatformInt64 registrationId,
    required Map<PlatformInt64, Uint8List> signedPreKeyStore,
  }) => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerImportSignalIdentity(
        identityKeyPairStructure: identityKeyPairStructure,
        registrationId: registrationId,
        signedPreKeyStore: signedPreKeyStore,
      );

  static Future<Uint8List?> loadSignedPrekey({
    required PlatformInt64 signedPreKeyId,
  }) => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerLoadSignedPrekey(
        signedPreKeyId: signedPreKeyId,
      );

  static Future<Map<PlatformInt64, Uint8List>> loadSignedPrekeys() => RustLib
      .instance
      .api
      .crateBridgeWrapperKeyManagerRustKeyManagerLoadSignedPrekeys();

  static Future<void> removeKeyManager() => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerRemoveKeyManager();

  static Future<void> removeSignedPrekey({
    required PlatformInt64 signedPreKeyId,
  }) => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerRemoveSignedPrekey(
        signedPreKeyId: signedPreKeyId,
      );

  /// Serialize the key_manager. Needed for the passwordless_recovery feature.
  static Future<Uint8List> serialize() => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerSerialize();

  static Future<void> setUserId({required PlatformInt64 userId}) => RustLib
      .instance
      .api
      .crateBridgeWrapperKeyManagerRustKeyManagerSetUserId(userId: userId);

  static Future<void> storeSignedPrekey({
    required PlatformInt64 signedPreKeyId,
    required List<int> record,
  }) => RustLib.instance.api
      .crateBridgeWrapperKeyManagerRustKeyManagerStoreSignedPrekey(
        signedPreKeyId: signedPreKeyId,
        record: record,
      );

  @override
  int get hashCode => 0;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is RustKeyManager && runtimeType == other.runtimeType;
}
