// 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 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

import '../frb_generated.dart';
import 'error.dart';

// These functions are ignored because they are not marked as `pub`: `from_entry`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`

Future<void> blockUser({
  required String accountPubkey,
  required String targetPubkey,
}) => RustLib.instance.api.crateApiMuteListBlockUser(
  accountPubkey: accountPubkey,
  targetPubkey: targetPubkey,
);

Future<void> unblockUser({
  required String accountPubkey,
  required String targetPubkey,
}) => RustLib.instance.api.crateApiMuteListUnblockUser(
  accountPubkey: accountPubkey,
  targetPubkey: targetPubkey,
);

Future<List<MuteListEntry>> getBlockedUsers({required String accountPubkey}) =>
    RustLib.instance.api.crateApiMuteListGetBlockedUsers(
      accountPubkey: accountPubkey,
    );

Future<bool> isUserBlocked({
  required String accountPubkey,
  required String targetPubkey,
}) => RustLib.instance.api.crateApiMuteListIsUserBlocked(
  accountPubkey: accountPubkey,
  targetPubkey: targetPubkey,
);

class MuteListEntry {
  final String accountPubkey;
  final String mutedPubkey;
  final bool isPrivate;
  final DateTime createdAt;

  const MuteListEntry({
    required this.accountPubkey,
    required this.mutedPubkey,
    required this.isPrivate,
    required this.createdAt,
  });

  @override
  int get hashCode =>
      accountPubkey.hashCode ^ mutedPubkey.hashCode ^ isPrivate.hashCode ^ createdAt.hashCode;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is MuteListEntry &&
          runtimeType == other.runtimeType &&
          accountPubkey == other.accountPubkey &&
          mutedPubkey == other.mutedPubkey &&
          isPrivate == other.isPrivate &&
          createdAt == other.createdAt;
}
