import 'package:flutter/foundation.dart';

class FactoryResetModel {
  final List<String> devicesUuid;
  final String operationType;

  FactoryResetModel({
    required this.devicesUuid,
    this.operationType = "RESET",
  });

  factory FactoryResetModel.fromJson(Map<String, dynamic> json) {
    return FactoryResetModel(
      devicesUuid: List<String>.from(json['devicesUuid']),
      operationType: "RESET",
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'devicesUuid': devicesUuid,
      'operationType': operationType,
    };
  }

  FactoryResetModel copyWith({
    List<String>? devicesUuid,
  }) {
    return FactoryResetModel(
      devicesUuid: devicesUuid ?? this.devicesUuid,
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'devicesUuid': devicesUuid,
      'operationType': operationType,
    };
  }

  factory FactoryResetModel.fromMap(Map<String, dynamic> map) {
    return FactoryResetModel(
      devicesUuid: List<String>.from(map['devicesUuid']),
    );
  }

  @override
  String toString() => 'FactoryReset(devicesUuid: $devicesUuid)';

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;

    return other is FactoryResetModel &&
        listEquals(other.devicesUuid, devicesUuid);
  }

  @override
  int get hashCode => devicesUuid.hashCode;
}

