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

IdNameEntity $IdNameEntityFromJson(Map<String, dynamic> json) {
  final IdNameEntity idNameEntity = IdNameEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    idNameEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    idNameEntity.name = name;
  }
  return idNameEntity;
}

Map<String, dynamic> $IdNameEntityToJson(IdNameEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  return data;
}

extension IdNameEntityExtension on IdNameEntity {
  IdNameEntity copyWith({
    String? id,
    String? name,
  }) {
    return IdNameEntity()
      ..id = id ?? this.id
      ..name = name ?? this.name;
  }
}