// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.8.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';

// These functions are ignored because they are not marked as `pub`: `calculate_hash`
// 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`

class ExternalApiConfig {
  final String filePath;
  final String? url;
  final String? lastHash;

  const ExternalApiConfig({
    required this.filePath,
    this.url,
    this.lastHash,
  });

  Future<ExternalApiConfig?> fetchUpdate() =>
      RustLib.instance.api.crateApiTypesExternalApiExternalApiConfigFetchUpdate(
        that: this,
      );

  static Future<ExternalApiConfig> fromPath(
          {required String path,
          required String documentFolder,
          String? customCacheRoot}) =>
      RustLib.instance.api.crateApiTypesExternalApiExternalApiConfigFromPath(
          path: path,
          documentFolder: documentFolder,
          customCacheRoot: customCacheRoot);

  static Future<ExternalApiConfig> fromUrl(
          {required String url,
          required String documentFolder,
          String? customCacheRoot}) =>
      RustLib.instance.api.crateApiTypesExternalApiExternalApiConfigFromUrl(
          url: url,
          documentFolder: documentFolder,
          customCacheRoot: customCacheRoot);

  @override
  int get hashCode => filePath.hashCode ^ url.hashCode ^ lastHash.hashCode;

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