delete_asset_response.model.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import 'dart:convert';
  2. class DeleteAssetResponse {
  3. final String id;
  4. final String status;
  5. DeleteAssetResponse({
  6. required this.id,
  7. required this.status,
  8. });
  9. DeleteAssetResponse copyWith({
  10. String? id,
  11. String? status,
  12. }) {
  13. return DeleteAssetResponse(
  14. id: id ?? this.id,
  15. status: status ?? this.status,
  16. );
  17. }
  18. Map<String, dynamic> toMap() {
  19. return {
  20. 'id': id,
  21. 'status': status,
  22. };
  23. }
  24. factory DeleteAssetResponse.fromMap(Map<String, dynamic> map) {
  25. return DeleteAssetResponse(
  26. id: map['id'] ?? '',
  27. status: map['status'] ?? '',
  28. );
  29. }
  30. String toJson() => json.encode(toMap());
  31. factory DeleteAssetResponse.fromJson(String source) =>
  32. DeleteAssetResponse.fromMap(json.decode(source));
  33. @override
  34. String toString() => 'DeleteAssetResponse(id: $id, status: $status)';
  35. @override
  36. bool operator ==(Object other) {
  37. if (identical(this, other)) return true;
  38. return other is DeleteAssetResponse &&
  39. other.id == id &&
  40. other.status == status;
  41. }
  42. @override
  43. int get hashCode => id.hashCode ^ status.hashCode;
  44. }