import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/switch_project_entity.dart'; import 'package:domain/entity/response/index_option_entity.dart'; SwitchProjectEntity $SwitchProjectEntityFromJson(Map json) { final SwitchProjectEntity switchProjectEntity = SwitchProjectEntity(); final List? cutUser = (json['cut_user'] as List?)?.map( (e) => jsonConvert.convert(e) as IndexOptionEntity).toList(); if (cutUser != null) { switchProjectEntity.cutUser = cutUser; } final List? userList = (json['user_list'] as List?)?.map( (e) => jsonConvert.convert(e) as SwitchProjectUserList).toList(); if (userList != null) { switchProjectEntity.userList = userList; } return switchProjectEntity; } Map $SwitchProjectEntityToJson(SwitchProjectEntity entity) { final Map data = {}; data['cut_user'] = entity.cutUser?.map((v) => v.toJson()).toList(); data['user_list'] = entity.userList?.map((v) => v.toJson()).toList(); return data; } extension SwitchProjectEntityExtension on SwitchProjectEntity { SwitchProjectEntity copyWith({ List? cutUser, List? userList, }) { return SwitchProjectEntity() ..cutUser = cutUser ?? this.cutUser ..userList = userList ?? this.userList; } } SwitchProjectUserList $SwitchProjectUserListFromJson(Map json) { final SwitchProjectUserList switchProjectUserList = SwitchProjectUserList(); final String? adminId = jsonConvert.convert(json['admin_id']); if (adminId != null) { switchProjectUserList.adminId = adminId; } final String? adminName = jsonConvert.convert(json['admin_name']); if (adminName != null) { switchProjectUserList.adminName = adminName; } final String? employerName = jsonConvert.convert(json['employer_name']); if (employerName != null) { switchProjectUserList.employerName = employerName; } return switchProjectUserList; } Map $SwitchProjectUserListToJson(SwitchProjectUserList entity) { final Map data = {}; data['admin_id'] = entity.adminId; data['admin_name'] = entity.adminName; data['employer_name'] = entity.employerName; return data; } extension SwitchProjectUserListExtension on SwitchProjectUserList { SwitchProjectUserList copyWith({ String? adminId, String? adminName, String? employerName, }) { return SwitchProjectUserList() ..adminId = adminId ?? this.adminId ..adminName = adminName ?? this.adminName ..employerName = employerName ?? this.employerName; } }