import 'package:domain/generated/json/base/json_convert_content.dart';
import 'package:domain/entity/response/job_list_add_staff_entity.dart';

JobListAddStaffEntity $JobListAddStaffEntityFromJson(Map<String, dynamic> json) {
  final JobListAddStaffEntity jobListAddStaffEntity = JobListAddStaffEntity();
  final List<JobListAddStaffResultList>? resultList = (json['result_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<JobListAddStaffResultList>(e) as JobListAddStaffResultList).toList();
  if (resultList != null) {
    jobListAddStaffEntity.resultList = resultList;
  }
  return jobListAddStaffEntity;
}

Map<String, dynamic> $JobListAddStaffEntityToJson(JobListAddStaffEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['result_list'] = entity.resultList?.map((v) => v.toJson()).toList();
  return data;
}

extension JobListAddStaffEntityExtension on JobListAddStaffEntity {
  JobListAddStaffEntity copyWith({
    List<JobListAddStaffResultList>? resultList,
  }) {
    return JobListAddStaffEntity()
      ..resultList = resultList ?? this.resultList;
  }
}

JobListAddStaffResultList $JobListAddStaffResultListFromJson(Map<String, dynamic> json) {
  final JobListAddStaffResultList jobListAddStaffResultList = JobListAddStaffResultList();
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    jobListAddStaffResultList.name = name;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    jobListAddStaffResultList.phone = phone;
  }
  final bool? result = jsonConvert.convert<bool>(json['result']);
  if (result != null) {
    jobListAddStaffResultList.result = result;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    jobListAddStaffResultList.msg = msg;
  }
  return jobListAddStaffResultList;
}

Map<String, dynamic> $JobListAddStaffResultListToJson(JobListAddStaffResultList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['name'] = entity.name;
  data['phone'] = entity.phone;
  data['result'] = entity.result;
  data['msg'] = entity.msg;
  return data;
}

extension JobListAddStaffResultListExtension on JobListAddStaffResultList {
  JobListAddStaffResultList copyWith({
    String? name,
    String? phone,
    bool? result,
    String? msg,
  }) {
    return JobListAddStaffResultList()
      ..name = name ?? this.name
      ..phone = phone ?? this.phone
      ..result = result ?? this.result
      ..msg = msg ?? this.msg;
  }
}